Presentation by Finn Haugen at NI Days 2005 in Drammen, Norway, April 26 2005:
Introduction to LabVIEW Control Design, System Identification and Simulation Tools
This document and the linked files are available at http://techteach.no/presentations/. (The files may be updated at any time.)
Contents of this document
1.1 A few words about my background
A few words about my background (http://techteach.no):
1.2 Outline of the presentation
This presentation will demonstrate how to use the above toolkits in a practical application: Analysis, design, simulation and implementation of a speed control system for a DC motor using a Compact FieldPoint system for I/O and embedded control. The motor and the Compact FieldPoint system are described briefly below.
The following LabVIEW tools are used:
1.3 The physical process - a DC motor
In this presentation a DC motor is modelled, simulated and controlled:
The motor is produced by Faulhaber. The control signal is in the range of ±10V, and the tachometer voltage is in the range of approximately ±10V. A load inertia has been added to the motor. The time constant of the motor including load and tachometer is approximately 0.3s. A load torque can be applied to the motor by simply braking the motor (the load) by hand.
1.4 The Compact FieldPoint I/O and embedded control system
Compact Fieldpoint system used in this applicarion consists of the following modules:
Below is shown how the FieldPoint system appears in the Measurement and Automation Explorer (MAX) utility.
Measurement and Automation Explorer (MAX) showing the Compact FieldPoint system
1.5 A procedure for analysis, design and implementation of a control system
Procedure for analysis, design and implementation of a control system
In the present application separate files implements the steps shown above. The logged data are stored in a spreadsheet file. The estimated model is also stored in a file.
The figure below shows a block diagram of the process with controller and estimator, and blocks containing functions for analysis and design of the control system.
Block diagram of the process with controller and estimator, and blocks containing functions for analysis and design of the control system.
2 Black-box modelling of the process
When a black-box model of a process is to be developed the process must be excited by a sufficiently "rich" signal (we can of course not expect to derive a dynamics model from constant signals). The excitation can be made in two ways, refer to the figure shown above):
In this application open loop excitation is used.
2.2 Exciting the process and measuring the response
excite_and_logg.vi shown below saves time t, input signal u and measured response y on the spreadsheet file logfile1. t, u, and y are columns in this file. The sampling time is h = 0.02s which is used both for analog output (control signal) and analog input (measurement signal) throughout this application.
Front panel of excite_and_logg.vi
Block diagram of excite_and_logg.vi
Here is the log file from one specific experiment: logfile1. The columns in the file are t, u, y.
2.3 Estimating a mathematical model from logged data
A mathematical model of the motor in the form of a discrete-time transfer function is estimated using the SI Estimate State Space Model function (which implements a Subspace-method which is an efficient and generally applicable estimation method). This function is included in the System Identification Toolkit. The function palette of this toolkit is shown below. The SI Estimate State Space Model function is on the Parametric Modeling palette.
Functions palette of System Identification Toolkit
system_ident.vi shown below estimates a discrete-time transfer function model compatible with the Control Design Toolkit, and saves the model on a file (or later use).
Front panel of system_ident.vi
Block diagram of system_ident.vi
2.4 Is the model accurate? Comparing process simulation and measurements
[Introduction to Simulation Module]
The functions palette of the Simulation Module is shown below.
The functions palette of the Simulation Module
In compare_process_simulation_and_measurements.vi shown below the estimated model is further evaluated. The user excites both the simulated process and the real process with an arbitrary input signal, and the simulated response and the real measurement are compared. Since in general the linear model is valid only around an operating point, the model is excited by the devation, du, from the operating point value, u0, of the input signal, and the simulated response is thus the deviation, dy, from the operating point value, y0, of the output signal.
In other words:
The model is accurate if the difference between dy_meas and dy_sim is small!
Front panel of compare_process_simulation_and_measurements.vi
Block diagram of compare_process_simulation_and_measurements.vi
3 Control system analysis and design
3.1 Analysis of control system using Control Design Toolkit
[Introduction to Control Design Toolkit]
The function palette of the Control Design Toolkit is shown below.
Function palette of the Control Design Toolkit
The figure below shows a block diagram of the control system, including a measurement low pass filter (which is a second order Butterworth lowpass filter). The blocks contains discrete-time transfer functions (i.e. z-transfer functions).
Block diagram of the control system
control_analysis_design.vi shown below analyses the control system with respect to the following:
In addition, PID settings are calculated from the Ziegler-Nichols' closed-loop method interpreted in the frequency domain.
Front panel of control_analysis_design.vi
Block diagram of control_analysis_design.vi
3.2 Comparing simulated control system and real control system (target: PC)
real_and_simulated_control_system.vi shown below simulates a PID control system for the estimated process model.
Front panel of real_and_simulated_control_system.vi
Block diagram of real_and_simulated_control_system.vi
4 Implementing and testing the control system on the real-time target (Compact FieldPoint)
rt_control_system.vi shown below implements the control system to be downloaded and run on the FieldPoint system.
Front panel of rt_control_system.vi
Block diagram of rt_control_system.vi
April 24 2005. By Finn Haugen, Associate Professor at Telemark University College. Also working in TechTeach. E-mail: email@example.com.