Вы находитесь на странице: 1из 8

Development of an educational tool for Control

Engineering
Alan Kardek Rgo Segundo, Jos Alberto Naves Cocota Junior, Digenes Viegas Mendes Ferreira
Departamento de Engenharia de Controle e Automao e de Tcnicas Fundamentais - DECAT
Escola de Minas, Universidade Federal de Ouro Preto - UFOP
Ouro Preto, Brasil
alankardek@em.ufop.br, cocota@em.ufop.br, diogenes_viegas@ymail.com
Abstract On this work, a device was made in order to help
the visualization by the student of a PID temperature control
and thus fix the concepts learned in the classroom. This device
was built primarily with a PIC18F4550 microcontroller, a mini
cooler from a PC, a heat resistor, LM35 temperature sensors,
liquid crystal display, USB connector, transistors, LEDs,
potentiometers, resistors and capacitors. The USB connection is
responsible for recording the microcontroller firmware
(bootloader mode), for interfacing with a supervisory software,
and to supply the system. The heat resistor provides heat to the
system. On the other hand, the cooler has the function of
removing heat from the system. The liquid crystal display helps
the student to check the temperature, the constants of the
controller (Kp, Ki and Kd) and the set point temperature or the
cooler voltage. The potentiometers provide the option to run the
system in open loop, that is, they serve to make the control of the
heat supplied by the heat resistor and the cooler voltage
manually. Both the heat resistor and the cooler are controlled
via transistors switched by PWMs (Pulse Wide Modulation). A
computer program was developed in C Sharp language to
display the temperature over time measured by the sensors. The
program also is used to adjust the constants Kp, Ki and Kd of the
controller and the temperature set point. The microcontroller
firmware allows the system to operate in both open and closed
loop modes. This work allows the student to learn in practice the
control actions when the controller parameters are changed,
contributing to improve the acknowledgment of Control
Engineering.
KeywordsProject
Based
Learning;
Microcontroller;
Supervisory System; PID; Temperature Control.

I.

INTRODUCTION

The discipline of Control Engineering is present in several


undergraduate courses such as Electrical Engineering,
Mechanical Engineering, Mechatronics and Control and
Automation Engineering. In this discipline the concepts of
physics are employed to represent the behavior of dynamic
systems by means of differential equations. It is possible to
analyze the response of a given system as a function of the
input signal. The transfer function of the system represents the
system behavior. It enables the engineer to design a control
system for the system to operate in a desired manner.

Control Engineering teaching often faces the challenging


problem of how to give undergraduate students interesting and
pragmatic teaching tools. That might achieved providing
hands-on experiments and design problems that complement
the theory presented in lectures [1].
Often students learn to model systems mathematically, but
do not really understand how the controller performs. There
are different controller gains (Kp, Ki, and Kd) acting in the
response of the classic closed loop system. It is noted the need
to develop a tool that could help to improve the understanding
of the concepts of Control Engineering discussed in class.
Currently, some engineering professors use active learning
methodologies to assist in learning process of students.
Among the various methodologies, it is important to highlight
the Project Based Learning (PBL), which was used in this
work, and that according to Edgar Dale's Cone the students
remember 90% of what was taught with active learning
methodologies [2]. Based on this, teaching engineering
practices associated with activities has become an essential
methodology to motivate undergraduates [3, 4, 5, 6].
This work presents the design of a low cost educational
system that assists the teaching of closed loop control for
undergraduate students. The board was developed by an
undergraduate student to support the classes of
Microcontrollers Applied to Control and Automation
Engineering discipline. It is a PID (Proportional, Integral and
Derivative) temperature control system using a heat resistance
and a mini cooler.
II.

MICROCONTROLLERS APPLIED TO CONTROL AND


AUTOMATION ENGINEERING DISCIPLINE

The discipline Microcontrollers Applied to Control and


Automation Engineering was created in order to facilitate
understanding of theoretical concepts covered throughout the
course of Control and Automation Engineering by using the
PBL methodology. This discipline is elective and is offered to
students who have completed the compulsory subject of
Embedded Systems. This discipline has 60 class hours, two
lectures and two practices per week, including the time
required for the evaluation of students during the semester.

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 594

The evaluation method consists on reports of practical lessons


and presentation of the final work, which involves the creation
of a microcontrolled device to interface with Windows or
Android operating system. Therefore, students should develop
the ability to design a system in terms of both hardware and
software at the end of the semester, which facilitates the
establishment of concepts related to control systems,
embedded systems, interfacing and programming systems.
III.

PROTOTYPE DEVELOPMENT

This work was developed in the laboratories of Prototype


and Development of New Technologies and Electrical
Machines, both belonging to the Department of Control and
Automation Engineering in the School of Mine, Federal
University of Ouro Preto, Ouro Preto, Minas Gerais, Brazil.
The work was conducted in three steps: (i) development of
the didactic device; (ii) development of a SCADA system
using C Sharp language; and (iii) design a controller by
Ziegler Nichols method.
A. Development of the didactic device
The hardware was designed using the AutoCAD software.
To achieve this, it was used acknowledgments in Electronics,
Embeded Systems and Instrumentation. This device was
developed using a PIC18F4550 microcontroller, a mini cooler
from a PC, a heat resistor, LM35 temperature sensors, liquid
crystal display (LCD), USB connector, transistors, LEDs,
potentiometers, resistors and capacitors. The Fig. 1 shows the
electronic design of this device.
The microcontroller firmware was developed in C
programming language. It has two operating modes: manual
and automatic. In manual mode, the voltage applied on the
cooler and the resistance is made through the scrollbars
adjustment in the supervisory system by the user. This mode is
used for testing and to assist in system modeling process. In
automatic mode, the controller is activated. Thus, the voltage
applied to the cooler is the output of this controller, which
operates depending on the proportional, integral and derivative
gains: Kp, Ki and Kd, respectively. The algorithm of this
controller is designed to automatically adjust the voltage on
the cooler and, consequently, to make the system set the
temperature close to the set point chosen by the user, with a
tolerance of 0.5C. The Fig. 2 shows the simplified flowchart
of this firmware. The Fig. 3 shows the simplified flowchart of
the controller algorithm.
B. Development of a SCADA system
The SCADA system was developed in the C#
programming language via the Visual Studio Express IDE. In
developing this program, the team was seeking to provide a
friendly graphical user interface. This system consists of a
screen containing three graphs (temperature, output voltage
controller and temperature error along time), temperature
gauges, configuration buttons, and dialog boxes to adjust Kp,
Ki e Kd. The Fig. 4 shows the simplified flowchart of the
SCADA system.
C. Controller design
The system was developed to provide a PID controller,
which sets an output as in (1). However, in this work was used

just the PI control, because the unit step response showed a


first order system behavior [7].


(1)

where: U(s) is the controller output, E(s) is the error, both in


Laplace domain, Kp is the proportional gain, Ti is the integral
time and Td is the derivative time.
The controller was designed using the Ziegler-Nichols
Open-Loop Tuning Method or Process Reaction Method. To
achieve this, it was applied a 5V step (100%) over the heat
resistance and 2,5V step (50%) over the cooler. After the
temperature stabilization, that occurs about 27.8C, it was
applied a 3,0V step over the cooler, which increases 10% of
full scale (5V). Thus, a temperature over time graph was
plotted. This response was an S-shaped curve, which enables
the application of Ziegler Nichols method. From the process
reaction curve it was determined the transportation lag or dead
time (dead), the time constant or time for the response to
change () and the output change of Mu, for a step change of
X0. Kp, Ti and Td were figured out according the Table I [7].
TABLE I.

ZIEGLER-NICHOLS METHOD PARAMETERS

Controller

Kp

Ti

Td





PI
PID

 


 


According to Ziegler and Nichols, the open-loop transfer


function of a system can be approximated with a time delay
and a single-order system [7], as in (2). The transfer function
of the PI controller can be approximated as in (3).


(2)
(3)

The output function of the controller was transformed


from the continuous to the discrete-time domain using the
Tustins method [7], as in (4). Thus, the discrete output of the
controller was as in (5). On that way, the controller was
implemented in the microcontroller firmware, according the
Fig 3.

(4)

where: s is the Laplace variable; z is the Z transform variable;


and T is the sampling period.




(5)

where: k is the currently sampling time.

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 595

Fig. 1. Electronic design of the didactic device.

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 596

Start

Header files inclusion.


Fuses, delay and ports configuration.
Global variables declaration.
Configuration of the peripherals: Timers,
ADC, CCP and USB.

No

USB
connected?

Bouncing treatment.

Yes
Yes

Any button
pushed?

Performing the function of the


pushed button.

No
Yes

Timer A ended?
No

No

Timer B ended?
No

Yes

AD conversion.

Controller
algorithm.

Writing on LCD.
USB data arrived?
Sending USB data.

Yes
Data processing.

One millisecond delay.

Fig. 2. Simplified flowchart of the firmware.

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 597

Start

Start

Temperature measuring (LM35).


Calculating temperature error.

Graphical interface initialization.


Global variables declaration.
USB communication initialization.

Error = set_point LM35


USB
connected?

V1 = Kp*((2*Ti+T)/(2*Ti))*Error
V2 = Kp*((-2*Ti+T)/(2*Ti))* Previous_Error
PID = PID + V1 + V2
Previous_Error = Error

Yes
No

PID > 255?

Yes

One second timer


event occurred?

PID = 255

Yes
Insert a new point in graph and refresh the data
acquisition list.

No

PID < 0?

No

Yes

PID = 0

No

USB data
arrived?

No
Yes
Cooler_PWM = PID

Data processing.
Refresh the gauge, graph and digital inputs
state.

End

Fig. 3. Simplified flowchart of the controller.

Button pushed or
scroll bar modified?

No

Yes
Sending USB data.
Fig. 4. Simplified flowchart of the SCADA system.

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 598

IV.

RESULTS

The Fig. 5 shows the final appearance of the PCB (Printed


Circuit Board). On the left is the cooler appointed to the
resistor surrounded by LM35 temperature sensors, four
navigation buttons, microcontroller in the center, LCD
display on the top and right side pots connected to A/D
converter, accompanied by USB connector. This is a simple
and inexpensive device. On its development less than
US$25.00 were spent.

To analyze the operation of the designed controller, a test


of its response to the reference temperature 27.7C worth was
made. Until the first 250 seconds the controller remained
without any external interference. However, after this time
some disturbances were applied to the system, among them
heated outdoor ventilation at first and then an external
ventilation with room temperature. As it can be seen in Fig. 8,
even when some external disturbance is applied to the system
the temperature values oscillate less than 1C.
In Fig. 9 could be observed that the controller designed by
Ziegler Nichols tuning method performs smooth change in the
voltage over the cooler. Consequently, small changes occur in
the cooler speed.
Even if the response of a controller designed by an
empirical method is not a great response, this is a good
starting point for fine adjustments, which can be made until
the system responds in a desirable way. As shown in Fig. 10
the system error remains very low (below 1C) throughout the
experiment.
After using this system in practical classes, the students
received a questionnaire evaluating this tool. Based on the
results, it was noticed that this system helped students to fix
the theoretical concepts seen in class of Control Engineering.
In addition, the students were very motivated by the
fulfillment of practical classes using this tool.

Fig. 5. Temperature control device.

After tuning the system by means of the Ziegler-Nichols


method, the block diagram of the closed loop system shown in
Fig. 6 was given.

Fig. 6. Block diagram of the closed loop system.

After assembly and programming of the supervisory


system, it was obtained the result shown in Fig. 7. In this
program the user has information about the temperature of the
system in real time, the action of the controller, the values of
proportional integral and derivative gain, the states LED's and
the value of the set-point.

During the last semester this system was presented to the


students of the discipline Microcontrollers Applied to Control
and Automation Engineering. The students showed great
interest in this system, because all the stages of its
development were shown in detail. This inexpensive tool
provided students to visualize a control system based in a real
project. Furthermore, the development of this system
involved other subject of the Control and Automation
Engineering course, e.g., Digital and Analog Electronics,
Embedded Systems, Control Engineering, Interfacing
Systems and Computer Programming. At the end of these
semesters a course evaluation questionnaires were distributed
to students, to have a feedback of the methodology adopted
(PBL) during the course. In particular, it was made a
statement about the importance of this educational system in
setting the theoretical concepts about Control Engineering.
Tab. 1 shows the results of a questionnaire answered by 9
students.

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 599

Fig. 7. Supervisory system.

Fig. 8. Temperature variation along time.

Fig. 9. Output voltage over the cooler along time

Fig. 10. Temperature error along time.

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 600

TABLE I.

ANSWERS TO THE SURVEY

Answers
A(%)
The project has
motivated me to
100.0
conclude the
engineering course.
The project has
motivated me to learn
100.0
more about the subject.
I would recommend
other students to attend
93.75
this subject with this
methodology adopted.
I could see in practice
how to develop
projects that involve
other subjects,
contributing
55.56
significantly to the
establishment of the
theoretical concepts
learned throughout the
course.
This educational tool
contributed to fix the
theoretical concepts
seen in Control
33.33
Engineering
disciplines, because
these concepts were
visualized in practice.
A= Strongly agree, B=Agree,
E=Strongly disagree

B(%)

C(%)

D(%)

E(%)

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

6.25

0.00

0.00

0.00

[4]

[5]

[6]

[7]

44.44

0.00

0.00

0.00

33.33

33.33

0.00

0.00

Technology Based Higher Education and Training (ITHET), pp.1-6,


Jun. 2012.
S. Ramasamy, H.V. Pradhan, P. Ramanathan, P. Arulmozhivarman, R.
Tatavarti, "A novel and pedagogical approach to teach PID controller
with LabVIEW signal express," IEEE International Conference on
Engineering Education: Innovative Practices and Future Trends
(AICERA), pp.1-8, Jul. 2012.
Shui-Chun Lin; Ching-Chih Tsai, "Development of a Self-Balancing
Human Transportation Vehicle for the Teaching of Feedback Control,"
IEEE Transactions on Education, vol. 52, no.1, pp. 157-168, Feb.
2009.
C. M. Liyanagedera, N. A. Kulatunga, , "Multi-motor controller as an
educational tool," IEEE Int. Conf. on Electric Machines & Drives
Conference (IEMDC), pp.1348-1351, May 2013.
D. Ibrahim. Microcontroller-based temperature monitoring and control.
Newnes, 2002.

C=Neutral, D=Disagree, and

Most of the students agreed that the educational system


developed in this work was important to establish the
theoretical concepts of Control Engineering. Moreover, it is
really necessary to highlight the importance of this discipline
in motivating students both in undergraduate engineering
program conclusion and in learning more about the topics
discussed. On both issues, 100% of students strongly agreed
on this motivational aspect that discipline provides.
V.

CONCLUSION

Based on the results obtained it can be concluded that it is


possible to develop a low cost educational tool to apply the
concepts of Control Engineering accompanied by a
supervisory system with an intuitive and user-friendly
graphical interface. This system helped to establish the
theoretical concepts previously seen in the course using a real
project.
REFERENCES
[1]

[2]

[3]

J. A. N. J. Cocota, D. C. Abro, A. G. Lopes, M. R. O. Medeiros and E.


S. S. Lopes, Development of Tangible Experiments for Motivating
Undergraduate Students IEEE Global Engineering Education
Conference (EDUCON), pp. 497-506, Mar. 2013.
J. A. N. J. Cocota, R. Souza, G. F. Santos, and R. A. Kitahara,
Development of an Automated Cell for the Teaching of Integrated
Manufacturing Systems, IEEE Int. Conf. on Technologies Applied to
Electronics Teaching (TAEE), pp. 170174, Jun. 2012.
N. R. Jackson, A. E. Ward, "Curiosity based learning: Impact study in
1st year electronics undergraduates," Int. Conf. on Information

978-1-4799-1908-6/15/$31.00 2015 IEEE


18-20 March 2015, Tallinn University of Technology, Tallinn, Estonia
2015 IEEE Global Engineering Education Conference (EDUCON)
Page 601

Вам также может понравиться