Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Digital Control Project Temperature Control Using PID

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Sana’a University

Faculty of Engineering
Mechatronics Department
Fourth Year

Digital Control Project


Temperature Control using PID

Done by:
Yasmin Al-Atraqchi 357/2017
Abstract:

Most household appliances are supplied from ac supply, such as lights, fans, TVs, etc.
These appliances can be turned on and off digitally, if needed, using relays and controllers.
Yet, this on-off control is usually not satisfactory, and power supplied to these appliances
need to be controlled to meet the desired use of power and thus save energy. This project
demonstrates this control of power. The objective of this paper is to illustrate a method for
design and implementation of a room heating system which maintains a constant preset
temperature across a given room. A PID controller is used to reach the optimal value
representing the desired temperature set by the user by comparing the set and real value of
the temperature. The system contains mainly of the actuator; heater, temperature sensor,
and the controller, with a power electronics circuit for control. This project is a complete
PID controller system solution implemented and programmed in Arduino. A Heater is
connected for testing and a program created in QT C++ is supplied to monitor the
temperature and change it to the desired value. Furthermore, an LCD and keypad are
available to monitor the temperature and change it respectively. All in all, the circuit
discussed through this paper is used on a heater yet can be used on other appliances like
lights and fans to achieve a desired level of performance.
Table of Contents
Abstract: .......................................................................................................................................... 2
1. Introduction ................................................................................................................................. 4
1.1. Overview............................................................................................................................... 4
1.2 Problem Definition ................................................................................................................ 4
1.3 Project Objectives.................................................................................................................. 5
2. Main Definitions .......................................................................................................................... 5
2.1 Qt ........................................................................................................................................... 5
2.2 PID ......................................................................................................................................... 5
2.3 PWM ...................................................................................................................................... 5
2.4 Triac ....................................................................................................................................... 6
2.5 Zero Crossing ......................................................................................................................... 7
2.6 Opto Coupler ......................................................................................................................... 7
3. Hardware Development .............................................................................................................. 7
3.1 Main Components Used ........................................................................................................ 7
3.2 Block Diagram ........................................................................................................................ 8
3.3 System’s Operation ............................................................................................................... 8
4. Conclusion ................................................................................................................................... 9
1. Introduction
1.1. Overview
Controlling the power of dc devices is a relatively easy task, the easiest way can by the use
of a potentiometer to control the voltage supplied to these devices. They can also be
controlled by PWM coming from a controller. On the other hand, ac powered devices
power control can be a trickier task, and does not only require PWM but also a power
electronics circuit to obtain the desired performance. The control can be applied to ac lights
where the brightness of the lamp can be controlled, or to a fan where its speed of rotation
is controlled, and to heaters, where the temperature resulting from the heater is controlled.
This temperature control is what is applied in this project.
Maintaining uniform temperature in the household, office premises, shopping
complex/malls is an important factor for comfortable stay of the inhabitants. In this project,
the power supplied to the heater is controlled by PWM and triac. A proportional-integral-
derivative controller(PID) is control loop mechanism employing feedback that is widely
used in industrial control system and variety of other applications requiring continuously
modulated control. A PID controller continuously calculates an error value as the deference
between a desired set point and a measured process variable, and applies a correction based
on proportional-integral-derivative terms. The PID is used to set the value of the duty cycle
and thus control the firing angle of the triac. The control is achieved by knowing the set
and real value of temperature and setting the controller’s output based on that.

1.2 Problem Definition


Many real systems deal with nonlinear response so an error happens between the desired
value or work and the actual value or work done, So PID system comes in hand by
continuously calculating an error value as the deference between a desired set point and a
measured process variable and applies a correction. For example, if we have a heater and
we want to maintain a temperature by controlling the power of the heater. The desired
temperature would be the desired set point and the current temperature would be the
measured process variable and the PID controller will controls the heater to reach the
desired temperature.
1.3 Project Objectives
This project controls a heater to match the desired temperature and provides data that is
drawn in graph using a designed program in QT for testing and monitoring.

2. Main Definitions
2.1 Qt

Qt (pronounced "cute") is a widget toolkit for creating graphical user interfaces as well as
cross-platform applications that run on various software and hardware platforms such as
Linux, Windows, macOS, Android or embedded systems with little or no change in the
underlying codebase while still being a native application with native capabilities and
speed.

2.2 PID

A proportional–integral–derivative controller (PID controller or three-term controller) is a


control loop mechanism employing feedback that is widely used in industrial control
systems and a variety of other applications requiring continuously modulated control. A
PID controller continuously calculates an error value e (t) {\displaystyle e(t)} as the
difference between a desired set point (SP) and a measured process variable (PV) and
applies a correction based on proportional, integral, and derivative terms (denoted P, I, and
D respectively), hence the name. In practical terms it automatically applies accurate and
responsive correction to a control function.

2.3 PWM

Pulse width modulation (PWM), or pulse-duration modulation (PDM), is a method of


reducing the average power delivered by an electrical signal, by effectively chopping it up
into discrete parts. The average value of voltage (and current) fed to the load is controlled
by turning the switch between supply and load on and off at a fast rate. The longer the
switch is on compared to the off periods, the higher the total power supplied to the load.
Along with MPPT maximum power point tracking, it is one of the primary methods of
reducing the output of solar panels to that which can be utilized by a battery. PWM is
particularly suited for running inertial loads such as motors, which are not as easily affected
by this discrete switching, because they have inertia to react slow. The PWM switching
frequency has to be high enough not to affect the load, that is to say that the resultant
waveform perceived by the load must be as smooth as possible.

The rate (or frequency) at which the power supply must switch can vary greatly depending
on load and application. For example, switching has to be done several times a minute in
an electric stove; 120 Hz in a lamp dimmer; between a few kilohertz (kHz) and tens of kHz
for a motor drive; and well into the tens or hundreds of kHz in audio amplifiers and
computer power supplies. The main advantage of PWM is that power loss in the switching
devices is very low. When a switch is off there is practically no current, and when it is on
and power is being transferred to the load, there is almost no voltage drop across the switch.
Power loss, being the product of voltage and current, is thus in both cases close to zero.
PWM also works well with digital controls, which, because of their on/off nature, can
easily set the needed duty cycle. PWM has also been used in certain communication
systems where its duty cycle has been used to convey information over a communications
channel.

Figure 1 An example of PWM in an idealized


Figure 2 TRIAC Symbol
inductor driven by a ■ voltage source
modulated as a series of pulses, resulting in a
■ sine-like current in the inductor.

2.4 Triac

TRIAC, from triode for alternating current, is a generic trademark for a three terminal
electronic component that conducts current in either direction when triggered. Its formal
name is bidirectional triode thyristor or bilateral triode thyristor. A thyristor is analogous
to a relay in that a small voltage induced current can control a much larger voltage and
current. Figure 2 shows the circuit symbol for a TRIAC where A1 is Anode 1, A2 is Anode
2, and G is Gate. Anode 1 and Anode 2 are normally termed Main Terminal 1 (MT1) and
Main Terminal 2 (MT2) respectively.
2.5 Zero Crossing

A zero-crossing is a point where the sign of a


mathematical function changes (e.g. from positive to
negative), represented by a intercept of the axis (zero
value) in the graph of the function.

Figure 1 A zero-crossing in a line


graph of a waveform representing
voltage over time

2.6 Opto Coupler

Opto coupler, photocoupler, or optical isolator is


an electronic component that transfers electrical
signals between two isolated circuits by using light.
Opto-isolators prevent high voltages from affecting
the system receiving the signal. Commercially
available opto-isolators withstand input-to-output
voltages up to 10 kV and voltage transients with
speeds up to 25 kV.

Figure 2 Opto Coupler

3. Hardware Development
3.1 Main Components Used
The main components comprising this project can be listed as follows:
 Arduino Mega 2560
 NRF 24L01
 Moc3041 non-zero crossing opto coupler
 En357 opto coupler
 Full-wave bridge rectifier
 BTA 16 triac
 Zero-crossing
 NTC- thermistor
 Heater
 Keypad
 LCD
3.2 Block Diagram

Figure 3 Block Diagram

Figure 6 Reading Values to Computer

3.3 System’s Operation


The input to the system is set by the user by inserting the desired temperature in Celsius
via the keypad. The set temperature represents the set point (SP) and is displayed on the
lcd as the “Goal temp”. The current temperature is read by the thermostat inserted on the
heater. To increase accuracy of the readings ten readings are obtained and the average of
these values is used as the process variable (PV). The P, I, and D terms were found
manually. The terms were changed simultaneously and the corresponding curve was
obtained. Upon reaching the optimal performance, these values were recorded and used.
Figure 7 Controller of heating node

The SP, PV, D, I, and P were inserted into a variable that belongs to the PID library in
Arduino. The value obtained by the library is then used to set the duty cycle of the output
used to trigger the triac. As for the triac, the time it should be fired is found by the zero-
crossing detect circuit and it depends on the frequency of the input voltage supply.
The values obtained in circuit are send via NRF to the UNO Arduino which is connected
serially to the computer. The signals are inserted into the program of QT. The program
shows three waves, that of the set point, the current temperature, and the control signal.

4. Conclusion
This project demonstrated the use of PWM and traic to control the power applied to the
heater. The PID was used to control the duty cycle of the PWM through using the current
and set temperature values, and the PID terms found using manual tuning. The circuit
implemented in this project can be used to control other devices like lamps and fans, and
is an efficient way to save power.

You might also like