Armdroid Serial Control Protocol

This documents the serial protocol when taking to an Arduino or similar device via its serial line (connected to the host using USB). This protocol will be used for all projects on this site requiring serial control of the Armdroid.


Version 1.0A


The serial line is fixed at 9600 baud, 8-bits, 1 stop bit and no parity.

In the following commands, all negative values must be specified using trailing hyphen '-' (0x2D) notation.


Get Motor Offsets:  Send the character 'o' (0x6F) to return current motor offset counters.
Device will respond with "offsets = n,n,n,n,n,n" followed by CR+LF
You may need to flush serial input buffers and send one or more offset commands to establish initial connectivity.

Drive Motor:  Send the motor channel number (1 - 6) followed by ',' (0x2C) and desired number of steps to drive motor. These are then followed by character 'd' (0x64) to action to the drive.
Device will respond with current offsets counters (see above) to acknowledge the command.

Drive Multiple Motors:  Send the number of steps for each of the six channels separated by ',' (0x2C). This must be followed by character 'D' (0x44) to action the drive.
Offsets counters are returned to acknowledge the command.

Return Home:  Send the character 'h' (0x68) to return all joints to starting position.
Offsets counters are returned to acknowledge the command.

Reset Home Position:  Send the character 'r' (0x72) to reestablish a new starting position based on the current physical positioning of joints.
Offsets counters (which will be zeroed) are returned to acknowledge the command.

Holding Torque:   Send the character '1' (0×31) to enable, or '0' (0×30) to disable holding torque, followed by character 't' (0x74). This command has no effect on prototype models configured to use on-board logic drive circuitry.
Command is acknowledged by torque = enabled | disabled followed by CR+LF.

Version: Send the character 'v' (0x76) for version number or 'V' (0x56) for interface information.
Device will respond with information followed by CR+LF


This specification does not include debug trace - the output from this may vary with device implementations.
When testing from a terminal (e.g minicom or hyper terminal) you will also see the welcome message "Welcome, Armdroid!" on initial connection.



Examples:


Drive motor channel 1, -300 steps (counter-clockwise):
1,300-d

Drive motor channel 6, 400 steps (clockwise):
6,400d

Drive all motors 1000 steps:
1000,1000,1000,1000,1000,1000D


No comments:

Post a Comment