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.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
|
output := proportional + p.iVal + p.dVal
|
||||||
boundOutput := output
|
boundOutput := output
|
||||||
|
|||||||
Reference in New Issue
Block a user