Catto / Topic Map · Control Systems Level 5
Control Systems · 96 h · Topic 8 of 8

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.

PID Ziegler–Nichols Digital control Sampling period Integral windup

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:

\[ u(t) = K_p \left( e(t) + \frac{1}{T_i}\int_0^t e\,d\tau + T_d \frac{de}{dt} \right) \] \( T_i \) is the integral time and \( T_d \) the derivative time. In practice the derivative is applied to the measurement rather than the error, so as not to cause a kick when the reference changes, and it is filtered so as not to amplify noise.

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:

\[ K_p = 0.6\, K_u, \quad T_i = T_u/2, \quad T_d = T_u/8 \] For the plant \( 1/(s+1)^3 \), \( K_u = 8 \) and \( T_u = 2\pi/\sqrt 3 \approx 3.63 \) s. The rules aim for a quarter-amplitude decay between successive peaks: they give a fast response but with a lot of overshoot, and are a starting point for fine tuning.

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:

\[ I_k = I_{k-1} + \frac{K_p T_s}{T_i}\, e_k \] \[ u_k = K_p\, e_k + I_k - K_p T_d\, \frac{y_k - y_{k-1}}{T_s} \] There are more exact versions, such as Tustin's bilinear transformation, which preserves the frequency response better. Sampling and holding are roughly equivalent to a delay of half a period, which subtracts phase: with \( T_s \) large compared with the loop dynamics, digital control degrades and can become unstable. The rule of thumb asks for sampling ten to twenty times per closed-loop time constant.
Lab · continuous and digital PID

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

Activity 1 · Real Ziegler–Nichols

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.

Activity 2 · Sampling period

Implement the PID in a microcontroller and increase the sampling period until the response degrades.

Activity 3 · Integral windup

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.
Development of the topic “Design of continuous and discrete controllers” of Control Systems (Level 5), based on the curriculum of the UTN Electronic Engineering program, 2023 curriculum — Ordinance No. 1849 of the UTN Higher Council. Back to the Topic Map · catto.ar