初级会员

- 积分
- 135
- 金钱
- 135
- 注册时间
- 2015-9-28
- 在线时间
- 31 小时
|
5金钱
本帖最后由 renyunpei 于 2022-11-5 18:37 编辑
位置速度双环PID控制代码中,原子哥在中断里有以下代码,限制外环输出的一段代码,为什么是150?
g_motor_data.location = (float)Encode_now; /* 获取当前编码器总计数值,用于位置闭环控制 */
g_motor_data.motor_pwm = increment_pid_ctrl(&g_location_pid, g_motor_data.location); /* 位置环PID控制(外环) */
if (g_motor_data.motor_pwm >= 150) /* 限制外环输出(目标速度) */
{
g_motor_data.motor_pwm = 150;
}
else if (g_motor_data.motor_pwm <= -150)
{
g_motor_data.motor_pwm = -150;
}
|
|