Vibration demo MWP

This script demonstrates how to program the MWP unit to deliver a vibration using the built-in motor.


Script explanation

Here we explain the key points for operating the vibration stimuli in the MWP using the ZCOMMAND. It is recommended that you test different vibration settings to see which ones are the best for your experiments.


The commands above define conditions used later in the script and outline the ACTION MAIN which is an overview of the whole experiment:

  • The two DEFINE commands specify a wait time in seconds and the number of times the sequence SAMPLE_VIBRATIONS in the action main will be repeated.
 ZCOMMAND("U0 D1000 M10 M-10") 
 ZCOMMAND("U1 D1000 M10 M-10") 
 ZCOMMAND("U2 D1000 M10 M-10") 
 ZCOMMAND("U3 D1000 M10 M-10") 
 ZCOMMAND("U0 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 ZCOMMAND("U1 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 ZCOMMAND("U2 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 ZCOMMAND("U3 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 

The above action programs the unit to deliver a range of different sized vibratory stimuli using the ZCOMMAND:

  • The "M" command programs how many steps the motor rotates. In the first 4 ZCOMMANDS the motor will rotate 10 steps clockwise. In the last 4 ZCOMMANDS the motor will rotate 1 step clockwise and 1 step anticlockwise for a total of 10 steps. This can provide a smaller but smoother stimuli than using M10. The greater the number of "M's" the longer the vibration. We recommend always using the M1 M-1 option for writing vibration stimuli so that the motor position is always reset at the end of each stimulus.
  • 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 (U0), and the motor to move 200 steps (i.e. M200) the motor will rotate a full cycle. So if you set the step mode to a half step (U1) you will require 400 steps (M400) to rotate a full cycle etc.
    • The smallest step mode (U3) has the smallest vibration
  • The "D" command controls the total amount of 'delays' between each step. Delays are in units of 4.2 µsecs (0.0000042 seconds). Therefore, for D2000, there are 2000 'delays' of 4.2 µsec between steps, which translates to a frequency of 1/(2000 x 0.0000042), 119Hz.

Frequency Calculator for Vibrations in the MWP

Download the spreadsheet below to quickly calculate the "D" command value needed for a desired frequency or the frequency created from a specified "D" command value.

Frequency Calculator For Vibrations MWP


Script download

To download the vibration_demo_MWP demo scripts as .zs files (file type Zantiks software reads), choose the Save File As option in the right-click dialogue box. Clicking on the script name hyperlink will open a read-only version of the script.

Script download: