比例积分导数中的 I

发布于 2024-10-23 18:17:00 字数 1459 浏览 0 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

嘿嘿嘿 2024-10-30 18:17:00

积分项是过去所有误差的总和。您只需在每个时间步将误差添加到“积分器”即可。如果需要限制此值,则在超出范围时将其限制为最小值或最大值。然后将此累积值复制到输出中,并添加比例项和导数项,并在必要时再次钳位输出。

导数项是当前误差和先前误差的差值(误差的变化率)。 P当然与误差成正比。

err = reference - new_measurement
I += kI * err
Derivative = err - old_err
output = I - kD * Derivative + kP * err
old_err = err

现在你就得到了它。当然省略限制。

一旦控制器达到参考值,误差将变为零,积分器将停止变化。噪声自然会使其稍微反弹,但它将保持在满足目标所需的稳态值,而 P 和 D 项则完成了减少瞬态的大部分工作。

请注意,在稳态条件下,I 项是唯一提供任何输出的项。如果控制已达到参考值并且需要非零输出,则该输出仅由积分器提供,因为误差为零。如果 I 项使用加权误差,它将开始衰减回零并且无法维持所需的输出。

The integral term is the sum of ALL the past errors. You simply add the error to the "integrator" at each time step. If this needs to be limited, clamp it to a min or max value if it goes out of range. Then copy this accumulated value to your output and add the proportional and derivative terms and clamp the output again if necessary.

The Derivative term is the difference in the present and previous error (the rate of change in the error). P of course is just proportional to the error.

err = reference - new_measurement
I += kI * err
Derivative = err - old_err
output = I - kD * Derivative + kP * err
old_err = err

And there you have it. Limits omitted of course.

Once the controller reaches the reference value, the error will become zero and the integrator will stop changing. Noise will naturally make it bounce around a bit, but it will stay at the steady state value required to meet your objective, while the P and D terms do most of the work to reduce transients.

Notice that in a steady state condition, the I term is the ONLY thing providing any output. If the control has reached the reference and this requires a non-zero output, it is provided solely by the integrator since the error will be zero. If the I term used weighted errors, it would start to decay back to zero and not sustain the output as needed.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文