mirror of
https://github.com/livekit/livekit.git
synced 2026-03-30 17:45:40 +00:00
fix the negative sign scope (#1696)
This commit is contained in:
@@ -1855,7 +1855,7 @@ func (p *PIDController) Update(setpoint, measurement float64, at time.Time) floa
|
||||
}
|
||||
p.iVal = boundIVal
|
||||
|
||||
p.dVal = (-2.0*p.kd*(measurement-p.prevMeasurement) + (2.0*p.tau-duration)*p.dVal) / (2.0*p.tau + duration)
|
||||
p.dVal = -(2.0*p.kd*(measurement-p.prevMeasurement) + (2.0*p.tau-duration)*p.dVal) / (2.0*p.tau + duration)
|
||||
|
||||
output := proportional + p.iVal + p.dVal
|
||||
boundOutput := output
|
||||
|
||||
Reference in New Issue
Block a user