Download as pdf or txt
Download as pdf or txt
You are on page 1of 22

Control

and Simula.on
in LabVIEW

Hans-Pe:er Halvorsen, M.Sc.

Hardware

Air Heater

USB-6008

Wi-Fi DAQ
Water Tank
Pt-100
TC-01

Arduino

ZigBee

Vision System

cRIO
NOx Sensor

LabVIEW Installa.on
Note! The Serial Number is in Fronter!

Download the soUware here:


h:ps://lumen.ni.com/nicif/us/acadevallvdl/content.xhtml

These are the main modules we use in the dierent courses at Telemark
University College:
LabVIEW (LabVIEW Professional Development System 32-Bit: English)
LabVIEW MathScript RT Module
LabVIEW Control Design and Simula>on Module
LabVIEW PID and Fuzzy Logic Toolkit
LabVIEW System Iden>ca>on Toolkit
NI-DAQmx
Note! These packages are separate downloads! Make sure to download and
install all of them!
Select the SoUware in the August 2013 column (LabVIEW 2013).

LabVIEW Training
LabVIEW Training for Students (Na.onal Instruments):
h:p://www.ni.com/academic/students/learn-labview/

LabVIEW Course:
h:p://home.hit.no/~hansha/?training=labview

Control and Simula.on in LabVIEW


Control Design & Simula.on Pale:e in LabVIEW

Control Design Pale:e in LabVIEW

Students:
Check that you have
all these pale:es

Simula.on Pale:e in LabVIEW

PID Pale:e in LabVIEW

LabVIEW Control and Simula.on Example

We are going to learn to create such a system!

Simula.on in LabVIEW
Simula.on Pale:e in LabVIEW
Simula>on Loop: Similar to a While Loop, but
cusomized for used together with the
Simula.on Blocks available in LabVIEW

Dierent Simula.on Blocks


by Category
Con.nuous Systems
Discrete Systems
Nonlinar Systems
etc.
Simula>on PaleJe Video (15 minutes)
h:p://home.hit.no/%7Ennh/videos/sim_module/sim_pale:e_overview/sim_pale:e_overview.html

Simula.on Example
Students: Implement and Simulate
this system in LabVIEW

Simula.on Example - Congura.on


In the example the following simula.on parameters could be used (right-click on the Simula.on
Loop border and select Congure Simula.on parameters):

Simula.on Example - Solu.ons

Step Response

We see the Step Response


is as expected!

PID Control in LabVIEW


Alterna>ve 2:

Alterna>ve 1:
PID Pale:e in LabVIEW (PID Toolkit)

Note! The func.ons PID.vi and PID Advanced.vi requires that Ti


and Td is in minutes, while its normal to use seconds as the unit for
these parameters. You can use the following piece of code in order
to transform them:
This means we entervalues for Ti and Td in secons on the Front
Panel and the values are converted to minutes in the code.

This alterna.ve
uses seconds!

PID Example

Students: Replace u in the previous example with the built-in PID Controller
(use Alterna.ve 2)

PID Example - Solu.ons


Front Panel:

PID Example - Solu.ons


Block Diagram:

PID Example Con.nuous Simula.on


Right-click on the
Simula.on Loop
border and select
Congure Simula.on
Parameters

Add a Stop Bu:on


and a Halt
Simula.on block

Students: Run your Simula.on with these changes

PID Example Con.nuous Simula.on - Solu.on

Simula.on Subsystem
A Way to structure your code, similar to SubVIs

File -> New


This is the recommended way to do it! You can easly reuse your
Subsystems in dierent VIs and your code becomes more structured!

Create a Subsystem of this part

Students: Change your code above where you create a Simula.on Sub System
for your Process

Simula.on Subsystem - Solu.ons

Simula.on Subsystem Solu.ons2

Simula.on Sub Systems

Now your code has become really


simple to understand!

Simula.ons using a While Loop


The Simula.on Loop has some drawbacks/is more complicated to use than an
ordinary While Loop. If we use simulata.on Subsystems, we can use them inside a
While Loop instead!
Simula.on Subsystems

So for real applica.ons that involves more than just simula.ons, I recommend to
use a While Loop instead of a Simula.on Loop.

Hans-PeJer Halvorsen, M.Sc.


Telemark University College
Faculty of Technology
Department of Electrical Engineering, Informa>on Technology and Cyberne>cs


E-mail: hans.p.halvorsen@hit.no
Blog: hJp://home.hit.no/~hansha/

22

You might also like