CONTROL ENGINEERING LEARNING USING A SOFTWARE TOOL FOR A LAB MOTOR Gil-Martínez, M. and Martín, R. Electrical Engineering Department, University of La Rioja. Luis de Ulloa, 20, 26004 Logroño, SPAIN. E-mail: [montse.gil, ricardo.martin]@die.unirioja.es
Abstract: Control engineering is a multidisciplinary, exciting and challenging subject, which has become an essential part of the engineering curriculum. The traditional approach based on theoretical concepts with a strong mathematical foundation has led control engineering students to not believe that the material learnt in the classroom is ever going to be applied directly to the industry, and finally working control engineers lay aside analysis, and rely on trial-and-error methods. To bridging this gap, this paper presents a control engineering learning based on a software tool that commands a lab motor, which is used as a simplified scaled version of a real-life system. The graphical user interface developed provides a friendly interactive environment to perform the following tasks: sensor and actuator calibrations; experimental identification of non-linearities and linear models; comparative responses of the real-plant and tuned-model; interactive design of control strategies; digital control algorithms synthesis from a wide range of controller structures; real-time control of the physical plant; and comparatives with control simulations. Commercial software, such as MATLAB and EXCEL, are integrated in the application as resource servers. The whole arrangement is suitable for undergraduate courses in control systems for engineering students. Copyright © 2006 IFAC. Keywords: Control engineering, Control education, Software tools, Interactive programs.
1. INTRODUCTION Control engineering is a multidisciplinary science that has revolutionised the automatic control of manufacturing, aerospace and automotive systems, electromechanical and consumer electronic devices, chemical processes, and so on; (Antsaklis, 1999). However, today there is a big gap between the control engineering demanded by industries and what the students learn in their undergraduate engineering education. First, professionals must be problem definers apart from problem solvers (Bissels, 1999), that is, students must develop not only the ability to analyse but also the ability to synthesise. Second, the practice of engineering requires insight and intuition, which are not so easy to convey (Johansson, 1998). Third, control engineering is highly conceptual and requires a solid background in mathematics. In all these, recent trends in control education claims for more emphasis on hands-on experiments and practical issues (Bernstein, 1999) to motivate the students and to make the subject useful in its subsequent industrial work. Hence, in this paper a lab DC motor reflects a simplified scaled version of a real-life system where control education concepts and theory will be learnt from a practical point of view.
The generalised use of computers has also meant a time for radical change in control education. The use of graphical interfaces and interactive tools is also of great help in control engineering learning (Dormido, 2004). Hence, this paper presents a software environment to control the lab motor. The tool provides an effective practical-oriented learning of control engineering, and covers: the reasons for feedback, the control technology (sensor, actuators, hardware and software platforms), the experimental model identification apart from physical modelling, and the control performance evaluation in the iterative process of the controller design and implementation, combining theory, simulation and digital concepts from the practice. Under the perspective of the Higher Education System, the whole arrangement is designed for undergraduate courses in control systems for engineering students, and in particular for electrical, industrial, mechanical, electronics and systems engineering degrees. The proposed tool can be used in the following courses: Modelling and Identification of Dynamic Systems, Automatic Control Systems and Digital Control Systems. Attending to the small complexity of the physical lab plant, the proposed software tool is
particularly suitable for basic courses on the described issues. Nevertheless, advanced identification methods and complex control structures are also supported, doing the tool also useful for advanced control subjects. The paper is organized as follows. Section 2 describes general aspects of the software tool. The lab plant and its control equipment are described in Section 3. The software environment developed is peer described for control engineering education in Section 4 (experimental identification) and in Section 5 (control issues). Section 6 includes the conclusions. 2. SOFTWARE TOOL Graphical User Interfaces (GUI) are being increasingly used in control education (Sanchez et al, 2005; Rodriguez et al., 2005; Keller, 2006). The one proposed in this paper has been developed with the following goals: -
-
-
Provide the students with a friendly, interactive and visual approach to perform control engineering tasks on a lab scaled DC motor. Sensor and actuator calibrations. Experimental identifications of non-linearities and linear models. Comparative responses of real plant and tuned model, for adjustments. Interactive design of control strategies; a flexible range of control structures; synthesise digital control algorithms; real-time control of the physical plant, and comparatives with control simulations. Input signal generators. Re-scalable monitoring of signals of interest: control input, setpoint, output and error, with active mouse drag-on the curves for x-y co-ordinates in digital, analogue or physical units.
application uses commercial software resources: Matlab/Simulink with its Toolboxes (Matwork Inc. 2004), and Excel, for simulations, post-processing, computations, file management, and other facilities related to control engineering. Graphical power is improved using API-Windows resources, and specific ActiveX controls are designed to monitor analogue signals. Commercial built-in and/or designer-made drivers link the physical plant and the digital hardware processor equipped with data acquisition and control board or specific A/D-D/A units. The dynamic link libraries (.DLL) are developed in C++ code and several utilities are also implemented in Vbasic. The reliability in the synchronism of critical real-time tasks is guaranteed switching off the interruptions originated by the user activity. Figure 2 shows an scheme of the software application resources and utilities. In subsequent sections the software tool is peer reviewed oriented to effective control engineering learning.
Fig. 2: Software tool: resources and utilities 3.
Fig. 1. Software tool links The software links are shown in Figure 1. Vbasic highlevel language (Siler and Spotts, 2004) is used, amongst other options (Depcik and Assanis, 2005), to build the GUI. In a client-server structure the main
LAB MOTOR AND CONTROL TECHNOLOGY
Although it is difficult to adopt all the details and realism of practical problems in lab experiments, the Direct Current (DC) motor developed by FEEDBACK reflects a simplified version of a real-life system. An armature controlled DC motor with permanent magnets is the core of the mechanical system. A reduction gear system (32:1) conveys the movement from the motorshaft to the output-shaft. A magnetic break simulates different load torques. A tachometer and a potentiometer report analogue dc voltages in the range ±10V proportional to angular motor velocity and servo position, respectively. A data acquisition and control (DAQ) board (DT-2801) plugged into a computer performs 12 bits A/D (analogue to digital) and D/A
(digital to analogue) conversions. It handles bipolar ±10V voltage supply, and also contains digital I/O ports. One digital input collects pulses from an incremental optical encoder that provides 8 pulses per revolution of the motor shaft. The processor generates the digital control signals that, converted to the range ±10V in the DAQ, attack the driver of a power amplifier. Finally, this commands the armature circuit of the DC motor. This small-scale mechanical unit, with its digital interfaces and equipment provides a useful environment to instruct the students on: (a) the final goal of feedback control; (b) the ‘real-life’ with its limitations; (c) the control technology that makes working the control systems theory. 4.
EXPERIMENTAL IDENTIFICATION
4.1. Calibrations The first step to operate with a real plant and its equipment is to calibrate the sensors and actuators, which will be the ‘eyes’ and ‘muscles’ of our control system. Independently that the control structure operates with digital words or analogue voltages, the engineering students must be conscious of the physical units involved (Bernstein, 1999).
4.2. Limitations in SISO control. Static characteristic The control engineer must be conscious of what is achievable and what is not achievable in the feedback loop. Main constraints, such as non-linearities or delays, are not only imposed by the plant but also by the control technology added. The experimental static characteristic, which gives the steady state relation between input and output, reveals the most severe non-linearities, the actuation range, and where the tuning of a linear dynamical model and its associated linear controller are valid. Figure 4 shows the software environment developed to obtain the static curve. The picture box on the screen illustrates the steady-state speed vs. the armature control voltage, revealing: saturation, small dead zone, small hysteresis, and a linear behaviour area (a different one for each load torque). Users can select: the input armature voltage range applied to focus an area (dead-zone), the voltage increment (resolution), the rotation direction (clock-wise or counter-clock-wise (to detect hysteresis), and they can record the experiment data in binary or text formats for post processing.
Fig. 3. Software tool for potentiometer calibration. Analogue sensors (tacho and pot) will be used for online experiments dealing with model identification and real-plant control. The major resolution sensor, that is the digital incremental encoder, is previously used to tune the conversion factors between the analogue voltage and the physical variable: Ktacho in V/rpm for the motor-shaft velocity and Kpot in V/º for the outputshaft position behind the gear train (1:32 ratio). The software tool is provided with menus to perform these tasks; i.e. the pot calibration experiment is shown in Figure 3. The incremental encoder on the motor-shaft provides 256 pulses per revolution of the output-shaft, that is 0.71 pulses/º. When the user switches on the experiment, the motor turns slowly to find the reference 0V position, read by the pot. Around this point, the motor is turned ±90º using the encoder measurements, and at the edges the dc pot voltage is captured. Kpot is computed as the ratio between the voltage and angle increments. Five essays are performed to obtain an averaged Kpot. In parallel, the software tool provides other menu to calibrate the tacho-dynamo sensor, Ktacho.
Fig. 4. Software environment for static characteristic. Dynamic constraints, such as delays or actuator slewrate limitation, are identified by subsequent experiments of the transient response. 4.3. Linear model identification A piecemeal analytical model of the whole system based on physical laws gives insights on the final model and its order. However for efficient control, some kind of experimental identification on the whole system is always needed due to: (a) difficulties in measuring certain parameters, for example frictions or viscous damping; (b) components can interact dynamically in complicated ways due to spurious feedback paths and unexpected couplings; (c) real hardware abounds with unmodelable effects and sensitivities; (Bernstein,1999). (d) plant parameter drifts or jumps, disturbances or different operating
points; (e) simplifications in linear modelling of nonlinear high order characteristics of real plants . The software developed provides tools for transient and frequency response identifications, and also identifications using pseudo random signals.
plant control for the same user defined input. Comparative results are provided graphically and in text/binary format files, for subsequent model readjustments. 5.
SISO FEEDBACK CONTROL
Transient Response Identification. The user selects the step-input amplitude range, a initial step of small size to avoid the dead zone, the time points to apply the step signals, the experiment final time and the sampling frequency. The output is shown in graphical and text boxes, and can be recorded with the input and the configuration parameters. For the speed- model, an automatic identification of the dominant time constants is provided. The tool implements the method of areas (Aström, 1995) in VBasic functions to tune a first order model. To compute the second order model, userdefined and built-in MATLAB functions are used. The software environment also provides tools to measure the actuator slew-rate and delays. Frequency Response Identification. The users can select on the software environment (Figure 5): the sinusoidal amplitude, the number of periods and points per period, and the sample time. Bode diagrams are depicted in the graphical area. The phase and amplification factors are computed by VBasic scripts using Lissajous formulation.
In theoretical lessons the students are trained in different recipes to tune controllers. Practical aspects such as: wind-up, digital delays, quantization errors, aliasing, noise filtering, actuator and sensor limitations, cost of feedback, disturbances, and uncertainties should be also accounted for. Even though, on-site control adjustments are always necessary. Hence, the software environment for controller design and effective control has to be interactive and flexible.
Fig. 5: Software identification
Fig. 6. Software tool to parametrize input signals
tool
for
frequency
response
Pseudorandom Input Identification. To do it, engineering students have to parametrize the pseudorandom input signal, apply it and study the data, using i.e. the MATLAB Identification Toolbox. The software environment to perform these tasks is the same as the one to carry on control experiments (see Section 5), but choosing open-loop operation with no controller. 4.4. Simulation Once identified: an appealing linear model and the nonlinear behaviours, Simulink environment can be invoked to sketch the model structure with build-in blocks. The server application (Simulink) and the main application (Vbasic) run model simulation and real
5.1 Input Signal Design. Different types of input signals can be designed as setpoints in closed loop control, or simply, for userdefined open loop experimental identifications. The software environment appearance is shown in Figure 6. The user selects the input signal type: impulse, step, ramp or pseudorandom signal; and configures it through its characteristic parameters (i.e. number of samples, sample time, amplitude and delay for an step signal). It is possible to combine test signals, and finally to save them for further application on the plant.
5.2 Control Strategies Design. The main software application uses MATLAB with its SISO Tool of the Control Toolbox as a server application. This provides an interactive environment to design controllers simultaneously visualizing several useful diagrams, i.e. root-locus, bode diagrams, and transient response. Final control laws are exported to the main software application. On the basis of fundamental control courses, the control designs are performed in the Laplace s-domain. Pseudo-continuous technique (PCT) or w-transform theories are applicable for further implementation as digital control laws. For digital control courses z-domain controllers are also supported.
5.3 Controller Structures. Different control structures can be defined. In a general structure, the software tool allows controllers in the direct path, in the feedback path, and as prefilters out of the feedback loop. In all these cases, parameters are defined as numerator and denominator coefficients in the continuous or discrete- domains, which can be served by MATLAB from its SISO Control Tool. Further, a major effort has been made on providing a great deal of PID structures, which are the most popular and effective in the industrial environment. The following structures are supported: P, PI, PD, PID in series or parallel format, with/without high frequency gain limitation, with proportional and derivative actions based just on the output signal (instead of error), and/or with setpoint weighting (see Figure 7).
Different software menus are offered to perform motor velocity and position control experiments, respectively. The output, setpoint, error, and control effort can be visualized on graphical and text boxes (see Figure 8) and can be recorded in files for post-processing. The user can configure the limits and physical units of the graphical representations, and can displace the mouse onto the selected curve obtaining its x-y co-ordinates. Real-test and simulation results can be compared. The whole environment provides a useful tool for analysing and adjusting iteratively the feedback control system performance.
5.4 Controller discretization. If a continuous-time controller structure and its parameters are defined, the tool computes the discretetime equivalent law according to backward, forward or trapezoidal rules. MATLAB and its Symbolic Toolbox are used in the background computation. Discrete equation is shown and can be saved for further real implementation.
Fig. 8. Digital controller implementation 6.
CONCLUSIONS
This paper presents a graphical interface and interactive tools developed in Vbasic to perform several identification and control experiments on a lab dc motor in order to control engineering learning from a practical point of view. This contributes to motivate the student and to make the subject useful to the future engineer.
Fig. 7. Software tool for controller parametrization 5.5 Control Simulations. The main software application uses SIMULINK as a server to perform simulations of the tuned control algorithm in conjunction with the model. 5.6 Controller implementation. For control tasks, the user has access from the main frame: to design an select set-point signals, to design controllers with the aid of MATLAB SISO tools, to parametrize different structures of analogue and discrete controllers, to discretize the analogue ones, to simulate the closed loop operation, and finally to apply the digital control algorithm to the real plant. The implementation code is also provided with anti-wind up functions (Aström, 1995), and velocity algorithms.
The main utilities of the tool are: sensor calibrations; experimental identification of non-linearities and linear models; comparative responses of the real-plant and tuned-model; interactive design of control strategies; synthesize digital control algorithms from a wide range of controller structures; real-time control of the physical plant; and comparatives with control simulations. The main resources include: WindowsAPI, user-defined DLLs, user-defined ActiveXcontrols, commercial software environments: MATLAB /SIMULINK and EXCEL. From the perspective of the electrical, industrial, mechanical, electronics and systems engineering degrees, the proposed software environment for the lab motor can be used in courses such as: Modelling and Identification of Dynamic Systems, Automatic Control Systems and Digital Control Systems. Considering the small complexity of the lab physical plant, the tool is mostly appropriate for basic courses on the described issues. Nevertheless, advanced identification methods and complex control structures are also supported, doing the tool also suitable for advanced control subjects.
ACKNOWLEDGEMENTS The authors gratefully appreciate the support given by La Rioja Government under grant ANGI 2004/13 and by the Spanish ‘Comisión Interministerial de Ciencia y Tecnología (CICYT)’ under grant DPI’2003-08580. REFERENCES Antsaklis, P.J. (2000) New directions in control engineering education: a north American perspective. IFAC/IEEE Symp. Advances Contr.Educ. Gold Coast, Australia. Aström, K., Hägglund, T, (1995). PID Controllers: Theory, Design, and Tuning. Instrument Society of America. 2ª Edition. Bernstein, D.S. (1999) Enhancing Undergraduate Control. IEEE Control Systems Magazine, 19(5), 40-43. Bisell, C.C. (1999) Control Education: Time for radical change? IEEE Control Systems Magazine, 19(5), 44-49. 1999.
Dormido, S. (2004). Control Learning: Present and Future. Annu Rev Control 28: 115-136. Depcik, C. and Assanis, D.N. (2005). Graphical User Interfaces in an Engineering Education Environment. Comput Appl Eng Educ, 13: 48-59. Johansson, M., Gäfvert, M. & Äström, (1998) K.J. Interactive tools for education in automatic control, IEEE Control Systems Magazine, 18, 33-40. Keller, J.P: (2006). Interactive Control System Design. Control Eng. Practice, 14, 177-184. Matworks Inc. (2004). .MATLAB 6.5, SIMULINK 3.0, Control Toolbox, System Identification Toolbox, Symbolic Math Toolbox, Optimization Toolbox. Rodriguez, A.A., Metzger, R.P:, Cifdaloz, J.O., Dhirasakdanon, T (2005). IEEE Trans.Educ., 48(3), 359-374. Sanchez, J., Dormido, S., Esquembre, F. (2005) The Learning of Control Concepts Using Interactive Tools. Comput Appl Eng Educ, 13: 84-98. Siler, B., Spotts J. (2001). Visual Basic 6 (Ed. Especial). Prentice Hall. (2004) Visual Basic.Net. Pearson Education.