You are on page 1of 3

Teaching Fuzzy PID Control With LabVIEW and Quanser DCMCT in NI ELVIS II

"Thanks to the flexibility of LabVIEW system design software and the new version of the Fuzzy System Designer, we can develop simulation applications to visualize the structure and working process of the rule base of a fuzzy controller."
- Dr. Ildik Jancskrn Anweiler, University of Pcs, Hungary

The Challenge:
Panel View of Fuzzy Control Simulation Creating a fuzzy controller simulator to introduce design elements to our students.

The Solution:
Using NI LabVIEW and NI ELVIS II to design a simulation of a simple, direct control loop consisting of a first-order plant simulator and a fuzzy controller. Author(s): Dr. Ildik Jancskrn Anweiler - University of Pcs, Hungary In the Department of Information Technology at the University of Pcs in Hungary, we have used LabVIEW system design software to teach automation and control theory for many years. Since 2011, we have been an official NI LabVIEW Academy, where information technology students can learn LabVIEW as part of normal coursework.

System Setup
In past years, we developed, among other things, simulations of process plants and control loops for educational purposes. For example, we demonstrated fuzzy control theory using a LabVIEW application as a plant simulator and developed the fuzzy controller in a FuzzyTech development system. The plant simulation and controller were connected via serial ports. When National Instruments released the 2011 version of the NI LabVIEW Control Design and Simulation Module , we found that the Fuzzy System Designer was much more user-friendly than in earlier versions, so we could develop the controller in LabVIEW as well. In this unique platform, the saved controller could programmatically set fuzzy system parameters such as the names of the I/O linguistic variables and their terms as well as the rule base and activity . In this way, we could easily test the fuzzy controller and detect errors with the controller. Our laboratory features a Quanser DC motor control trainer for the NI Educational Laboratory Virtual Instrumentation Suite ( NI ELVIS) platform to give students hands-on, practical experiences in the important aspects of engineering. The vendor-appended LabVIEW example applications offer practice in system identification and speed control with proportional integral derivative (PID) algorithms. Nowadays, almost all programmable logic control (PLC) manufacturers provide an optional fuzzy control algorithm beneath the PID algorithms, which helps students gain important insight into the fundamentals of a fuzzy controller.

Direct Control-Loop Simulation


The simplest and most frequently used fuzzy algorithm is the fuzzy PID algorithm, so we wanted to enhance our laboratory exercise with a fuzzy speed-control experiment. We developed two LabVIEW applications for demonstrating transient control processes using a fuzzy PID controller with a periodically or manually adjusted setpoint. The first program was a direct control-loop simulation, and both the plant and the controller were programmed in LabVIEW (see Figure 1). We constructed the fuzzy controller with the Fuzzy System Designer of the LabVIEW Control Design and Simulation Module. After changing and saving a fuzzy controller, we could load it into the example application. A plant is a general first order plus dead time (FOPDT) process. The scheme of the direct control loop is shown in the top of the front panel in Figure 1. The figure shows from left to right the actual set value; the fuzzy PID controller input values; an LED indicating whether inputs are rule invoked; a color-coded rule base; the actual crisp output value of the fuzzy controller; the amplified motor voltage; and, in the scheme of the process, the actual control value and model parameters. Beneath the control-loop scheme, the fuzzy rule base, activity of the rules, and trend curves are displayed. We preferred reviewing the rule base in matrix form over text form, but in the Fuzzy System Designer, we can edit the rules only in text form (for example, in rows of if/then rules). We solved this problem in our simulation by generating a rule-based matrix and enclosing it with the names and terms of the I/O linguistic variables and with the rule activities in a cluster. In this cluster, we rearranged the variables and the rules according to the increasing order of the membership functions of inputs (from negative to positive) because the order of the rules in the designed controller can be random. We could not only change the plant parameters and set value but also switch Gaussian noise on and off and modify and load the fuzzy controller while the application was running. If we knew the plant parameters (for example, after system identification), we could apply this simulation to developing and enhancing an appropriate fuzzy controller.

Figure 1. Front Panel View of Fuzzy Control Simulation

Fuzzy Control of the Quanser DC Motor Model

1/3

www.ni.com

The second application was a fuzzy control of the Quanser DC motor model. The control value was the motor speed. We replaced the plant simulator with a DC motor that built up the connection to the real system with the NI ELVIS II workstation. Although the signal of the tachometer was filtered with an exponential filter before it entered the control algorithm, this was not indicated on the front panel because we were interested in the control process and wanted to retain the perspicuity of the front panel (see Figure 2). With this application, students could test their designed fuzzy controllers on a real system.

Figure 2. Front Panel View of Fuzzy PID Control of Quanser DC Motor Speed

Thanks to the flexibility of LabVIEW system design software and the new version of the Fuzzy System Designer, we can develop simulation applications to visualize the structure and working process of the fuzzy controller rule base. Author Information: Dr. Ildik Jancskrn Anweiler University of Pcs, Hungary Rkus u. 2. Pcs 7624 Hungary Tel: +36 72 503 650 (3742) Fax: +36 72 501 534 jai@morpheus.pte.hu

Panel View of Fuzzy Control Simulation

2/3

www.ni.com

Panel View of Fuzzy PID Control of Quanser DC Motor Speed

Legal This case study (this "case study") was developed by a National Instruments ("NI") customer. THIS CASE STUDY IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE ( http://ni.com/legal/termsofuse/unitedstates/us/).

3/3

www.ni.com

You might also like