Communication and Information Commands

Note: Before communicating directly via the communication protocol, you need to flash "Transponder" on M5Stack-basic and flash the latest atomMain on Atom.

Please read the interface protocol documentation carefully and continue with program development after testing.

1 USB Communication Settings

Make sure you have the following settings ready:

  • Mainline Interface: USB Type-C to connect to a computer and basic
  • Baud rate: 115200
  • Data bits: 8
  • Parity bit: none
  • Stop bits: 1

2 Introduction to Instruction Frames & Guidance

The main PC transmits data to the peripheral PC via M5Stakc-basic. The peripheral PC decodes the data into a command with a return value, and then sends the results back to the primary PC within 500 milliseconds.

3 Format for sending and receiving information commands

Both sending and receiving should be expressed in hexadecimal. Each command should contain 5 sections as follows. Sections 3 and 4 can be left blank.

  • 1 Command pin: 0xFE 0xFE
    • No change -indispensable
  • 2 Effective Length:
    • The overall length includes pins, serial numbers, function codes, and endpoints -indispensable
  • 3 Serial number: 00 ~ 8F
    • The corresponding number of developed instructions
    • Can be left blank.
  • 4 Feature Codes
    • Be goal-oriented
    • Can be left blank.
  • 5 End: 0XFA
    • No change -indispensable

4 Command Explanation

The main PC transmits data to the peripheral PC via M5Stakc-basic. The peripheral PC decodes the data into a command with a return value, and then sends the results back to the primary PC within 500 milliseconds.

Type DATA Length FEATURES
Directive Framework Start bits: 0 1 Start frame recognition, 0XFE
Start bit: 1 1 Start frame recognition, 0XFE
Bit data length 1 Different commands correspond to different data lengths
Instruction bits 1 Depends on different command
Directive Framework Data 0-16 Commands vs. data, depending on the command
End frame End Bit 1 Stop bit, 0XFA

5 Single Command Command Description

Power on

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Instruction frame 0X10
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 10 FA

There is no return value


Power drops and connections are interrupted

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Instruction frame 0X11
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 11 FA

There is no return value


Check the status of Atom

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Instruction frame 0X12
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 12 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return value: Recognition frame 0X03
Data[3] Return value: Command frame 0X12
Data[4] Power on/off 0X01/0X00
Data[5] End frame 0XFA

Example:

Assuming the Atom is plugged in:

Port returns: FE FE 03 12 01 FA


Joint enable

Data Field Description Data
Data[0] Identification Frame 0XFE
Data[1] Identification Frame 0XFE
Data[2] Data Length Frame 0X04
Data[3] Command Frame 0X13
Data[4] Servo Serial Number 1~6/254
Data[5] On/Off 0X01/0X00
Data[6] End Frame 0XFA

示例:

串口传输:FE FE 02 13 FA

无返回值


Get bot error status

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X15
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 15 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X12
Data[3] Return value: Command frame 0X15
Data[4] Return value: motor 1 error value high servo1_high
Data[5] Return value: motor 1 error value low servo1_low
Data[6] Return value: Motor 2 error value high servo2_high
Data[7] Return value: Motor 2 error value low servo2_low
Data[8] Return value: motor 3 error value high servo3_high
Data[9] Return value: Motor 3 error value low servo3_low
Data[10] Return value: motor 4 error value high servo4_high
Data[11] Return value: Motor 4 error value low servo4_low
Data[12] Return value: motor 5 error value high servo5_high
Data[13] Return value: motor 5 error value low servo5_low
Data[14] Return value: motor 6 error value high servo6_high
Data[15] Return value: motor 6 error value low servo6_low
Data[16] Return value: motor 7 error value high servo7_high
Data[17] Return value: motor 7 error value low servo7_low
Data[18] Return value: motor 8 error value high servo8_high
Data[19] Return value: motor 8 error value low servo8_low
Data[20] End frame 0XFA

Example:

Assuming the Atom is successfully connected:

Port returns: fe fe fe 12 15 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00


Clear the bot exception

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X16
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 16 FA


The total length of the queue for read and receive instructions

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X17
Data[4] End frame 0XFA

Example:

Port returns: FE FE 03 17 03 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X03
Data[3] Command frame 0X17
Data[4] Total length of the received command queue 0X03
Data[5] End frame 0XFA

Set the total length of the receiving command queue

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0X18
Data[4] Total queue length 0X10
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 03 18 10 FA


Clear the queue for receiving commands

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X19
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 02 19 FA


Read the current length of the receive queue

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X08
Data[4] End frame 0XFA

Example:

Port returns: FE FE 03 08 03 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X03
Data[3] Command frame 0X08
Data[4] Total length of the received command queue 0X03
Data[5] End frame 0XFA

Reading Single Joint Angle (Reading Movement Information)

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0X1c
Data[4] Joint serial number 0X01
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 03 1c 01 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return Value: Start frame 0XFE
Data[1] Return Value: Start frame 0XFE
Data[2] Return Value: Data Length Frame 0X05
Data[3] Return value: Command frame 0X1c
Data[4] Serial number 0X01
Data[5] Servo angle high Angle_high
Data[6] Servo angle low Angle_low
Data[7] End frame 0XFA

Example:

Return value of port: FE FE 05 1c 01 00 8C FA

temp = angle_low+angle_high*256

Angle=(temp 33000 ? (temp – 65536) : temp)/100

Explanation: If temp is greater than 33000, temp subtracts 65536 and then divides by 100, and if temp is less than 33000, temp is divided by 100.


Reading Angle (Reading Movement Information)

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X20
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 20 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return Value: Start frame 0XFE
Data[1] Return Value: Start frame 0XFE
Data[2] Return Value: Data Length Frame 0X0A
Data[3] Return value: Command frame 0X20
Data[4] Servo 1 angle high Angle1_high
Data[5] Servo 1 angle low Angle1_low
Data[6] Servo No. 2 angle high Angle2_high
Data[7] Servo No. 2 angle low Angle2_low
Data[8] Servo No. 3 angle high Angle3_high
Data[9] Servo 3 angle low Angle3_low
Data[10] Servo 4 angle high Angle4_high
Data[11] Servo 4 angle low Angle4_low
Data[12] Servo No. 5 angle high Angle5_high
Data[13] No. 5 servo angle low Angle5_low
Data[14] Servo No. 6 angle high Angle6_high
Data[15] Servo No. 6 angle low Angle6_low
Data[16] No. 7 servo angle high Angle7_high
Data[17] Servo No. 7 angle low Angle7_low
Data[18] End frame 0XFA

Example:

Return value of port: FE FE 0E 20 00 8C 00 3D FF E6 FF 3F 00 AF FF 51 00 3B 00 4F FA

How to get joint angle 1:

temp = angle1_low+angle1_high*256

Angle1=(temp 33000 ? (temp – 65536) : temp)/100

Explanation: If temp is greater than 33000, temp subtracts 65536 and then divides by 100, and if temp is less than 33000, temp is divided by 100.

Other joint angles are calculated in a similar way.


Send angles

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X06
Data[3] Command frame 0X21
Data[4] Serial number joint_no
Data[5] High Angle angle_high
Data[6] Low angle angle_low
Data[7] Specify the speed sp
Data[8] End frame 0XFA

Example:

Move the servo 1 to zero

Serial transmission: FE FE 06 21 01 00 00 14 FA

Joint No.: 1-7

angle_high: byte

Calculation: Multiply the angular value by 100 and convert to integral form to get a hexadecimal high byte

angle_low: byte

Calculation: Multiply the angle value by 100 and convert to integral form to get the hexadecimal low byte

There is no return value


Send all angles

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X11
Data[3] Command frame 0X22
Data[4] Servo 1 angle high Angle1_high
Data[5] Servo 1 angle low Angle1_low
Data[6] Servo No. 2 angle high Angle2_high
Data[7] Servo No. 2 angle low Angle2_low
Data[8] Servo No. 3 angle high Angle3_high
Data[9] Servo 3 angle low Angle3_low
Data[10] Servo 4 angle high Angle4_high
Data[11] Servo 4 angle low Angle4_low
Data[12] Servo No. 5 angle high Angle5_high
Data[13] No. 5 servo angle low Angle5_low
Data[14] Servo No. 6 angle high Angle6_high
Data[15] Servo No. 6 angle low Angle6_low
Data[16] No. 7 servo angle high Angle7_high
Data[17] Servo No. 7 angle low Angle7_low
Data[18] Specify the speed Sp
Data[19] End frame 0XFA

Example:

Send an angle of 0 to the entire joint to move the servo to zero.

Serial transmission: FE FE 0F 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 1E FA

angle1_high: byte

Calculation: Multiply the angular value by 100 and convert to integral form to get a hexadecimal high byte

angle1_low: byte

Calculation: Multiply the angle value by 100 and convert to integral form to get the hexadecimal low byte

Other angles are calculated in a similar way. _

no returns a value


The robot stops moving

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X29
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 26 FA

There is no return value


Mobile checks

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X2B
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 2B FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return Value: Header 0XFE
Data[1] Return Value: Header 0XFE
Data[2] Return Value: Data Length Frame 0X03
Data[3] Return value: Command frame 0X2B
Data[4] Exercise/No Exercise 0X01/0X00
Data[5] End frame 0XFA

Example:

Let's say the program is running:

port Return: FE FE 03 2B 01 FA


Send potential value

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X05
Data[3] Command frame 0X3A
Data[4] Serial number Joint
Data[5] The potential value is high Encoder_high
Data[6] The potential value is low Encoder_low
Data[7] End frame 0XFA

Example:

Set joint number 5 to potential 2048

Serial transmission: FE FE 05 3A 05 08 00 FA

Joint serial numbers from 0 to 5

Data type of Joint: byte

Encoder_high data type: byte

Calculation method: Get the high position of the potential value (hexadecimal form)

Encoder_low data type: byte

Calculation method: Get the low bit of the potential value (hexadecimal form)

There is no return value


Get the potential value

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0X3B
Data[4] Joint serial number joint
Data[5] End frame 0XFA

Example:

Get the potential of the NO.2 servos

joint_no Value range: 1 to 7

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0X3B
Data[4] The rudder potential value is high Encoder_high
Data[5] The rudder potential value is low Encoders_low
Data[6] End frame 0XFA

Example:

Serial transmission: FE FE 04 3B 08 07 FA

How to calculate the potential value:

Potential value = potential value low + potential value high * 256


23 servo direction is opposite, when it is not 2048 zero, you need to say No. 2: 1800; Then number 3 needs to be 2296

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X13
Data[3] Command frame 0X3C
Data[4] The high byte . of servo 1 encoder_1_high
Data[5] The low byte of servo 1 encoder_1_low
Data[6] The high byte of the 2nd servo encoder_2_high
Data[7] The low byte of servo 2 encoder_2_low
Data[8] The high byte of the servo No. 3 encoder_3_high
Data[9] The low byte of servo 3 encoder_3_low
Data[10] The high byte of servo 4 encoder_4_high
Data[11] The low byte of the 4 servos encoder_4_low
Data[12] The high byte of servo 5 encoder_5_high
Data[13] The low byte of servo 5 encoder_5_low
Data[14] The high byte of the 6 servos encoder_6_high
Data[15] The low byte of the 6 servos encoder_6_low
Data[16] The high byte of the 7 servos encoder_7_high
Data[17] The low byte of the 7 servos encoder_7_low
Data[18] The high byte of the 8 servos encoder_8_high
Data[19] The low byte of the 8 servos encoder_8_low
Data[20] Specify the speed Sp
Data[21] End frame 0XFA

Example:

The potential value of all the motors sent is 2048 and the speed is 20

Serial transmission: FE FE 13 3C 08 00 08 00 08 00 08 00 08 00 08 00 08 00 08 00 08 00 14 FA

Refer to the individual potential values sent above

encoder_1_high data type: byte

Calculation: Convert the potential of servo 1 into an integral form to obtain a high-byte hexadecimal number

encoder_1_low data type: byte

Calculation: Convert the potential of servo 1 into an integral form to obtain a low-byte hexadecimal number

sp: Byte data type, ranging from 0 to 100

There is no return value

Send the potential values of the seven servos

2\3 servo direction is opposite, when it is not 2048 zero, you need to say No. 2: 1800; Then number 3 needs to be 2296

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X22
Data[3] Command frame 0X3E
Data[4] The high byte . of servo 1 encoder_1_high
Data[5] The low byte of servo 1 encoder_1_low
Data[6] The high byte of the 2nd servo encoder_2_high
Data[7] The low byte of servo 2 encoder_2_low
Data[8] The high byte of the servo No. 3 encoder_3_high
Data[9] The low byte of servo 3 encoder_3_low
Data[10] The high byte of servo 4 encoder_4_high
Data[11] The low byte of the 4 servos encoder_4_low
Data[12] The high byte of servo 5 encoder_5_high
Data[13] The low byte of servo 5 encoder_5_low
Data[14] The high byte of the 6 servos encoder_6_high
Data[15] The low byte of the 6 servos encoder_6_low
Data[16] The high byte of the 7 servos encoder_7_high
Data[17] The low byte of the 7 servos encoder_7_low
Data[18] The high byte of the 8 servos encoder_8_high
Data[19] The low byte of the 8 servos encoder_8_low
Data[20] Servo No. 1 specifies speed Sp
Data[21] Designated speed of servo No. 2 Sp
Data[22] No. 3 servo specified speed Sp
Data[23] Specified speed of servo 4 Sp
Data[24] No. 5 servo specified speed Sp
Data[25] No. 6 servo specified speed Sp
Data[26] No. 7 servo specified speed Sp
Data[27] Servo No. 8 specified speed Sp
Data[28] End frame 0XFA

Example:

The potential value of all the motors sent is 2048 and the speed is 20

Serial transmission: FE FE 22 3E 08 00 08 00 08 00 08 00 08 00 08 00 08 00 08 00 14 14 14 14 14 14 14 14 14 14 14 FA

Refer to the individual potential values sent above

encoder_1_high data type: byte

Calculation: Convert the potential of servo 1 into an integral form to obtain a high-byte hexadecimal number

encoder_1_low data type: byte

Calculation: Convert the potential of servo 1 into an integral form to obtain a low-byte hexadecimal number

sp: Byte data type, ranging from 0 to 100

There is no return value


Read the potential values of the seven servos

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X3D
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 3D FA

Return Value: Data structure

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X12
Data[3] Command frame 0X3D
Data[4] The high byte of the bit value of the 1 rudder machine encoder_1_high
Data[5] The low byte of the bit value of the 1 rudder encoder_1_low
Data[6] The high byte of the potential value of the 2 rudder machine encoder_2_high
Data[7] The low byte of the bit value of the 2 rudder encoder_2_low
Data[8] The high byte of the bit value of the 3rd rudder encoder_3_high
Data[9] The low byte of the bit value of the 3rd rudder encoder_3_low
Data[10] The high byte of the rudder 4 potential value encoder_4_high
Data[11] The low byte of the bit value of the 4 rudder machine encoder_4_low
Data[12] The high byte of the bit value of the 5 rudder machine encoder_5_high
Data[13] The low byte of the 5 rudder machine bit value encoder_5_low
Data[14] The high byte of the 6 rudder electromechanical potential value encoder_6_high
Data[15] The low byte of the 6 rudder electromechanical bit value encoder_6_low
Data[16] The high byte of servo 5 encoder_7_high
Data[17] The low byte of servo 5 encoder_7_low
Data[18] The high byte of the 6 servos encoder_8_high
Data[19] The low byte of the 6 servos encoder_8_low
Data[20] End frame 0XFA

Example:

Suppose that all joints of the robotic arm are currently in the 0 position

Serial port return value: FE FE 12 3D 08 00 08 00 08 00 08 00 08 00 08 00 FA

How to calculate the potential value

Potential value = potential value low + potential value high * 256


Read speed

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0XE1
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 E1 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0XE1
Data[4] specified speed Sp
Data[5] End frame 0XFA

Example:

Let's say the speed is 50

port return value: FE FE 03 E1 32 FA


Read the minimum angle of all joints

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X4A
Data[4] End frame 0XFA

Example:

Serial transmission: FE FE 02 4A FA

joint_no Value range: 1 to 7

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X0A
Data[3] Return value: Command frame 0X4A
Data[4] Joint 1 angle value high Angle_high
Data[5] The angle value of joint 1 is low Angle_low
Data[6] Joint 2 angle value high Angle_high
Data[7] Joint 2 angle value low Angle_low
Data[8] Joint 3 angle value high Angle_high
Data[9] Joint 3 angle value low Angle_low
Data[10] Joint 4 angle value high Angle_high
Data[11] Joint 4 angle value low Angle_low
Data[12] Joint 5 angle value high Angle_high
Data[13] Joint 5 angle value low Angle_low
Data[14] Joint 6 angle value high Angle_high
Data[15] Joint 6 angle value low Angle_low
Data[16] Joint 7 angle value high Angle_high
Data[17] Joint 7 angle value low Angle_low
Data[18] End frame 0XFA

Example:

port return value: FE FE 0A 4A F9 F2 F9 F2 F9 F2 F9 F2 F9 F2 F2 F9 F2 F9 F2 F9 F2 FA

How to arrive at the minimum angle of the joint

temp = angle1_low+angle1_high*256

Angle1=(temp 33000 ? (temp – 65536) : temp)/10

Calculation method: angle value low + angle high value multiplied by 256 first determine whether it is greater than 33000 if it is greater than 33000 then subtract 65536 and finally divide by 10 if it is less than 33000 directly divide by 10


Read the maximum angle of all joints

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X4B
Data[4] End frame 0XFA

joint_no Value range: 1 to 7

Example:

Serial transmission: FE FE 02 4B FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X0A
Data[3] Return value: Command frame 0X4B
Data[4] Joint 1 angle value high Angle_high
Data[5] The angle value of joint 1 is low Angle_low
Data[6] Joint 2 angle value high Angle_high
Data[7] Joint 2 angle value low Angle_low
Data[8] Joint 3 angle value high Angle_high
Data[9] Joint 3 angle value low Angle_low
Data[10] Joint 4 angle value high Angle_high
Data[11] Joint 4 angle value low Angle_low
Data[12] Joint 5 angle value high Angle_high
Data[13] Joint 5 angle value low Angle_low
Data[14] Joint 6 angle value high Angle_high
Data[15] Joint 6 angle value low Angle_low
Data[16] Joint 7 angle value high Angle_high
Data[17] Joint 7 angle value low Angle_low
Data[18] End frame 0XFA

Example:

port return value: FE FE 0A 4B F9 F2 F9 F2 F9 F2 F9 F2 F9 F2 F9 F2 F9 F2 F9 F2 F2 F2 F2 F2 F2 F2 FA

How to arrive at the maximum angle of the joint

temp = angle1_low+angle1_high*256

Angle1=(temp 33000 ? (temp – 65536) : temp)/10

Calculation method: angle value low + angle high value multiplied by 256 first determine whether it is greater than 33000 if it is greater than 33000 then subtract 65536 and finally divide by 10 if it is less than 33000 directly divide by 10


Sets the maximum angle of the joint

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X05
Data[3] Command frame 0X4D
Data[4] Joint servo serial number Joint_number
Data[5] highbyte of steering gear Angle_high
Data[6] lowbyte of steering gear Angle_low
Data[7] End frame 0XFA

Example:

Set the maximum angle of joint 2 to 45

joint_no Value range: 1 to 7

port return value: FE FE 03 41 32 FA

angle1_high: The data type is byte

Calculation: The servo angle value is multiplied by 100 and converted to int first, and then the hexadecimal high byte is taken

angle1_low: The data type is byte

Calculation: The servo angle value is multiplied by 100 and converted to int first, and then the hexadecimal low byte is taken

Serial transmission: FE FE 05 4C 02 11 94 FA

There is no return value


Check if all servos are powered on

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X51
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 02 51 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X03
Data[3] Return value: Command frame 0X51
Data[4] power on/off 0X01/0X00
Data[5] End frame 0XFA

Example:

All servos are powered on

Serial port return value: FE FE 03 51 01 FA


Get the temperature of all servo motors

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0XE5
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 02 E5 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X0A
Data[3] Return value: Command frame 0XE5
Data[4] Motor 1 temperature servo1_temp
Data[5] Motor 2 temperature servo2_temp
Data[6] Motor 3 temperature servo3_temp
Data[7] Motor 4 temperature servo4_temp
Data[8] Motor 5 temperature servo5_temp
Data[9] Motor 6 temperature servo6_temp
Data[10] Motor 7 temperature servo7_temp
Data[11] Motor 8 temperature servo8_temp
Data[12] End frame 0XFA

Example:

Serial port return value: FE FE 0A E5 14 14 14 14 14 14 14 14 FA


Get the voltage of all servo motors

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0XE3
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 02 E3 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X0A
Data[3] Return value: Command frame 0XE3
Data[4] Motor 1 voltage servo1_vol
Data[5] Motor 2 voltage servo2_vol
Data[6] Motor 3 voltage servo3_vol
Data[7] Motor 4 voltage servo4_vol
Data[8] Motor 5 voltage servo5_vol
Data[9] Motor 6 voltage servo6_vol
Data[10] Motor 7 voltage servo7_vol
Data[11] Motor 8 voltage servo8_vol
Data[12] End frame 0XFA

Example:

Serial port return value: FE FE 0A E5 00 00 00 00 00 00 00 00 00 FA


Get the current of all servo motors

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0XE2
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 02 E2 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X12
Data[3] Return value: Command frame 0XE2
Data[4] Motor 1 temperature servo1_current_high
Data[5] Motor 1 temperature servo1_current_low
Data[6] Motor 2 temperature servo2_current_high
Data[7] Motor 2 temperature servo2_current_low
Data[8] Motor 3 temperature servo3_current_high
Data[9] Motor 3 temperature servo3_current_low
Data[10] Motor 4 temperature servo4_current_high
Data[11] Motor 4 temperature servo4_current_low
Data[12] Motor 5 temperature servo5_current_high
Data[13] Motor 5 temperature servo5_current_low
Data[14] Motor 6 temperature servo6_current_high
Data[15] Motor 6 temperature servo6_current_low
Data[16] Motor 7 temperature servo7_current_high
Data[17] Motor 7 temperature servo7_current_low
Data[18] Motor 8 temperature servo8_current_high
Data[19] Motor 8 temperature servo8_current_low
Data[20] End frame 0XFA

Example:

Serial port return value: FE FE 12 E2 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0


Get all statuses of all servo motors

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0XE4
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 02 E3 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X0A
Data[3] Return value: Command frame 0XE4
Data[4] Motor 1 voltage servo1_status
Data[5] Motor 2 voltage servo2_status
Data[6] Motor 3 voltage servo3_status
Data[7] Motor 4 voltage servo4_status
Data[8] Motor 5 voltage servo5_status
Data[9] Motor 6 voltage servo6_status
Data[10] Motor 7 voltage servo7_status
Data[11] Motor 8 voltage servo8_status
Data[12] End frame 0XFA

Example:

Serial port return value: FE FE 0A E4 00 00 00 00 00 00 00 00 00 FA


Get all servo motor protection currents

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0XE6
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 02 E6 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X12
Data[3] Return value: Command frame 0XE6
Data[4] Motor 1 temperature servo1_protect_current_high
Data[5] Motor 1 temperature servo1_protect_current_low
Data[6] Motor 2 temperature servo2_protect_current_high
Data[7] Motor 2 temperature servo2_protect_current_low
Data[8] Motor 3 temperature servo3_protect_current_high
Data[9] Motor 3 temperature servo3_protect_current_low
Data[10] Motor 4 temperature servo4_protect_current_high
Data[11] Motor 4 temperature servo4_protect_current_low
Data[12] Motor 5 temperature servo5_protect_current_high
Data[13] Motor 5 temperature servo5_protect_current_low
Data[14] Motor 6 temperature servo6_protect_current_high
Data[15] Motor 6 temperature servo6_protect_current_low
Data[16] Motor 7 temperature servo7_protect_current_high
Data[17] Motor 7 temperature servo7_protect_current_low
Data[18] Motor 8 temperature servo8_protect_current_high
Data[19] Motor 8 temperature servo8_protect_current_low
Data[20] End frame 0XFA

Example:

Serial port return value: FE FE 12 E6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0


Set the motor enabled

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X13
Data[4] Serial number servo_no
Data[6] Enable/Disable Enable 0X01/0X00
Data[6] End frame 0XFA

Example:

Enable the 1 servo

Serial transmission: FE FE 04 13 01 01 FA

servo_no Value range: 1-8

There is no return value


Set the servo zero point

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0X54
Data[4] Joint servo serial number servo_no
Data[5] End frame 0XFA

Example:

Set the zero position of servo 1

Serial transmission: FE FE 03 54 01 FA

servo_no Value range: 1-8

There is no return value


Set the position loop P scale factor for the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X70
Data[4] Serial number servo_no
Data[5] Serial number data
Data[6] End frame 0XFA

Example:

Serial transmission: FE FE 04 70 01 01 FA

servo_no Value range: 1-8

There is no return value


Set the proportional factor of the position ring D of the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X71
Data[4] Serial number servo_no
Data[5] Serial number data
Data[6] End frame 0XFA

Example:

Serial transmission: FE FE 04 71 01 01 FA

servo_no Value range: 1-8

There is no return value


Set the ratio factor for the position ring I of the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X72
Data[4] Serial number servo_no
Data[5] Serial number data
Data[6] End frame 0XFA

Example:

Serial transmission: FE FE 04 72 01 01 FA

servo_no Value range: 1-8

There is no return value


Reads the position loop P scale factor of the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0XE7
Data[4] Motor serial number servo_no
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 03 E7 01 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0XE7
Data[4] Motor serial number servo_no
Data[5] Position loop P scale factor P
Data[6] End frame 0XFA

Example:

Serial port return value: FE FE 04 E7 01 01 FA


Reads the position loop D scale factor for the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0XE8
Data[4] Motor serial number servo_no
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 03 E8 01 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0XE8
Data[4] Motor serial number servo_no
Data[5] Position loop P scale factor D
Data[6] End frame 0XFA

Example:

Serial port return value: FE FE 04 E8 01 01 FA


Reads the position loop I scale factor of the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0XE9
Data[4] Motor serial number servo_no
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 03 E9 01 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0XE7
Data[4] Motor serial number servo_no
Data[5] Position loop P scale factor I
Data[6] End frame 0XFA

Example:

Serial port return value: FE FE 04 E9 01 01 FA


Sets the clockwise insensitivity zone of the encoder for the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X73
Data[4] Serial number servo_no
Data[5] Clockwise insensitive zone value data
Data[6] End frame 0XFA

Example:

Serial transmission: FE FE 04 73 01 01 FA

servo_no Value range: 1-8 The value range of data is 0-32

There is no return value


Reads the clockwise insensitive area of the encoder for the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0XEA
Data[4] Motor serial number servo_no
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 03 E7 01 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0XEA
Data[4] Motor serial number servo_no
Data[5] Clockwise insensitive zone value data
Data[6] End frame 0XFA

Example:

Serial port return value: FE FE 04 EA 01 01 FA


Sets the counterclockwise insensitivity zone of the encoder for the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X74
Data[4] Serial number servo_no
Data[5] Counterclockwise insensitive zone value data
Data[6] End frame 0XFA

Example:

Serial transmission: FE FE 04 74 01 01 FA

servo_no Value range: 1-8 The value range of data is 0-32

There is no return value


Reads the counterclockwise insensitive area of the encoder for the specified servo motor

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0XEB
Data[4] Motor serial number servo_no
Data[5] End frame 0XFA

Example:

Serial transmission: FE FE 03 EB 01 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0XEB
Data[4] Motor serial number servo_no
Data[5] Counterclockwise insensitive zone value data
Data[6] End frame 0XFA

Example:

Serial port return value: FE FE 04 EB 01 01 FA


Read the servo parameters

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X05
Data[3] Command frame 0X53
Data[4] Joint servo serial number Joint_number
Data[5] Data address data_id
Data[5] Read length data_len
Data[6] End frame 0XFA

Example: Read the proportional parameter of the position P of the servo position No. 1

Serial transmission: FE FE 03 53 01 15 02 FA

joint_no Value range: 1-8

data_len: 1/2 1 byte/2 byte

Data_id: The data type is byte, and the values in the following table can be used

Address FEATURES Value range Initial value Value parsing
20 LED Alarm 0-254 0 1/0: Turn on/off LED siren
21 Position ring P 0-254 10 Control motor scale factor
22 Position Ring I 0-254 0 Controls the differential coefficient of the motor
23 Position Ring D 0-254 1 Control the integral factor of the motor
24 Minimum starting force 0-1000 0 Set the minimum output torque 1000 = 100%

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X03
Data[3] Return value: Command frame 0X53
Data[5] Data address data_id
Data[5] Return value: data data_high
Data[4] Return value: data data_low
Data[5] End frame 0XFA

Set the servo parameters

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X05
Data[3] Command frame 0X52
Data[4] Joint servo serial number Joint_no
Data[5] Data address data_id
Data[5] Data high data_high
Data[5] Data low data_low
Data[6] End frame 0XFA

Example:

Set the Servo 1 Position P Scale parameter to 1

Serial transmission: FE FE 05 52 01 15 00 01 FA

joint_no Value range: 1-8

There is no return value

Data_id: The data type is byte, as shown in the following figure:

Address FEATURES Value range Initial value Value parsing
20 LED Alarm 0-254 0 1/0: Turn on/off LED siren
21 Position ring P 0-254 10 Control motor scale factor
22 Position Ring I 0-254 0 Controls the differential coefficient of the motor
23 Position Ring D 0-254 1 Control the integral factor of the motor
24 Minimum starting force 0-1000 0 Set the minimum output torque 1000 = 100%

Set Atom mode

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X60
Data[4] Balloom pin_no
Data[5] Input/Output 00X00/00X01
Data[6] End frame 0XFA

Example:

Set Atom Pin22 to input mode

Serial transmission: FE FE 04 60 16 00 FA

Pin_no: Data type byte

Pin_mode:0/1

There is no return value


Set Atom IO(setDigitalOutput)

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X61
Data[4] Balloom pin_no
Data[5] Level Signal 0X00/0X01
Data[6] End frame 0XFA

Example:

Set pin P2 high

Serial transmission: FE FE 04 61 02 01 FA

pin_no:1/2

There is no return value


Read Atom IO(getDigitalInput)

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0X62
Data[4] Balloom pin_no
Data[5] End frame 0XFA

Example:

Read the level signal of pin P2

Serial transmission: FE FE 03 62 02 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X03
Data[3] Return value: Command frame 0X53
Data[4] Balloom pin_no
Data[5] Level Signal 0X00/0X01
Data[6] End frame 0XFA

Example:

Suppose pin P2 is high

Port return value: FE FE 04 62 02 01 FA


Set the master IO output

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0X65
Data[4] Balloom Pin_no
Data[5] Level Signal 0X00/0X01
Data[4] End frame 0XFA

Example:

Set pin 2 output high

Serial transmission: FE FE 04 65 02 01 FA


Read master IO output

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0X66
Data[4] Balloom Pin_no
Data[4] End frame 0XFA

Serial transmission: FE FE 03 66 02 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0X66
Data[4] Balloom Pin_no
Data[5] Level Signal 0X00/0X01
Data[6] End frame 0XFA

Example:

Suppose pin 2 is high

Port return value: FE FE 04 66 02 01 FA


Set the color of the RGB lights on the atom screen

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X05
Data[3] Command frame 0X6A
Data[4] R 0X00/0XFF
Data[5] G 0X00/0XFF
Data[6] B 0X00/0XFF
Data[7] End frame 0XFA

Example:

Set RGB to blue

Serial transmission: FE FE 05 6A 00 00 FF FA

There is no return value


Read the end LED pressed status

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X02
Data[3] Command frame 0X6B
Data[4] End frame 0XFA

Serial transmission: FE FE 02 6B FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X03
Data[3] Return value: Command frame 0X6B
Data[5] Pressed/unpressed 0X00/0X01
Data[6] End frame 0XFA

Set the base IO output

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X04
Data[3] Command frame 0Xa0
Data[4] Balloom Pin_no
Data[5] Level Signal 0X00/0X01
Data[4] End frame 0XFA

Example:

Set pin 2 output high

Serial transmission: FE FE 04 a0 02 01 FA


Read the base IO output

Data Field Description DATA
Data[0] Recognize frame 0XFE
Data[1] Recognize frame 0XFE
Data[2] Data length frame 0X03
Data[3] Command frame 0Xa1
Data[4] Balloom Pin_no
Data[4] End frame 0XFA

Serial transmission: FE FE 03 a1 02 FA

Return Value: Data structure

Data Field Description DATA
Data[0] Return value: Recognition frame 0XFE
Data[1] Return value: Recognition frame 0XFE
Data[2] Return Value: Data Length Frame 0X04
Data[3] Return value: Command frame 0Xa1
Data[4] Balloom Pin_no
Data[5] Level Signal 0X00/0X01
Data[6] End frame 0XFA

Example:

Suppose pin 2 is high

Port return value: FE FE 04 a1 02 01 FA


← Previous Section | Next Chapter →

results matching ""

    No results matching ""