AK80-64 AK Series Actuator Driver Manual V1.0.8

Table Of Contents
https://www.cubemars.com/
36 / 52
5.1.4 Velocity mode
Velocity loop simple control block diagram
Velocity loop mode sends data definition
Data bits
Data[3]
Data[2]
Data[1]
Data[0]
Range
0~0xff
0~0xff
0~0xff
0~0xff
Corresponding
variables
Speed 25-32 bit
Speed 17-24 bit
Speed 9-16 bit
Speed 1-8 bit
Among them, the speed value is int32 type, and the range -100000-100000 represents
-100000-100000 electrical speed.
Velocity loop sending routine
void comm_can_set_rpm(uint8_t controller_id, float rpm) {
int32_t send_index = 0;
uint8_t buffer[4];
buffer_append_int32(buffer, (int32_t)rpm, &send_index);
comm_can_transmit_eid(controller_id |
((uint32_t)CAN_PACKET_SET_RPM << 8), buffer, send_index);
}