Vibration demo MWP


This script demonstrates how to program the MWP unit to deliver a vibration using the built-in motor. This motor is a stepper motor, with 200 steps to make a full rotation. However, the motor is mounted such that it cannot rotate freely, but by attempting to rotate the motor moves the plate that the stand rests on - hence the turns (or attempted turns) can pass vibrations to the animals. This is the same motor (& control) as used for the peristaltic pump and feeders (for the AD/LT).

Top

Key commands for operating the vibration plate

The built-in motor is a stepper motor and is controlled using the following operation commands within ZCOMMAND.

'U' Step mode (0-3, for full/half/quarter/eighth step modes)
'D' Delay between motor steps (to set motor speed - should not be below 1000) 
'M' Number of Motor steps (e.g., 200, -50)
'P' Pause, to set delay between operations (ms)
  • "M" operation command controls the number of 'steps' the motor rotates. To rotate the motor a full 360 degrees, the number following M would be 200.
  • "D" operation command tells the unit the delay between each step. This is in units of 4.25 µsecs.
  • The "U" operation command tells the unit how large each step should be. The operations available are 0-3. "U0" is a full step, "U1" is a ½ step, "U2" is a ¼step, "U3" is an ⅛ of a step.
    • If the step mode at a full step (U0), and the motor is set to move 200 steps (M200) the motor will rotate a full cycle. If the step mode is set to a ½ step (U1), 400 steps (M400) are required to rotate a full cycle.
    • The smallest step mode (U3) has the smallest vibration
  • "P" operation command is used to add a delay in milliseconds between operation commands (e.g., motor movements). It can be used between any of the other parameters below.

Some example ZCOMMANDs for driving the motor for the vibration plate in the MWP system are shown below. 

ZCOMMAND("D2500 U0 M1000") 
ZCOMMAND("D2500 U1 M1000") 
ZCOMMAND("D2500 U2 M1000") 
ZCOMMAND("D2500 U3 M1000") 
ZCOMMAND("D1000 U0 M2000 P100 M-2000")
Top

Script explanation

Below we have an example script which can be copied and pasted into a Zanscript to run vibration stimuli in the MWP system, followed by an explanation of the code. It is recommended that you test different vibration settings to see which ones are the best for your experiments.

ACTION MAIN
 
 ZCOMMAND("U0 D1000 M10 M-10") 
 WAIT(2) 
 
 ZCOMMAND("U1 D1000 M10 M-10") 
 WAIT(2) 
 
 ZCOMMAND("U2 D1000 M10 M-10") 
 WAIT(2)
 
 ZCOMMAND("U3 D1000 M10 M-10") 
 WAIT(2) 
 
 ZCOMMAND("U0 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(2) 
 
 ZCOMMAND("U1 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(2) 
 
 ZCOMMAND("U2 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(2) 
 
 ZCOMMAND("U3 D1000 M1 M-1 M1 M-1 M1 M-1 M1 M-1 M1 M-1") 
 WAIT(2) 
 
COMPLETE

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

  • The "U" command tells the unit how big each step should be, where "U0" is a full step (i.e. 1.8 degrees), "U1" is a half step (0.9 degrees), "U2" is a quarter step (0.45 degrees), "U3" is an eighth of a step (0.225 degrees).
  • The "D" command controls the total amount of 'delays' between each step. Delays are in units of 4.25 µsecs (0.00000425 seconds). Therefore, for D2000, there are 2000 'delays' of 4.25 µsec between steps, which translates to a frequency of 1/(2000 x 0.00000425), 118Hz.
  • 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. Multiple commands in the same direction often lead to slippage of the stepper motor (as it is prevented by its mounting from turning all the way), and bigger vibrations, but they are not strictly repeatable / consistent. 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, this leads to better consistency.
Top

Frequency Calculator for Vibrations in the MWP

Download the spreadsheet below to 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