mirror of
https://gitee.com/dlmu-cone/bf_original_balance_chassis
synced 2026-07-24 03:27:45 +08:00
修改了bsp_usart的初始化方式,防止出现变包长数据读取一场的问题.增加了注释.
This commit is contained in:
@@ -209,6 +209,7 @@ void DJIMotorControl()
|
||||
motor_controller = &motor->motor_controller;
|
||||
motor_measure = &motor->motor_measure;
|
||||
|
||||
// pid_ref会顺次通过被启用的环充当数据的载体
|
||||
if (motor_setting->close_loop_type & ANGLE_LOOP) // 计算位置环
|
||||
{
|
||||
if (motor_setting->angle_feedback_source == OTHER_FEED)
|
||||
@@ -233,7 +234,7 @@ void DJIMotorControl()
|
||||
motor_controller->pid_ref = PID_Calculate(&motor_controller->current_PID, motor_measure->given_current, motor_controller->pid_ref);
|
||||
}
|
||||
|
||||
set = (int16_t)motor_controller->pid_ref;
|
||||
set = (int16_t)motor_controller->pid_ref; // 获取最终输出
|
||||
if (motor_setting->reverse_flag == MOTOR_DIRECTION_REVERSE) // 设置反转
|
||||
set *= -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user