User Manual

MCP Series
Brushed DC Motor Controllers
MCP Series User Manual
171
MOVE2
Syntax
move2 speed1,accel1,deccel1,position1, speed2,accel2,deccel2,position2, buffer
Motor1...Motor2 - is a variable, constant or expression that species which motor to
access.
Speed1...Speed2 - is a variable, constant or expression that sets the speed to run the
motor at.
Accel1...Accel2 - is a variable, constant or expression that sets the acceleration to use
when the motor start its movement.
Deccel1...Deccel2 - is a variable, constant or expression that sets the decceleration to
use when the motor stops its movement.
Position1...Position2 - is a variable, constant or expression that sets the position for the
motor to move to.
Buffer - is a variable, constant or expression that determines if the command will be buffered(0)
or execute immediately(1) overriding any currently running command on the motor.
Description
The MOVE2 command is used to control both motors using encoders with a Position PID control
algorithm. The user must have tuned the Position PID settings for the motors before using the
MOVE2 command. With a properly tuned Position PID accurate absolute movments can be made
by the motors. Note that multiple Move2 commands can be chained together by buffering the
commands. As each command nishes the next will start executing.
;example assumes velocity/position PID settings are correct for the motors
main
move2 1000,0,0,1000,1000,0,0,-1000,0
pause 2000 ;move should take 1 second then stops for 1 second
move2 1000,0,0,-1000,1000,0,0,1000,0
pause 2000 ;move should take 1 second then stops for 1 second
goto main