Professional Documents
Culture Documents
92 - The Design of Temperature Control System Using PIC18F4620 PDF
92 - The Design of Temperature Control System Using PIC18F4620 PDF
Publicat de
Universitatea Tehnică „Gheorghe Asachi” din Iaşi
Tomul LVI (LX), Fasc. 4, 2010
SecŃia
AUTOMATICĂ şi CALCULATOARE
Abstract. Applications that require temperature control are often meet in industry.
In this paper a low cost application for temperature control in a ventilation system using
the PIC18F4620 was designed and developed. Ventilating is the process of changing or
replacing air in any space to control temperature or remove moisture, smoke, dust,
unpleasant smells or bacteria. Ventilation in a test room refers both to the exchange of air
to the outside as well as circulation of air within a room. This study includes real time
temperature control using a PID controller implemented on a microcontroller.
Key words: temperature control, educational low cost application, PID controller,
PIC18F4620.
2000 Mathematics Subject Classification: 93C10, 93C40, 93C83.
1. Introduction
1
This is an extended version of the paper: Levărdă B. and Budaciu C., Temperature Control
Application for a Ventilation System Using PIC18F6420. Proc. ICSTC 2010, 282−286, 2010.
204 Bogdan Levărdă and Cristina Budaciu
of processes. In the paper [8] the authors propose a fuzzy PID thermal control
system for a casting process and in [6] an indirect adaptive general predictive
temperature control of a class of passive HVAC system is design. Real time
PID control for water heating system using PIC16F887 microcontroller was
designed and implemented as is shown in [2]. The authors propose design
architecture for water temperature control. The study implies both acquisition
and modeling techniques and control strategies based on PID controller.
A mandatory demand to implement the agreeably solution is the model
acquirement which describes the complex behavior of the system. The paper
focuses on the model identification and control of temperature in a test room
designed for a ventilation system. The main reason to derive a low cost
application is that to be suitable for different studies with respect to control
strategies for temperature control or to be of interest for plant design. The goal of
this study is to analyze and develop an educational plant that can be used at
different application laboratory where students study about microcontrollers, data
acquisition, system identification and especially control system design. Plant
implementation can easily be reused by users who are not expert in plant design.
The laboratory architecture proposed in this paper permits to run experiments
while interacting with its components. The control architecture allows for the
users to implement their knowledge of control engineering in an easy way due to
process access by a friendly design. The designed application with PIC18F4620 is
also useful in predictive control research for embedded controller [3]. Moreover,
in recent years, the requirements for the quality of control design in process
increased due to the computing power high complexity [1], [9].
The paper is organized as follows: the second part of the paper presents
the cooling system design and implementation with PIC18F4620. The next
section deals with the data acquisition and model identification. In the third part
of the paper a control system design based on PID controller was developed.
Also, some real time experiments have been performed in order to illustrate the
performances of the implemented controller. Finally some conclusions are given.
designed for application with low cost microcontrollers like Microchip 8 bits
16xxx and 18xxx, with 40 pins, family. This board contains the PIC 18F4620
which can significantly reduce power consumption during operation. The 40
Mhz operating frequency combined with 13 input channels for the 10-bit
Analog-to-Digital Module, 65536 Bytes of Program Memory and 1024 Bytes
for Data EEPROM are a few of the features of 18F4620. The microcontroller
uses a 75 instruction set and 83 extended instruction set enabled. The device
permits enhanced USART Serial Communication and also admits 5 I/O ports
and 4 Timers.
The communication to the computer is made with a USB cable which
adapts the signal to serial communication with a hardware device FT232RL, as
illustrated in [3]. This facility offers the possibility to establish connections with
all modern PC or notebook. MDB01 is equipped with L298 Dual Full Bridge,
providing the command actions. It is a high voltage, high current dual full-
bridge driver designed to accept standard TTL logic levels and drive inductive
loads such as relays, solenoids, DC and stepper motors. Two enable inputs are
provided to enable or disable the device independently of the input signals. In
this application it is used a single input due to one single DC motor. The
emitters of the lower transistors of each bridge are connected together and the
corresponding external terminal can be used for the connection of an external
resistor. An additional supply input is provided so that the logic works at a
lower voltage. A user friendly part of the process is the color LCD S1D15G14
with 98x67 pixels interfaced with 8 bits with 18F4620 which is able to display
in real-time the temperature degree from the sensors.
phenomenon. In the next section, the attention is focused on real time data
acquisition, followed by the open loop model identification.
quick memory can record very accurate the A/D sent values. A number of
samples in C degrees were recorded in this time.
Stationary regime is settled in about 4 min, afterwards a new command
is sent by the microcontroller to the L298 bridge. This forces the motor to work
at a 90% duty cycle and the air temperature in the test room decreases. The new
temperature values were recorded after the last output value given by the 20%
duty cycle command. It can be mentioned that the 90% duty cycle command
was applied using 1 second sampling time. The values from the EEPROM
memory were sent to a PC using a USB communication cable and all output
values were saved in a text file. FT232RL interface helps to convert the serial
transmitter of the 18F4620 into a large scale USB interface who acts like a
serial communication channel.
The frequency for the DC cooling motor was tested during the
acquisition stage to set up the pulse width period in the time of the experiments.
After testing how the system works at different PWM frequency a 2.44 kHz was
established. Some tests were made in the test room varying the DC motor
cooling power. The PWM command was observed on the oscilloscope as shown
in Fig.3.
environment. A step will be applied to the system and the output response will
be saved in Matlab workspace. The input for the system can be considered the
duty cycle value of the PWM and will be considered in percent values. Some
different values of the step were applied to the system and the responses are
plotted in the Figs. 4 and 5 .
From the existing responses the last set of data was used to identify the
continuous time model in Matlab software. In the Identification Toolbox, the
command and the output response was used to create a model.
kf
(1) G f ( s) = e- sL ,
1 + sT f
1
(2) U(s)=K p ⋅ 1+ +s ⋅ Td ⋅ E(s) ,
s ⋅ Ti
Ts (1-z -1 )
(3) U(z)=E(z) ⋅ K p ⋅ 1+ +Td ⋅ ,
Ti ⋅ (1-z -1 ) Ts
For the discrete PID, the parameters were calculated with the following
relations:
Kpdiscrete = K p
K p ⋅ Ts
(4) Ti = ,
discrete Ti
K p ⋅ Td
Td discrete =
Ts
Bul. Inst. Polit. Iaşi, t. LVI (LX), f. 4, 2010 211
With these modified values a new real time temperature control has
been performed, subject to the set point changes.
4. Conclusions
REFERENCES
1. Bouhenchir H., Cabassud M., Le Lann M., Casamatta V.G., A General Simulation
Model and a Heating–Cooling Strategy to Improve Controllability of Batch
Reactors. Trans IchemE, Part A, 79, 641–654, 2001.
2. Imbrahim D., Microcontroller Based Temperature Monitoring and Control. Newnes,
2002.
3. Kadirkamanathan V., Halauca C., Anderson S., Predictive Control of Fast-Sampled
Systems Using the Delta-Operator. International Journal of Systems Science,
40, 7, 745−756, 2009.
4. Lazăr C., Vrabie D., Carari S., Sisteme automate cu regulatoare PID. Edit.
MatrixRom, Bucureşti, 2004.
5. Manolis I., Lourakis A., A Brief Description of the Levenberg-Marquardt Algorithm
Implemened by Levmar. 2005.
214 Bogdan Levărdă and Cristina Budaciu
(Rezumat)