This script demonstrates how to program the MWP unit to deliver a vibration using the built-in motor.
Refer to this script when programming an auditory or vibratory stimulus on the MWP unit using the built-in motor. It is recommended that you test different vibration settings to see which ones are the best for your experiments.
First part and Action Main:
INCLUDE zsys DEFINE NUM_TIMES 2 DEFINE WT 3 ACTION MAIN INVOKE(SAMPLE_VIBRATIONS,NUM_TIMES) COMPLETE
The commands above detail:
- INCLUDE zsys at the top of the script, you need this command first to build any script in the unit.
- Specifies two DEFINE commands to detail values used later in the script
- The Action Main details the overview of the whole experiment, in this case it invokes Action Sample_Vibrations to run the number of times as defined above (i.e. 2)
ACTION SAMPLE_VIBRATIONS MOTORCOMMAND("U0 D1000 M10 M-10") WAIT(WT) MOTORCOMMAND("U1 D1000 M10 M-10") WAIT(WT) MOTORCOMMAND("U2 D1000 M10 M-10") WAIT(WT) MOTORCOMMAND("U3 D1000 M10 M-10") WAIT(WT) MOTORCOMMAND("U0 D4000 M8 M-8") WAIT(WT) MOTORCOMMAND("U1 D4000 M8 M-8") WAIT(WT) MOTORCOMMAND("U2 D4000 M8 M-8") WAIT(WT) MOTORCOMMAND("U3 D4000 M8 M-8") WAIT(WT) COMPLETE
This action programs the unit to deliver a range of different sized vibratory stimuli using the MOTORCOMMAND:
- The "M" command programs how many steps the motor rotates. In the first 4 MOTORCOMMANDS the motor will rotate 10 steps clockwise (M10) and 10 steps anticlockwise (M-10).
- The "U" command tells the unit how big each step should be, where "U0" is a full step, "U1" is a half step, "U2" is a quarter step, "U3" is an eighth of a step.
- If you set the step mode at a full step (i.e. "U0), and the motor to move 200 steps (i.e. "M200") the motor will rotate a full cycle. Similarly if you set the step mode at a half step (i.e. "U1") and the motor to move 400 steps (i.e. "M400") the motor will rotate a full cycle too.
- You will notice that the smaller the step mode (i.e. "U3) the smaller the vibration.
- The larger number of motor steps taken (i.e. "M200") the longer the vibration is delivered.
- The "D" command tells the unit the delay between each step. This in units of 4.2 Microseconds. So for D1000 there is a delay between steps of 4.2 ms, which translates to a frequency of 1000/4.2, 238 Hz.
Here you can download the vibration demo script for the MWP unit as a .zs file. Right click on the download link below and download / save the file as a zanscript file, i.e. in the same format: vibration_demo_mwp.zs.
Script download: vibration_demo_mwp.zs