CalcWorldHub
Free online calculator · no signup

Discrete PID step with output limiting calculator

Calculate one positional PID update using derivative on measurement, clamping, and conditional integral anti-windup.

4,000 tools
Discrete PID step with output limiting calculator — Current setpoint, Current measured process value, Previous measured value and calculation method
Discrete PID step with output limiting calculator: inputs and calculation method.

How to use this calculator

Calculate one positional PID update using derivative on measurement, clamping, and conditional integral anti-windup.

  1. Enter Current setpoint, Current measured process value, Previous measured value, Previous integral contribution, then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

Discrete PID step with output limiting explained

Limited PID output5.8output units
Limited PID output: 5.8 output units in the worked scenario.

How the calculation works

u=Kp·e+I−Kd·(y−yp)/dt; I update=Ki·e·dt

Compute error from setpoint minus measurement and differentiate the measurement change. Form a trial integral update; hold it only if its increment would drive an already saturated trial output farther outward. Clamp the final sum and return the integral state for the next sample.

Set up the calculation

sp — Current setpoint
Current setpoint.
y — Current measured process value
Current measured process value.
yp — Previous measured value
Previous measured value.
ii — Previous integral contribution
Previous integral contribution.
kp — Proportional gain
Proportional gain.
ki — Integral gain per second
Integral gain per second.
kd — Derivative gain in seconds
Derivative gain in seconds.
dt — Sample interval (s)
Sample interval (s).
lo — Output lower limit
Output lower limit.
hi — Output upper limit
Output upper limit.

Limits of this model

No derivative filter or plant simulation. Integral accumulation is held only when the trial increment would push a saturated output farther into saturation.

Check this example

Current setpoint = 10; Current measured process value = 8; Previous measured value = 7; Previous integral contribution = 1; Proportional gain = 2; Integral gain per second = 0.5; Derivative gain in seconds = 0.2; Sample interval (s) = 1; Output lower limit = 0; Output upper limit = 10.

  • Limited PID output: 5.8 output units
  • Next integral contribution: 2 output units
  • Proportional contribution: 4 output units
  • Derivative-on-measurement contribution: -0.2 output units
  • Integral anti-windup: Increment accepted

Error is 2, so the proportional contribution is 4 and the trial integral becomes 2. Derivative on measurement contributes −0.2, giving output 5.8 without saturation.

Source

MathWorks, Discrete PID Controller documentation. Notes that discrete integral and derivative behavior depends on sample time and the selected discretization method; this page specifies its own single-step equation.

Interpreting the result

The example command is 5.8 output units, inside the 0-to-10 limits, so the clamp is inactive for that step. The result uses the updated integral term and a derivative on the measured-value change; it does not model anti-windup, filtering or actuator dynamics.

Frequently asked questions

Why differentiate measurement rather than setpoint error?

It avoids a derivative kick from an abrupt setpoint change.

What state must I keep?

Feed the returned integral and current measurement into the next step.

Does this tune controller gains?

No.

How do I use the Discrete PID step with output limiting calculator?

Enter Current setpoint, Current measured process value, Previous measured value, Previous integral contribution, then complete the remaining labeled fields. Match the units shown beside each field and review the result together with the assumptions below.

What is a worked example of Discrete PID step with output limiting?

Current setpoint = 10; Current measured process value = 8; Previous measured value = 7; Previous integral contribution = 1; Proportional gain = 2; Integral gain per second = 0.5; Derivative gain in seconds = 0.2; Sample interval (s) = 1; Output lower limit = 0; Output upper limit = 10. Limited PID output: 5.8 output units Next integral contribution: 2 output units Proportional contribution: 4 output units Derivative-on-measurement contribution: -0.2 output units Integral anti-windup: Increment accepted Error is 2, so the proportional contribution is 4 and the trial integral becomes 2. Derivative on measurement contributes −0.2, giving output 5.8 without saturation.