Lingxi Gloria-D Series Servo Communication Protocol Manual
1. Overview
This document applies to the servo communication control of the Lingxi Gloria-D Series robotic arms.
2. Communication Protocol Specification
2.1 Basic Communication Parameters
| Parameter | Value |
|---|---|
| Baud Rate | 1000000 bps (default) |
| Data Bits | 8 bits |
| Stop Bits | 1 bit |
| Parity | None |
| Communication | Half-duplex UART |
2.2 Packet Format
The communication packet uses the following format:
Header (2 bytes: 0xFF, 0xFF) + ID (1 byte) + Length (1 byte) + Instruction (1 byte) + Parameters (N bytes) + Checksum (1 byte)
| Field | Description |
|---|---|
| Header | Fixed as two bytes 0xFF, 0xFF |
| ID | Servo ID (0-254, 0xFE is the broadcast ID) |
| Length | Parameter length + 3 (Instruction + Checksum) |
| Instruction | Command type |
| Parameters | Command parameters |
| Checksum | Checksum |
2.3 Checksum Calculation
Checksum calculation formula:
Checksum = ~(ID + Length + Instruction + Parameter1 + ... + ParameterN) & 0xFF
3. Main Command Descriptions
3.1 PING Instruction
Function: Test whether the servo is connected properly
Instruction Format:
| Header | ID | Length | Instruction | Checksum |
|---|---|---|---|---|
| 0xFF, 0xFF | ID | 0x02 | 0x01 | Checksum |
Response:
| Header | ID | Length | Error | Checksum |
|---|---|---|---|---|
| 0xFF, 0xFF | ID | 0x02 | Error | Checksum |
3.2 READ Instruction
Function: Read servo data
Instruction Format:
| Header | ID | Length | Instruction | Address | Length | Checksum |
|---|---|---|---|---|---|---|
| 0xFF, 0xFF | ID | 0x04 | 0x02 | Address | Length | Checksum |
Parameter Description:
- Address: Read start address
- Length: Length of data to read
3.3 WRITE Instruction
Function: Write data to the servo
Instruction Format:
| Header | ID | Length | Instruction | Address | Data1 | Data2 | ... | Checksum |
|---|---|---|---|---|---|---|---|---|
| 0xFF, 0xFF | ID | Length | 0x03 | Address | Data | Data | ... | Checksum |
3.4 REG WRITE Instruction
Function: Write data and wait for the ACTION instruction to execute
Instruction Format:
| Header | ID | Length | Instruction | Address | Data1 | Data2 | ... | Checksum |
|---|---|---|---|---|---|---|---|---|
| 0xFF, 0xFF | ID | Length | 0x04 | Address | Data | Data | ... | Checksum |
3.5 ACTION Instruction
Function: Trigger the previously written action
Instruction Format:
| Header | ID | Length | Instruction | Checksum |
|---|---|---|---|---|
| 0xFF, 0xFF | ID | 0x02 | 0x05 | Checksum |
3.6 RESET Instruction
Function: Reset servo settings
Instruction Format:
| Header | ID | Length | Instruction | Checksum |
|---|---|---|---|---|
| 0xFF, 0xFF | ID | 0x02 | 0x06 | Checksum |
4. Control Table Description
4.1 Basic Information Area (Address 0-23)
| Address | Name | Description | Length | Access |
|---|---|---|---|---|
| 0 | Model Number L | Model number low byte | 1 | Read-only |
| 1 | Model Number H | Model number high byte | 1 | Read-only |
| 2 | Version | Firmware version | 1 | Read-only |
| 3 | ID | Servo ID | 1 | Read/Write |
| 4 | Baud Rate | Baud rate | 1 | Read/Write |
| 5 | Return Delay Time | Return delay time | 1 | Read/Write |
| 6 | CW Angle Limit L | Clockwise angle limit low byte | 1 | Read/Write |
| 7 | CW Angle Limit H | Clockwise angle limit high byte | 1 | Read/Write |
| 8 | CCW Angle Limit L | Counterclockwise angle limit low byte | 1 | Read/Write |
| 9 | CCW Angle Limit H | Counterclockwise angle limit high byte | 1 | Read/Write |
| 10 | System Data2 | System data 2 | 1 | Read-only |
| 11 | Limit Temperature | Maximum temperature limit | 1 | Read/Write |
| 12 | Down Limit Voltage | Minimum voltage limit | 1 | Read/Write |
| 13 | Up Limit Voltage | Maximum voltage limit | 1 | Read/Write |
| 14 | Max Torque L | Maximum torque low byte | 1 | Read/Write |
| 15 | Max Torque H | Maximum torque high byte | 1 | Read/Write |
| 16 | Return Level | Return status level | 1 | Read/Write |
| 17 | Alarm LED | LED alarm | 1 | Read/Write |
| 18 | Alarm Shutdown | Shutdown alarm | 1 | Read/Write |
| 19 | Operating Mode | Operating mode | 1 | Read/Write |
| 20 | Down Calibration L | Lower-limit calibration low byte | 1 | Read/Write |
| 21 | Down Calibration H | Lower-limit calibration high byte | 1 | Read/Write |
| 22 | Up Calibration L | Upper-limit calibration low byte | 1 | Read/Write |
| 23 | Up Calibration H | Upper-limit calibration high byte | 1 | Read/Write |
4.2 Status Information Area (Address 24-35)
| Address | Name | Description | Length | Access |
|---|---|---|---|---|
| 24 | Torque Enable | Torque enable | 1 | Read/Write |
| 25 | LED | LED status | 1 | Read/Write |
| 26 | CW Compliance Margin | Clockwise compliance margin | 1 | Read/Write |
| 27 | CCW Compliance Margin | Counterclockwise compliance margin | 1 | Read/Write |
| 28 | CW Compliance Slope | Clockwise compliance slope | 1 | Read/Write |
| 29 | CCW Compliance Slope | Counterclockwise compliance slope | 1 | Read/Write |
| 30 | Goal Position L | Goal position low byte | 1 | Read/Write |
| 31 | Goal Position H | Goal position high byte | 1 | Read/Write |
| 32 | Moving Speed L | Moving speed low byte | 1 | Read/Write |
| 33 | Moving Speed H | Moving speed high byte | 1 | Read/Write |
| 34 | Torque Limit L | Torque limit low byte | 1 | Read/Write |
| 35 | Torque Limit H | Torque limit high byte | 1 | Read/Write |
4.3 Feedback Information Area (Address 36-49)
| Address | Name | Description | Length | Access |
|---|---|---|---|---|
| 36 | Present Position L | Current position low byte | 1 | Read-only |
| 37 | Present Position H | Current position high byte | 1 | Read-only |
| 38 | Present Speed L | Current speed low byte | 1 | Read-only |
| 39 | Present Speed H | Current speed high byte | 1 | Read-only |
| 40 | Present Load L | Current load low byte | 1 | Read-only |
| 41 | Present Load H | Current load high byte | 1 | Read-only |
| 42 | Present Voltage | Current voltage | 1 | Read-only |
| 43 | Present Temperature | Current temperature | 1 | Read-only |
| 44 | Registered Instruction | Registered instruction | 1 | Read-only |
| 45 | Reserved | Reserved | 1 | Read-only |
| 46 | Moving | Moving status | 1 | Read-only |
| 47 | Lock | Lock | 1 | Read-only |
| 48 | Punch L | Punch low byte | 1 | Read/Write |
| 49 | Punch H | Punch high byte | 1 | Read/Write |
5. Angle and Position Conversion
5.1 Angle Range
- Minimum Angle: 0°
- Maximum Angle: 300° (depending on the specific model)
- Resolution: 0.29°
5.2 Position Value Calculation
Position value range: 0 - 1023
Angle to Position Value:
Position = (Angle / 300) * 1023
Position Value to Angle:
Angle = (Position / 1023) * 300
6. Complete Example: Angle Control and Angle Feedback for Each Servo of the Robotic Arm
Please refer to the following complete protocol in detail and familiarize yourself with the meaning of each part:
-
Header Default is 0xFF, 0xFF:
| 0xFF | 0xFF | 0x01 | 0x02 | 0x01 | 0xFB | -
Instruction ID 0x01, executes the PING instruction:
| 0xFF | 0xFF | 0x01 | 0x02 | 0x01 | 0xFB | -
Instruction Length 0x02, indicates the instruction length is 2 bytes:
| 0xFF | 0xFF | 0x01 | 0x02 | 0x01 | 0xFB | -
Instruction Type 0x01, PING instruction:
| 0xFF | 0xFF | 0x01 | 0x02 | 0x01 | 0xFB | -
Checksum 0xFB, checksum calculation:
| 0xFF | 0xFF | 0x01 | 0x02 | 0x01 | 0xFB | -
Response Frame
| 0xFF | 0xFF | 0x01 | 0x02 | 0x00 | 0xFB |
7. Complete Example: Reading the Current Servo Position
Please refer to the following complete protocol in detail and familiarize yourself with the meaning of each part:
-
Header Default is 0xFF, 0xFF:
| 0xFF | 0xFF | 0x01 | 0x04 | 0x02 | 0x24 | 0x02 | 0xD9 | -
Instruction ID 0x01, executes the READ instruction:
| 0xFF | 0xFF | 0x01 | 0x04 | 0x02 | 0x24 | 0x02 | 0xD9 | -
Instruction Length 0x04, indicates the parameter length is 4 bytes:
| 0xFF | 0xFF | 0x01 | 0x04 | 0x02 | 0x24 | 0x02 | 0xD9 | -
Instruction Type 0x02, READ instruction:
| 0xFF | 0xFF | 0x01 | 0x04 | 0x02 | 0x24 | 0x02 | 0xD9 | -
Parameter 0x24, read start address (current position):
| 0xFF | 0xFF | 0x01 | 0x04 | 0x02 | 0x24 | 0x02 | 0xD9 | -
Read Length 0x02, read 2 bytes:
| 0xFF | 0xFF | 0x01 | 0x04 | 0x02 | 0x24 | 0x02 | 0xD9 | -
Checksum 0xD9, checksum calculation:
| 0xFF | 0xFF | 0x01 | 0x04 | 0x02 | 0x24 | 0x02 | 0xD9 | -
Response Frame Example
| 0xFF | 0xFF | 0x01 | 0x04 | 0x00 | 0xE8 | 0x03 | 0x16 | -
Response Parsing
- 0xFF, 0xFF: Header
- 0x01: Servo ID
- 0x04: Data length
- 0x00: Error code (no error)
- 0xE8: Position low byte
- 0x03: Position high byte
- 0x16: Checksum
8. Error Codes
| Error Value | Meaning |
|---|---|
| 0 | No error |
| 1 | Input voltage error |
| 2 | Angle limit error |
| 4 | Overheating error |
| 8 | Angle range error |
| 16 | Overload error |
| 32 | Instruction error |
| 64 | Checksum error |
9. Notes
- Communication Timing: There should be at least a 1 ms interval between two adjacent packets
- Servo ID: It is recommended to use an ID between 1 and 253; avoid using the broadcast ID (0xFE) for write operations
- Baud Rate Setting: The servo must be restarted after changing the baud rate
- Temperature Monitoring: Monitor the servo temperature during prolonged operation
- Load Limit: Ensure the servo load does not exceed the rated value
- Firmware Upgrade: Periodically check and upgrade the servo firmware
10. Troubleshooting
Common Issues:
- Communication failure: Check the baud rate, servo ID, and connection cables
- Servo not responding: Check the power supply voltage and whether the servo is locked
- Inaccurate position: Check the angle limit settings and calibration parameters
- Overheat protection: Reduce the load and improve heat dissipation