AK80-64 AK Series Actuator Driver Manual V1.0.8

Table Of Contents
https://www.cubemars.com/
35 / 52
5.1.3 Current Brake Mode
Current brake mode sends data definition
Data bits
Data[3]
Data[2]
Data[1]
Data[0]
Range
0~0xff
0~0xff
0~0xff
0~0xff
Correspondin
g variables
Brake current
25-32 bit
Brake current 17-24
bit
Brake current 9-16
bit
Brake current 1-8
bit
Among them, the braking current value is of int32 type, and the value 0-60000 represents 0-60A.
Current brake mode sending routine
void comm_can_set_cb(uint8_t controller_id, float current) {
int32_t send_index = 0;
uint8_t buffer[4];
buffer_append_int32(buffer, (int32_t)(current * 1000.0), &send_index);
comm_can_transmit_eid(controller_id |
((uint32_t)CAN_PACKET_SET_CURRENT_BRAKE << 8), buffer, send_index);
}