feat(FOC): 添加开关机功能并优化定时器配置
This commit is contained in:
+13
-4
@@ -596,10 +596,19 @@ void CAN_transmiter::communication_check() {
|
||||
// }
|
||||
if (receive_message.rx_efid == 0x18ff0200) {
|
||||
FOC.control_mode = receive_message.rx_data[0];
|
||||
FOC.limit_voltage =
|
||||
float(unpack_bytes_to_u16(receive_message.rx_data, 1)) / 1000;
|
||||
FOC.limit_velocity =
|
||||
unpack_bytes_to_float(receive_message.rx_data, 3).f;
|
||||
if (float(unpack_bytes_to_u16(receive_message.rx_data, 1)) / 1000 !=
|
||||
FOC.limit_voltage) {
|
||||
FOC.limit_voltage =
|
||||
float(unpack_bytes_to_u16(receive_message.rx_data, 1)) /
|
||||
1000;
|
||||
FOC.is_shut_down = 100; // 1s滤除启动电流
|
||||
}
|
||||
if (unpack_bytes_to_float(receive_message.rx_data, 3).f !=
|
||||
FOC.limit_velocity) {
|
||||
FOC.limit_velocity =
|
||||
unpack_bytes_to_float(receive_message.rx_data, 3).f;
|
||||
FOC.is_shut_down = 100; // 1s滤除启动电流
|
||||
}
|
||||
FOC.target_angle =
|
||||
unpack_bytes_to_float(receive_message.rx_data, 7).f;
|
||||
FOC.target_velocity =
|
||||
|
||||
Reference in New Issue
Block a user