修改了a0~a3系数计算公式

This commit is contained in:
2026-08-17 17:33:15 +08:00
parent bff24e8301
commit 2f4080f01e
12 changed files with 1188 additions and 5 deletions
+4 -4
View File
@@ -71,10 +71,10 @@ class IncrementalPID:
self.du_max = None
def _calculate_coefficients(self):
"""Calculate the discrete incremental-PID coefficients."""
self.a0 = self.kp + (self.ki * self.dt / 2.0) + (2.0 * self.kd / self.dt)
self.a1 = -self.kp + (self.ki * self.dt / 2.0) - (4.0 * self.kd / self.dt)
self.a2 = (2.0 * self.kd) / self.dt
"""矩形积分与后向差分微分形式的增量式 PID 系数。"""
self.a0 = self.kp + self.ki * self.dt + self.kd / self.dt
self.a1 = -self.kp - 2.0 * self.kd / self.dt
self.a2 = self.kd / self.dt
def set_values(self, measurement, setpoint):
"""Set the current measurement and desired setpoint."""