Difference between revisions of "CanServo/Protocol/Control/en"
| Line 47: | Line 47: | ||
V1: Checksum removed format   | V1: Checksum removed format  | ||
NOTE) V1: FW Ver >= 1.3  | |||
NOTE) V1 has included V0.  | NOTE) V1 has included V0.  | ||
Revision as of 02:52, 10 January 2025
This protocols is used when CanServo/MODE/CAN/en = 2.0A or 2.0B. For protocol in UAVCAN state, refer to CanServo/Protocol/UAVCAN/en.
CAN servo is controlled by sending CAN packets with CAN ID set in Register CanServo/ID2/en and data following the message format below.
Depending on the message type of CAN Data, the servo register can be changed or read.
- As a simple example, when the following packet is sent, all received servos change the value of Register 0x30 to 0x1234.
- CAN ID = 0
 - CAN DATA = 'w', 0, 0x30, 0x34, 0x12
 - DLC = 5
 
 - However, the Can Packet Type is determined according to the CanServo/MODE/CAN/en setting value.
 
There are 11 types of messages in 8 data bytes of CAN Packet, 3 old types and 8 new types.
The first byte indicates the kind of message.
The second byte is the servo ID.
Here, Target Servo ID must match the value of CanServo/ID1/en of Servo.
Or if 0 is specified, all servos will react.
For the exact procedure, refer to CanServo/Packet Accept Rule/en.
V0: 0x96 Format:
- 0x96 Write Command
- write 1 register
- 0x96, (target servo id), (address), 2, (data low byte), (data high byte), (chksum)
 - DLC = 7
 
 
 - write 1 register
 
- 0x96 Read Command
- read 1 register
- 0x96, (target servo id), (address), 0, (chksum)
 - DLC = 5
 
 
 - read 1 register
 
- 0x96 Return Message
- return 1 register
- 0x69, (servo id), (address), 2, (data low byte), (data high byte), (chksum)
 - DLC = 7
 
 
 - return 1 register
 
- 0x96 message's chksum
- add all bytes before chksum, except first byte
 
 
V1: Checksum removed format
NOTE) V1: FW Ver >= 1.3
NOTE) V1 has included V0.
- Write Command
- write 1 register
- 'w', (target servo id), (address), (data low byte), (data high byte)
 - DLC = 5
 
 - write 2 registers
- 'W', (target servo id), (address 0), (data 0 low byte), (data 0 high byte), (address 1), (data 1 low byte), (data 1 high byte)
 - DLC = 8
 
 
 - write 1 register
 
- Read Command
- read 1 register
- 'r', (target servo id), (address)
 - DLC = 3
 
 - read 2 registers
- 'R', (target servo id), (address 0), (address 1)
 - DLC = 4
 
 
 - read 1 register
 
- Write and Read Command
- write and read: 1 register
- 'x', (target servo id), (address), (data low byte), (data high byte)
 - DLC = 5
 
 - write and read: 2 registers
- 'X', (target servo id), (address 0), (data 0 low byte), (data 0 high byte), (address 1), (data 1 low byte), (data 1 high byte)
 - DLC = 8
 
 
 - write and read: 1 register
 
- Return Message : Servo --> Host
- return 1 register
- 'v', (servo id), (address), (data low byte), (data high byte)
 - DLC = 5
 
 - return 2 registers
- 'V', (servo id), (address 0), (data 0 low byte), (data 0 high byte), (address 1), (data 1 low byte), (data 1 high byte)
 - DLC = 8
 
 
 - return 1 register