0% found this document useful (0 votes)
284 views10 pages

PID Controller Tuning in SIMULINK

This document discusses the use and tuning of PID controllers in process control simulations using SIMULINK, highlighting the effects of proportional, integral, and derivative actions. It outlines a procedure for tuning PID parameters using the modified Ziegler-Nichols method and provides step-by-step instructions for building a block diagram in SIMULINK. The document concludes with a discussion of the advantages and effects of different controller types on system response.

Uploaded by

Suhas Mohite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
284 views10 pages

PID Controller Tuning in SIMULINK

This document discusses the use and tuning of PID controllers in process control simulations using SIMULINK, highlighting the effects of proportional, integral, and derivative actions. It outlines a procedure for tuning PID parameters using the modified Ziegler-Nichols method and provides step-by-step instructions for building a block diagram in SIMULINK. The document concludes with a discussion of the advantages and effects of different controller types on system response.

Uploaded by

Suhas Mohite
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PID Controller with Ziegler Nichols tuning for Process control simulation

using SIMULINK

1. Introduction

This session studies the use and tuning of proportional (P), proportional-integral (PI) and
proportional-integral-derivative (PID) controllers in a feedback loop. It demonstrates
effects of each type of control action (P, I or D) and the concept of critical stability. It
uses practical and industrially proven methods to tune the controller parameters and
shows the response of the closed loop system in the face of setpoint changes and step
disturbances.
SIMULINK is a MATLAB based software package for modeling, simulating, and
analyzing dynamical systems. It supports linear and nonlinear systems, modeled in
continuous time, sampled time, or a hybrid of the two. SIMULINK provides a graphical
user interface (GUI) for building models as block diagrams, using click-and-drag mouse
operations. With this interface, you can draw the models just as you would with pencil
and paper (or as most textbooks depict them).

At the end of this session you should have learned


 a simple procedure for tuning PID controllers.
 the concept of critical stability.
 the effects of proportional, integral and derivative actions.
 how to implement block diagrams and carry out simulations using SIMULINK.

2. Description of the control system


2.1 Block diagram
The layout of a typical feedback control system can be illustrated by Figure l. It
consists of a plant whose output y is to be controlled according to the desired value r,
subject to an external disturbance d. Here G(s) represents the process transfer function
and C(s) represents the controller transfer function.

1
Disturbance
Setpoint d
r Controller Plant Output
+ + + y
G(s)
C(s)
-

Figure 1: Feedback control system

2.2. Process plant model

The plant will have relationships and parameters that depend on the underlying physical
system. Consider a process plant with a transfer function of the form:

K K
G(s)= =
( 1+ sT 1 ) ( 1+ sT 2 )( 1+ sT 3 ) ( T 1 T 2 T 3 ) s + ( T 1 T 2 + T 2 T 3 +T 3 T 1 ) s 2+ ( T 1 +T 2+ T 3 ) s+1
3

where T1, T2 and T3 are the time constants of three cascaded lags and K is the static gain
,

of the plant.
The plant is assumed to have values of T1  T  T3  5 K  1.
2
1, and
2,

2.3. Controller structure

The aim of the controller shown in Figure 1 is to keep the output y as close as possible to
the reference r. If this is attempted by a simple proportional gain, it is found that a large
gain is required to make the error small. However, a large gain can make a third order
system unstable. To achieve acceptable transients we may need to set the gain at a low
value that may produce unacceptable steady state errors.

The steady state response can be improved by the addition of an integral term, and the
speed of response can be increased by the addition of a derivative term. A common PID

2
control transfer function is given by

Choosing the controller parameters: We will use the modified Ziegler Nichols method to tune
the controller. This method is very simple. The system is placed under proportional control and
taken to the limit of stability by increasing the gain until permanent oscillations are achieved.

Figure 1: System tuned using the Ziegler-Nichols closed-loop tuning method

The gain at which this occurs is called the ultimate gain (Ku), and the period of this
oscillation is known as the ultimate period (Tu). With these two parameters, the controller
parameters Kp, Ti and Td can be calculated as shown in Table 1.
Kp Ti Td
P 0.33 Ku
PI 0.33 Ku 2 Tu
PID 0.20 Ku 0.8 Tu 0.2 Tu

3
Table 1: Modified Ziegler-Nichols PID tuning.

4
3. Building a block diagram in Simulink.

Step 1: Start MATLAB and type the following command at the prompt:
>> T1=1;T2=2;T3=5;K=1;
>> simulink
You will see the main Simulink window. On this window select the menu option.
File/New/Model. A new blank window called Untitled will appear.

Step 2: On the Simulink window Select the Simulink / Continuous option and then right
click the mouse on the Transfer Fcn block and select “add to untitled”.

Step 3: In the Untitled window, double click on the Transfer Fcn block, delete the
contents of the Numerator and Denominator fields and enter the following row vectors:
Numerator:
[K]
Denominator:
[(T1*T2*T3) (T1*T2 +T2*T3+T1*T3) (T1+T2+T3) 1]

Step 4: Open the Menu Block Sets and ‘Simulink Extras/Additional Linear’,
take a PID Controller block and drop it on the left of the Transfer Fcn block inside
the Untitled window.
Step 5: From the ‘Simulink/Math operations’ option, take a sum block and drop it
on the left of the PID controller block. In the Untitled window, double click on the
sum block and replace the second plus (+) sign in the list of signs with a minus (-) sign.
Take another sum block and drop below the PID Controller block.
Step 6: From the ‘Simulink/Sources’ menu, take a step block and drop it on the left
of the sum block in the Untitled window. Take another step block and drop it below
the PID Controller block. Rename this block as disturbance by left clicking on the
step label and over-writing it.
Step 7: Double click on the disturbance block and change the step time field to 100
seconds and the final value field to –1.

5
Step 8: From the ‘Simulink/Sinks’ option, take a scope block and drop it on the left
of the sum block in the Untitled window.

Step 9: Now you will introduce links between the blocks.


i. Right click on the triangle on the right of the sum block and holding the mouse
extend a link to the triangle on the left of the PID Controller block.
ii. Similarly, create a link between the PID Controller block and the sum block
that is on its right.
iii. Create a link between the disturbance block and the sum block on the right of
the PID controller block, and a link between this sum block and the input of
the Transfer Fcn block.
iv. Create a link between the step block and the positive input of the sum block on
the left of the PID Controller block.

v. Create a link between the Transfer Fnc block and the scope block.
vi. Finally, create a feedback link between the output of the Transfer Fcn block
and the negative input of the sum block that is on the left of the PID
Controller block.

After you have followed Steps 1-9, the Untitled window should look like Figure 2. Now
you should save the Untitled window using its File pull-down menu. Also, select the
Simulation/Parameters pull-down menu of the Untitled window, and change the
stop time field to 200 seconds.

6
Figure 3: Simulink system

3. System response with proportional controller

3.1. Critical Stability

It can be shown theoretically that when Kp=12.6 the closed loop will be critically stable.
This gain is the ultimate gain (Ku). To verify, double click on the PID Controller block
in the Untitled window and set the following values for the parameters: Proportional
12.6, Integral 0, Derivative 0. Start the simulation by clicking on the start () button
and double click on the scope block to view the results (you may like to auto-scale the
plot by clicking on the binoculars button). Estimate the period of the oscillation by
measuring the distance (in seconds) between two adjacent peaks. This is the ultimate
period (Tu)

7
Question: Suggest a way of finding the ultimate gain of a system under proportional
control.

4. System Response with PI Controller

Using the formulas given in Table 1, calculate the integral time constant Ti for a PI
controller. Calculate the corresponding integral gain as Ki = Kp/Ti. Double click on the

PID Controller block in the Untitled window and update the Integral field with the
value of Ki that you have calculated. Start the simulation and observe the result by double
clicking on the scope block.

Sketch these responses, and annotate the curves with relevant data. Note the effects of the
step disturbance at 100 s.

5. System Responses with PID Control

Using the formulas given in Table 1, calculate the controller gain Kp, the integral time
constant Ti and the derivative time constant Td for a PID controller. Calculate the
corresponding integral gain as Ki = Kp/Ti and the derivative gain as Kd=KpTd. Double
click on the PID Controller block in the Untitled window and update the Proportional
8
field with the new value of Kp, the Integral field with the value of Ki and the derivative
field with the new value of Kd. Start the simulation and observe the result by double
clicking on the scope block.
Sketch these responses, and annotate the curves with relevant data. Note the effects of the
step disturbance at 100 s.

6. Discussion of Results and Conclusions

Explain the relative advantages of the different controllers studied in this experiment.
The characteristics of Proportional (P), Integral (I), and Derivative (D) controllers (Kp,
Ki, and Kd respectively) and their effects on a closed-loop system:
 Proportional Controller (Kp):
Decreases rise time and steady-state error, but increases overshoot and has a small effect
on settling time. It degrades stability.
 Integral Controller (Ki):
Decreases rise time, eliminates steady-state error, but increases overshoot and settling
time. It also degrades stability.
 Derivative Controller (Kd):
Causes a minor change in rise time, decreases overshoot and settling time, and has no
effect on steady-state error. It improves stability if Kd is small.
The table below sums up the effects of Kp, Ki and Kd on response parameters:

9
Figure 4: Step response of P, PD, and PID controllers

1
0

Common questions

Powered by AI

In Simulink, linking components in a model follows a systematic approach: right-click the output of a block and extend a link to the input of another block, ensuring the logical flow of signals through components like PID Controller, Sum, and Transfer Fcn blocks. This approach mirrors the mathematical relationships of a control system, with feedback loops critically essential for model accuracy .

Analyzing the step response of different controllers reveals the trade-offs between rise time, overshoot, settling time, steady-state error, and stability. A P controller decreases rise time and steady-state error but increases overshoot. A PI controller eliminates steady-state error completely but may increase overshoot and settling time. A PID controller combines the benefits of P and I controllers while using the derivative action to reduce overshoot and settling time, providing a balanced response .

Critical stability occurs when a system is on the verge of oscillation but does not diverge. It is exemplified using a proportional controller by setting the proportional gain, Kp, to the ultimate gain (Ku), which is the gain at which permanent oscillations occur without increasing in amplitude. For example, in the described system, setting Kp to 12.6 makes the closed loop critically stable .

For different controller types, the Ziegler-Nichols tuning method provides distinct formulas to calculate PID parameters based on the ultimate gain Ku and ultimate period Tu. For example, for a P controller, Kp is 0.33 Ku. For a PI controller, Kp is 0.33 Ku and Ti is 2Tu. For a full PID controller, Kp, Ti, and Td are calculated using formulas like 0.20 Ku, 0.8 Tu, and 0.2 Tu, respectively .

Constructing a Simulink model involves selecting and arranging blocks such as Transfer Fcn, Sum, PID Controller, and Step blocks from Simulink libraries. These blocks are connected to form a feedback control loop, emulating the dynamics and disturbances in a physical system. The steps include using commands to initialize component parameters and altering block settings as required .

The derivative term in a PID controller has a minor impact on rise time, significantly decreases overshoot and settling time, and does not affect steady-state error. It improves system stability by anticipating system behavior and applying corrections based on the rate of change of the error, especially effective when the derivative gain Kd is small .

The Ziegler-Nichols tuning method determines the ultimate gain (Ku) and ultimate period (Tu) by increasing the proportional gain until the system reaches the edge of stability, exhibiting permanent oscillations. The gain at this oscillation point is Ku, and the oscillation period is Tu .

Changes in the derivative gain Kd adjust how the controller reacts to the rate of change of the error signal. Increasing Kd reduces overshoot and settling time while having little to no impact on steady-state error. However, if Kd is too high, it may induce noise into the system, potentially destabilizing it. Thus, small adjustments in Kd can improve stability and response time modestly when well-calibrated .

Adding an integral term to a proportional controller decreases rise time and eliminates steady-state error. However, it also increases overshoot and settling time, degrading system stability .

A step disturbance introduces a sudden change in the input of the system, testing its ability to return to set conditions. In a PID-controlled system in Simulink, this disturbance at, for instance, 100 seconds, would typically lead to a temporary deviation in the output. The PID action works to minimize this deviation and restore stability, using proportional, integral, and derivative actions to quickly counteract the impact of the disturbance .

You might also like