Skip to content

Communication Protocol

sciguy14 edited this page Sep 22, 2012 · 4 revisions

This is the serial communication protocol used to send and receive commands between a host computer and the Aracna robot via a wireless XBee connection. The serial commands can be executed via any host software, but we've chosen to use python 2.7 in conjunction with the pySerial library in our tests.

General Usage Notes

  • A Baud rate of 38400 is used
  • Everything is transmitted at characters (ie. 1023 is transmitted as a "1023", not 0x3FF)
  • Values will range from 0-1023 and are never negative
  • All commands start with a '.' (Period)
  • All commands end withe '\n' (Newline Character)
  • Command separated Values (CSV) are used for all communications. There is no comma between the command character and the first variable. There is no comma between the last variable and the newline character. An example command might look like this (for 3 motors): ".c450,384,24\n"

Presently Implemented Commands

Hello

The Hello command is sent from the Aracna when it wakes up. This is the only command that is sent to the PC without first receiving a request.

  • Aracna sends ".h\n" on wake to indicate that it is initialized and ready to receive commands

Query

The Query command returns the current state of the Aracna, as well as some compile-time information.

  • PC sends ".q\n"
  • Aracna replies ".q\n"
    • CSV1 = Firmware Version
    • CSV2 = Configured Number of Dynamixels

Set Positions

The position command accepts a position value for all motors from 0-1023 and sets the motors to that position. When the motors have finished moving, it replies with an ACK that contains all the present positions.

  • PC sends: ".c\n"
    • CSV1 = motor0 goal position
    • CSV2 = motor1 goal position
    • etc... number of CSVs depends upon number of configured motors
  • Aracna moves motors to assigned positions
  • Aracna replies: ".c\n"
    • CSV1 = motor0 present position
    • CSV2 = motor1 presnet position
    • etc... number of CSVs depends upon number of configured motors

Set Speeds

This sets all the speeds that each dynamixel should move at. These values are used until a new value is assigned.

  • PC sends: ".v\n"
    • CSV1 = motor0 velocity setting
    • CSV2 = motor1 velocity setting
    • etc... number of CSVs depends upon number of configured motors
  • Aracna sets these velocities for in each motors memory
  • Aracna replies: ".v\n"
    • CSV1 = motor0 velocity setting
    • CSV2 = motor1 velocity setting
    • etc... number of CSVs depends upon number of configured motors

Future Plans

These are features and ideas that have not been implemented, but which we are planning to implement.

  • General I/O remote control
    • .d for setting pin directions
    • .p for setting pins
    • .r for reading digital pins
    • .a for reading ADC pins
    • .s for Servo Control
  • TX/RX Checksums
  • Increased transmission rate
  • Conversion to direct transmission instead of char transmission