User Manual

RoboClaw Series
Brushed DC Motor Controllers
RoboClaw Series User Manual
96
BASICMICRO
45 - Buered M2 Drive With Signed Speed, Accel And Distance
Drive M2 with a speed, acceleration and distance value. The sign indicates which direction the
motor will run. The acceleration and distance values are not signed. This command is used to
control the motors top speed, total distanced traveled and at what incremental acceleration
value to use until the top speed is reached. Each motor channel M1 and M2 have separate
buers. This command will execute immediately if no other command for that channel is
executing, otherwise the command will be buered in the order it was sent. Any buered
or executing command can be stopped when a new command is issued by setting the Buer
argument. All values used are in quad pulses per second.
Send: [Address, 45, Accel(4 bytes), Speed(4 Bytes), Distance(4 Bytes),
Buer, CRC(2 bytes)]
Receive: [0xFF]
The Buer argument can be set to a 1 or 0. If a value of 0 is used the command will be buered
and executed in the order sent. If a value of 1 is used the current running command is stopped,
any other commands in the buer are deleted and the new command is executed.
46 - Buered Drive M1 / M2 With Signed Speed, Accel And Distance
Drive M1 and M2 with a speed, acceleration and distance value. The sign indicates which
direction the motor will run. The acceleration and distance values are not signed. This command
is used to control both motors top speed, total distanced traveled and at what incremental
acceleration value to use until the top speed is reached. Each motor channel M1 and M2 have
separate buers. This command will execute immediately if no other command for that channel
is executing, otherwise the command will be buered in the order it was sent. Any buered
or executing command can be stopped when a new command is issued by setting the Buer
argument. All values used are in quad pulses per second.
Send: [Address, 46, Accel(4 Bytes), SpeedM1(4 Bytes), DistanceM1(4 Bytes),
SpeedM2(4 bytes), DistanceM2(4 Bytes), Buer, CRC(2 bytes)]
Receive: [0xFF]
The Buer argument can be set to a 1 or 0. If a value of 0 is used the command will be buered
and executed in the order sent. If a value of 1 is used the current running command is stopped,
any other commands in the buer are deleted and the new command is executed.
47 - Read Buer Length
Read both motor M1 and M2 buer lengths. This command can be used to determine how many
commands are waiting to execute.
Send: [Address, 47]
Receive: [BuerM1, BuerM2, CRC(2 bytes)]
The return values represent how many commands per buer are waiting to be executed. The
maximum buer size per motor is 64 commands(0x3F). A return value of 0x80(128) indicates
the buer is empty. A return value of 0 indiciates the last command sent is executing. A value of
0x80 indicates the last command buered has nished.