UNIVERSITI TEKNIKAL MALAYSIA MELAKA
CONTROL SYSTEM DESIGN FOR TEMPERATURE ALERT
SYSTEM
This report submitted in accordance with requirement of the Universiti Teknikal
Malaysia Melaka (UTeM) for the Bachelor Degree of Manufacturing Engineering
(Robotic and automation) with Honours
by
NOOR HISHAM BIN MOHAMAD SAID
B050810184
FACULTY OF MANUFACTURING ENGINEERING
2011
UNIVERSITI TEKNIKAL MALAYSIA MELAKA
BORANG PENGESAHAN STATUS LAPORAN PSM
TAJUK: Control System Design for Temperature Alert System
SESI PENGAJIAN: 2010/11 Semester 2
Saya NOOR HISHAM BIN MOHAMAD SAID
mengaku membenarkan tesis (PSM/Sarjana/Doktor Falsafah) ini disimpan di Perpustakaan Universiti Teknikal Malaysia Melaka (UTeM) dengan syarat-syarat kegunaan seperti berikut:
1. Tesis adalah hak milik Universiti Teknikal Malaysia Melaka dan penulis. 2. Perpustakaan Universiti Teknikal Malaysia Melaka dibenarkan membuat salinan
untuk tujuan pengajian sahaja dengan izin penulis. 3. Perpustakaan dibenarkan membuat salinan tesis ini sebagai bahan pertukaran
antara institusi pengajian tinggi.
4. *Sila tandakan (√)
SULIT
TERHAD
TIDAK TERHAD
(Mengandungi maklumat yang berdarjah keselamatan atau kepentingan Malaysia yang termaktub di dalam
AKTA RAHSIA RASMI 1972)
(Mengandungi maklumat TERHAD yang telah ditentukan
oleh organisasi/badan di mana penyelidikan dijalankan)
(TANDATANGAN PENULIS)
Alamat Tetap: NO 15 JALAN DR 2, TAMAN DUYONG RIA 75460 MELAKA, MELAKA.
Tarikh: _______________________
Disahkan oleh:
(TANDATANGAN PENYELIA)
Cop Rasmi:
Tarikh: _______________________
* Jika tesis ini SULIT atau TERHAD, sila lampirkan surat daripada pihak berkuasa/organisasi berkenaan
dengan menyatakan sekali sebab dan tempoh tesis ini perlu dikelaskan sebagai SULIT atau TERHAD.
DECLARATION
I hereby declare that this report entitled “Control System Design for Temperature Alert
System” is the result of my own research except as cited in the references.
Signature :
Author’s Name : Noor Hisham bin Mohamad Said
Date : 19 MAY 2011
APPROVAL
This report is submitted to the Faculty of Manufacturing Engineering of UTeM as a
partial fulfillment of the requirements for the degree in Bachelor of Manufacturing
Engineering (Robotic and Automation). The members of the supervisory committee are
as follow:
……………………………………
(Madam Nur Aidawaty Binti Rafan)
Main Supervisor
Faculty of manufacturing Engineering
i
ABSTRAK
Dalam sistem kejuruteraan suhu merupakan pembolehubah fizikal yang perlu dipantau
dan dikawal. Sebagai contoh, sensor suhu digunakan di gedung-gedung, kilang
pemprosesan kimia, mesin, komputer, kenderaan, dan lain-lain. Suhu yang amat tinggi
boleh merosakkan kualiti dalam sesuatu sistem, sedangkan suhu rendah pula
menyebabkan pembakaran dalam masa yang lama. Dengan meningkatkan kualiti sistem
kawalan boleh mengawal suhu dengan mencapai bacaan yang memuaskan. Projek ini
lebih tertumpu kepada sistem kawalan reka bentuk dengan menggunakan simulasi pada
perisian MATLAB. Kaedah yang digunakan adalah berdasarkan rekaan pengawal PID,
yang meningkatkan konsisten ralat dan tindak balas sementara secara bebas. Projek ini
juga melibatkan analisis unsur-unsur sistem kawalan dengan membezakan nilai
konsisten ralat dan tindak balas sementara (masa puncak, masa naik, masa penetapan)
hasil daripada graf simulasi daripada input unit langkah untuk pampasan dan terpampas
sistem. Satu daripada objektif reka bentuk sistem kawalan adalah proses penstabilan
oleh itu, analisis sistem diteruskan dalam istilah kestabilan supaya mencapai objektif
dengan mencari julat (K) supaya sistem itu akan beroperasi samada system stabil, tidak
stabil atau hampir-hampir stabil supaya proses yang dilakukan akan beroperasi dalam
keadaan yang sebaik mungkin
ii
ABSTRACT
In many engineering systems temperature constitutes an important physical variable that
needs to be monitored and controlled. For example, temperature sensors are present in
buildings, chemical processing plants, engines, computers, vehicles, etc. A very high
temperature may destroy the qualities of the some system, while a low temperature may
result in long burning time. By enhancing quality of control system can make the
controlled temperature reach a satisfactory point. This project will focus primarily on
the design control system by using simulation on MATLAB software. The method is
based on the designing the PID controller, which improving the steady-state error and
transient response independently. This project also involves analysis the elements of
control system by differentiate the value of steady-state error and the transient response
(peak time, rise time, settling time) from the simulation graft of unit step input for the
uncompensated and compensated system. The one objective of control system design is
process stabilization so that the analysis of the system will continue in term of stability
to achieved the objective by finding the range of the gain (K) in the systems so that, the
system will operate either stable, unstable or marginally stable in order to processes
operates in the best possible way.
iii
DEDICATION
I dedicate this PSM thesis to my beloved parents, my lovely brothers and sisters, friends
and colleagues, not forgot UTeM’s lecturers.
iv
ACKNOWLEDGEMENT
In the name of Allah, invocation and greetings to adoration of Nabi Muhammad
(S.A.W.), thanks to God because giving me strength and patience in finishing this final
year project and thesis writing on time. Alhamdulillah. Firstly I would like to express
my appreciation to my supervisor Puan Nur Aidawaty Rafan for her guidance, advice
and continuous encouragement in process of completing my project successfully.
Besides that, a lot of cooperation to all staff and officer at Manufacturing Lab that help
me had done my experiment. I would also want to express my thankfulness to my
beloved parents for never ending support, advice and encouragement since childhood
until now. May your love and support will never be gone until the end of my life. For
UTeM’s lecturers who have taught me, thank you for giving me precious and valuable
knowledge. For my friends and my classmates, thanks for your cooperation, support and
help throughout these 3 years in UTeM. Thank you so much.
v
TABLE OF CONTENT
Abstrak i
Abstract ii
Dedication iii
Acknowledgement iv
Table of Content v
List of Tables x
List of Figures xi
List of Abbreviation xv
1. INTRODUCTION
1.1 Background 1
1.2 Problem Statement 2
1.3 Project Objective 3
1.4 Project Scope 4
1.5 Project Planning 5
2. LITERATURE REVIEW
2.1 Introduction 7
2.2 Temperature Sensor 7
2.2.1 Selecting a Temperature Sensor 8
2.2.2 Thermocouple Temperature Sensor 8
2.3 Time Response 10
2.3.1 Natural Frequency 12
2.3.2 Damping Ratio 12
2.3.3 Underdamped Second-Order Systems 13
2.4 Stability System 16
2.5 Steady-state Error 17
vi
2.5.1 Application to Stable Systems 18
2.5.2 Evaluating Steady-State Error 18
2.5.3 Sources of Steady-State Error 19
2.6 Temperature Control 20
2.6.1 Ideal Integral Compensation (PI) 20
2.6.2 Ideal Derivative Compensation (PD) 21
2.6.3 Proportional Integral Derivative (PID) 22
2.7 Computer Aided Design 23
2.7.1 MATLAB Software 24
2.8 Temperature Control Application by means of a 25
PIC16F877 Microcontroller
2.8.1 Introduction 25
2.8.1.1 The Heat Control System 25
2.8.1.2 Input Layer 26
2.8.1.3 Output Layer 27
2.8.2 Control Methods 29
2.8.2.1 Stages of Digital PID Controller Design 29
2.8.2.2 Stages of Fuzzy Controller Design 30
2.8.3 Control Program 32
2.8.4 Experimental Results 33
2.8.4.1 Result of PID Control 33
2.8.4.2 Result of Fuzzy Control 34
2.8.5 Conclusion 35
3. METHODOLOGY
3.1 Introduction 36
3.2 Project flow planning 36
3.3 Literature Stage 46
3.4 Experiment: At Machining Process (Press Drill Machine) 38
3.5 Design Stage 38
vii
3.6 Comparison and Analysis Stage 39
3.7 Tool and Equipments 39
3.7.1 Thermocouple type –K 40
3.7.2 Vernier Lab Pro 40
3.7.3 Logger Pro 3 41
3.7.4 Workpiece for Experiments 41
4. DESIGN AND DEVELOPMENT
4.1 Introduction 43
4.2 Conceptual Design 43
4.2.1 Software Design 44
4.2.2 Importing data 44
4.2.3 Building the Block Diagram 48
4.2.3.1 Block diagram representation of control systems 49
4.2.3.2 Control system operation 50
4.2.4 Designing PID Controller 51
4.2.4.1 MATLAB programming for design PID Controller 52
4.2.5 Static Error Constants 54
4.2.5.1 System Type 55
4.2.5.2 MATLAB Programming for Steady-state Error 56
4.2.6 Stability Design of the system 56
4.2.6.1 Generating a Basic Routh Table 57
4.2.6.2 MATLAB Programming for analysis the stability by using 59
RH Table
5. RESULT AND DISCUSSION
5.1 Introduction 60
5.2 Project Finding 60
5.3 Experimental for This Project 61
5.4 Experiment by using Aluminum Material 62
viii
5.4.1 Transfer Function of the System (Aluminum) 62
5.4.2 Block Diagram of the System (Aluminum) 63
5.4.2.1 MATLAB Command to find the Transfer Function 64
(Aluminum)
5.4.2.2 Reduction of the Block Diagram (Aluminum) 64
5.4.3 Controller of the System (Aluminum) 65
5.4.4 Steady-state Error of the System (aluminium) 73
5.4.5 Characteristics between Uncompensated, PD and PID 76
(Aluminium)
5.4.6 System Stability of Aluminium 77
5.5 Experiment by using Mild Steel Material 82
5.5.1 Transfer Function of the System (Mild steel) 82
5.5.2 Block Diagram of the System (Mild steel) 83
5.5.3 Controller of the System (Mild steel) 83
5.5.4 Steady-state Error of the System (Mild steel) 86
5.5.5 Characteristics between Uncompensated, PD and PID 89
(Mild Steel)
5.5.6 Stability of the System of Mild Steel 90
5.6 Experiments to Measure Car Engine Block 92
5.6.1 Transfer Function of the System (Car Engine Block) 92
5.6.2 Block Diagram of the System (Car Engine Block) 93
5.6.3 Controller of the System (Car Engine Block) 93
5.6.4 Steady-state Error of the System (Car engine block) 96
5.6.5 Characteristics between Uncompensated, PD and PID 99
(Car engine block)
5.6.6 Stability of the System of Mild Steel 100
6. CONCLUSION AND RECOMMENDATION
6.1 Conclusion 102
6.1.1 Limitation 103
6.2 Recommendation and Future Work 103
ix
REFERENCE 105
APPENDIX
A Data for Temperature Reading 107
B MATLAB Programming 110
x
LIST OF TABLES
2.1 Temperature Sensors 8
2.2 Test waveforms for evaluating steady-state errors of position control
systems
17
4.1
4.2
4.3
4.3
Correlation kp, ki and kd to the characteristic of the system
Relationships between input, system type, static error constants, and
steady-state errors
Initial layout for Routh Table
Completed Routh table
51
56
57
58
5.1
5.2
5.3
5.4
5.5
5.6
5.7
5.8
5.9
5.10
5.11
Predicated characteristic for uncompensated, PD-, and PID-
compensated system of Aluminum
Routh table for Aluminum
Routh table for Aluminum with K= -468.7
Routh table for Aluminum with K= -78.75
Summary of pole location for Aluminum
Predicated characteristic for uncompensated, PD-, and PID-
compensated system of Mild Steel
Routh table for Mild steel with K= -78.75
Summary of pole location for Mild steel
Predicated characteristic for uncompensated, PD-, and PID-
compensated system of CEB
Routh table for Car engine block with K= -67.5
Summary of pole location for Aluminum
76
78
79
79
80
89
90
91
99
100
101
xi
LIST OF FIGURES
1.1
1.2
1.3
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.21
2.22
The General Control System
Gantt chart for PSM 1
Gantt Chart for Overall Project PSM I and II
A thermocouple circuit
Comparison of thermocouple junction mounting
Step response for second-order system damping case
Second order system, pole plots and step response
Second-order response as a function of damping ratio
Second-order underdamped response specifications
Steady-state error
PI Controller
PD Controller
PID Controller
Block Diagram of the Control System
Heat Sensor and Measurement Amplifier
Crystal and Voltage Supply Connections
2-2R Ladder Scheme
Pulse Width Modulator
Triac Trigering Circuit
Circuit of the LCD Driver
Block Diagram of a Closed Loop Digital Controller
Membership Functions for E
Membership Functions for Offset Change of Heat
Membership Functions of the Variable That Adjusts the Fan’s
Speed
Flowchart of the control program
2
5
6
9
9
10
11
13
14
19
21
22
23
25
26
26
27
27
28
29
30
31
31
32
32
xii
2.23
2.24
2.25
3.1
3.2
3.2
3.4
3.5
4.1
4.2
4.3
4.4
4.5
4.6
4.7
4.8
4.9
4.10
4.11
4.12
4.13
4.14
5.1
5.2
5.3
5.4
Graph of System’s heating
PID Control Result
Fuzzy Control Result
Methodology flow chart
Thermocouple Type K
Vernier Lab Pro
Vernier Logger Pro
Aluminium hollow box and mild steel bar
Current Window in MATLAB
Import Wizard window in MATLAB
Array Editor Window in MATLAB
Plotting option in MATLAB
Transfer function of plotting data
Temperature Control system
Block Diagram representation of a Temperature Control System
Programming for uncompensated system
Programming for PD-compensated system
Programming for PID-compensated system
Transfer function
Programming for Steady-state error
Equivalent closed-loop transfer function
Programming for stability system
Experiment at Press Drill machine
Graft Temperature VS Time for Aluminum
Block diagram of the total system for Aluminum
MATLAB command of the total system for Aluminum (Transfer
function)
33
34
35
37
40
40
41
42
45
46
47
47
48
49
51
52
53
53
55
56
57
59
61
62
63
64
xiii
5.5
5.6
5.7
5.8
5.9
5.10
5.11
5.12
5.13
5.14
5.15
5.16
5.17
5.18
5.19
5.20
5.21
5.22
5.23
5.24
5.25
5.26
5.27
5.28
5.29
Transfer function of the total system for Aluminum
Uncompensated feedback control system for Aluminum
Root locus for uncompensated system of aluminum
Coding to find Root locus for uncompensated system of aluminum
Zoom view of Root locus for uncompensated system of aluminum
Calculating the PD compensator zero for aluminum
Root locus for PD-compensated system of aluminum
Coding to find Root locus for PD-compensated system of aluminum
Root locus for PID-compensated system of aluminum
Coding to find Root locus for PID-compensated system of
aluminum
Step responses for uncompensated, PD-, and PID-compensated
system of Aluminium
Coding for steady-state error of uncompensated system (aluminum)
Coding for steady-state error of PD-compensated system
(aluminum)
Coding for steady-state error of PID-compensated system
(aluminum)
Coding for analysis the stability by using RH Table (Aluminum)
Pzmap for the stability system of Aluminum
Pzmap for the unstable system of Aluminum
Pzmap for the marginally stable system of Aluminum
Graft Temperature VS Time for Mild steel
Uncompensated feedback control system for Mild steel
Coding for Uncompensated system of Mild steel
Coding for PD-compensated system of Mild steel
Coding for design PID-compensated system of Mild steel
Root locus and Step Response of Uncompensated, PD- and PID-
uncompensated for Mild steel
Coding for steady-state error of uncompensated system (Mild steel)
64
65
66
66
67
68
69
69
70
71
72
73
74
75
77
80
81
81
82
83
83
84
84
85
86
xiv
5.30
5.31
5.32
5.33
5.34
5.35
5.36
5.37
5.38
5.39
5.40
5.41
5.42
5.43
5.44
Coding for steady-state error of PD-compensated system (Mild
steel)
Coding for steady-state error of PID-compensated system (Mild
steel)
Coding for analysis the stability by using RH Table (Mild steel)
Pzmap for the stable, unstable and marginally stable system of Mild
steel
Graft Temperature VS Time for Car Engine Block
Uncompensated feedback control system for Car Engine Block
Coding for Uncompensated system for Car engine block
Coding for design PD-compensated system for Car engine block
Coding for design PID-compensated system for Car engine block
Root locus and Step Response of Uncompensated, PD- and PID-
uncompensated for Car engine block
Coding for steady-state error of uncompensated system (Car engine
block)
Coding for steady-state error of PD-compensated system (Car
engine block)
Coding for steady-state error of PID-compensated system (Car
engine block)
Coding for analysis the stability by using RH Table (Car engine
block)
Pzmap for the stable, unstable and marginally stable system of Car
engine block
87
88
90
91
92
93
93
94
94
95
96
97
98
100
101
xv
LIST OF ABBREVIATIONS
PC - Personal Computer
RTD - Resistance Temperature Detector
PID - Proportional Integrated Derivative
PD - Proportional Derivative
PI - Proportional Integral
DC - Direct Current
AC - Alternative Current
VB - Visual Basic
GUI - Graphical User Interface
I/O - Input Output
CPU - Central Processing Unit
CU - Control Unit
PWM - Pulse Width Modulator
IEEE - The Institute of Electrical and Electronic Engineers
ADC - Analog Digital Computer
CEB - Car Engine Block
1
CHAPTER 1
INTRODUCTION
1.1 Background
Temperature control is an important issue in many industrial processes, e.g., electric-
resistance furnaces, crystal ovens, and heating boilers/tanks/barrels for various chemical
and metallic products. Such a thermal process usually shows an integrating response
characteristic during the heating stage, and after rising up to the set-point temperature, it
tends to behave in a stable manner given a certain heating range, due to air convection
or radiation loss into the environment. The main control challenges for such processes
are to avoid overheating (i.e., temperature overshoot) in the heating stage and to tightly
maintain the set-point temperature against load disturbances and process/environmental
variations. Furthermore, thermal processes typically have slow time constants and long
time delay, causing difficulties to control-system design. (Stanley M.Shinners, 1998)
The design procedure for designing a control system is an orderly sequence of steps.
Good engineering design is interdisciplinary and requires that the engineer first
thoroughly understand the customer’s requirements, the defined control system
specifications, the environment that the control system will operate in, the available
power, the schedule that it must be built in, and the available budget to do the job. Other
considerations are reliability and maintainability which may dictate the kind of motor to
use (i.e., electric motor or hydraulic motor). (Stanley M.Shinners, 1998)
2
The general control system as shown in figure 1.1 can be divided into the controller and
the machine. The controller can be divided into the control laws and the power
converter. The machine may be temperature bath, a motor, or as in the case of a power
supply, an inductor/capacitor circuit. The machine can also be divided in two: the plant
and the feedback device(s). The plant receives two types of signals: a controller output
from the power converter and the one or more disturbances. Simply put, the goal of the
control system is to drive the plant in response to the command while overcoming
disturbance. (George Ellis, 2000)
Figure 1.1: The General Control System (George Ellis, 2000)
1.2 Problem Statement
The most important parameter of some system is the temperature. For example, the
Catalyst regeneration process regenerates the catalyst of a chemical reactor. An
important variable, which is to be controlled, is the temperature of catalyst bed. A very
high temperature may destroy the qualities of the catalyst, while a low temperature may
result in long burning time. So, when the control system elements are introduced, the
system become more stable by maintaining the temperature reaches a satisfactory point.
3
Temperature is one of the most frequently used parameters in process measurements in
industry. There are many controllers can be used and one of the controller is PID.
Mostly heater using an on-off method of it was the simplest form on control. When the
heater is hotter than the set point temperature the heater is switch off completely. Based
on this method, the temperature is fluctuate and caused the temperature is not constant.
So based on this problem PID method has been used. PID controller provides a close
loop concept in system. This close loop system will ensure that there is no error at the
output. It will fix the error in order to reach the set point value. Three terms in this
controller will provide a good performance for the output. Each of this term has its own
contribution for the system. When these three terms is combining, the system will
perform more efficient and precise.
Once the system reached operating temperature, all we worried about was overheating.
Computers used to control system performance through all stages of temperature,
maintaining time constant and stability of system, sensitivity, accuracy and transient
response. When using PID controller, user can be easily tuning according to the system
requirement. Tuning is important in order to achieved good performance of the system.
If problem occurred or the system requirement change, user can set the new tuning easy
and faster.
1.3 Project Objective
i. Design the PID controller of Temperature Control System using the
simulation in MATLAB software according to the system requirement.
ii. Reduce the steady-state error of the system.
iii. Analysis the performance of designed control system such as the
stability of the system by adjusting the gain, K either the system is
stable, unstable or marginally stable.
4
1.4 Project Scope
This project will focus primarily on the design control system, so that processes operate
in the best possible way. Generally, complete control system may have controller and
machine. The controller will be used for this project is PID system that improves the
steady-state error and transient response independently. Then differentiate the steady-
state error for the uncompensated and compensated system for each process.
Once the PID controller are completely design, derive a proportional term, an
integration term and a derivative term from the resulting transfer function of the PID
compensator.
The improvements are focused on devising a new control technique that improves the
system behavior against any kind of disturbances by study the performance which
greatly improved the stability and control accuracy of the Temperature Alert System.
The performance of a control generally specified in terms of stability, steady-state error
and transient response.
5
1.5 Project Planning
Semester Break
Due Date
Plan
Figure 1.2: Gantt chart for PSM 1
Top Related