Control Systems Experiment #4
Control Systems Experiment #4
LEARNING OUTCOMES:
After completing this experiment the students will be able to:
1. Understand the different modules related to control and simulation.
2. Implement the various control and simulation models.
3. Use control and simulation toolkits of LabVIEW.
Simulation
Control Design
PID Control
Simulation
Simulation is a process that involves using software to recreate and analyze the behavior
of dynamic systems. You use the simulation process to lower product development costs by
accelerating product development. You also use the simulation process to provide insight into the
behavior of dynamic systems you cannot replicate conveniently in the laboratory. For example,
simulating a jet engine saves time, labor, and money compared to building, testing, and rebuilding
an actual jet engine. You can use the LabVIEW Control Design and Simulation Module to simulate
a dynamic system or a component of a dynamic system. For example, you can simulate only the
plant while using hardware for the controller, actuators, and sensors (Hardware-in-the-loop
Simulation in LabVIEW
Use the Simulation VIs and functions to create simulation applications in LabVIEW. In the
Control Design & Simulation palette we have the Simulation Sub palette:
The Control & Simulation Loop has an Input Node (upper left corner) and an Output Node (upper
right corner). Use the Input Node to configure simulation parameters programmatically. You also
can configure these parameters interactively using the Configure Simulation Parameters dialog
box. Access this dialog box by double-clicking the Input Node or by right-clicking the border and
selecting Configure Simulation Parameters from the shortcut menu.
Configuration:
For the Transfer Function (Simulation Continuous Linear Systems) block we have the
following Configuration window:
Simulation Subsystem
The Simulation Subsystem is very useful when dealing with larger simulation systems in
order to create a more structured code. I recommend that you (always) use this feature. The
Simulation Subsystem is almost equal to a normal LabVIEW Block Diagram but notice the
background color is slightly darker.
Note: In order to open the Simulation Subsystem, right-click and select Open Subsystem. The
Simulation Subsystem may also be represented by different icons. If you select dynamic icon
style, you will see a miniature version of the subsystem. If you select static icon style you see
the icon you created with the Icon Editor.
In the Continuous Linear Systems Sub palette will be to create a simulation model. The
most used blocks probably are Integrator, Transport Delay, State-Space and Transfer Function.
When you place these blocks on the diagram you may double-click or right-click and then select
Configuration
Integrator - Integrates a continuous input signal using the ordinary differential equation (ODE)
solver you specify for the simulation.
Transport Delay - Delays the input signal by the amount of time you specify.
Transfer Function - Implements a system model in transfer function form. You define the system
model by specifying the Numerator and Denominator of the transfer function equation.
State-Space - Implements a system model in state-space form. You define the system model by
specifying the input, output, state, and direct transmission matrices.
Simulation Model
Figure 14. Sample Simulation Model using Control and Simulation Loop
In this window you set some Parameters regarding the simulation, some important are:
Final Time (s) set how long the simulation should last. For an infinite time set Inf.
Enable Synchronized Timing - Specifies that you want to synchronize the timing of the
Control & Simulation Loop to a timing source. To enable synchronization, place a
checkmark in this checkbox and then choose a timing source from the Source type list
box.
Where t is the simulation time, F(t) is an external force applied to the system, c is the damping
constant of the spring, k is the stiffness of the spring, m is a mass, and x(t) is the position of the
mass. x dot is the first derivative of the position, which equals the velocity of the mass. x double
dot is the second derivative of the position, which equals the acceleration of the mass.
The goal is to view the position x(t) of the mass m with respect to time t. You can calculate the
position by integrating the velocity of the mass. You can calculate the velocity by integrating the
acceleration of the mass. If you know the force and mass, you can calculate this acceleration by
using Newton's Second Law of Motion, given by the following equation:
Force = Mass Acceleration
Therefore,
Acceleration = Force / Mass
Substituting terms from the differential equation above yields the following equation:
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________
_________________________________________________________________________________________