AK80-64 AK Series Actuator Driver Manual V1.0.8

Table Of Contents
https://www.cubemars.com/
44 / 52
Handbrake current sending mode example
Serial command02 05 0A 00 00 13 88 00 0E 03 //5A HB current Electrical speed
Serial command02 05 0A FF FF EC 78 68 2E 03 //5A HB current Electrical speed
HAND_Brake=(float)buffer_get_int32(data, &ind) / 1000.0 //值为接收 4 位数据/1000.0
Example of Sending Mode of Position Velocity Loop
Serial command02 0D 5B 00 02 BF 20 00 00 13 88 00 00 75 30 A5 AC 03
/*
180 转速 5000ERPM 加速 30000/S
数据段为 位置+ 速度 + 加速
*/
Pos=(float)buffer_get_int32(data, &ind) / 1000.0) // 位置值为接收 4 位数据/1000.0
Speed=(float)buffer_get_int32(data, &ind) //值为接收 4 位数据
Acc_Speed=(float)buffer_get_int32(data, &ind)//值为接收 4 位数据
Example of setting multi-turn mode sending
Serial command02 05 5C 00 00 00 00 9E 19 03 //Set the motor position loop as multi-turn
operation mode ±100 turns
Setting the lap mode to send an example
Serial command 02 05 5D 00 00 00 00 34 48 03 //Set the motor position loop to single-turn
operation mode 0-360 degrees
Set the current position to 0 to send the instance
Serial command02 02 5F 01 0E A0 03 //Set the current position loop of the motor as the zero
reference point of the position loop
Serial check
unsigned short crc16(unsigned char *buf, unsigned int len) {
unsigned int i;
unsigned short cksum = 0;
for (i = 0; i < len; i++) {
cksum = crc16_tab[(((cksum >> 8) ^ *buf++) & 0xFF)] ^ (
cksum << 8);
}
return cksum;
}
const unsigned short crc16_tab[] = { 0x0000, 0x1021, 0x2042,
0x3063, 0x4084,