PID控制逻辑基本介绍

1. 源由

飞控上有9DOF(Degree Of Freedom):

  • 磁力计方向(degree/gauss)
  • 加速度方向(g)
  • 角速度方向(degree per second)

遥控器上对应的控制:

  • 姿态控制:Pitch/Roll/Yaw

角速度:Pitch/Roll/Yaw
磁力计:机头水平面投影指向方向
注1:角速度是通过扭力来触发

  • 油门控制:Throttle

加速度:(推力 + 重力 + 阻力) 矢量和
注2:推理矢量方向取决于飞控姿态

而上述遥控可以认为是输入,其整个逻辑过程如下:

遥控RC setpoint ==》 error ==》 飞控(PID)控制 ==》 动力模块(process)处理 ==》 物理output
注3:setpoint - output = error,这就是PID控制一个回路。

PID(Proportion Integration Differentiation比例-积分-微分)控制规律作为经典控制理论的最大成果之一,由于其原理简单且易于实现,具有一定的自适应性和鲁棒性,在目前的工业过程控制中仍被广泛采用,飞控算法中亦是如此。

为了更好的理解飞控控制行为,对PID的理解将可以深化飞控姿态调整逻辑。所以,本章将对PID基本控制逻辑做一个简单的介绍。

2. PID基本框图

该模型出现于20世纪40年代,目前世界上可能有高达95%的控制模型都是采用类似模型,比如:PI/PD/PID等。

在这里插入图片描述
其对应教科书上的经典理论公式:

在这里插入图片描述

其中:

  • y:measurable process variable
  • ysp:setpoint
  • e = ysp - y:control error
  • K:proportional gain
  • Ti:integral time
  • Td:derivative time

3. PID公式变换

上面表达式经过变换以后可以得到:

u ( t ) = K ⋅ e ( t ) + K T i ∫ 0 t e ( τ ) d τ + K ⋅ T d d e ( t ) d t u(t)=K \cdot e(t) + \cfrac{K}{T_i}\int_{0}^{t} e(\tau) d\tau + K \cdot T_d \cfrac{de(t)}{dt} u(t)=Ke(t)+TiK0te(τ)dτ+KTddtde(t)
= K ⋅ e ( t ) + K i ∫ 0 t e ( τ ) d τ + K d d e ( t ) d t = K \cdot e(t) + K_i \int_{0}^{t} e(\tau) d\tau +K_d \cfrac{de(t)}{dt} =Ke(t)+Ki0te(τ)dτ+Kddtde(t)

得到最终Kp,Ki,Kd参数如下:
K p = K K_p=K Kp=K

K i = K T i K_i=\cfrac{K}{T_i} Ki=TiK

K d = K ⋅ T d K_d=K \cdot T_d Kd=KTd

4. PID参数释义

假设:表达式不存疑的情况下,可以看出Kp,Ki,Kd之间是有关联关系的。

因此,首先不纠结Kp,Ki,Kd之间的关联关系,单独分析;然后在从关联关系去讨论。

4.1 比例因子Kp

Kp是修正误差的比例因子,时间作用于在于一次反馈回路的时间。

  1. 误差越大,相应的修正值也越大;
  2. 当比例因子越大,该修正项贡献越大;
  3. 及时性取决于一次反馈回路的耗时;
  4. 作用于当下,快速修正;

4.2 比例积分Ki

Ki修正的是累计误差,时间作用于起始时间到作用时间。

  1. 累计误差越大,相应修正值越大;
  2. 当比例积分越大,该修正项贡献越大;
  3. 长期持续(具有记忆效应);
  4. 作用于过去,具有纠错性;

4.3 比例微分Kd

Kd修正的是误差的变化(斜率),时间作用于误差计算时刻。

  1. 误差变化率越大,相应修正值越大;
  2. 当比例微分越大,该修正项贡献越大;
  3. 当下时刻斜率(具有瞬时性);
  4. 作用于未来,具有短时预测性;

4.4 Kp/Ki关系

Ki是有一个统计时间的概念,其作用时刻是对该时刻之前的统计时间的一个响应,会出现一种迟滞的问题。

典型场景:

当output被拉回setpoint时,由于error始终在积累,导致在output == setpoint时刻,Ki会将output继续维持推离setpoint。

此时,需要增加integrator windup的方法来进行判断处理。

4.5 Kp/Kd关系

鉴于Kp是瞬时斜率,通常来说稳定系统在修正过程中output变化不会非常大,而常见大斜率往往是一些噪声干扰,进而破坏稳定性。

此时,需要增加对output传感量进行降噪处理。

5. 总结

上述所介绍的都是在一个continous domain(连续域)的PID控制器,当处理简单线性变化的控制逻辑具有非常好的应用。

从定性的角度,可以给出如下表格:
在这里插入图片描述
从PID调试方法,简单可以给出如下方法:

在这里插入图片描述

当要针对复杂问题,尤其是discrete domain(分散域)处理问题时,往往需要进行更深入的业务分析,进而采用cascade control/discrete control/feedforward control/ratio control/split range control/neural networks/fuzzy control 等复杂方式进行控制。

6. 附录

6.1 了解 PID 控制,第 1 部分:什么是 PID 控制?

了解 PID 控制,第 1 部分:什么是 PID 控制?

6.2 Anti-windup for PID control Understanding PID Control- Part 2

Anti-windup for PID control Understanding PID Control- Part 2

6.3 Noise Filtering in PID Control Understanding PID Control- Part 3

Noise Filtering in PID Control Understanding PID Control- Part 3

6.4 A PID Tuning Guide Understanding PID Control- Part 4

A PID Tuning Guide Understanding PID Control- Part 4

6.5 Build a Model for Control System Design | Understanding PID Control, Part 5

Build a Model for Control System Design | Understanding PID Control, Part 5

6.6 Manual and Automatic PID Tuning Methods Understanding PID Control- Part 6

Manual and Automatic PID Tuning Methods Understanding PID Control- Part 6

6.7 Important PID Concepts Understanding PID Control- Part 7

Important PID Concepts Understanding PID Control- Part 7

猜你喜欢

转载自blog.csdn.net/lida2003/article/details/130839675