Você está na página 1de 6

Implementation of a Fuzzy Controller on Low-Cost

Embedded Systems for Learning Process Control


Jorge Buele1,2, Franklin Salazar L., Homero J. John Espinoza, Victoria M. López, Pablo A. Zambrano
Velasteguí Departamento de Eléctrica y Electrónica
2
Facultad de Ingeniería en Sistemas, Electrónica e Industrial Universidad de las Fuerzas Armadas ESPE
1
Universidad Técnica de Ambato Sangolquí, Ecuador
Ambato, Ecuador {jjespinoza6, vmlopez2, pazambrano, jlbuele}@espe.edu.ec
{jl.buele, fw.salazar, hvelastegui6534}@uta.edu.ec

Angel Soria Daniel Fiallos


Electrical and Computer Engineering Facultad de Arquitectura e Ingenierías
Purdue University Universidad Internacional SEK
Lafayette, United States of America Quito, Ecuador
asoriach@purdue.edu dfiallos.mti@uisek.edu.ec

Abstract— In this paper we propose the low-cost solutions algorithms, programmable logic controllers (PLC) are usually
granted to university students to contribute to their professional used, with the inconvenience of elevated costs to acquire them
development. Two control systems were simulated applying [12-14]. In addition, they require the purchase of additional
embedded devices, such as the BeagleBone Black and Udoo Neo modules for the development and implementation of advanced
Full boards applied on a didactic flow station. With these controllers. Taking into consideration smaller budgets, tools
prototypes, the aim is to develop critical thinking in the user as that offer similar benefits consider low cost embedded devices
well as putting into practice, the learned concepts about as an option [15-16]. Thus, fulfilling the objective of training
advanced controllers. To visualize the events produced, an better professionals.
interface can be made in the software LabVIEW and the option
of saving this data in an .xlsx file is added for the later analysis of Following this context, the academy has developed
this information. The validation of the project is carried out by research projects that seek to prepare students for their future
evaluating the acceptance of these characteristics by the students roles in the industry. In [17] a real time process simulator has
and the experimental results of the controller to changes in the been developed, users can benefit by learning programming
set-point value. skills and industrial automation. In [18] the construction of a
modern control training module is presented, allowing the
Keywords— Embedded systems, Process control, Fuzzy control, students to familiarize with industrial processes such as flow
Engineering education.
and speed, to evaluate commonly used controls in a practical
way. In [19] the implementation of a training system for
I. INTRODUCTION industrial process remote control is presented, the system
In the area of process control a constant search is enables the reconfiguration of the process to provide precise
conducted to improve the performance of the process and knowledge to the user. In addition to this, proposals have been
therefore the benefits for the end user [1-3]. Improvement of development with the use of embedded boards. As in [20], a
the process depends on the applied control strategy and proper Raspberry Pi board is used to perform control of household
selection of tuning parameters. The combination of these devices by IoT. In [21 – 22] the implementation of a fuzzy
elements allows the process to achieve an efficient and control algorithm for process control running on a Raspberry
automatic operation [4]. Control theory encloses classic and Pi board is presented. In [23] Arduino and Raspberry Pi
advanced controllers, PID being more popular in the first boards are combined to perform control of devices with
group [5]. Application of this controller allows the intelligent communication. BeagleBone Black board is utilized
development of several industrial applications due to its in the field of robotics to achieve the navigation control of a
versatility [6]. With the passage of time advanced controllers robot, and to perform image processing in [24].
were taking more prominence, and fuzzy controller is a good To provide the students with new tools that improve the
example for the ease in which it adjusts to the needs of the learning process, an advanced control algorithm applied on
system [7-8]. BeagleBone Black and Udoo Neo Full embedded boards is
Institutions of higher education are focused on improving proposed. Also making the comparison of their performance
the teaching – learning process of the students of technical controlling the flow variable of an educational station that
careers that seek to consolidate their knowledge with the simulates an industrial process, as it is displayed on Fig. 1.
respective practice [9-11]. For the teaching of control With this station the users will put into practice the concepts
of advanced control theory that they received in the classroom.

978-1-5386-5995-3/18/$31.00 ©2018 IEEE


B. Embedded boards
BeagleBone Black is an embedded platform, based on a
SITARA processor AM335x at 1GHz ARM Cortex-A8, with a
memory of 512 MB DDR3, 69 GPIO and special pins (I2C,
CAN, SPI, serial ports, timers and PWM) that operates in a
range of 3.3 to 5V, it has 7 internal ADC that work at 1.8V
with up to 12-bit resolution. It is ideal for integrated
applications since it operates with Linux operating system,
which can boot in less than 10 seconds [25].
Udoo Neo Full is a platform that works with Android /
Linux and incorporates its own version of Arduino IDE, it
operates with a heterogeneous NXP i.MX processor, which
has two co-processors, the first one is the ARM Cortex-A9
that makes it compatible with Arduino UNO and the second is
Cortex-M4, a feature that makes it compatible with Linux
systems. It is perfect for various applications such as: robots,
Fig. 1. Diagram of the control system implemented 3D printers and automation in general [26].

This project is divided into VI sections, including the III. SOFTWARE


introduction I section 1, section II presents the hardware used;
section III talks about the control algorithm; section IV shows A. Fuzzy controller
the implementation of the proposal; and in section V discusses
A fuzzy logic controller objective is to provide a system
about the obtained results. Finally, conclusions are presented
equipped with techniques that allow work with an
in section VI.
approximate reasoning, instead of an exact one. Its main
advantage is the ease with which it adapts to the experiences
II. HARDWARE and the environment in which the user develops, because it
works with a control algorithm that uses linguistic labels. A
A. Description of the plant fuzzy control system is the one that makes decisions and
The educational flow station provides experimental results, offers the possibility of creating a control algorithm by using
as shown in Fig. 2. It consists of a 25-gallon cylindrical linguistic variables. Compared to classical controllers, diffuse
reservoir tank, three manual passage valves, and a three-phase variables can assume values between 0 and 1 [27-28]. The
centrifugal pump of ½ HP, which drives the water that advantages of this controller are: implementation with
circulates through the pipeline to and from the tank. In processes where obtaining a mathematical model is complex
addition, a rotameter graduated in gallons per minute and liters due to its non-linearity, non-modeled physical quantities,
per minute (GPM and LPM respectively). A magnetic flow unpredictable disturbances, etc. It also allows adjustment to
sensor, connected to a flow transmitter, which produces a the problem in the same linguistic terms used by a person.
standard signal of 4 to 20 mA. As a final control element,
The proposed fuzzy controller consists of 3 stages as
there is a frequency inverter (FI) that operates with an input
mentioned in [29] which are: a) Fuzzyfication, during this
ranging from 0 to 10 V and proportionally modifies the speed
stage the physical variables of the system are converted into
of the three-phase centrifugal pump. In this way it is possible
linguistic variables granting them a degree of belonging,
to control the flow that circulates through the pipeline.
through the membership functions associated with said sets, b)
Inference, in this stage the base knowledge formed for the
controller is used, and the fuzzy input and output sets of the
system are interrelated; In this work we use the logical
inference of Mamdani type that is represented in (1), last c)
Defuzzyfication, stage in which based on a fuzzy set obtained
from the inference rules, and said set is transformed to a
numerical value that the process control can use upon the
system. In the implemented control algorithm, the output is
obtained by means of the center area method.

IF µ1 is A1 AND µ2 is A2 AND… AND µn is An THEN v is B (1)

Where µi y vj are linguistic variables; and Ai and Bj


symbolize the linguistic values that these variables must
assume.
Fig. 2. Educational flow station
B. Control algorithm (Linguistic tag) method to point to the case according to the
The algorithm is developed with the library eFLL rule to be formed, the consequent is symbolized by the
FuzzyRuleConsequent object, and finally to add the rule the
(Embedded Fuzzy Logic Library), compatible with the
FuzzyRule object is used.
Arduino IDE and C programming language compilers; it is
structured in four blocks of programming that are: declaration
TABLE I. FUZZY RULES BASE
of variables, Fuzzification, rules of inference and
Defuzzification. For the algorithm to execute the Fuzzification EN O EP
stage it is necessary to create an object of the Fuzzy type as ENA T T T
indicated in (2).
ENM VA VA VMA

Fuzzy * fuzzy = new Fuzzy () (2) ENB VMA VMA VMA


Z VMA C VMB

The current error e(k) is represented by 7 input functions EPB VMB VMB VB
identified with the following linguistic labels: "ENA", EPM VB VB VB
"ENM", "ENB", "Z", "EPB", "EPM", "EPA"; where, "E"
symbolizes error, "N" negative, "P" is positive, "A" represents EPA VB VmuyB VmuyB
high, "M" is medium, "B" means low and "Z" is zero and to
ensure adequate space for error variations, a range of errcaudal IV. IMPLEMENTATION
= {-30, ..., 30} was established, declared by the FuzzyInput
and FuzzySet objects. Whereas for the cumulative error ea(k) A. Hardware Implementation
the labels "EN", "O" and "EP" are used, which means negative As stated previously, the flow transmitter produces a signal
error, zero and positive error respectively. that varies from 4 to 20 Ma, for this to happen the flow level
For the exit rules used in the Defuzzification stage, it is should oscillate between the values of 10 to 40 liters per
proceeded in the same way as for the inputs, also FuzzyOutput minute (LPM). To use the transmitter as a controller input, the
object is used, and the following 7 linguistic labels "VmuyB", signal must be transformed into a standard voltage with
"VB", "VMB" "C", "VMA", "VA" and "T" in the output range magnitude ranging between 1 to 5 V, by using a current-to-
= {-5, ..., 5}, where "V" is voltage, "M" is medium, "B" voltage converter (I/E), to be more specific a resistance of 250
represents low, "A" symbolizes high and "T" is terminal. In ohms placed in series with the circuit. In order to reduce any
Fig. 3, each of the fuzzy sets is shown. kind of high frequency noise a low pass filter and a capacitor
were placed in the output of the power supply of the integrated
circuits.
Given the previous handling of the signal, for data
acquisition in the case of BeagleBone Black board, the 12 bits
resolution double channel analog to digital converter (ADC)
MCP3202 is used. The ADC conversion communicates
through the serial peripheral interface bus (SPI), a
synchronous protocol that operates in full duplex mode, and
provides good data transmission speed through four signals.
a) For the case of the Udoo Neo Full board, an internal 16-bit
ADC is used, but it is configured to operate at 12 bits, just like
its counterpart. Each of the boards will perform the control
action that is configured with software.
After the control stage, an external digital to analog
converter (DAC) is required to emit a voltage signal, since
neither of the two boards possess an internal one. To achieve
this the PCF8591 integrated circuit (I.C) is used, which
receives data through I2C communication and operates at 8
b) bits of resolution. For technical reasons said I.C produces a
Fig. 3. Fuzzy sets: a) Fuzzification sets. b) Defuzzification sets
maximum of 5V that must be amplified with gain 2 to be
connected to the frequency inverter of the process that
Table 1 shows the basis of rules with which the fuzzy operates between 0 – 10 V. Afterwards, an impedance
controller will act. The structure to create the objects of the coupling is made between the designed circuit and the flow
antecedent and consequent of the algorithm simulates the station, by the means of a voltage follower. To perform all of
structure of the Mamdani fuzzy rules in the form IF ...... the signal conditioning discussed in this chapter, a printed
THEN ......, in this way the antecedent is represented by the circuit board has been made, the design is shown in Fig.4.
FuzzyRuleAntecedent object, followed by the joinSingle Finally, boxes are made to protect the developed electronic
boards and facilitate their connection.
b)
Fig. 5. Display interface: a) Block diagram b) Front Panel

For the visualization of the process an interface was


created using LabVIEW software, and for both cases serial
a) b) communication was chosen. Taking into consideration that
Fig. 4. Design of the electronic board: a) BeagleBone Black. b) Udoo Neo each board offers different programming commands, and
Full digital pins that can be used for this purpose. The desired set
point value (SP) is transmitted from the interface to the board.
Meanwhile, for the monitoring of the process, data is
B. Software implementation encapsulated in a frame to redirection it in the opposite
Both embedded boards require the installation of an direction. In this frame are the values of SP, Process Variable
operating system because they are like mini-computers. (PV) and Control Variable (CV), separated by start and end
Ubuntu Mate was chosen for this application, a Linux release characters. This interface is shown in Fig. 5
that does not require many resources and provides all its
functionalities, this open source language allows the V. RESULTS
downloading of free add-ons such as the WiringPi library,
which is required for the configuration of the MCP3202 A/D A. Acceptance Tests
converter using SPI protocol, and the PCF8591 D/A converter
using I2C. For the validation phase; 40 students of the last semesters
of the electrical and electronics engineering department, tried
For the implementation of the fuzzy controller logic the the developed prototypes. In order to evaluate the percentage
standard embedded system library Embedded Fuzzy Logic of acceptance that each proposal has. The results are presented
Library (eFLL), which was chosen because of its efficient and in Table 2.
simplified implementation of fuzzy systems, it is written in C
++ and C, using the standard C language library “stdlib.h”,
TABLE II. ACCEPTANCE TESTS
this one has no restrictions on the quantity of fuzzy rules,
inputs and outputs, and only depends on the speed of the Indicators BeagleBone (%) Udoo (%)
controllers processing.
Cost 100 87.5
Friendly interface 100 100
Scalability 82.5 82.5
Sturdiness 92.5 75
Controller reconfiguration 95 95
Controller performance 97.5 80
Real-time response 100 100

As can be seen, the system implemented with the


BeagleBone card is more popular with the students, especially
in terms of robustness and driver performance. On the other
hand, the second proposal despite having a higher cost and
a) being a relatively new technology also provided good results.
B. Controller performance
The whole setup for the experimental validation is shown
in Fig. 6.

a)

Fig. 6. Complete setup of the flow control station.

Figure 7 shows the response curves produced by the


process variables when the control algorithm is implemented b)
in the embedded boards. The process starts at the lower limit, Fig. 7. a) Response curves of PV vs. SP. b) CV response curves
that starts in 25 LPM, and then modifies its value to 35, 15, 35
and 20 LPM every 20 seconds, respectively. This curve serves
as evidence that the response of the controllers is fast; the VI. CONCLUSIONS
percentage of the control action without the presence of The compatibility of the Udoo Neo full board with
oscillations is less than 65%, which lengthens the lifespan of programs developed in Arduino IDE, makes this embedded
the final control element. The temporal and over-oscillation system an alternative with greater capacity for development of
characteristic values of the system with BeagleBone Black fuzzy control algorithms; maintaining the same programming
board are presented in Table 3 and with Udoo Neo Full board development characteristics provided by Arduino platform.
in Table 4. Although BeagleBone Black and Udoo Neo Full boards
can’t be considered industrial solutions due to their lack of
TABLE III. PERFORMANCE IN DIFFERENT SETPOINT CHANGES WITH sturdiness, they respond satisfactorily to SP changes and
BEAGLEBONE BLACK
disturbances applied on the flow process of a plant, showing
Indicators 25-35 35-15 15-35 35-20 percentages of overshoot and establishment time acceptable
for each embedded system. In addition, from data obtained in
Dead time (s) 0.48 0.56 0.32 0.24 the validation phase it can be confirmed that the performance
Rise time (s) 4.242 4.363 4.121 4 of both boards at the time of algorithm implementation, and its
response in real time will help with the consolidation of the
Settling time (s) 6.975 7.764 6.909 6.58
student's practical knowledge of automatic control.
Overshoot (%) 0.19 0.31 0.16 0.28
Acknowledgment
TABLE IV. PERFORMANCE IN DIFFERENT SETPOINT CHANGES WITH To the dean Pilar Urrutia and authorities of FISEI of
UDOO NEO FULL
Universidad Técnica de Ambato (UTA), for support for this
Indicators 25-35 35-15 15-35 35-20 work and future research. To the Universidad de las Fuerzas
Armadas ESPE Extensión Latacunga because of the facilities
Dead time (s) 0.436 0.524 0.291 0.218 gave for the development of this work.
Rise time (s) 2.545 2.618 2.473 2.399

Settling time (s) 3.854 4.291 3.818 3.636


References
Overshoot (%) 1.89 3.26 1.56 1.12
[1] S. M. Zanoli, L. Barboni, F. Cocchioni and C. Pepe, “Advanced process
control aimed at energy efficiency improvement in process industries,”
For future work, these authors propose the implementation 2018 IEEE International Conference on Industrial Technology (ICIT),
Lyon, 2018, pp. 57-62.
of multiple advanced controllers in more embedded boards, to
elaborate a comparison between the behaviors of each one of [2] A. W. Saif and M. A. Akram, “Network-based process control and
improvements with fuzzy time delay modulator,” 2017 IEEE
them inside of an industrial environment. International Conference on Industrial Engineering and Engineering
Management (IEEM), Singapore, 2017, pp. 1281-1285.
[3] Y. Naung, A. Schagin, H. L. Oo, K. Z. Ye and Z. M. Khaing, Electrical, Electronics Engineering, Information and Communication
“Implementation of data driven control system of DC motor by using Technologies (CHILECON), Pucon, 2017, pp. 1-7.
system identification process,” 2018 IEEE Conference of Russian [16] [D. M. Lima, M. V. Americano da Costa and J. E. Normey-Rico, “A
Young Researchers in Electrical and Electronic Engineering flexible low cost embedded system for Model Predictive Control of
(EIConRus), Moscow, 2018, pp. 1801-1804. industrial processes,” European Control Conference (ECC), Zurich,
[4] W. Yi, H. Ketai, Z. Xiaomin and D. Wenying, “Machine vision based 2013, pp. 1571-1576.
statistical process control in fused deposition modeling,” 2017 12th [17] E. Pruna, F. Bayas, H. Cocha, I. Escobar, A. Gordon and P. Constante,
IEEE Conference on Industrial Electronics and Applications (ICIEA), “Implementation of a simulator of industrial processes,” 2016 IEEE
Siem Reap, 2017, pp. 936-941. International Conference on Automatica (ICA-ACCA), Curico, 2016,
[5] I. Belai and M. Kocur, “A positional servo drive with filtered PID pp. 1-6.
control,” 2017 Intl Conf on Advanced Control Circuits Systems (ACCS) [18] E. Pruna et al., “Building a training module for modern control,” 2015
Systems & 2017 Intl Conf on New Paradigms in Electronics & CHILEAN Conference on Electrical, Electronics Engineering,
Information Technology (PEIT), Alexandria, 2017, pp. 73-78. Information and Communication Technologies (CHILECON), Santiago,
[6] N. K. Sinha and P. M. Tiwari, “Multiple motor synchronization using 2015, pp. 369-373.
nonlinear PID control,” 2017 3rd International Conference on Advances [19] E. Pruna, D. Bautista, I. Escobar, J. Acosta and J. Cortez, “Training
in Computing,Communication & Automation (ICACCA) (Fall), system for remote control of industrial processes,” 2016 IEEE
Dehradun, 2017, pp. 1-6. International Conference on Automatica (ICA-ACCA), Curico, 2016,
[7] G. Qiang, H. Junfeng and P. Wei, “PMSM Servo Control System Design pp. 1-7.
Based on Fuzzy PID,” 2017 2nd International Conference on [20] S. J. Johnston, M. Apetroaie-Cristea, M. Scott and S. J. Cox,
Cybernetics, Robotics and Control (CRC), Chengdu, 2017, pp. 85-88. “Applicability of commodity, low cost, single board computers for
[8] F. Parivash and A. Ghasemi, “Trajectory tracking control for a quadrotor Internet of Things devices,” 2016 IEEE 3rd World Forum on Internet of
using fuzzy PID control scheme,” 2017 IEEE 4th International Things (WF-IoT), Reston, 2016, pp. 141-146.
Conference on Knowledge-Based Engineering and Innovation (KBEI), [21] C. A. García et al., “Fuzzy control implementation in low cost CPPS
Tehran, 2017, pp. 553-558. devices,” 2017 IEEE International Conference on Multisensor Fusion
[9] R. Y. S. Ann, H. Oneda, S. Osawa, K. Ozaki, “Development of a and Integration for Intelligent Systems (MFI), Daegu, 2017, pp. 162-
Teaching Material that Can Motivate Students to Learn Control 167.
Engineering and Image Processing,” 2014 IEEE 17th International [22] Buele J. et al., “Interactive System for Monitoring and Control of a Flow
Conference on Computational Science and Engineering, Chengdu, 2014, Station Using LabVIEW,” Advances in Intelligent Systems and
pp. 413-419. Computing, vol. 721. Springer, 2018, pp. 583-592.
[10] F. Ramírez, R. Domingo, M. Sebastián, “Deep Drawing Tool for E [23] P. Kumar and Umesh Chandra Pati, “Arduino and Raspberry Pi based
learning,” Education Engineering (EDUCON), IEEE, pp. 1857-1866, smart communication and control of home appliance system,” 2016
April 2010. Online International Conference on Green Engineering and
[11] M. Bustamante, G. Moreno, A. Pelaez, C. Madrigal, “Design and Technologies (IC-GET), Coimbatore, 2016, pp. 1-6.
Implementation of an Automation Didactic Module focused to Machine [24] I. Siradjuddin, S. P. Tundung, A. S. Indah and S. Adhisuwignjo, “A real-
Vision and Programmable Logic Control,” III International Congress of time Model Based Visual Servoing application for a differential drive
Engineering Mechatronics and Automation (CIIMA), IEEE, pp. 1-5, mobile robot using Beaglebone Black embedded system,” 2015 IEEE
October 2014. International Symposium on Robotics and Intelligent Sensors (IRIS),
[12] S. Amir, M. S. Kamal, S. S. Khan and K. M. A. Salam, “PLC based Langkawi, 2015, pp. 186-192.
traffic control system with emergency vehicle detection and [25] V. Kathare and S. N. Prasad, “CTF controller for CT scan using Beagle
management,” 2017 International Conference on Intelligent Computing, Bone Black,” 2016 IEEE International Conference on Recent Trends in
Instrumentation and Control Technologies (ICICICT), Kannur, 2017, pp. Electronics, Information & Communication Technology (RTEICT),
1467-1472. Bangalore, 2016, pp. 1292-1295.
[13] H. Xu, K. j. Zhao, Y. d. Ning, H. Yan and X. s. Che, “Automatic [26] UDOO. https://www.udoo.org/
Locating System of Clean-Up Locomotive Based on PLC,” 2017 2nd
International Conference on Cybernetics, Robotics and Control (CRC), [27] J. J. M. Nolasco and J. A. Padilla Medina, “LabVIEW-based Classic,
Chengdu, 2017, pp. 144-148. Fuzzy and Neural Controllers Algorithm Design Applied to a Level
Control Prototype,” IEEE Latin America Transactions, vol. 15, no. 6, pp.
[14] F. Durrani, M. Riaz, M. H. Ahmad, S. Durrani and H. Ali, “SCADA & 1154-1162, June 2017.
PLC based fully automated pneumatic cutting machine: A test bench for
industry and laboratory,” 2018 International Conference on Engineering [28] A. Kumar Dutta, “Computing with words using intuitionistic fuzzy logic
and Emerging Technologies (ICEET), Lahore, 2018, pp. 1-6. programming,” International Journal of Engineering & Technology, vol.
7, no. 1.9, pp. 178-181, March 2018.
[15] M. Pilatásig et al., “Implementation of fuzzy controller in low cost
embedded boards for a flow system,” 2017 CHILEAN Conference on [29] J. R. Mountain, “Fuzzy logic motor speed control with real-time
interface using an 8-bit embedded processor,” 2010 42nd Southeastern
Symposium on System Theory (SSST), Tyler, TX, 2010, pp. 307-312.

Você também pode gostar