control systems in labview - overview
TRANSCRIPT
ControlSystemsinLabVIEW
Hans-PetterHalvorsen,M.Sc.
http://home.hit.no/~hansha/?page=labview
withSelf-pacedStep-by-StepExercises
LabVIEWInstallation
Downloadthesoftwarehere:
http://home.hit.no/~hansha/?page=labviewThesearethemainmodulesweuseinthedifferentcoursesatTelemark UniversityCollege:
• LabVIEW (LabVIEW ProfessionalDevelopmentSystem32-Bit:English)
• NI-DAQmx (HardwareDriverforNIUSB-6008,NITC-01,etc.)• LabVIEW ControlDesignandSimulationModule• LabVIEWMathScript RTModuleNote!Thesepackagesareseparate downloads!
Note!YougettheSerialNumber fromyourTeacher,butthesoftwarecanbeused for30daysbeforeyouneed toenteravalidSerialNumber.
AllLabVIEWSoftwarecanbedownloadedhere:www.ni.com/download
LabVIEWTraining
• LabVIEWTrainingforStudents(NationalInstruments):
http://ni.com/students/learnlabview
• LabVIEWCourse:http://home.hit.no/~hansha/?training=labview
Hereyouwillfind lotsofVideos,TutorialsandExercises
Itisrecommendedthatyouwatchsomeofthevideosbeforeyoureadfurter
LearningbyDoing!
LabVIEW=Fun!GraphicalProgramming:• VerydifferentfromtraditionalprogramminglikeVB,C#,
Maple,MATLAB,MathScript,etc.• Itismorelikea“drawingprogram”thanaProgramming
Language• Thismakesiteasytouseforthosewhoarenotprogrammers
(ordont likeprogrammingJ)• ExcellenttoolwhenusingHardware,whenyouneedtotake
Measurements(DAQ),etc.• Itisfunandmakesyouverycreative!
LabVIEWExample
PropertyNodes
SequenceStructure WhileLoop SubVI(Function/Method)
CaseStructure(if-else)Constants
Arrays
StopButtonCondition
(Whenshalltheloopend?)
LocalVariableComment
Note!Todosomethingwithanobject– Right-clickonit
LabVIEWhasthesamethingsasotherprogramminglanguages,butinagraphical way!
Hardware
cRIO
ZigBee
VisionSystem
Arduino
USB-6008
Wi-FiDAQ
TC-01
NOxSensor
Pt-100
AirHeater
WaterTank
DAQmxistheHardwareDriverneeded inorder tousehardwaredevices likeNIUSB-6008,NITC-01,etc.insideLabVIEW.Themoduleisavailableasapaletteonyourblockdiagram.
LabVIEWThisisthecoreLabVIEWinstallationthatinstallstheLabVIEWProgrammingEnvironment.
Thismoduleisatext-based toolthatisverysimilartoMATLAB.Thesyntaxissimilarto MATLAB,youcancreateandrunso-calledmfiles,etc.ThemoduleisavailablefromtheToolsmenuinsideLabVIEW.
LabVIEWMathScriptRTModule
LabVIEWControlDesignandSimulationModuleThismoduleisusedforcreatingControlandSimulationapplicationswithLabVIEW.HereyouwillfindPIDcontrollers,etc.Themoduleisavailableasapaletteonyourblockdiagram.
NI-DAQmx
DAQ– DataAcquisition
ADAQSystemconsistsof4parts:1. Physicalinput/outputsignals,sensors2. DAQdevice/hardware3. Driversoftware4. Yoursoftwareapplication(Applicationsoftware)
NIDAQmx Driver
YourAppcreatedwithLabVIEW
NITC-01ThermocoupleDevice,NIUSB6008DAQDevice,etc.
Sensors,etc.
ImplementingaControlSystemWhiletherealprocessiscontinuous,normallytheControllerandtheFilterisimplementedinacomputer.
IndustrialControlSystems(ICS)
DistributedControlSystems(DCS)
DeltaV
PLC (ProgrammableLogicController)
SiemensPLC
PCbasedControlSystem/SCADASystem(Supervisory ControlAndDataAcquisition)
cRIO
IndustrialControlSystemsarecomputercontrolledsystemsthatmonitorandcontrolindustrialprocessesthatexistinthephysicalworld
Controller I/OModules
IndustrialPIDController
I/OModule
ProgrammableAutomationController (PAC)
LabVIEW
USB
PC-basedControlSystem
Analog InMeasurement(s)
AnalogOutControlSignal
ProcessExamples
Controller (PID)andLowpassFilterImplementation
ADConverter
DAConverter
I/OModule
USB-6008
+ +--
0-5V0-5V/1-5V
PC-basedControlSystem–LabVIEWExample(Simulation)
MathematicalModeloftheProcess
FeedbackNode
FeedbackLoop
PC-basedControlSystem– LabVIEWExample(Realprocess)
SubVI thathandlestheI/ObetweenLabVIEWandtheRealProcessincludedFilterandScaling
ControlSystemimplementationinLabVIEW
PID Process
Sensor
r e u y-
Kp Ti Td
vControlSystemimplementationwith“Pen&Paper”
ASimulationLoopisusedinthisExample
PID Process
Sensor
r e u y-
Controller
Kp Ti Td
v
ControlSystemimplementationinLabVIEW
ControlSystemimplementationwith“Pen&Paper”
AWhileLoop isusedinthisExample
PIDControlinLabVIEWPIDPaletteinLabVIEW(PIDToolkit)
Note!Thefunctions“PID.vi”and“PIDAdvanced.vi”requires thatTi andTdisinminutes,whileit’snormaltousesecondsastheunitfortheseparameters.Youcanusethefollowing pieceofcodeinordertotransformthem:ThismeansweentervaluesforTi andTdinsecons ontheFrontPanelandthevaluesareconvertedtominutes inthecode.
Alternative1:Alternative2:
Thisalternativeusesseconds!
PIDControlDemoHelp->FindExamples...
Students:Trythe“GeneralPIDSimulator”examplethatisincludedwithLabVIEW
ADConverter
DAConverter
MeasurementSignal
ControlSignal
USB
AD&DAConverters
AD – AnalogtoDigitalDA – DigitaltoAnalog
ContinuousSignal
DiscreteSignal Acomputercanonlydealwithdiscretesignals
Note!Differentbooksusedifferentnotations
k=0,1,2,3,4,....
Ts=SamplingTime
WhenTs->0,wehaveacontinuoussignal,butinacomputerthatisnotpossible.
DiscretizationMethodsEulerforwardmethod:
Eulerbackwardmethod:
OthermethodsareZeroOrderHold(ZOH),Tustin’smethod,etc.
DiscretizationinLabVIEWusingtheFormulaNode
Example:
ImplementingdiscreteequationsinLabVIEWusingCsyntax
DiscreteLowpassFilter
WeusetheEulerBackwardmethod:
InverseLaplacethedifferentialEquation:
Thisgives:
Lowpass FilterTransferfunction:Wedefine:
Thisgives:
Thisalgorithmcanbeeasilyimplemented inaProgramming language
Filteroutput Noisyinput signal
DiscretePIControllerContinuous PIController:
WeusetheEulerBackwardmethod:
Wemayset:
ThisgivesthefollowingdiscretePIalgorithm:
Thisalgorithmcanbeeasilyimplemented inaProgramming language
MathematicalModeloftheProcess
FeedbackNode
TestofDiscretePIControllerinLabVIEW
FeedbackLoop
PIDControllercreatedfromscratchinLabVIEW
Hans-PetterHalvorsen,M.Sc.
UniversityCollegeofSoutheastNorwaywww.usn.no
E-mail:[email protected]:http://home.hit.no/~hansha/