AK80-64 AK Series Actuator Driver Manual V1.0.8

Table Of Contents
https://www.cubemars.com/
37 / 52
5.1.5 Position loop mode
Position loop simple control block diagram
Position loop mode sends data definitions
Data bits
Data[3]
Data[2]
Data[1]
Data[0]
Range
0~0xff
0~0xff
0~0xff
0~0xff
Corresponding
variables
Position 25-32 bit
Position 17-24 bit
Position 9-16 bit
Position 1-8 bit
Position loop sending routine, position as int32 typerange-360000000~360000000 represents
position -36000°~36000°
void comm_can_set_pos(uint8_t controller_id, float pos) {
int32_t send_index = 0;
uint8_t buffer[4];
buffer_append_int32(buffer, (int32_t)(pos * 1000000.0), &send_index);
comm_can_transmit_eid(controller_id |
((uint32_t)CAN_PACKET_SET_POS << 8), buffer, send_index);
}
5.1.6 Set origin mode
Date bits
Data[0]
Range
0~0x02
Corresponding
variable
Set instruction
Among them, the setting command is uint8_t type, 0 means setting the temporary origin (power
failure elimination), 1 means setting the permanent zero point (automatic parameter saving), 2