Movado is a motion control software for Pico-2, which has been used in Infanoid and Keepon. Movado receives commands from a host PC through a serial communication line, and controls four DC motors with digital encoders in addition to another four RC-servos. A signle communication line can host up to 31 Pico-2s (hereafter "nodes"), which means you can control up to 124 DC motors and 124 RC-servos on a signel communication line. For details of connections with PC and motors, please refer to "ClayBot's Spec".
- Download: Motion control software Movado
This page describes the command protocol, by which you can control Movado from your PC.
A command to Movado is a sequence of 6 byte data, called a "packet". As illustrated below, the first byte has its MSB=1, and the following 5 bytes have their MSB=0.

A packet consists of address (addr), motor number (n), instruction (inst), and 4 byte argument (quad).
- addr : 5bit (0~31) address, specifies the receiver of this packet. Pico-2's address is set by the on-board switches SW5~1; for example, SW5=on SW4=off SW3=off SW2=on SW1=off for address 0x12 (18). Note that address 0x1f (31) is reserved for broadcast.
- n : 2bit motor number (0~3), specifies the target motor to which the command applies.
- inst : 3bit instruction (0~7), describes in detail below.
- quad : 4byte (32bit) argument. Note that the 3rd to 6th bytes of a packet have its MSBs (m1~4) displaced to the 2nd byte. A quad has various meanings: 32bit fixed-point data (fix) for major commands, upper 16bit data and lower 16bit data for movac/movel commands, and 8bit jnst, 8bit index, and 16bit word for sub-commands.
The 32bit fixed-point data (fix) has a 16bit integer part (the upper 16bit of quad) and a 16bit fractional part (the lower 16bit of quad). The following C functions make conversion between fix and double.
typedef int fix; fix double2fix (double d) { return (fix) (d * 65536); } double fix2double (fix f) { return f / 65536.0; }
When Movado received a command packet whose address matched Movado's address, Movado performs the command. There are 10 types of commands described as follows. Most commands operate on a motor specified by the address (addr) and the motor number (n).
command | inst:3 | fix:32 / quad:32 | |
---|---|---|---|
upper:16 | lower:16 | ||
move | 0 | pos [rad] | |
setacc | 1 | acc (≥ 0) [rad/s2] | |
movac | −acc_int (< 0) [rad/s2] | pos_int [rad] | |
setvel | 2 | vel (≥ 0) [rad/s] | |
movel | −vel_int (< 0) [rad/s] | pos_int [rad] | |
setpos | 3 | pos [rad] | |
sub | 4 | sub-command | |
getacc | 5 | (1), (2) [rad/s2] | |
getvel | 6 | (1), (2) [rad/s] | |
getpos | 7 | (1), (2) [rad] | |
(1) Ignored in command packets. (2) A value is stored in returning packets. |
- move (inst=0)
Moves the specified motor to pos [rad] with Trapezoid Velocity Control. It uses prestored acceleration (by setacc) and maximum velocity (setvel). - setacc (inst=1 and fix ≥ 0)
Sets acceleration to acc [rad/s2] for the specified motor. - movac (inst=1 and fix < 0)
Moves the specified motor to pos [rad] with Trapezoid Velocity Control using acceleration −acc [rad/s2] and prestored maximum velocity (setvel). Note that pos and −acc are 16bit interger (no fractional part). - setvel (inst=2 and fix ≥ 0)
Sets maximum velocity to vel [rad/s] for the specified motor. - setvel (inst=3)
Sets goal position to pos [rad] for the specified motor. This causes a ballistic move. - movel (inst=1 and fix < 0)
Moves the specified motor to pos [rad] with Trapezoid Velocity Control using preset acceleration (setacc) and maximum velocity −vel [rad/s]. Note that pos and −vel are 16bit interger (no fractional part). - sub (inst=4)
Performs sub-command, whose details are described below. - getacc (inst=5)
Returns preset acceleration [rad/s2] for the specified motor. - getvel (inst=6)
Returns current velocity [rad/s] for the specified motor. - getpos (inst=7)
Returns current position [rad] for the specified motor.
Sub-commands are described below. Some sub-commands (m in N/m column) operate on a specified motor (by addr and n); other sub-commands (N in N/m column) operate on a specified node (by addr).
Movado's internal parameters, like PID gains, can be set/get by the following sub-commands. To set 32bit parameters, you need to perform set_lower first, then set_upper To get 32bit parameters, you need to perform get_upper first, then get_lower. If you want to check completion of move/movac/movel, read CAMOD. If you want to check completion of calibration (described below), read MMFLG.
sub-command | N/m | jnst:8 | index:8 | word:16 |
---|---|---|---|---|
set_upper | m | 0x00 | index | upper |
set_lower | N | 0x00 | 0xff | lower |
set_word | m | 0x01 | index | word |
get_upper | m | 0x80 | index | (1), (2) |
get_lower | N | 0x80 | 0xff | (1), (2) |
get_word | m | 0x81 | index | (1), (2) |
(1) Ignored in command pckaets. (2) A value is stored in returning packets. |
32bit fixed-point paramters (part) | ||
---|---|---|
name | index | description |
MIN | 0x10 | min position [rad] (set by do_min) |
MAX | 0x11 | max position [rad] (set by do_max) |
KP | 0x12 | gain for proportional control (def: 2.0) |
KI | 0x13 | gain for integral control (def: 40.0) |
KD | 0x14 | gain for differential control (def: 0.05) |
VMP | 0x15 | motor power voltage [V] (def: 12.0) |
16bit (word) parameters (part) | ||
---|---|---|
name | index | description |
CAMOD | 0x00 | submode in CAM (0 for completion) |
MMFLG | 0x04 | flag for do_min/max (0 for completion) |
Movado has automatic calibration system for motors with incremental encoders. The set_zero command forces current position as zero (POS=0). The do_max/do_min commands move to positive/negative physical limit and store the position into MIN/MAX parameters. The do_minmax performs do_min first, then do_max. The do_minmaxcen performs do_minmax, then move to the center, and finally perform set_zero. The do_minmaxmax performs do_minmax, then move to the maximum position, and finally perform set_zero. The do_minmaxmin performs do_minmax, then move to the maximum position, and finally perform set_zero.
For do* commands, Movado uses the maximum velocity (setvel) for finding the physical limits. The parameter emg stands for "error magnitude". When motion delay exceeds the amount of motion for emg [ms] period, Movado detects it as a physical limit. In most cases, emg should be 100~200.
sub-command | N/m | jnst:8 | index:8 | word:16 |
---|---|---|---|---|
set_zero | m | 0x7f | 0x00 | (1) |
do_max | m | 0x7f | 0x05 | emg |
do_min | m | 0x7f | 0x06 | emg |
do_minmax | m | 0x7f | 0x07 | emg |
do_minmaxcen | m | 0x7f | 0x08 | emg |
do_minmaxmax | m | 0x7f | 0x09 | emg |
do_minmaxmin | m | 0x7f | 0x0a | emg |
(1) Ignored in command packets. |
Movado can control up to 4 RC-servos in the similar way to DC motors. The commands move_rcs uses Trapezoid Velocity Control, whose acceleration and maximum velocity can be set by setacc_rcs and setvel_rcs; while, setpos_rcs makes a ballistic motion. For most RC-servos, 0x2400 is approximately at the center.
sub-command | N/m | jnst:8 | index:8 | word:16 |
---|---|---|---|---|
move_rcs | m | 0x70 | 0x00 | pos_rcs |
setacc_rcs | m | 0x70 | 0x01 | acc_rcs |
setvel_rcs | m | 0x70 | 0x02 | vel_rcs |
setpos_rcs | m | 0x70 | 0x03 | pos_rcs |
The reset command resets Movado. The get_report command is for reporting current position at a cycle of interval [ms] for count times. Having received get_report command, Movado starts reporting current positions when move/movac/movel/setpos is performed. The report will be in the same packet for getpos command.
sub-command | N/m | jnst:8 | index:8 | word:16 |
---|---|---|---|---|
reset | N | 0x7f | 0xff | (1) |
get_report | m | 0xff | interval | count |
(1) Ignored in command packets. |



Pico-2 | resolution/rev | ERPC8 | LPFA |
---|---|---|---|
ADDR | [pulse, count] | [rad/count×28] | filter coeff. |
0x00〜0x07 | 16, 64 | 25.133 | 0.0625 |
0x08〜0x0f | 200, 800 | 2.0106 | 0.2500 |
0x10〜0x1e | 256, 1024 | 1.5708 | 0.2500 |
32bit fixed-point parameters | ||
---|---|---|
name | index | description |
ERPC8 | 0x0f | encoder resolution [rad/count in s0824] |
LPFA | 0x19 | coefficient of the velocity filter (LPF) |
32bit fixed-point parameters | ||
---|---|---|
name | index | description |
PMAR | 0x0a | safe margin [rad] (def: 1.0) |