Instituto Tecnológico de Ciudad Madero, Departamento de Ingenierıa Eléctrica y Electrónica. División de ..... 2010, San Francisco, USA, October 20-22, 2010.
An Experimental Setup for Teaching Dynamic Systems R. Salas-Cabrera∗ , J. C. Mayo-Maldonado∗, J. G. Gonz´alez-Hern´andez† E.N. Salas-Cabrera∗ , F.A. Garc´ıa-Santiago∗, J. E. Mart´ınez-Bernal∗, R. Castillo-Gutierrez∗ , ∗ Instituto Tecnol´ ogico de Ciudad Madero, Departamento de Ingenier´ıa El´ectrica y Electr´onica Divisi´on de Estudios de Posgrado e Investigaci´on, Madero, M´exico † Universidad Tecnol´ ogica de Altamira, Departamento de Mecatr´onica, Altamira, M´exico
Abstract—In this work an experimental tool is presented for teaching the most important features of continuous ndimensional linear time-invariant dynamic systems. This tool consists of a combination of analog/digital electronics hardware and software. An analog electronics-based dynamic system is used as the experimental plant to be studied. A free Linux-based real-time software is used to implement a linear observer and a linear state feedback. The digital set up is composed by the mentioned real-time software, a commercial data acquisition board and a personal computer. Experimental results are presented. Keywords-real-time, dynamic system, linear observer, state feedback, Linux.
I. I NTRODUCTION Since control systems has played a very important role in many engineering areas, universities normally include several courses to deal with the theory and design of controllers. Basics of linear systems are commonly taught in some undergraduate level courses. Then, the student is introduced to more advanced topics related to linear systems. An average graduate student of Electrical Engineering has the opportunity of learning about other advanced control topics as nonlinear control and design. These courses might increase the quality of the teaching-learning process by including some laboratory experiments. The main contribution of this work is related to the idea of showing the potential of an experimental tool for teaching/learning purposes. It is important to note that models, variables and phenomena that occur in the time domain are more likely to be understood than those that are represented in the Laplace domain. An average undergraduate student is clearly challenged when he/she is introduced to the idea of controlling a system that is defined by a representation in the Laplace domain. In this work, the natural and intuitive features of models, variables and phenomena defined in the time domain are utilized for promoting the learning process of linear control. A continuous n-dimensional linear time-invariant dynamic system is implemented using analog electronics, [1]. This analog-based prototype will be used as an experimental plant to be studied. The dynamic model of the experimental prototype is employed for calculating the gains of a well-known linear state
feedback. A state space representation of an integrator is also included as part of the state feedback. The resulting control law is implemented in real-time by using the RTAI-Lab platform, a data acquisition board and a personal computer. The poles of the system are relocated by the experimental state feedback, [1]. In addition, a well-known linear state observer is employed for calculating the non-measurable state variables of the system, [1]. There are several software packages that provide the possibility of controlling dynamic systems by utilizing some data acquisition boards. In this work RTAI-Lab [2], a Linux based real-time platform [3], is chosen as a tool for learning dynamic systems. The RTAI-Lab platform is a free open source platform that allows low cost implementations. In addition, it can be executed by employing low cost general purpose computers without compromising the performance [4]. In recent years, this real-time platform has included Scilab/Scicos, a tool that provides the possibility of developing programs by employing block diagrams [5]. This platform has been used to control motion applications [6], control and parameter estimation of electric machines [7][8] and power electronics applications [9], among many others. In other works, RTAI-Lab has been employed for developing learning tools for laboratories [10] and for realtime simulation of dynamic systems [11]. II. M ODELING A. State Space Representation Consider the following continuous n-dimensional linear time-invariant dynamic equation x˙ = y =
Ax + Bu Cx
(1)
where x = [x1 x2 ... xn ]T is the state; u = [u1 u2 ... up ]T is the input and y = [y1 y2 ... yq ]T is the output. A, B and C are n x n, n x p and q x n real constant matrices, respectively [1]. Let us propose a particular case of the system in (1), i.e. 0 1272.5 x1 1000 x˙ 1 = + u x˙ 2 −1272.5 1000 −400 x2 (2) x1 y = 1 0 x2
B. State Observer
III. E XPERIMENTAL S ETUP
It is well-known that an asymptotic state observer for the dynamic system in (1) is given by xˆ˙
= Aˆ x + Bu − L (y − C x ˆ)
(3)
where x ˆ = [ˆ x1 xˆ2 ... x ˆn ]T is the state of the observer and L is the observer gain, [1]. Since the dynamic equation in (2) is observable, a state observer can be written as 0 1272.5 xˆ1 1000 xˆ˙ 1 = + u −1272.5 1000 xˆ˙ 2 −400 xˆ2 (4) 1601 ˆ1 ) + (x1 − x −989.06 where entries in gain L are calculated by defining the following poles for the observer error dynamics: −1000, −1001. C. Control Law
A. Analog electronics-based prototype Most of the real-life so-called linear dynamic systems contains significant steady-state parametric variations. In other words, parameters normally depend on the equilibrium point. In addition, some of the so-called linear dynamic systems exhibit parametric variations even during transient conditions. In contrast, there are no significant parametric variations in the analog electronics prototype proposed in this section since precision resistors and polyester-based capacitors are utilized. This prototype becomes a useful tool for obtaining insight of important features and properties of a continuous n-dimensional linear time-invariant dynamic system. The objective of the prototype is to have a reliable experimental dynamic system as a part of a teaching tool for studying the design of linear control laws and linear state observers. For this purpose, the dynamic system in (2) is implemented as it is shown in Fig. 1.
Consider the dynamic system given by expression (2) and the following dynamic equation of an integrator d xI = y − r = x1 − r dt where xI is the state variable of the integrator; the output to be controlled is y = x1 and r is the set point. Therefore, the augmented state space representation can be expressed as ⎡ ⎤ ⎡ ⎤⎡ ⎤ x˙ I 0 1 0 xI ⎣x˙ 1 ⎦ = ⎣0 0 1272.5⎦ ⎣x1 ⎦ + x˙ 2 x2 0 −1272.5 −400 ⎡ ⎤ ⎡ ⎤ (5) 0 1 + ⎣1000⎦ u − ⎣0⎦ r 1000 0 Let us consider the following input for the state space representation in (5) u = KI
K1
⎡ ⎤ xI K2 ⎣x1 ⎦ x2
(6)
Pole placement technique can be used to calculate the gains associated with the state feedback, see [1]. This standard procedure can be also accomplished by employing the Matlab command place. For this particular case, a set of poles are chosen as s1,2,3 = −501, −502, −503 Thus the corresponding controller gains become KI K1 K2 = 75.639 0.15908 0.94692
(7)
(8)
Figure 1.
Analog electronics-based implementation of a dynamic system
This analog electronics-based prototype is designed by employing several operational amplifiers, capacitors and resistors. Inverting amplifier, integrator and voltage follower are the operational amplifier configurations that are utilized in this design. The following components values are used in the analog electronics circuit: R = 10000 Ω; R1 = 8664 Ω; R2 = 11025 Ω; R3 = 27932 Ω; R4 = 8780 Ω; R5 = 11173 Ω; C1 = 9.07x10−8 F ; C2 = 8.95x10−8 F . It is clear that values in this circuit are chosen such that are related to the entries of the dynamic system in (2), for example 1/ (R1 C1 ) = 1272.5. An open loop experimental input is applied to the analog circuit in Fig. 1. In particular, the input is defined as a square signal that generates a sequence of periodic transients. Fig. 2 depicts the transient behavior of the state variables in the n-dimensional state space. In other words, each axis is associated to a particular state variable. It is clearly noted in this Figure the experimental equilibrium point associated to each level of input voltage (square signal).
Figure 4. Figure 2.
Scilab/Scicos RTAI Library
Measured state variables in the 2-dimensional state space
B. Real-time platform In this particular work, a National Instruments PCI-6024E data acquisition card is used. The sampling frequency is defined as 10kHz. The Knoppix 5.0 Linux distribution contains the RTAI-Lab and Scilab/Scicos packages, [2] [3]. These free open-source software packages include a library of blocks that can be utilized for studying dynamic systems. Figure 3 shows the blocks of the linear library that was used in this particular work. These blocks can be used to perform mathematical operations for both continuous and discrete time dynamic systems. They are easily identified by their graphical presentation.
Figure 3.
a graphical interface tool included in RTAI-Lab, may be used for running and monitoring executable programs. Figure 5 shows the Xrtailab software tool. This tool allow us to execute previously compiled programs. It may be used for modifying some of the parameters as it is illustrated in Fig. 5. A Scope block from the RTAI library in Scilab/Scicos can be included in the source program to be compiled. Then, the Xrtailab tool can be used to display the digital oscilloscope that can show any signal that is obtained from a calculation performed by the executable program. This oscilloscope can also be used to show signals that are measured at the input channels of the data acquisition card. In order to save numerical data the FIFO block included in the RTAI library can be utilized. In other words, numerical data can be saved in real-time. Once the numerical data are saved, an offline plot can be obtained by employing Scilab or Matlab, as it is explained in [2]. The FIFO block is used in this paper for saving the experimental results of the implementation.
Scilab/Scicos Linear Library
The Scilab/Scicos software package provides access to the analog/digital input/output terminals of the data acquisition card. Figure 4 shows the RTAI library that includes the COMEDI blocks. These blocks allow us to employ the input/output channels of the data acquisition card. In other words, some Comedi blocks can be employed for measuring external signals whereas other Comedi blocks can be utilized to perform a write operation of a calculated value at the output channels. In order to obtain an executable program, the source program is compiled by using the RTAIcodegen tool which is included in the RTAI-Lab package, [2]. Then the Xrtailab,
Figure 5.
Xrtailab (Graphical user interface)
IV. E XPERIMENTAL RESULTS A. Open loop operation The linear observer given by (4) is implemented in the RTAI Linux platform. The observer state variables are obtained by utilizing the Scilab program illustrated in Fig. 6. Two integrators are clearly necessary for obtaining both state variables of the dynamic equation.
4 3 x1,x1 estimated (Volts)
It is important to emphasize that there exist more useful libraries for other type of applications which are not fully explored in this paper. For example, a nonlinear library may be used to perform mathematical operations for implementing a nonlinear controller as it is presented in [9].
2 1 0
−1 −2 0
0.01
0.02 0.03 Time(sec)
0.04
0.05
Figure 7. Open loop operation. Measured x1 (-) and observed-based realtime calculated x ˆ1 (*).
Figure 6.
Scilab-based block diagram of the observer implementation
Fig. 7 and Fig. 8 show the dynamic performance of the measured states variables and the corresponding observedbased real-time calculated state variables during open loop operation. As it was carried out in the previous section an experimental square signal is applied as an input to the analog circuit in Fig. 1. For observation purposes this input u and the output x1 are measured. The other state variable x2 is measured to be able to compare it to the corresponding state variable provided by the observer. The initial conditions are: x1 (0) = x2 (0) = 0, xˆ1 (0) = 2, x ˆ2 (0) = −2. B. Closed loop operation The closed loop real-time program consists of the full order state observer defined by (4) and the state feedback given by (6). The gains of the control law are defined by (8). The corresponding real-time Scicos program is depicted in Fig. 9. The control algorithm was computed every 0.0001 seconds (10 kHz). The set point for the output to be controlled is set as x1ref = 5. Fig. 10 and Fig. 11 illustrate the transient performance of the measured states variables and the corresponding observed-based real-time calculated state variables during closed loop operation. It is important to note that the state feedback also includes the state variable of the integrator, see Fig 12.
x2,x2 estimated (Volts)
1.5 0.5 −0.5 −1.5 −2.5 −3.5 0
0.01
0.02 0.03 Time(sec)
0.04
0.05
Figure 8. Open loop operation. Measured x2 (-) and observed-based realtime calculated x ˆ2 (*).
As a result of the state feedback, the original set of conjugate complex poles of the dynamic system are modified to a new set of real poles. In other words, the open loop under-damped behavior (see Fig. 7 and Fig. 8) becomes an over-damped behavior (see Fig. 10 and Fig. 11) by means of the experimental state feedback. V. C ONCLUSIONS This work proposes an experimental setup to illustrate several important features of linear systems. Observer and controller designs are addressed by using a particular state space representation. Excellent agreement was obtained when comparing the estimated states and the actual measured states. The transient behavior of the output to be controlled is clearly connected to the closed loop poles
Figure 11. Closed loop operation. Measured x2 (-) and observed-based real-time calculated x ˆ2 (*). Figure 9.
Scicos program of the controller
Figure 12.
State variable of the integrator xI in closed-loop operation
Figure 10. Closed loop operation. Measured x1 (-) and observed-based real-time calculated x ˆ1 (*).
defined by the experimental state feedback. The results presented in this work can be easily extended to higher order linear dynamic systems and different control techniques. R EFERENCES [1] Chi-Tsong Chen. Linear System Theory and Design Oxford University Press. 1999. [2] R. Bucher, S. Mannori and T. Netter. RTAI-Lab tutorial: Scilab, Comedi and real-time control. http://www.rtai.org. 2008. [3] Knoppix. Knoppix Open Source http://www.knoppix.net. 2004.
Linux
Distribution.
[4] L. Dozio and P. Mantegazza. Linux Real Time Application Interface (RTAI) in low cost high performance motion control, 2003, ANIPLA, Milano, Italy, 2003. [5] Bucher, R.; Balemi, S.; Scilab/Scicos and Linux RTAI - a unified approach. Control Applications, 2005. CCA 2005. Proceedings of 2005 IEEE Conference on , vol., no., pp.11211126, 28-31 Aug. 2005. [6] Chiandone, M.; Cleva, S.; Menis, R.; Sulligoi, G.; Industrial motion control applications using Linux RTAI. Power Electronics, Electrical Drives, Automation and Motion, 2008. SPEEDAM 2008. International Symposium on , vol., no., pp.528-533, 11-13 June 2008
[7] Salas-Cabrera R., Mayo-Maldonado J. C., Rendon-Fraga E. Y., Salas-Cabrera E. N. and Gonzalez-Rodriguez A.; On the Real Time Implementation of a Controller for an Electromechanical System. Proceedings of the World Congress on Engineering 2009 Vol I WCE 2009,London, U.K. July 1 - 3, 2009, [8] Salas-Cabrera, R.; De Leon-Morales, J.; Mayo-Maldonado, J.C.; Rosas-Caro, J.C.; Salas-Cabrera, E.N.; Reyna-Lopez, C.A.; Observer Design for DC Electric Machines Computer and Electrical Engineering, 2009. ICCEE ’09. Second International Conference on , vol.1, no., pp.90-94, 28-30 Dec. 2009 [9] Mayo-Maldonado J. C., Salas-Cabrera R., Cisneros-Villegas H., Gomez-Garcia M., Salas-Cabrera E. N., Castillo-Gutierrez R. and Ruiz-Martinez O.; Modeling and Control of a DC-DC Multilevel Boost Converter. Proceedings of the World Congress on Engineering and Computer Science 2010 Vol II WCECS 2010, San Francisco, USA, October 20-22, 2010. [10] Balestrino, A.; Caiti, A.; Crisostomi, E.; From Remote Experiments to Web-Based Learning Objects: An Advanced Telelaboratory for Robotics and Control Systems. Industrial Electronics, IEEE Transactions on , vol.56, no.12, pp.4817-4825, Dec. 2009 [11] Palli G., Carloni R., Claudio Melchiorri C.; Innovative Tools for Real-Time Simulation of Dynamic Systems. Proceedings of the 17th World Congress The International Federation of Automatic Control Seoul, Korea, July 6-11, 2008.