Sie sind auf Seite 1von 12

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:
LabVIEW, short for Laboratory Virtual Instrument Engineering Workbench , is a programming environment in
which you create programs using a graphical notation (connecting functional nodes via wires through which
data flows); in this regard, it differs from traditional programming languages like C, C++, or Java, in which
you program with text. However, LabVIEW is much more than a programming language. It is an interactive
program development and execution system designed for people, like scientists and engineers, who need
to program as part of their jobs. The LabVIEW development environment works on computers running
Windows, Mac OS X, or Linux. LabVIEW can create programs that run on those platforms, as well as
Microsoft Pocket PC, Microsoft Windows CE, Palm OS, and a variety of embedded platforms, including
Field Programmable Gate Arrays (FPGAs), Digital Signal Processors (DSPs), and microprocessors.

Using the very powerful graphical programming language that many LabVIEW users affectionately call "G"
(for graphical), LabVIEW can increase your productivity by orders of magnitude. Programs that take weeks
or months to write using conventional programming languages can be completed in hours using LabVIEW
because it is specifically designed to take measurements, analyze data, and present results to the user. And
because LabVIEW has such a versatile graphical user interface and is so easy to program with, it is also
ideal for simulations, presentation of ideas, general programming, or even teaching basic programming
concepts.

LabVIEW offers more flexibility than standard laboratory instruments because it is software-based. You, not
the instrument manufacturer, define instrument functionality. Your computer, plug-in hardware, and
LabVIEW comprise a completely configurable virtual instrument to accomplish your tasks. Using LabVIEW,
you can create exactly the type of virtual instrument you need, when you need it, at a fraction of the cost of
traditional instruments. When your needs change, you can modify your virtual instrument in moments.

LabVIEW tries to make your life as hassle-free as possible. It has extensive libraries of functions and
subroutines to help you with most programming tasks, without the fuss of pointers, memory allocation, and
other arcane programming problems found in conventional programming languages. LabVIEW also
contains application-specific libraries of code for data acquisition (DAQ), General Purpose Interface Bus
(GPIB), and serial instrument control, data analysis, data presentation, data storage, and communication
over the Internet. The Analysis Library contains a multitude of useful functions, including signal generation,
signal processing, filters, windows, statistics, regression, linear algebra, and array arithmetic.
1
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.

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/(50s 2 + 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
blocks 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
2
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.

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.

3
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:

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
4
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.

Course: Laboratory Exercise No.:


Group No.: Section: CH51FC1
5
Group Members: Date Performed: August 23, 2017
Cuesta, Alwyn Wren C. 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

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

6
7
8
B. Procedure B
Table B.1 Unit set-point response for ITAE (disturbance) settings

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

7.Conclusion:

10
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.
9. Assessment (Rubric for Laboratory Performance):

11
12

Das könnte Ihnen auch gefallen