labview控制仿真与实践课件_第1页
labview控制仿真与实践课件_第2页
labview控制仿真与实践课件_第3页
labview控制仿真与实践课件_第4页
labview控制仿真与实践课件_第5页
已阅读5页,还剩67页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、+_Introduction toin 3 Hoursfor Control Design and Simulation第1页,共72页。Course GoalsPrerequisite: Learn LabVIEW 8 in 3 HoursRequirements:LabVIEW 8.2 or laterLabVIEW Control Design Toolkit 2.1 or laterLabVIEW Simulation Module 8.2 or later(Optional) NI ELVIS & Quanser QNET DC Motor HardwareBecome comfor

2、table with the LabVIEW Control Design Toolkit and Simulation ModuleLabVIEW ConceptsConstruct transfer functions and build systemsDevelop a control algorithm and analyze its responseSimulate a control algorithm with non-linear behaviorOptimize algorithms through the interactive environment第2页,共72页。Th

3、e Virtual Instrumentation Approach第3页,共72页。Virtual Instrumentation ApplicationsDesignSignal and Image ProcessingEmbedded System Programming(PC, DSP, FPGA, Microcontroller)Simulation and PrototypingAnd moreControlAutomatic Controls and Dynamic SystemsMechatronics and RoboticsAnd moreMeasurementsCircu

4、its and ElectronicsMeasurements and InstrumentationAnd moreDesignPrototypeDeployA single graphical development platform第4页,共72页。Spectrum of Control ApplicationsProcess ControlPrecision Machine ControlMotion ControlFlight ControlEngine ControlIndustrial Control Embedded Control第5页,共72页。Topics Covered

5、A. Review: LabVIEW EnvironmentFront Panel / Block DiagramToolbar /Tools PaletteB. The Design ProcessModelingControl DesignSimulationOptimizationDeployment第6页,共72页。Start All Programs National Instruments LabVIEW 8.2Startup Screen:Start from a Blank VI:New Blank VIStart from an Example:Examples Find E

6、xamplesorReview: Open and Run LabVIEW第7页,共72页。Review: Creating a Virtual InstrumentLabVIEW programs are called Virtual Instruments or VIs.Each VI has two windowsFront Panel User Interface (UI)Controls = User InputsIndicators = OutputsBlock Diagram Program CodeData travels on wires from controls thro

7、ugh functions to indicatorsBlocks execute by DataflowBlock DiagramFront Panel第8页,共72页。Front PanelReview: Front Panel Controls Palette(Controls & Indicators)Indicator:GaugeControl:Numeric第9页,共72页。Review: Block Diagram Functions PalettesStructure:While Loop第10页,共72页。Block Diagram WindowFront Panel Win

8、dowNumeric ControlsNumeric IndicatorReview: Block Diagram Terminals第11页,共72页。Recommended: Automatic Selection ToolTools to operate and modify both front panel and block diagram objectsOperating ToolPositioning/Resizing ToolLabeling ToolWiring ToolReview: Tools PaletteAutomatic Selection ToolAutomati

9、cally chooses among the following tools:第12页,共72页。Run Button Continuous Run ButtonAbort ExecutionExecution Highlighting ButtonAdditional Buttons on the Diagram ToolbarReview: Status ToolbarRetain Wire Values ButtonStep Function Buttons第13页,共72页。Block diagram executionDependent on the flow of dataBlo

10、ck diagram does NOT execute left to rightNode executes when data is available to ALL input terminalsNodes supply data to all output terminals when doneReview: Dataflow Programming第14页,共72页。Review: Context Help WindowHelpShow Context Help, press the keysHover cursor over object to update windowAdditi

11、onal HelpRight-Click on the VI icon and choose Help, orChoose “Detailed Help.” on the context help window第15页,共72页。Review: Textual Math in LabVIEWIntegrate existing scripts with LabVIEW for faster developmentInteractive, easy-to-use, hands-on learning environmentDevelop algorithms, explore mathemati

12、cal concepts, and analyze results using a single environmentFreedom to choose the most effective syntax, whether graphical or textual within one VISupported Math Tools:MathScript script nodeMathSoft softwareMathematica softwareMATLAB softwareMaple software Xmath softwareMATLAB is a registered tradem

13、ark of The MathWorks, Inc.第16页,共72页。Review: Math with the MathScript NodeImplement equations and algorithms textuallyInput and Output variables created at the borderGenerally compatible with popular m-file script languageTerminate statements with a semicolon to disable immediate outputPrototype your

14、 equations in the interactive MathScript Window.(FunctionsProgrammingStructuresMathScript)第17页,共72页。Review: The Interactive MathScript WindowRapidly develop and test algorithms (LabVIEWToolsMathScript Window)OutputWindowVariableWorkspaceView/ModifyVariable ContentsUser Commandsm-file ScriptShare Scr

15、ipts and Variables with the NodeView /Modify Variable content in 1D, 2D, and 3D第18页,共72页。Review Exercise: Introduction to LabVIEWObjectives:Calculate the Acceleration given Force and MassBecome familiar with the LabVIEW Environment第19页,共72页。Hidden Notes Page第20页,共72页。The Design ProcessModeling Ident

16、ify a mathematical representation of the plantControl Design Choose a control method and design a controllerSimulation Employ a point-by-point approach to simulate the system timing with a solverTuning and Verification Introduce real-world nonlinearities, tune, and verify the control algorithmDeploy

17、ment Implement the finalized control system第21页,共72页。Step 1: ModelingIdentify a mathematical representation of the plant第22页,共72页。Modeling Identify a mathematical representation of the plantControl Design Choose a control method and design a controllerSimulation Employ a point-by-point approach to s

18、imulate the system timing with a solverTuning and Verification Introduce real-world nonlinearities, tune, and verify the control algorithmDeployment Implement the finalized control systemThe Design ProcessCreate a model that describes the motor speed given an input voltage.第23页,共72页。Why Model?A mode

19、l represents a physical systemInputs and outputs have real-world unitsIt is often a simplification of the systems behaviorMany types of systems can be modeledMechanical systemsElectronic circuitsAnalog and digital filtersThermal and fluid systemsModels can be represented in many waysTransfer functio

20、nState spaceOthers第24页,共72页。Modeling with the Transfer FunctionA transfer function provides a mathematical description or model for how the Inputs and Outputs of a system are related.In this case, the system is a motor.Motor input is voltageMotor output is angular velocityIn this case, the model of

21、the system is derived from the physical model (using physics). An alternative would be to measure system response to stimulus and derive a model with LabVIEW System Identification Toolkit.第25页,共72页。QNET DC Motor Control TrainerThe model in this course is based on the Quanser QNET DC Motor. The motor

22、 is a 24 volt DC motor The motor is highly linear in terms of its speed given a voltage We will use the Control Design Toolkit functions to create the mathematical model in LabVIEW第26页,共72页。Electrical1. 2. 3.Mechanical4.5.6.7.Deriving the Motor ModelMotor DiagramFixed MagnetsMotor CoilBrushesDrive S

23、haftEncoderInertial MassMotor model derivation from Quanser QNET Interactive Learning Guide. Copyright 2019, by Quanser Inc. All rights reserved.第27页,共72页。Motor Specifications SheetSymbolDescriptionValueUnitMotor:RmMotor armature resistance.3.30ohmsKtMotor torque constant.0.0280N.mKmMotor back-emf c

24、onstant0.0280V/(rad/s)JmMoment of inertia of motor rotor9.64e-6kg.m2MlInertial load disc mass0.033kgrlInertial load disc radius0.0242mPulse-Width Modulated Amplifier:VmaxPWM amplifier maximum output voltage24VPWM amplifier maximum output current5APWM amplifier gain2.3V/VMotor model specifications fr

25、om Quanser QNET Interactive Learning Guide. Copyright 2019, by Quanser Inc. All rights reserved.第28页,共72页。LabVIEW Control Design ToolkitConstruct and analyze system modelsDesign basic and advanced control algorithmsSimulate response of controller designsAnalyze control efficiency and stability inter

26、actively第29页,共72页。Constructing Models Graphically Create continuous and discrete time models Models can be created symbolically第30页,共72页。Constructing Models TextuallyMathScript allows models to be created using m-file syntax.第31页,共72页。Exercise 1a:Create and Display a Transfer FunctionUse physical sp

27、ecifications to create a plant model.Build a transfer function with Control Design Toolkit.第32页,共72页。Exercise 1b:Create and Display a Transfer FunctionUse physical specifications to create a plant modelBuild a transfer function with Control Design Toolkit第33页,共72页。Step 2: Control DesignChoose a cont

28、rol type and design a controller第34页,共72页。The Design ProcessModeling Identify a mathematical representation of the plantControl Design Choose a control method and design a controllerSimulation Employ a point-by-point approach to simulate the system timing with a solverTuning and Verification Introdu

29、ce real-world nonlinearities, tune, and verify the control algorithmDeployment Implement the finalized control systemUse feedback to control the speed of the motor in the presence of disturbances.第35页,共72页。Control SystemsA control system consists of a Controller model and a Plant model.Control syste

30、ms can be open or closed loop.+_第36页,共72页。PID Control AlgorithmPID stands for Proportional, Integral, DifferentialCommon algorithm for:Linear, Single Input Single Output (SISO)Uses error from feedback as control inputProportional: Proportional linear reaction to errorDifferential: React more when si

31、gnal is changing quicklyIntegral: React when error is present over a long period of time+_Setpoint Output 第37页,共72页。Constructing a PID Controller with Control Design ToolkitCreate a PID model in the form of a transfer functionModel can then be interconnected with plant model第38页,共72页。Series:ABAB+AB+

32、-Parallel:Feedback:Control Design Model InterconnectionGraphicalMathScript第39页,共72页。Control Design Model Interconnection (MathScript) Use MathScript commands to interconnect modelsTypes of interconnection:SeriesParallelFeedbackAppend第40页,共72页。 Connect models in series and parallel Create feedback lo

33、opsControl Design Model Interconnection (Graphical) +_第41页,共72页。Time Response AnalysisParametric Time ResponseOvershootRise TimeSteady State Error第42页,共72页。Displaying Frequency Response and Dynamic Characteristics Data第43页,共72页。Control Design Analysis and Display Perform general linear simulations i

34、n the time domainAnalyze models in the frequency domainCalculate dynamic properties of a model第44页,共72页。Review: While Loops terminal counts each iterationAlways runs at least onceRuns until stop condition is met第45页,共72页。Exercise 2:Construct a PID ControllerBuild a PID controller with Control Design

35、 Toolkit.Create a system that combines PID controller with existing transfer function.View time and frequency response data.第46页,共72页。Step 3: SimulationTest the controller and incorporate real-world nonlinearities第47页,共72页。Modeling Identify a mathematical representation of the plantControl Design Ch

36、oose a control method and design a controllerSimulation Employ a point-by-point approach to simulate the system timing with a solverTuning and Verification Introduce real-world nonlinearities, tune, and verify the control algorithmDeployment Implement the finalized control systemThe Design ProcessTe

37、st the motor and controller with real-world timing and a continuous time solver.第48页,共72页。LabVIEW Simulation ModuleDevelop dynamic systems such as motor controllers and hydraulic simulators with LabVIEWImplement your dynamic systems with real-time I/O using built-in LabVIEW data acquisition function

38、sSimulate linear, nonlinear, and discrete systems with a wide array of solversDeploy dynamic systems to real-time hardware with the NI LabVIEW Real-Time Module Translate models from The MathWorks, Inc. Simulink into LabVIEW with built-in utility第49页,共72页。The Simulation LoopBuilt in Differential Equa

39、tion Solver allows continuous-time systemSimilar to a While Loop with a predefined time periodInstalled with Simulation ModuleDouble-click Input Node to configure simulation parametersCreate an indicator on the Output Node to display Simulation errorsInput NodeMain LoopOutput Node第50页,共72页。Simulatio

40、n Loop ParametersDrag left node to show current parameters and provide inputs for run-time simulation configurationDouble-click Input Node to configure simulation parameters第51页,共72页。Drawing a Simulation LoopSelect the structure from the Functions Palette2. Left-click at the top left pointand drag t

41、o the bottom right to enclose code to be looped第52页,共72页。Generating Simulation InputSimulated SignalsStep InputImpulseFront Panel User InputReal World signals Data Acquisition HardwareSimulations can utilize a wide variety of signal sources:第53页,共72页。Capturing Simulation OutputUse the Graph Utilitie

42、s functions to plot one or more signalsPlots are updated as the Simulation Loop executes第54页,共72页。Exercise 3:Simulate the Motor Control SystemBuild a PID controller with Simulation Module.Create a state model that combines PID controller with existing transfer function.Use different solver methods i

43、n the Simulation loop to optimize performance.+_第55页,共72页。Step 4: Tuning and Verification Tune the controller behavior to meet design specifications in a realistic environment第56页,共72页。Modeling Identify a mathematical representation of the plantControl Design Choose a control method and design a con

44、trollerSimulation Employ a point-by-point approach to simulate the system timing with a solverTuning and Verification Introduce real-world nonlinearities, tune, and verify the control algorithmDeployment Implement the finalized control systemThe Design ProcessIntroduce real-world voltage limits and

45、tune control parameters for performance.第57页,共72页。Introducing NonlinearitiesSources of NonlinearitiesSaturationNoiseFrictionNonlinearities cause ideal models and controllers to behave differently in the real world.第58页,共72页。Nonlinearity ExampleIdeal response with linear model in Control DesignSame c

46、ontroller with saturation added in Simulation Introducing a saturation nonlinearity with the Simulation Module can change the behavior of a model dramatically.Kc = 10Ki = 0Kd = 1第59页,共72页。Controller OptimizationControl DesignTune Controller ParametersEstimate PerformanceSimulation Introduce Impairme

47、nts and NonlinearitiesVerify PerformanceController optimization is an iterative process第60页,共72页。Tuning your PID ControllerTune PID controller design using the step responseBegin with Gains set at: Kc = 1, Ki = 0, and Kd = 0Increase Proportional Gain (Kc) to get desired rise timeIncrease Derivative

48、Gain (Kd) to reduce overshoot and settling timeIncrease Integral Gain (Ki) to reduce steady-state error if necessary第61页,共72页。Exercise 4:Tune the ControllerChange Simulation loop to a continuous modelIncorporate nonlinearities into state model.Tune PID parameters with a continuous input.+_第62页,共72页。

49、Step 5: Deployment Implement the finalized control system第63页,共72页。Modeling Identify a mathematical representation of the plantControl Design Choose a control method and design a controllerSimulation Employ a point-by-point approach to simulate the system timing with a solverTuning and Verification

50、Introduce real-world nonlinearities, tune, and verify the control algorithmDeployment Implement the finalized control systemThe Design ProcessDeploy the control algorithm on real hardware to control the speed of the motor.第64页,共72页。Control System Deployment OptionsAlgorithms designed in LabVIEW Cont

51、rol Design Toolkit and Simulation Module can be deployed on a desktop PC, or a Real Time system.Desktop PCProgram runs on WindowsInput and Output via NI Data Acquisition deviceFor example, desktop PC with PCI-6259Real Time SystemProgram runs on a deterministic operating systemInput and Output via sp

52、ecialized devicesFor example, CompactRIO controller with selected modules第65页,共72页。DeploymentMoving from a simulated model to a real life modelReplace Plant Model with Hardware I/OMake sure Hardware I/O timing matches Simulation Loop timing第66页,共72页。Exercise 5: (Optional)Use the Controller in a Real Life SystemReplace the plant model with the real life motor.Test the behavior of the motor, and compare to the o

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论