C O M P U T E R - A I D E D C O N T R O L S Y S T E M S D E S I G N Practical Applications Using MATLAB® and Simulink®
Cheng Siong Chin
SIMULINK CLOSED-LOOP CONTROL SYSTEM DESIGN
After completing the open-loop simulation using MATLAB and Simulink, a closedloop control system can be designed. In this section, PID parameters tuning using the Ziegler–Nichols method is used. A closed-loop control system is one in which the output signal has a direct effect upon the control action, that is, closed-loop control systems are feedback control systems. The system error signal, which is the difference between the input signal and the feedback signal, is fed back to the controller so as to reduce the output error and thus bring the output of the system to the desired value. In other words, the term closed-loop implies the use of feedback action in order to reduce the system error. Figure 2.42 shows the block diagram of the closedloop control system.
A Proportional-Integral-Derivative (PID) controller is one in which the outputs of the P-action, I-action and D- action are added together to produce the controller output.
This type of control provides zero offset and faster response. Derivative mode is added to the PI controller to make the response speed faster and less oscillatory.
In order to get the best performance from the three terms in the controller, the amount of each action (P-action, I-action, D-action) has to be selected carefully.
If a perfect model of the plant was available, then the selection process could be done through simulation or other analytical techniques. However, if the mathematical model of the plant is unknown, then an analytical approach to the design of a PID controller is not possible. Then, we must resort to an experimental approach to the design of PID controllers. There are many methods to tune the PID controller.
One of the methods is to use the Ziegler–Nichols method.
PID Tuning Using Simulink
The process of selecting the controller parameters to meet given performance specifications is known as controller tuning. Ziegler and Nichols suggested a rule for tuning PID controllers (meaning to set values of Kp, Ti and Td), which is
FIGURE 2.42 Closed-loop control system using PID controller.
based on the experimental value of Kp that results in marginal stability with the P-action acting alone.
Initially the line is operated using only a P controller. Its gain is increased until a continuous oscillation of the controlled variable is produced. This value of gain is the critical gain Kc. Also, the periodic time of the
oscillation Tc (critical period) must be established. Based on these values, the controller can then be tuned based on the Ziegler–Nichols recommended settings for process controllers shown in Table 2.1: Note that the Ziegler–Nichols method only provides the initial setting for the PID controller. In order to have the optimal result, fine-tuning is required. For example, the transfer function of the plant is given by
FIGURE 2.43 PID block diagram using Simulink.
Next, to find out the critical gain Kc and critical period Tc, follow the procedure below.
• Select the simulation.
• Observe the transient response in the Scope window.
• Increase the parameter: Proportional, in the PID Controller block, (suggested incremental value of Proportional is 0.5).
• Restart your simulation. Check the response curve. If it is not a continuous oscillation (sine waveform), repeat step with new Kp values until you get continuous oscillation in the transient response. When the sustained oscillation occurs, this Kp (proportional gain) value is called critical proportional gain, Kc.
• The value of critical gain Kc = 3.
• The value of critical period Tc = 3s.
After obtaining the Kc and Tc, we can use Table 2.1 to obtain the following parameters.
Follow the steps to obtain these PID parameters.
• Using Table 2.1, the Ziegler–Nichols Criterion, determine the PID controller settings: Kp = 1.8, Ti = 2.5s and Td = 0.625s.
• Set the PID Controller block according to the values found.
• Proportional: 1.8 (Proportional gain, Kp )
• Integral: 0.72 (Integral gain, Ki = Kp / Ti)
• Derivative: 1,17 (derivative gain, Kd = KpTd)
• Start the simulation and the final value of the controlled variable in this case is around 0.98 V. Hence, it has a steady-state error of 0.02 V. The time response of the PID control system can be seen in Figure 2.44.
PID Tuning Using the SISO Tool
Instead of tuning the PID controller gains using Simulink, a single-input, singleoutput (SISO) tool in MATLAB can be used. To use the SISO tool in MATLAB, enter the plant’s transfer function to be used. In this case, the transfer function used for the plant is shown in (2.14).
The commands are as follows:
>> TF = tf([1],[1 2 2 1]);
>> sisotool(TF)
The graphical user interface (GUI) for the SISO tool can be seen in Figure 2.45.
It contains Bode plot and Root Locus plot for open-loop system analysis and control.
FIGURE 2.46 Select Automated Tuning method in SISO tool.
FIGURE 2.47 Display or Update controller in SISO tool.
For automated tuning, we use the Ziegler–Nichols method. Select Automated Tuning method as shown in Figure 2.46. Then, select PID Tuning and choose the Ziegler–Nichols method.
To begin with the controller design, click Update Compensator. The controller can be obtained as shown in Figure 2.47. As observed in the procedures, the tuning method is quite automatic without any involvements in defining the critical gain, critical period, and other parameters.