Case-study Simulator-based Control Systemtuning and Testing Using an Estimated Processmodel
Case-study Simulator-based Control Systemtuning and Testing Using an Estimated Processmodel
Abstract
A mathematical model of a process to be controlled can be used for off-line tuning and testing of
control systems for the process. The tuning and testing can be performed using analytical methods
or using simulations. The benefit of simulations in this respect is that it is straight-forward to
include non-linearities in the model. This presentation demonstrates the application of
commercially available functions for system identification and simulation, and control design.
Focus is on functions available in National Instrument's LabVIEW, but similar functions are
available in other tools, as MATLAB. The presentation shows a practical application, namely a
speed servo for a DC motor.
1 Introduction
This presentation will demonstrate how to use LabVIEW toolkits for analysis, design, and
simulation of a speed control system for a DC motor. The control system is finally implemented
on a National Instruments Compact FieldPoint system for I/O and embedded control. The motor
and the Compact FieldPoint system are described briefly below.
Figure 1: DC motor
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.
The Compact Fieldpoint system used in this application consists of the following modules:
Figure 2 shows the Compact FieldPoint System, and Figure 3 shows how the FieldPoint system
appears in the Measurement and Automation Explorer (MAX) utility where I/O channels are
defined and tested before being used in a LabVIEW program.
Figure 4 shows a procedure for analysis, design and implementation of a control system.
Figure 4: 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.
Figure 5: Block diagram of the process with controller and estimator, and blocks containing
functions for analysis and design of the control system.
• Closed loop excitation. This means that the process is under feedback control.
The excitation is via the setpoint.
• Open loop excitation. This means that the process is not under feedback control.
The excitation is via the control signal.
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.
Here is the log file from one specific experiment: logfile1. The columns in the file are t, u, y.
A mathematical model of the motor in the form of a discrete-time transfer function, Hp(z) is
estimated. This transfer function is actually calculated from an estimated discrete-time state space
model,
The state-space model is estimated using the SI Estimate State Space Model function. This
function implements a Subspace-method which is an efficient and generally applicable method
for estimating black-box (canonical) state-space models. The function is based on the Subspace-
method reported in [4]. The SI Estimate State Space Model function is on the Parametric
Modeling palette of the System Identification function palette, see the figure below.
The program 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 (for later use).
Important features of the program are as follows:
• The SI Estimate Orders of System Model function indicates the best (optimal) order
based on a calculation of the number of significant singular values of the system matrix
of the underlying state-space model used by the subspace estimation method. The user
can still freely select the order of the estimated order.
• The user can choose to apply linear detrending of the input and output data before the
data is used for system identification. The detrending is made by the SI Remove Trend
function.
• The quality of the estimated model is indicated by plotting together the measured system
output and the simulated model output which is generated using the SI Simulate Model
function.
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 input signal to the simulated process is du, while the total input signal to the physical
process is
u = u0 + du
• The response from the simulated process is dy_sim, while the response from the real
process is
y_meas = y0 + dy_meas
giving
dy_meas = y_meas - y0
The model is accurate if the difference between dy_meas and dy_sim is small!
Figure 13: Block diagram of
compare_process_simulation_
Figure 12: Front panel of and_measurements.vi
compare_process_simulation_and_measurements.vi
The function palette of the Control Design Toolkit [3] is shown below.
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).
control_analysis_design.vi shown below analyses the control system with respect to the following
[1]:
In addition, PID settings are calculated from the Ziegler-Nichols' closed-loop method interpreted
in the frequency domain.
3.2 Comparing simulated control system and real control system (target:
PC)
The model order was selected by the user based on a visual comparison of the measured response
and simulated response. Based on this visual comparion, the model order was acually selected
different from the "optimal" order indicated by the Subspace-method. Although the visual
comparison may be a good basis for selecting model order in a partly manual application, it can,
of course, not be used as a validation method in a fully automated system. Future work will focus
on building a fully automated system for model estimation and control design. Alternative
validation methods and alternative estimation methods will then be considered, as the prediction
error method with validation based on e.g. the FPE (Final Prediction-Error croterion) or the AIC
(Akaike's Information Theoretic Criterion).
Finally, LabVIEW is a nice tool for developing application for system identification, simulation,
and control system analysis and design. This is due to its graphical programming environment,
easy physical I/O support, and several powerful toolkits recently added. At Telemark University
College we use LabVIEW increasingly in student labs to bring theory into practical applications.
References
[1] Haugen, F. 2005: Discrete-time signals and systems,
http://techteach.no/publications/discretetime_signals_systems/discrete.pdf
[4] Overschee, P. V., and B. De Moor. 1993. N4SID: Subspace algorithms for the stochastic
identification problem. Automatica 29, no. 3:649–660.