The Sampled PID Equation: Term Bookkeeping and Saturation
The Sampled PID Equation: Term Bookkeeping and Saturation
Ada re-derives the chapter’s sampled PID equation, keeping each term’s error sample and the actuator bound explicit
ADA · CALCULATION AUDIT
The Sampled PID Equation: Term Bookkeeping and Saturation
A controller trace is trustworthy only when the math records which error sample fed each term and the physics records whether the actuator, sensor, and sample interval could support that command.
A PID controller does not begin with three gains but with a measured gap: temperature below a setpoint, tank level above a limit, or motor speed drifting from target. The chapter sums proportional, integral, and derivative action on that error, then warns that the equation is not complete until the loop record also names the sample interval, output limits, integral limit, and derivative filtering. This audit asks the question that warning invites: can the chapter’s PID equation be trusted as written, or only once each term’s error sample and the actuator bound are made explicit?
Companion to the chapter PID Control Theory — every number here comes from that chapter.
See the relationship before changing it
The figure reads from left to right. The blue card is instantaneous control error. The middle card applies this page's rule. The green card is proportional contribution. Walk the arrows once: set the input, apply the rule, then read the result with its unit.
The retained audit below checks several chapter fixtures. This model keeps those stated values fixed and changes only instantaneous control error, so the numeric fixture does not switch without explanation.
Derive the baseline in four named moves
- 1
Name the input. The chapter baseline is 10 units.
- 2
Name the relationship. proportional term = Kp 2.0 x error
- 3
Substitute with units. 2.0 x 10 = 20.0 output units
- 4
Read the result. Keep the unit beside the value. Use it only inside the technical boundary on this page.
Predict, then change instantaneous control error
Try Predict the direction of proportional term = Kp 2.0 x error. Test another instantaneous control error, then compare proportional contribution.
Observe A larger error creates a larger proportional correction before clamps, integral memory, and derivative filtering act. Reset instantaneous control error to 10 and compare proportional contribution.
Explain A larger error creates a larger proportional correction before clamps, integral memory, and derivative filtering act.
Check yourself
What should you do before trusting a moved-control result?
What does this small model leave out?
Ready: use the stated baseline inputs, then compare each displayed result.
Start with the measured error
1. Start with the measured error. The chapter already defines error as setpoint minus process variable, so the sampled version at time step k is:
Preserve the sample interval before adding integral or derivative action
2. Preserve the sample interval before adding integral or derivative action. Integral action accumulates error over time; derivative action divides the error change by time. Without the same sample interval in both records, the units do not match the physical loop.
Then compute the bounded actuator request
3. Then compute the bounded actuator request. This is the chapter's PID equation with the missing implementation guardrails made explicit.
| Audit item | Formula check | What it proves |
|---|---|---|
| Proportional term | P[k] = Kp * e[k] | The immediate command is proportional to the current measured gap only. |
| Integral term | I[k] = Ki * clamp(error_sum[k-1] + e[k] * dt) | Persistent error is accumulated in time units and bounded before it can wind up. |
| Derivative term | D[k] = Kd * (e[k] - e[k-1]) / dt | Damping uses the error trend, so noisy measurements and slow sampling must be filtered or justified. |
| Actuator physics | output[k] = clamp(P[k] + I[k] + D[k]) | The command sent to the device respects real actuator limits instead of assuming unlimited correction. |
No numeric tuning claim is made here: this chapter supplies the PID equation and required records, but not measured gains, traces, sample periods, or actuator limits. A numeric panel would need those values from a real loop before it could claim a stable setting.
Every expression above is taken from the chapter’s own PID equation and required records, and re-derived step by step.