CANFD:
Usage Demo 1. Environment Configuration
- Arbitration domain baud rate: 1Mbps 80%.
- Data and baud rate: 5Mbps 75%.
2. Basic demo
Read the current position of the module whose ID is 1
Command = CMD_RD; Current position low 16-bit address = 0x14, read the data of two registers;
Command package:
CAN-ID | DLC | Byte1 | Byte2 | Byte3 |
---|---|---|---|---|
0x01 | 0x03 | 0x01 | 0x14 | 0x02 |
Current position query |
Response package:
CAN-ID | DLC | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 |
---|---|---|---|---|---|---|---|
0x101 | 0x06 | 0x01 | 0x14 | 0x10 | 0x27 | 0x00 | 0x00 |
Current position |
Current position: position = 0x00002710/10000 = 1°
Set the target position of the module whose ID is 1 to 1°
Command = CMD_WR; address = 0x36; data = 10000 = 0x00002710;
(1) Normal mode:
Command package:
CAN-ID | DLC | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 |
---|---|---|---|---|---|---|---|
0x01 | 0x06 | 0x02 | 0x36 | 0x10 | 0x27 | 0x00 | 0x00 |
Set the target position |
Response package:
CAN-ID | DLC | Byte1 | Byte2 | Byte3 | |
---|---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x36 | 0x01 | |
Target position set successfully |
(2) Servo mode:
Command package:
CAN-ID | DLC | Byte1 | Byte2 | Byte3 | Byte4 |
---|---|---|---|---|---|
0x201 | 0x04 | 0x10 | 0x27 | 0x00 | 0x00 |
Set the target position |
Response package:
CAN-ID | DLC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0x501 | 0x10 | 0x64 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x10 | 0x20 | 0x00 | 0x00 |
Current current (100 mA) | Current speed (0) | Current position | |||||||||||
13 | 14 | 15 | 15 | ||||||||||
0x01 | 0x00 | 0x00 | 0x00 | ||||||||||
Enable status (Enable status) | Error code (no error) |
3. Demo of common command package
Position servo command package
When the joint is in the position servo mode, it enters the cyclic position servo control stage. At this stage, the controller sends position command frames to each joint module, and each joint module that has received the command frames performs corresponding position servo control and sends the current position information, current information, speed information, enable status, and error code to the controller through a feedback frame.
If 7 modules on a bus participate in cyclic servo control, 14 frames of communication will be generated on the bus within one control cycle to reduce the bus load.
Position servo command frame:
Arbitration field | Control field | Data field | CRC and other fields | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | IDE | FDF | R0 | BRS | ESI | DLC/4 | Data(4Byte) | CRC | ACK | EOF | IFS | |||
ID+0x200 | 0 | 0 | 1 | 0 | 1 | 0 | Length | D0 | D1 | D2 | D3 | ||||
4 | Current position |
Servo feedback frame:
Arbitration field | Control field | Data field | CRC and other fields | ||||||
---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | ...... | DLC/4 | Data(16Byte) | ...... | ||||
ID+0x500 | 0 | ...... | Length | D0~D3 | D4~D7 | D8~D11 | D12~D13 | D14~D15 | ...... |
16 | Current current | Current speed | Current position | Enable status | Error code | ...... |
Speed servo command package
When the joint is in the speed servo mode, it enters the cyclic speed servo control stage. At this stage, the controller sends speed command frames to each joint module, and each joint module that has received the command frames performs corresponding speed servo control and sends the current position information, current information, speed information, enable status, and error code to the controller through a feedback frame.
Speed servo command frame:
Arbitration field | Control field | Data field | CRC and other fields | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | IDE | FDF | R0 | BRS | ESI | DLC/4 | Data(4Byte) | CRC | ACK | EOF | IFS | |||
ID+0x300 | 0 | 0 | 1 | 0 | 1 | 0 | Length | D0 | D1 | D2 | D3 | ||||
4 | Target speed |
Servo feedback frame:
Arbitration field | Control field | Data field | CRC and other fields | ||||||
---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | ...... | DLC/4 | Data(16Byte) | ...... | ||||
ID+0x500 | 0 | ...... | Length | D0~D3 | D4~D7 | D8~D11 | D12~D13 | D14~D15 | ...... |
16 | Current current | Current speed | Current position | Enable status | Error code | ...... |
Current servo command package
To control the joint current. Once a current servo command frame is issued, a servo feedback frame is returned.
Current servo command frame:
Arbitration field | Control field | Data field | CRC and other fields | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | IDE | FDF | R0 | BRS | ESI | DLC/4 | Data(4Byte) | CRC | ACK | EOF | IFS | |||
ID+0x400 | 0 | 0 | 1 | 0 | 1 | 0 | Length | D0 | D1 | D2 | D3 | ||||
4 | Target speed |
Servo feedback frame:
Arbitration field | Control field | Data field | CRC and other fields | ||||||
---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | ...... | DLC/4 | Data(16Byte) | ...... | ||||
ID+0x500 | 0 | ...... | Length | D0~D3 | D4~D7 | D8~D11 | D12~D13 | D14~D15 | ...... |
16 | Current current | Current speed | Current position | Enable status | Error code | ...... |
Joint status query command package
To query the joint status in cycles. To improve the bus utilization, the common joint data is queried through a command frame, and after the joint receives the command frame, it integrates the error code, system voltage, system temperature, enable status, and current position into a joint status feedback frame for feedback.
Joint status query command frame:
Arbitration field | Control field | Data field | CRC and other fields | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | IDE | FDF | R0 | BRS | ESI | DLC/4 | Data(0Byte) | CRC | ACK | EOF | IFS |
ID+0x600 | 0 | 0 | 1 | 0 | 1 | 0 | Length | |||||
0 |
Joint status feedback frame:
Arbitration field | Control field | Data field | CRC and other fields | |||||||
---|---|---|---|---|---|---|---|---|---|---|
STID/11 | R1 | ...... | DLC/4 | Data(16Byte) | ...... | |||||
ID+0x700 | 0 | ....... | Length | D0~D1 | D2~D3 | D4~D5 | D6~D7 | D8~D11 | D12~D15 | ....... |
12 | Error code | System voltage | System temperature | D6 Enable status D7 Brake status | Current position | Current current | ...... |
4. Usage Examples
IAP Online Update Flag (Required Operation)
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x49 | 0x00 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x49 | 0x01 |
Get Current Joint Status
Command package:
CAN-ID | DLC |
---|---|
0x601 | 0x00 |
Response package:
CAN-ID | DLC | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 |
---|---|---|---|---|---|---|---|---|---|
0x701 | 0x10 | 0x00 | 0x00 | 0xFC | 0x08 | 0xEA | 0x01 | 0x01 | 0x00 |
Error Code | System Voltage | System Temperature | Enable Status | Brake Status | |||||
D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 | ||
0x61 | 0x0D | 0x03 | 0x00 | 0xFA | 0xFF | 0xFF | 0xFF | ||
Current Position | Current Current |
Position Mode Control
(1) Set Working Mode to Position Mode:
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x30 | 0x03 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x30 | 0x01 |
(2) Joint Movement via Position Servo Command:
After querying the current angle using the joint status query command, send a position servo command to move the joint within ±10°. For example, if the current angle is 20°, move the joint to 30°.
Command package:
CAN-ID | DLC | DATA | DATA | DATA | DATA |
---|---|---|---|---|---|
0x201 | 0x04 | 0xE0 | 0x93 | 0x04 | 0x00 |
Response package:
CAN-ID | DLC | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 |
---|---|---|---|---|---|---|---|---|---|
0x501 | 0x10 | 0xC0 | 0xFF | 0xFF | 0xFF | 0x00 | 0x00 | 0x00 | 0x00 |
Current Current | Current Speed | ||||||||
D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 | ||
0x40 | 0x0D | 0x03 | 0x00 | 0x01 | 0x00 | 0x00 | 0x00 | ||
Current Position (Position before movement) | Enable Status | Error Code |
After obtaining the joint status again, the current joint angle should be within ±10° of the initial position.
Current Mode Control
(1) Set Working Mode to Current Mode:
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x30 | 0x01 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x30 | 0x01 |
(2) Joint Movement via Current Servo Command:
Send a current servo command to move the joint in the positive or negative direction based on the current value (the joint moves in the opposite direction if the data is negative, and in the positive direction if the data is positive), for example, a current of 500 mA.
Command package:
CAN-ID | DLC | DATA | DATA | DATA | DATA |
---|---|---|---|---|---|
0x401 | 0x04 | 0xF4 | 0x01 | 0x00 | 0x00 |
Response package:
CAN-ID | DLC | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 |
---|---|---|---|---|---|---|---|---|---|
0x501 | 0x10 | 0xF3 | 0xFF | 0xFF | 0xFF | 0x02 | 0x00 | 0x00 | 0x00 |
Current Current | Current Speed | ||||||||
D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 | ||
0xBB | 0xB0 | 0x09 | 0x00 | 0x01 | 0x00 | 0x00 | 0x00 | ||
Current Position (Position before movement) | Enable Status | Error Code |
Speed Mode Control
(1) Set Working Mode to Speed Mode:
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x30 | 0x02 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x30 | 0x01 |
(2) Joint Movement via Speed Servo Command:
Send a speed servo command to move the joint in the positive or negative direction based on the speed value (the joint moves in the opposite direction if the data is negative, and in the positive direction if the data is positive), for example, a speed of 5 RPM.
Command package:
CAN-ID | DLC | DATA | DATA | DATA | DATA |
---|---|---|---|---|---|
0x301 | 0x04 | 0xC4 | 0x09 | 0x00 | 0x00 |
Response package:
CAN-ID | DLC | D0 | D1 | D2 | D3 | D4 | D5 | D6 | D7 |
---|---|---|---|---|---|---|---|---|---|
0x501 | 0x10 | 0xC0 | 0xFF | 0xFF | 0xFF | 0x00 | 0x00 | 0x00 | 0x00 |
Current Current | Current Speed | ||||||||
D8 | D9 | D10 | D11 | D12 | D13 | D14 | D15 | ||
0x76 | 0x14 | 0x03 | 0x00 | 0x01 | 0x00 | 0x00 | 0x00 | ||
Current Position (Position before movement) | Enable Status | Error Code |
Clear Joint Error
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x0F | 0x01 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x0F | 0x01 |
WARNING
After clearing the joint error, switch the working mode to position servo mode, send an enable command, and the joint will be successfully enabled.
Set Joint Zero Position
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x0E | 0x01 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x0E | 0x01 |
Set Enable Status
Enable:
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x0A | 0x01 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x0A | 0x01 |
Disable:
Command package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x01 | 0x03 | 0x02 | 0x0A | 0x00 |
Response package:
CAN-ID | DLC | CMD | INDEX | DATA |
---|---|---|---|---|
0x101 | 0x03 | 0x02 | 0x0A | 0x01 |
Low-Power Mode Description
After enabling low-power mode, the maximum power consumption of each joint does not exceed 80W. Low-power mode is activated when the memory vector table address 0x69 is set to 1, and it is deactivated when set to 0 returning, to the normal joint state.
TIP
Supported only for joints WHJ10N/WHJ30/WHJ60 with firmware version 519 and later versions.
End-Effector Mode Description
In end-effector mode, when the memory vector table address 0x79 is set to 0, the end-effector is non-joint; when set to 1, the end-effector is in joint mode, functioning as a joint.
TIP
Supported only for joints WHJ10N/WHJ30/WHJ60 with firmware version 519 and later versions.
Time-Sharing Power-On Mode Description
In time-sharing power-on mode, when the memory vector table address 0x1f is set to 0, the joint power-on is delayed; when set to 1, the joint power-on is immediate without delay.
TIP
Supported only for joints WHJ10N/WHJ30/WHJ60 with firmware version 519 and later versions.