You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Reason**: Prevents "derivative kick" during setpoint changes.
86
+
87
+
When using derivative on error: `d(error)/dt = d(setpoint - measurement)/dt`
88
+
89
+
If the setpoint changes suddenly (e.g., slewing to a new target):
90
+
- Error jumps instantly from small value to large value
91
+
-`d(error)/dt` becomes extremely large
92
+
- Derivative term produces a huge spike in output
93
+
- This causes jerky motion and potential overshoot
94
+
95
+
When using derivative on measurement: `d(measurement)/dt`
96
+
97
+
- Measurement changes gradually (limited by physical system dynamics)
98
+
- Derivative remains smooth even during setpoint changes
99
+
- Only responds to actual process variable changes, not command changes
100
+
101
+
**Mathematical equivalence during tracking**:
102
+
When setpoint is constant: `d(setpoint)/dt = 0`
103
+
104
+
Therefore: `d(error)/dt = -d(measurement)/dt`
105
+
106
+
The negative sign in the implementation accounts for this, making it mathematically equivalent to error-based derivative during steady tracking, but smooth during setpoint changes.
107
+
108
+
#### Why Trapezoidal Integration (Using Both Current and Previous Error)?
109
+
110
+
The implementation uses trapezoidal rule for integration:
0 commit comments