AK80-64 AK Series Actuator Driver Manual V1.0.8

Table Of Contents
https://www.cubemars.com/
39 / 52
buffer_append_int16(buffer,spd, & send_index1);
buffer_append_int16(buffer,RPA, & send_index1);
comm_can_transmit_eid(controller_id |
((uint32_t)CAN_PACKET_SET_POS << 8), buffer, send_index);
}
5.2 Servo mode of motor message format
5.2.1 Servo mode CAN upload message protocol
In servo mode, motor packets are uploaded in timing mode. The upload frequency can be set to
1-500Hz, and the upload byte is 8 bytes
Data bits
Data[0]
Data[1]
Data[2]
Data[3]
Data[4]
Data[5]
Data[6]
Data[7]
Range
0~0xff
0~0xff
0~0xff
0~0xff
0~0xff
0~0xff
0~0xff
0~0xff
Corresponding
variables
Position
8 bit
high
Position
8 bit
low
Speed 8
bit high
Speed 8
bit low
Current
8 bit
high
Current
8 bit
low
Motor
temperature
An error
code
Among them, the position is int16 type, and the range -32000-32000 represents the position
-3200
°
-3200
°
;
Among them, the speed is int16 type, and the range -32000-32000 represents
-320000-320000rpm electrical speed;
Among them, the current is of type int16, and the value -6000-6000 represents -60-60A
Among them, the temperature is int8 type, and the range of -20-127 represents the temperature
of the driver board: -20
-127
;
Among them, the error code is uint8 type, 0 means no fault, 1 means over temperature fault, 2
means over current fault, 3 means over voltage fault, 4 means under voltage fault, 5 means
encoder fault, 6 means phase current unbalance fault (The hardware may be damaged);
The following is an example of message acceptance
void motor_receive(float* motor_pos,float*
motor_spd,float* cur,int_8* temp,int_8* error,rx_message)
{
int16_t pos_int = (rx_message)->Data[0] << 8 | (rx_message)->Data[1]);
int16_t spd_int = (rx_message)->Data[2] << 8 | (rx_message)->Data[3]);
int16_t cur_int = (rx_message)->Data[4] << 8 | (rx_message)->Data[5]);
&motor_pos= (float)( pos_int * 0.1f); //motor position