Skip to content

Commit 877adac

Browse files
added warning about pid code example
1 parent a21214d commit 877adac

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/section-7/feedback-control.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ double calculate(double currentPosition, double targetPosition) {
5555
return kP * error + accumulatedError + kD * derivative;
5656
}
5757
```
58-
58+
!!! warning
59+
The code excerpt is only meant to show how PID works. This is not how we actually implement PID, but should give you a better idea of the inner workings of PID.
60+
5961
For those that know calculus, the formal definition of PID control is:
6062

6163
$$ u(t) = K_{p}e(t) + \int_{0}^{t}e(\tau)d\tau + K_{d}\frac{de}{dt} $$

0 commit comments

Comments
 (0)