Instruction Packet

Instruction Packet is command data that Main Controller sends to Dynamixel.

The structure of Instruction Packet is as follows:

 

The meaning of each byte composing packet is as follows:

 

 0xFF 0xFF

This signal notifies the beginning of the packet

 

 ID

It is the ID of Dynamixel which will receive Instruction Packet. It can use 254 IDs from 0 to 253 (0X00~0XFD).

 

Broadcasting ID

ID = 254 (0XFE)

If Broadcast ID is used, all linked Dynamixels execute command of Instruction Packet, and Status Packet is not returned.

 

 LENGTH

It is the length of the packet. The length is calculated as “the number of Parameters (N) + 2”.

 

 INSTRUCTION

This command gives an instruction to Dynamixel and has the following types.

Value

Name

Function

No.of

Parameters

0x01

PING

No execution.

 It is used when controller is ready to receive Status Packet

0

0x02

READ_DATA

 This command reads data from Dynamixel

2

0x03

WRITE_DATA

 This command writes data to Dynamixel

2 or more

0x04

REG WRITE

It is similar to WRITE_DATA, but it remains in the standby state without being executed until the ACTION command arrives.

2 or more

0x05

ACTION

 This command initiates motions registered with REG WRITE

0

0x06

RESET

 This command restores the state of Dynamixel to the factory default setting.

0

0x83

SYNC WRITE

This command is used to control several Dynamixels simultaneously at a time.

4 or more

 

 

 PARAMETER 0…N

Parameter is used when Instruction requires ancillary data.

 

 CHECK SUM

It is used to check if packet is damaged during communication. Check Sum is calculated according to the following formula.

Check Sum = ~ ( ID + Length + Instruction + Parameter1 + … Parameter N )

 

Where, “~” is the Not Bit operator.

When the calculation result of the parenthesis in the above formula is larger than 255 (0xFF), use only lower bytes.

 

For example, when you want to use Instruction Packet like the below

ID=1 (0x01), Length= 5 (0x05), Instruction= 3 (0x03),  

Parameter1= 12 (0x0C), Parameter2= 100 (0x64), Parameter3= 170 (0xAA)

 

Check Sum = ~ ( ID + Length + Instruction + Parameter1 + … Parameter 3 )

= ~ [ 0x01 + 0x05 + 0x03 + 0x0C + 0x64 + 0xAA ]

= ~ [ 0x123 ] // Only the lower byte 0x23 executes the Not operation.

= 0xDC

 

Thus, Instruction Packet should be 0x01, 0x05, 0x03, 0x0C, 0x64, 0xAA, 0xDC.

Status Packet (Return Packet)

Dynamixel executes command received from the Main controller and returns the result to the Main Controller. The returned data is called Status Packet. The structure of Status Packet is as follows:

 

 

Each byte composing the packet means as below.

 

 0xFF 0xFF

This signal notifies the beginning of the packet.

 

 ID

It is the ID of RX-64 which transfers Status Packet.

 

 LENGTH

is the length of Status Packet, the value of which is“the number of Parameters (N) + 2”.

 

 ERROR

It displays the error status occurred during the operation of Dynamixel.

The meaning of each bit is described in the below table.

Bit

Name

Contents

Bit 7

0

-

Bit 6

Instruction Error

  In case of sending an undefined instruction or delivering the         action command without the reg_write command, it is set as 1.

Bit 5

Overload Error

  When the current load cannot be controlled by the set Torque, it is set as 1.

Bit 4

Checksum Error

  When the Checksum of the transmitted Instruction Packet is incorrect, it is set as 1.

Bit 3

Range Error

  When a command is out of the range for use, it is set as 1.

Bit 2

Overheating Error

  When internal temperature of Dynamixel is out of the range of operating temperature set in the Control table, it is set as 1.

Bit 1

Angle Limit Error

  When Goal Position is written out of the range from CW Angle Limit to CCW Angle Limit , it is set as 1.

Bit 0

Input Voltage Error

  When the applied voltage is out of the range of operating voltage set in the Control table, it is as 1.
  
 

For example, when Status Packet is returned as below

 

0xFF 0xFF 0x01 0x02 0x24 0xD8

It means that the error of 0x24 occurs from Dynamixel whose ID is 01. Since 0x24 is 00100100 as binary, Bit5 and Bit2 become 1. In order words, Overload and Overheating Errors have occurred.

 

The error types on the table above are related to actuators, and the contents may vary depending on the type of Dynamixel.

 

 

 PARAMETER 0…N

It returns data except ERROR. For the usage of parameters, refer to “Kind of Instruction".

 

 CHECK SUM

It is used to check if packet is damaged during communication. The below formula defines Check Sum. This formula is constructed in the same way as the Check Sum of Instruction Packet.

Check Sum = ~ ( ID + Length + Error + Parameter1 + … Parameter N )