Vibration demo MWP


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

Top

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.

DEFINE NUM_TIMES 2 
DEFINE WAIT_TIME 3 
 
ACTION MAIN
 
 INVOKE(SAMPLE_VIBRATIONS,NUM_TIMES) 
 
COMPLETE

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.
ACTION SAMPLE_VIBRATIONS
 
 ZCOMMAND("U0 D1000 M10 M-10") 
 WAIT(WAIT_TIME) 
 
 ZCOMMAND("U1 D1000 M10 M-10") 
 WAIT(WAIT_TIME) 
 
 ZCOMMAND("U2 D1000 M10 M-10") 
 WAIT(WAIT_TIME)
 
 ZCOMMAND("U3 D1000 M10 M-10") 
 WAIT(WAIT_TIME) 
 
 ZCOMMAND("U0 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(WAIT_TIME) 
 
 ZCOMMAND("U1 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(WAIT_TIME) 
 
 ZCOMMAND("U2 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(WAIT_TIME) 
 
 ZCOMMAND("U3 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(WAIT_TIME) 
 
COMPLETE

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 larger the M value the longer the vibration.
  • 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 tells the unit the delay between each step. This is in units of 4.2 µsecs. Therefore, for D1000 there is a delay between steps of 4.2 µsec, which translates to a frequency of 1000/4.2, 238 Hz.

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

Top

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:
vibration_demo_MWP.zs