A Framework for Modeling, Digital Control Design and Simulations of Dynamic Systems
Gustavo A. Andrade Control Process Laboratory Department of Electrical Engineering Federal University of Maranho So Lus, Brazil, Zip Code: 65080-040 Email: [email protected]
Joo Viana F. Neto and Leandro Rocha Lopes Control Process Laboratory Department of Electrical Engineering Federal University of Maranho So Lus, Brazil, Zip Code: 65080-040 Email: [email protected]
AbstractA digital system design framework, based on fuzzy logic controllers and virtual instrumentation, are the main issues presented in this article. An algorithm oriented for real time applications is the core of the fuzzy control and its performance is evaluated in a computational (M AT LAB and LabV IEW ) platforms. The (CTBoard/NI-Elvis) hardware platform is used to implement the fuzzy position and velocity controls of a DC servomotor. The results are compared with the traditional PID control simulations in computational and hardware platforms. The algorithms performance are also evaluated in terms of portability and runtime for real world applications. Keywords-Real time Control, System Identication, microcontrollers, Fuzzy Control, PID control, Virtual Instrumentation and DC Servomotor.
exibility and computational power of a procedure to perform digital control system design. A. The Virtual Instrumentation The concepts of instrumentation in the industry is suffering considerable sophistication as regards the communication and monitoring requests in industrial instrumentation. The concept of virtual instrumentation (VI), from our point of view, is integration of real time hardware and software in attendance to monitoring and control of a given dynamic system. A very interesting concept of VI device, the integration is seen as part of communication technology that allows only use the station as an interface for the operator, but gaps can be identied and action can be taken to control plant, the exibility implementation and application of algorithms can be seen in [9] [3]. B. Fuzzy Controllers Applications An advantage of the fuzzy controller is the simplicity of the system design, where it is needed only prior knowledge of the plant operation to be controlled. These controllers are of easy dissemination and integration in products and industrial systems. Products like photographic machines, washing machines, refrigerators and ovens can now be found with these technologies. In the industry also is spread through equipment within the plant, such as conveyor belts, cranes and robotic arms already exist with fuzzy control [6] [3]. 1) Fuzzy Controllers Operation: In Figure 1 is shown a diagram of a fuzzy controller in order to characterize its input and output variables. As noted this control system does not use algebraic equations
I. I NTRODUCTION Control systems developed through fuzzy logic become comprehensive with regard to the development of new technologies in digital control and computational intelligence (CI). The technological advances in microelectronics allow the implementation of IC algorithms more efciently and more quickly, thereby ensuring that certain real-time applications can have a sophisticated control system [10] [8] [5] [1] [2]. The combination of intelligent control technics to improve the dynamic systems behavior by simulations of mathematical models (dynamic and control systems) and validations (computational and hardware) are presented as general design procedure. The integration part of theory and tools to perform modeling, digital control design and simulations of dynamic systems is called the hardware and software framework. The main characteristic of this framework is to present the
Fuzzy Input Variables
Mamadani Inference Model
A. Servomotor Measurements The acquired observations of Eq.(2) are used to perform the OE parameter estimation. The OE model simulation gives the necessary information to build knowledge data base le (DBF) of the system.
12
Fuzzy Output Variables
Error
Control Uc
10
Error Variation
Figure 1.
General Fuzzy blocks
(rad/sec)
directly, but rather an inference logic based on rules that are stipulated in accordance with a previous system knowledge. For general purpose, the model is a very power full simulation element, because (in our case) allow the evaluation of the behavior for fuzzy control systems design. II. T HE S ERVOMOTOR OE M ODEL The model OE is used to control and observers designs based on the state space theory. The system identication methods has well established procedures to estimate the parameter of the Output-Error (OE) models. This model is a source of knowledge, in our case, a DC servomotor is used to evaluate the performance control fuzzy design. The OE model in the polynomial form is given by
1
Usetpoint (rad/sec)
0 100
150
200
250
300
350
400
Time(s)
Figure 2.
Measurements in DC Servo Motor
The A(q) and B(q) polynomials of OE model, Eq. (1), represent the system dynamics and inputs, respectively. The polynomial parameters of of Eq.(1) are estimated by the Identif icationT oolBox of M AT LAB . The polynomials of Eq.(2) and Eq.(3) for a DC servomotor are given by
B(q) = 0.07191q 1 + 0.06922q 2
(4)
B( q) k = uknk + ek A( q)
(1)
and
A(q) = 1 + 0.03972q 1 0.8547q 2
where k represents the servomotor speed in rad/sec and uknk represents the terminal voltage in volts, respectively. The A(q) and B(q) represent plant dynamics and the input recurrences, respectively. The polynomials are given by
A( q) = 1 + a1 q 1 + a2 q 2 + . . . + ana q na (2)
(5)
Applying the Z transform in Eq.(1) and neglecting the error, the transfer function is given by
G(z) = 0.03441z 2 z 2 1.43z + 0.4753
(6)
and
B( q) = b1 + b2 q 1 + b3 q 2 + . . . + bnb q nb (3)
In order to obtain a model to design fuzzy strategies of the dynamic systems is necessary that all the investigated dynamics are well represented in model.
After the model identication, the next stage is to perform the computational and hardware experiments. The hardware platform has a DC servomotor (actuator/CTboard) and virtual instrumentation devices (NIElvis II ). This platform is designed for fast prototyping developments and has a strong integration that is
promoted by LABV IEW (process systems).
with made man systems
III. F UZZY C ONTROL The control system core is built on concepts of real time systems, and its taxonomy in terms of hard real time (HRT) devices (sensors, actuators and network) and soft real time (SRT) engines (microcontrollers and implemented algorithms). The FLC core in controller of Figure 3 has a functional unit to perform rules classication, each rule has a membership function value that is associated with the inputs.
FLC CORE
operation to take decisions, can be evaluated by the maximum time spent to elaborate a machine based on decision that is provoked by external subject) and efciency. A. Design Steps of the Fuzzy Controller The design is conceived in several steps to perform the main targets that are listed below:
Rules E(k) E(k) If...T hen... Y (z) R(k)Wi R(k) z 1 Activate R(i) E(k) E(k) min(E(k) , E(k) ) G(z)
Uref H(z)
Perception of the process and its parameter modeling, Analysis of the process by real world variables that are represented in the model, Fuzzy linguistic variables mapping, such: as its parameters. Dynamic systems rules of operation and transient time. Control parameter computation (Implication methods, logical operators and defuzzication methods). System simulations to evaluate the performance of the algorithms and control actions.
Figure 3.
Fuzzy Controller Functional Units and Plant.
The fuzzy-controller output by the centroid method is given by N min(e(i) , e(i) ) Uc = i=1 Wi , (7) N min(e(i) , e(i) ) i=1 where Wi the membership function values of output variable. The fuzzy rules establishment is next task, considering the performance that can be evaluated in terms of time domain metrics, such as: impulse and step responses and steady state error. The fuzzy controllers, due to exibility of implementation are growing in industrial control applications, as well as the practical conception of some 1 parameters design (estimation or data sheets). In this research the goal is not only the design of the fuzzy system control, but to obtain a design method to implement hard real time controllers based on fuzzy logic [10]. The research is guided to promote improvements in microcontrollers algorithms to evaluate some aspect of the developed fuzzy control. The evaluation is performed in terms of algorithm speed (number of
1) Real World Variables: The real world variables under investigation are the output variables that are generated by the input variables. For the DC servomotor, position, velocity and torque are the output variables. The input variables are the armature voltage, systems perturbations and measurement noise. 2) Linguistic Variables: A good sensitivity of the system is obtained with seven linguistic variables for fuzzy control design, this number of variables enable a satisfactory characterization of the designed controller in attendance servomotor operations, taking into account fast changes in servomotor velocity. The variables are dened by their parameters. The triangular membership function is chosen to implement the control law output, this function is easy to implement in embedded systems. The variables values are established by heuristics that are oriented by dynamic plant behavior for the designed operational conditions. The linguistic variables are: NL - Negative Large, NS - Negative Small, ZR - Zero, PS - Positive Small and PL Positive Large. The graphical representation of linguistic variables in fuzzy set are shown in Figure 4. In accordance with the knowledge obtained by simulations of the servomotor model, the fuzzy rules are developed with this model are shown in Table I.
NL 1
NS
ZR
PS
PL
0.8 Degree of membership
0.6
0.4
0.2
0 1 0.5 0 Input Values E(k) or E(k) 0.5 1
Figure 4.
Fuzzy Set Linguistic Variables
Table I FLC RULES OF THE DC S ERVOMOTOR O PERATION .
Error \ ChangingError NL NS ZR PS PL
NL PL PS PS NS NL
NS PL PS ZR NS NL
ZR PL PS ZR NS NL
PS PL PS NS NS NS
PL NL NS ZR PS PS
These linguistic variables generates rules that can be represented by a surface, as shown in Figure 5. A rst evaluation of the fuzzy control behavior can be observed in Figure 5 due to changes in system operation ranges. This surface demonstrates the behavior of the controller according to variations in the input variables.
tions, called MCD-Simulation to evaluate real time algorithms, for example: the fuzzy control of DC servomotor. In rst instance, the fuzzy control algorithm is used to request operational situations of the actuator, the MATLAB environment is used to understand operational situations of the DC servomotor and to assemble a data base le (DBF) of its behavior. The MCD-Simulation results are developed in MATLAB (Simulink ) and LabVIEW , in Figure ?? is presented a virtual instrument (VI). The basic building blocks of LabVIEW for deploying simulations are: 1) Simulation Loop: Its the necessary tool for simulations, solves the differential equations dynamic system within a particular control loop. 2) Transfer Function Block: Its the block that implements the transfer function in Z, that is, the simulation of the plant system. 3) Input Gains: These blocks are the necessary gains to normalize the input of the controller. 4) Output Gain: Its the gain in output of the controller, necessary to counter the entry gains. 5) Fuzzy Controller Loader: This block load the fuzzy controller designed for the LabVIEW VIs and communicates with another block that implements the controller. 6) Fuzzy Controller: This block receives the controller parameters from fuzzy loader and implements the fuzzy controller. A. Fuzzy Controller Algorithm The control fuzzy algorithm is implemented in Simulink and LabVIEW to evaluate the performance of the control strategies by hardware and computational simulations. A LabVIEW Virtual Instrument is developed to implement a proportional, integral and derivative (PID) controller that is compared with fuzzy controller. After the these evaluations, the algorithm is ready to be implemented in C language as nal product that can be embedded in microcontrollers [4] [6] [7].
Figure 5. DC Servomotor surface of the Rules System Output.
IV. T HE MCD-S IMULATION F RAMEWORK In this section is presented the main elements of framework for modeling, control design and simula-
In second instance the algorithm is implemented in LabVIEW to evaluate the real time performance of fuzzy control algorithm is given in Figure 7.
B. Simulations Results The VI of Figure ?? implements the fuzzy control algorithm that is a pseudo code called Fuzzy Controller(Error(t), Error(t)). A simulator was developed in Simulink of the MATLAB platform. 1) Time Domain Analysis: The rst analysis in terms of control goals are the step response evaluation, in Figure 8 are presented the actions of the PID controller and fuzzy control.
Comparison of PI and Fuzzy Controller 1.4
1.2
1 (rad/seg)
0.8
0.6
0.4 PI Controller Fuzzy Controller
0.2
200
400 Time (s)
600
800
1000
Figure 7.
The Algorithm of Pseudo Code Steps
Figure 8.
Comparison of PID and Fuzzy Controllers
The fuzzy control is designed according to the proposed methodology that integrates in framework (hardware and software) a general procedure for modeling, digital control design and simulations of dynamic systems. In terms of fuzzy control performance, the results of Figure 8 show improvements in DC servomotor velocity. The PID design is supported by Ziegler-Nichols rst method. The proposed fuzzy algorithm presented a good performance in terms of control system design for a rst comparison with the classical PID controller. V. C ONCLUDING R EMARKS In this paper a hardware and software framework was presented to design and analysis of digital control systems. The relevance of this work is the development of a procedure to integrate a exibility tool for control system design based on reliable hardware and software. As an educational means, a exible and reliable platform had been evaluated to control design. This
framework can be used to perceive real world phenomena based on applications of dynamic systems identication, hardware and software simulations tools. As nal remark, this article had been presented an integrated general methodology that is dedicated to evaluation digital control algorithms. ACKNOWLEDGMENT The authors would like to thank DE.EE/UFMA and PPGE/UFMA (Department of Electrical Federal University of Maranho), FAPEMA (Research and Development agency of Maranho State), National Instruments for Hard and Software support and CNPq for supporting this research by physical means and scholarships. R EFERENCES
[1] C.Z. Janikow. Exemplar learning in fuzzy decision trees. In Fuzzy Systems, 1996., Proceedings of the Fifth IEEE International Conference on, volume 2, pages 15001505 vol.2, Sep 1996. [2] C.Z. Janikow. Fuzzy decision trees: issues and methods. Systems, Man, and Cybernetics, Part B: Cybernetics, IEEE Transactions on, 28(1):114, Feb 1998. [3] J. Jerome, A.P. Aravind, V. Arunkumar, and P. Balasubramanian. Labview based intelligent controllers for speed regulation of electric motor. In Instrumentation and Measurement Technology Conference, 2005. IMTC 2005. Proceedings of the IEEE, volume 2, pages 935 940, May 2005. [4] Jianying Liu, Pengju Zhang, and Fei Wang. Real-time dc servo motor position control by pid controller using labview. In Intelligent Human-Machine Systems and Cybernetics, 2009. IHMSC 09. International Conference on, volume 1, pages 206209, Aug. 2009. [5] E. H. Mamdani and Others. Application of fuzzy algorithms for control of simple dynamic plant. Procedings of IEEE, 121(12):15851588, 1974. [6] D.D. Popa, A. Craciunescu, and L. Kreindler. A pifuzzy controller designated for industrial motor control applications. In Industrial Electronics, 2008. ISIE 2008. IEEE International Symposium on, pages 949 954, 30 2008-July 2 2008.
[7] D.H. Rao and S.S. Saraf. Study of defuzzication methods of fuzzy logic controller for speed control of a dc motor. In Power Electronics, Drives and Energy Systems for Industrial Growth, 1996., Proceedings of the 1996 International Conference on, volume 2, pages 782787 vol.2, Jan 1996. [8] T.;Sugeno Takagi. Derivation of fuzzy control rules from human operators control actions. IFAC Proceedings Series, 1964. [9] Xiang Xuejun, Xia Ping, Yang Sheng, and Liu Ping. Real-time digital simulation of control system with labview simulation interface toolkit. In Control Conference, 2007. CCC 2007. Chinese, pages 318322, 26 2007-June 31 2007. [10] L. A Zadeh. Fuzzy sets. Information and Control, 8:338333, 1965.