# Ziegler-Nichols' and Åström–Hägglund's Methods on PID Tuning with a Real Life Example

This document is intended to be the third report of the laboratory homeworks. The objective of the homework is to create a PID controller using Zigler-Nichols' critical gain and Åström–Hägglund's relay methods for the plant we had investigated on the second experiment. All the calculations will be shown in the paper, and the simulations will be held on MATLAB's Simulink.

Note: The reader can read the text with using the document below. It is totally the same.

## Plant Model

The plant model we will use is desribed mathematically in the Eq. (1). This model was found on the basis of data we got for the second experiment. As one may notice that plant model also includes enviromental status with adding $3$.

$$\text{PM} = \frac{1.0708}{1 + 34.536s} \cdot e^{-0.0124s} + 3$$

On the next section, we will briefly explain you how does these methods work. After that, we will create the sections that covers implementation of these methods to our problem, and finding gains of the controller. Then, we will do some simulations to test our design. At the end, we'll investigate the results and conclude about it.

## Tuning Methods

### Zigler-Nichols' Method

Method suggest us that find a gain for proportional that the graph shows as a stabilize oscillation. During these experiments, remove the integral and derivative components. This proportional gain is called \textbf{critical gain}, which is also the main drawback of the method. One should notice that it is really hard to find the stability border, with an oscillation, for example in a pressure plant.

After finding the stability border, one should calculate for oscillation's period, to have these two important parameters: $T_{osc}$ and $K_{kr}$.

For 30% overshoot,

K Ti Td
P $0.5 K_{kr}$
PI $0.45 K_{kr}$ $T_{osc} / 1.2$
PID $0.6 K_{kr}$ $T_{osc} / 2$ $T_{osc} / 8$

For 0% overshoot,

K Ti Td
P $0.2 K_{kr}$
PI $0.15 K_{kr}$ $T_{osc} / 2.5$
PID $0.25 K_{kr}$ $T_{osc} / 3$ $T_{osc} / 2$

### Åström–Hägglund's Method

It can be considered a modification of the method of Zigler-Nichols. However, this one is much more easy, fast, and reasonable for real systems.

Within this method, one of the magnificent change is having a relay to create a discrete system without integral or derivative. Proportional gain has to be enough high for creating a oscillation on the end. Putting a relay between the error and the plant will give a clock signal to plant, and this clock signal's output at the other end of the plant will be a oscillating sawtooth signal. One should find the period of that oscillation.

$$K_{kr} \approx \frac{4 B}{\pi A}$$

$$T_{kr} = T_{osc}$$

Controller parameters of PID can be found using the formulas in the table below.

Kp Ti Td
P $K_{kr} / 2$
PI $K_{kr} / 2.2$ $T_{kr} / 1.2$
PID $K_{kr} / 1.7$ $T_{kr} / 2$ $T_{kr} / 8$

Even the experimenter doesn't have any relays, we can still achieve the same thing with using the saturation points of the devices since it means that you can't achieve more (or less) than these saturation points will act like a clock. These saturation points even can be programmed if we're going to use a electronic computer.

## Finding PID Gains

One can see the PID controller scheme that we're going to use in this paper in the Figure (2).

### Zigler-Nichols' Experiment

1. Let's create only P controller with very high gain to achieve oscillation.
2. Try to find stabilized oscillation with changing the gain of proportional.
3. Measure the period of that oscillation, and do the calculations.

When I applied 4.175 as proportion gain, it nearly hold an oscillation around 5.5 while reference point is 6. You can see the results, and period in the Figures (3) and (4).

$$T_{osc} \approx 637 - 619 = 18$$

$$K_{kr} = 4.175$$

One can find the PID controller coefficents within the equations below.

$$K_p = 0.25 \cdot 4.175 = 1.04375$$

$$K_i = 18 / 3 = 6$$

$$K_d = 18 / 2 = 9$$

The final working experiment can be found in the Figure (5).

### Åström–Hägglund Relay Experiments

1. Let's create PID controller with very high proportional gain, 1/999 integrator gain, and zero derivative gain.
2. Put a saturation element after the error calculation.
3. Try to find stabilized oscillation with changing the gain of proportional.
4. Measure the period of that oscillation, and do the calculations.

When I applied 10 as proportion gain, it nearly hold an oscillation around the reference point that is setted as 6 by an input. You can see the results, and period in the Figures (6) and (7). Amplitude of the control signal ($A$) is 5, and amplitude of the controled signal ($B$) is $2.8$.

$$T_{osc} \approx 353 - 325 = 28$$

$$K_{kr} = \frac{4\cdot B}{\pi A} = 11.2/15.7 \approx 0.713$$

One can find the PID controller coefficents within the equations below.

$$K_p = 0.713 / 1.7 \approx 0.419$$

$$K_i = 28/2 = 14$$

$$K_d = 28 / 8 = 3.5$$

The final working experiment can be found in the Figure (8).

## Conclusion

We have found another PID parameters for the same plant in the previous laboratory homework, however, it is for sure that this method gave us the significantly better results.

Åström–Hägglund's method is a improvement for the Ziegler-Nichols' method since oscillations of the plant signal can be limited any value that we want. As you may see from the simulation that Åström–Hägglund's method gives us more stabile results.

One of the most important advantage of relay experiments is that it can be automatized -- therefore, a machine's PID controller can be tuned by only the operator, themselves. So, the control engineering knowledge behind tunning can be eliminated, and abstracted from the end-user.

The reader should note all the files and the schemes can be found online at https://dar.vin/Intro2ControlEng-ZieglerNichols-AstromHagglund. (Down below.)

1. Laboratory Document of Third Experiment, dr. hab. Pawel Dworak, 2022.
2. Chemical Process Dynamics and Controls (Woolf), Chapter: PID Tuning via Classical Methods, LibreText Books.
3. Relay Method Automates PID Loop Tuning, Vance VanDoren, Ph.D. et al, September 1, 2009.