You are on page 1of 16

Laboratory Exercise No.

9
Dynamic Systems Simulation Using LabVIEW

1. Objective:
The activity aims to simulate a dynamic system with transfer function having G(s)=2 e -s /(10s + 1)(5s + 1)
using the simulation functions of LabVIEW.
2. Intended Learning Outcomes (ILOs):
The students shall be able to:
2.1 Build a model of the open-loop system for the second order plus time delay process and determine
the unit set-point and unit disturbance responses.
2.2 Build a closed-loop model for the same process and simulate the unit disturbance response and
the unit-set-point response for two different PID controller tuning methods.
3. Discussion:
PID control systems are evaluated, in normal practice, by their Unit-Step Set-Point Response and
Unit-Step Disturbance Response.
The Unit-Step Set-Point Response is the response 𝑦𝑟,𝑠𝑡𝑒𝑝 (𝑡) of the process variable to the
unit-step point value 𝑟 𝑡 = 𝑓𝑠𝑡𝑒𝑝 (𝑡) added to the control system at rest, keeping the disturbance
𝑑 𝑡 =0
The Unit-Step Disturbance Response is the response 𝑦𝑑,𝑠𝑡𝑒𝑝 (𝑡) of the process variable to the
unit-step disturbance 𝑑 𝑡 = 𝑓𝑠𝑡𝑒𝑝 (𝑡) added to the control system at rest, keeping the set-point
𝑟 𝑡 =0

The most important property required for those responses is that they converge to constant values 𝑦𝑟,∞
and 𝑦𝑑,∞ , respectively. Under the linearity assumption, this property is equivalent to stability of the
feedback control system. Stability is the condition that must be guaranteed by any means, and the
evaluation of control systems only becomes meaningful under this condition.

Types of control systems


There are two types of control systems namely:
1. Open loop control systems (non-feedback control systems)
2. Closed loop control systems (feedback control systems)

Open loop control system


If in a physical system there is no automatic correction of the variation in its output, it is called an
open loop control system. That is, in this type of system, sensing of the actual output and comparing of
this output (through feedback) with the desired input does not take place. The system on its own is not
in a position to give the desired output and it cannot take into account the disturbances. In these
systems, the changes in output can be corrected only by changing the input manually.
1
Fig - 1 shows the block diagram of open loop control system in which process output is totally
independent of controller action.

These systems are simple in construction, stable and cost cheap. But these systems are inaccurate
and unreliable. Moreover these systems do not take account of external disturbances that affect the
output and they do not initiate corrective actions automatically.
Any non-feedback control system can be considered as a feedback control system if it is under the
supervision of someone. Although open loop control systems have economical components and are
simple in design, they largely depend on human judgment. As an example, let us consider a home
furnace control system. This system must control the temperature in a room, keeping it constant. An
open loop system usually has a timer which instructs the system to switch on the furnace for some time
and then switch it off. Accuracy cannot be achieved as the system does not switch on/off based on the
room temperature but it does as per the preset value of time.

Closed loop control system


A closed loop control system is a system where the output has an effect upon the input quantity
in such a manner as to maintain the desired output value.

An open loop control system becomes a closed loop control system by including a feedback. This
feedback will automatically correct the change in output due to disturbances. This is why a closed loop
control system is called as an automatic control system. The block diagram of a closed loop control
system is shown in figure. In a closed loop control system, the controlled variable (output) of the system
is sensed at every instant of time, feedback and compared with the desired input resulting in an error
signal. This error signal directs the control elements in the system to do the necessary corrective action

2
such that the output of the system is obtained as desired.
The feedback control system takes into account the disturbances also and makes the corrective
action. These control systems are accurate, stable and less affected by noise. But these control
systems are sophisticated and hence costly. They are also complicated to design for stability, give
oscillatory response and feedback brings down the overall gain of the control system.

PID Control
PID controllers are found in a wide range of applications for industrial process control. Approximately
95% of the closed loop operations of industrial automation sector use PID controllers. PID stands for
Proportional-Integral-Derivative. These three controllers are combined in such a way that it produces a
control signal.

As a feedback controller, it delivers the control output at desired levels. Before microprocessors were
invented, PID control was implemented by the analog electronic components. But today all PID
controllers are processed by the microprocessors. Programmable logic controllers also have the inbuilt
PID controller instructions. Due to the flexibility and reliability of the PID controllers, these are
traditionally used in process control applications.

PID Controller Tuning

PID tuning is the process of finding the values of proportional, integral, and derivative gains of a PID
controller to achieve desired performance and meet design requirements.

PID controller tuning appears easy, but finding the set of gains that ensures the best performance of
your control system is a complex task. Traditionally, PID controllers are tuned either manually or using
rule-based methods. Manual tuning methods are iterative and time-consuming, and if used on
hardware, they can cause damage. Rule-based methods also have serious limitations: they do not
support certain types of plant models, such as unstable plants, high-order plants, or plants with little or
no time delay.

PID Controller Tuning Methods


Proportional, Integral and derivative (PID) controllers are the most widely-used controller in the chemical
process industries because of their simplicity, robustness and successful practical application. Before
the working of PID controller takes place, it must be tuned to suit with dynamics of the process to be
controlled. Designers give the default values for P, I and D terms and these values couldn’t give the
desired performance and sometimes leads to instability and slow control performances. Different types
of tuning methods are developed to tune the PID controllers and require much attention from the
operator to select best values of proportional, integral and derivative gains.

The PID controller tuning methods are classified into two main categories
 Closed loop methods
 Open loop methods
3
Closed loop tuning techniques refer to methods that tune the controller during automatic state in which
the plant is operating in closed loop. The open loop techniques refer to methods that tune the controller
when it is in manual state and the plant operates in open loop. The closed loop methods considered for
simulation are:
 Ziegler-Nichols method
 Modified Ziegler-Nichols method
 Tyreus-Luyben method
 Damped oscillation method
 Open loop methods are:
 Open loop Ziegler-Nichols method
 C-H-R method
 Cohen and Coon method
 Fertik method
 Ciancone-Marline method
 IMC method
 Minimum error criteria (IAE, ISE, ITAE) method
4. Resources:
LabVIEW
5. Procedure:
A. Open-Loop System Simulation
Note: Create a directory (folder) named Maranan_YourSurname_LabExer9 and place inside
it all virtual instruments that you will create through this laboratory exercise. Download the
PID controller.vi from ftp and place inside this folder to be used in Procedure B.3.
1. Open LabVIEW and start with a new/blank VI. Name the virtual instrument as
YourSurname_openLoop. To view the palette functions that will be used in creating
LabVIEW programs, right-click inside the block diagram. Select the Control Design &
Simulation palette in order to view the library of simulation functions.
2. Click-and-drag a simulation loop on the block diagram.

4
3. From the Continuous sub-palette under Simulation palette of Control Design and Simulation
module of LabVIEW, drag and drop the block of Transfer Function and the block of Transport
Delay. The Transfer Function block represents the process and rename this block as
Process Transfer Function (or simply Process TF). Connect the output of the Process TF
block to the input of Transport Delay block .
4. To specify the transfer function 2/(50s2 + 15s + 1), double-click the Process TF block and
specify the Numerator as 2 and Denominator as 1 15 50. The specification of the numerical
coefficients are treated as the numerical coefficients of ascending powers of s. Resizing the
block’s icon is a must to see clearly the transfer function.
5. To specify the value of 1 for the Transport Delay, double-click the Transport Delay block and
assign the value of 1. The Transport Delay can represent measurement delay or other types.
6. Drag and drop another block of Transfer Function and another block of Transport Delay and
place them slightly above the blocks created in Procedure 2. Rename the Transfer Function
as Disturbance Transfer Function (or simply Disturbance TF) and specify the Numerator as 2
and Denominator as 1 15 50. In this exercise the transfer function of the process (Gp)and the
transfer function of the disturbance (Gd) are the same. For the Transport Delay1, specify the
value of 1.
7. Located in the Signal Arithmetic palette, place a copy of Summation block to the right of the
Transport Delay block. Right click the Summation block and select visible items >Label and
choose Summation. Connect the output of each Transport Delay block to the input of the
Summation block. From the dialog box, the number of inputs and their polarity can be
modified.
8. From the Graph Utilities palette place a SimTime Waveform. Connect the output of the
summation block to the input of the SimTime Waveform block.
9. From step Signal Generation palette place a Step Signal block, to the left of Disturbance TF.
Connect the output of the Step Signal block to the input of Disturbance block. Rename the
Step Signal block as D. To open its dialog block, double click it and set the initial value to
zero, final value to zero and step time to zero. This means that for this time, this block is
disabled.
10. Place a Step Signal block to the far left of process TF and rename it as U. Connect the output
of U to the input of Process TF. Set time to zero, Initial value to zero and Final value to 1.
This is the model of open-loop system. It should look similar to the model below.

5
11. Double-click on the left terminal of the Simulation loop, set the Final Time to 50 and
Maximum step size to 1. The maximum step size determines the largest step LabVIEW uses
in numerically integrating the ODE.
12. Run the simulation by clicking the arrow on either the front panel or the block diagram. Use
CTRL-E to switch between FP and BD. Double click on the title to change the name of the
plot as Unit Step-Response (Open-Loop). You can also right-click on the plot to view axis
settings, auto-scaling, and other parameters. Show the output in Table A.1. Save this file as
YourSurname_le9_pA12
13. To simulate the open-loop disturbance response, disable U by setting Final value to 0.
Enable D by setting Final value to 1. This creates a unit disturbance step. Begin the
simulation. Rename the graph title as Unit Disturbance Response (Open-Loop). Save this file
as YourSurname_le9_pA13. Show the output in Table A.2.
B. Close-Loop System Simulation
1. Delete the connection between the U block and Process TF block and rename the U block as
Ysp. This block will be used to produce a step change in the set-point.
2. Place a Summation block to the right of Ysp. Change the lower input from + to – by opening
its dialog box. Connect the output of the Ysp to the input of Summation block. Click the
bottom input of this Summation block and drag the arrow to the output of the other
Summation block. The model should look like this.

6
3. Place a PID Controller by clicking Select a vi (select PID controller.vi which you saved inside
the folder created in Procedure A.1) and drag it to the right newest Summation block.
Connect the output of the of the newest Summation block to the input of the PID controller
and the output of the PID controller to the input of the Process TF. Double-click on the PID
controller and enter the ITAE (disturbance) controller setting given in Table 12.3 SEM as well
as gains for closed-loop :

Note that the PID controller settings are Kc, τI and τD where P = Kc, I = Kc τI / , and D =
Kc*τD , so numerical values of P,I and D should reflect these definitions. This model
represents the closed-loop system. An important feature of LabVIEW is interactivity. This
capability makes the PID controller gains interactive from the front panel, rather than having
to edit them on the block diagram. Double-click on the PID Controller and change Parameter
Source from Configuration Dialog Box to Terminal.
4. Select CTRL-H and hover the PID controller to see where the gain terminals are. They come
in from the top. Right click on each terminal and select Create>Control to automatically wire a
control to the terminal. The inputs to the PID controller should look like this:

7
By default, LabVIEW creates a standard Numeric control, but this can easily be changed. Go
to the front panel, right-click on the control, select Replace>Horizontal Pointer Slide. Then
right-click on the new control and Visible Items > Digital Display. This way, gains may be
entered either from the slide or typed in the numeric control. Do this for each PID gain. The
front panel should look like this:

5. Click on block D and set the Final value to 0 so that no step in the disturbance will occur.
Create a step in the set-point by clicking on Ysp and setting this final value to 1. Run the
simulation. The resulting graph will be for the unit set-point response and label it as unit set-
point response for ITAE (disturbance) settings. Show the output in Table B.1. Save the file as
YourSurname_le9_pB5.
6. Double-click on Ysp and set final value to 0. Double-click on D and set final value 1. Run the
simulation. Label this as Unit Disturbance Response for ITAE (disturbance) settings. Show
the output in Table B.2. Save the file as YourSurname_le9_pB6.

8
Course: CHE 508 Computer Applications in ChE Laboratory Exercise No.: 9
Group No.: N/A Section: CH51FC1
Group Members: Date Performed: August 23, 2017
Percil, Queenie Rose I. Date Submitted: August 30, 2017
Instructor:
Engr. Crispulo Maranan
6. Data and Results:
A. Procedure A
Table A.1 Open-Loop System and its Unit Step Response

9
Table A.2 Open-Loop System and its Unit Disturbance Response

10
11
B. Procedure B
Table B.1 Unit set-point response for ITAE (disturbance) settings

12
Table B.2 Unit disturbance response for ITAE (disturbance) settings

13
14
7.Conclusion:
I therefore comclude that in this exercise, I am able to simulate a dynamic system with transfer function
having G(s)=2 e-s /(10s + 1)(5s + 1) using the simulation functions of LabVIEW. By exploring the different
controls in the LabView application, I was able to learn on how to apply them in this exercise. Along with
this, I was able to simulate a model of the open-loop system for the second order plus time delay process
and determine the unit set-point and unit disturbance responses and with a closed-loop model for the same
process and simulate the unit disturbance response and the unit-set-point response for two different PID
controller tuning methods.

8. Further Readings:
Seborg Dale E., Edgar, Thomas F., and Mellichamp Duncan A. (2004). Process Dynamics and
Control. Singapore: Wiley.
Knopf, F. C. (2012). Modeling, analysis and optimization of process and energy systems.Hoboken,
New Jersey: John Wiley and Sons.
Velten, K. (2009). Mathematical modeling and simulation: introduction for scientists and engineers.
Singapore: Wiley-VCH.

15
9. Assessment (Rubric for Laboratory Performance):
TECHNOLOGICAL INSTITUTE OF THE PHILIPPINES
RUBRIC FOR MODERN TOOL USAGE
(Engineering Programs)
Student Outcome (e): Use the techniques, skills, and modern engineering tools necessary for engineering
practice in complex engineering activities.
Program: Chemical Engineering Course: CHE 506 Section: _______ ____Sem SY ________
Performance Unsatisfactory Developing Satisfactory Very Satisfactory Score
Indicators 1 2 3 4
1. Apply Fails to identify Identifies Identifies modern Recognizes the
appropriate any modern modern techniques and is benefits and
techniques, techniques to techniques but able to apply these constraints of
skills, and perform fails to apply in performing modern engineering
modern tools discipline- these in discipline-specific tools and shows
to perform a specific performing engineering task. intention to apply
discipline- engineering discipline- them for engineering
specific task. specific practice.
engineering engineering
task. task.
2. Demonstrate Fails to apply Attempts to Shows ability to Shows ability to
skills in any modern apply modern apply fundamental apply the most
applying tools to solve tools but has procedures in using appropriate and
different engineering difficulties to modern tools when effective modern
techniques problems. solve solving engineering tools to solve
and modern engineering problems. engineering
tools to solve problems. problems.
engineering
problems.
3. Recognize Does not Recognizes Recognizes the Recognizes the
the benefits recognize the some benefits benefits and need for benefits
and benefits and and constraints constraints of and constraints of
constraints of constraints of of modern modern engineering modern engineering
modern modern engineering tools and shows tools and makes
engineering engineering tools. intention to apply good use of them for
tools. tools. them for engineering
engineering practice.
practice.
Total Score
Mean Score = (Total Score / 3)
Percentage Rating = (Total Score / 12) x 100%
Evaluated by: Engr. Crispulo G. Maranan August 30, 2017
Printed Name and Signature of Faculty Member Date

16

You might also like