Design of continuous and discrete controllers
The same PID that controls a plant well in continuous time makes it oscillate if it is implemented by sampling every half second. The sampling period is part of the design.
01The PID controller
Most industrial loops use a three-action controller. The proportional action acts according to the current error; the integral, according to the accumulated error, and eliminates the steady-state error because it raises the type of the system, as seen in steady state; the derivative, according to the rate of change, and anticipates, adding phase and damping:
On the root locus, the PID adds a pole at the origin and two zeros, which attract the branches to the left; in frequency, it raises the gain at low frequencies and adds phase near the crossover. Both readings were covered in root locus and in frequency response.
02Tuning: Ziegler and Nichols
In 1942, John Ziegler and Nathaniel Nichols proposed empirical rules for tuning a PID without a model. In the oscillation method, only the proportional action is left, the gain is raised until the loop oscillates in a sustained way and that ultimate gain \( K_u \) and the period \( T_u \) are noted. It is the critical gain given by the Routh criterion:
03The digital controller
Today the PID is implemented in a microcontroller or a PLC. In each sampling period \( T_s \) the sensor is read, the action is computed and held constant until the next period (zero-order hold). The simplest form approximates the integral by a sum and the derivative by a difference:
A PID on the plant \( 1/(s+1)^3 \) with a unit reference step. The plant is integrated with Runge-Kutta with a 1 ms step; the controller computes its action every \( T_s \) and holds it until the next period. The dotted line is the reference.
04The design of a control system
A complete project goes through everything covered in the subject: specifying the required behavior (overshoot, settling time, steady-state error, disturbance rejection), modeling or identifying the plant, choosing the structure of the controller, designing it with the root locus or in frequency, verifying it by simulation with the real nonlinearities (actuator saturation, with its anti-windup protection), choosing the sampling period, implementing it and tuning it on the real plant.
05In the lab
On a thermal or speed plant, find Ku and Tu with the oscillation method and apply the rules. Measure the overshoot and tune by hand.
Implement the PID in a microcontroller and increase the sampling period until the response degrades.
Saturate the actuator with a large step and compare the response with and without anti-windup protection.
06Common mistakes
- Differentiating the error. A reference change produces an enormous spike in the action; it is better to differentiate the measurement.
- Forgetting actuator saturation. The integral keeps growing and produces a large overshoot when leaving saturation.
- Sampling too slowly. The sampling delay subtracts phase and can make unstable a loop that was stable in continuous time.
- Taking the Ziegler–Nichols tuning as final. It gives responses with a lot of overshoot; it is a starting point.
07Self-assessment
A loop oscillates with Ku = 12 and Tu = 2 s. What PID do the Ziegler–Nichols rules give?
Kp = 7.2; Ti = 1 s; Td = 0.25 s.
What action eliminates the steady-state error for a step?
The integral.
What approximate delay does a hold with Ts = 0.2 s add?
Half a period: 0.1 s.
Why is the derivative action filtered?
Because it amplifies the high-frequency noise of the measurement.
08Further reading
- Karl J. Åström and Tore Hägglund. Advanced PID Control. ISA, 2006. PID in practice: tuning, filtering, integral windup and implementation.
- Katsuhiko Ogata. Discrete-Time Control Systems. 2nd ed., Prentice Hall, 1995 (Spanish edition: “Sistemas de control en tiempo discreto”, 2nd ed., Prentice Hall, 1996). The z-transform, sampling and the design of digital controllers.
- John G. Ziegler and Nathaniel B. Nichols. Optimum Settings for Automatic Controllers. Transactions of the ASME, 64, 1942. The original paper with the tuning rules.