mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
f0e3bb51642acae7e7a002c0072538dd94743432
This avoids large additions introduced by the D term when a step change occurs in the setpoint. Otherwise, the changes return the same values. Let error = setpoint - input and prevError = prevSetpoint - prevInput. If the D term is calculated via error - prevError, then:
error - prevError = (setpoint - input) - (prevSetpoint - prevInput)
If we ignore the setpoint changing, then we get:
error - prevError = (setpoint - input) - (setpoint - prevInput)
= prevInput - input
Change-Id: Ifa4af9b265e3c4bd263e8541355f2b80269693e9
Description
WPILib - FRC Robotics Library
Languages
C++
53.1%
Java
32.6%
Python
7.5%
C
2.6%
Jinja
1.7%
Other
2.4%