SlideShare ist ein Scribd-Unternehmen logo
1 von 111
Downloaden Sie, um offline zu lesen
Kurdistan Region-Iraq
Ministry of High Education and Scientific Research
Salahaddin University-Erbil
GUI Based Remote Control of (Gas Reduction System)
using PIC Microcontroller
A Thesis
Submitted to the Council of the College of Engineering at Salahaddin
University-Erbil in Partial Fulfillment of the Requirements for the Degree
of Master in Software Engineering
By
Essa Faiq Abdallh, B.Sc. in Computer Engineering- Al-Mustansuria University- 2006
Supervised by
Asst. Prof. Dr. Raghad Zuhair YousifAsst. Prof. Dr. Ayad Ghany Ismaeel
February 2012 A.D. Rabi Al Thani 1433 Al-H. Rashme 2711 K.
·]iàÄÑÁ“:Í€ˇËÑÌ‚G—2¬
]d:ÍfiÅflˇËÁ|:ÍhÏÑÜÏÊ˚:8âfiÜ:ÎÏÊÌflËɡËÁh:Ê
‡ËÄÄÌt˜Ìà:ΡÁ”fiÜGÖˇÈ÷ÊÌ‚
:‘ˇÈ÷ı�1fiˆ“:Ífi]flˇÈ‚Ñ]“Ìd:Ìd:Ü]∆:Í€ÈiâÈà:ÑÌàÌd:ÎÑÊÊÄ:Ìd:ÑÊÊÄ:Í÷ı1fiˆ“
›ÖöıÖl:ˆd:ˇÎÜ]âd
Ì“ÌËÌ⁄]fi::‡ËÄÄÌt˜Ìà:ΡÁ”fiÜ:Ì÷:ÏÊÖ“:ÎÑ]ËÜÅfiÌÒ:ÎÉÈ÷ˇÁ“:ÍfiÌ⁄Áß ÌÒ:ÍåÌ”çˇÈl–::‘ˇÈåÌd:’ÏÊ:ÖˇÈ÷ÊÌ‚
ÎÜ]à:›ÖöˇÊ�Öl:ÎÑ]ËÜÅfiÌÒ:Ì÷:ÑÌià]⁄:ÎÌ◊l:Ífi]flˇÈ‚:jàÏÄÌd:Ífi]“ÌÈiâËÊÅˇÈl:Ì÷
·Ì˘:Ì÷
! Åe¬:–Ò] :ÓâȬÎÑ]ËÜÅfiÌÒ:Ì÷:ãˇÁËÑˇÁ÷]“Ìd:F:Ê:ÖËÊÄÑ]‚:ÎÜ]à:›ÖöˇÊ�Öl:G:ÌÈËÖâfiÌiàÁ⁄:ΡÁ”fiÜG::::Å∆Ìd
2006
8åÑÌlÑÌàÌd
:
:
Ä:HÎ:HoÿȬ]3:9∆:Ä]Ë^:H:HÄ:HÎ:Ho:‫زھﯾر‬ ‫رﻏد‬‫ﯾوﺳف‬
åÏÑÌˇÍ⁄:::F2711:ÔÄÑÁ“:::::::::::::::::::::Í√ÈdÏÑ:ÄÊ›ÏÊ::F1433:ÓîˇÁ“::::::::::::::::::::::::::::k]dÁå:F2012:ÓflË:Ü:
‫ﻛﻮردﺳﺘﺎن‬ ‫إﻗﻠﯿﻢ‬–‫اﻟﻌﺮاق‬
‫اﻟﻌﻠﻤﻲ‬ ‫واﻟﺒﺤﺚ‬ ‫اﻟﻌﺎﻟﻲ‬ ‫اﻟﺘﻌﻠﯿﻢ‬ ‫وزارة‬
‫اﻟﺪﯾﻦ‬ ‫ﺻﻼح‬ ‫ﺟﺎﻣﻌﺔ‬–‫أرﺑﯿﻞ‬
‫ﻏﺎز‬ ‫ﺑﻤﻨﻈﻮﻣﺔ‬ ‫ﺑﻌﺪ‬ ‫ﻋﻦ‬ ‫اﻟﺘﺤﻜﻢ‬‫ﯾﺔ‬‫ﻟﻠﺒﺮﻣﺠﺔ‬ ‫ﻗﺎﺑﻞ‬ ‫ﻣﺘﺤﻜﻢ‬ ‫ﺑﺈﺳﺘﺨﺪام‬
‫رﺳﺎﻟﺔ‬
‫اﻟﺪﯾﻦ‬ ‫ﺻﻼح‬ ‫ﺟﺎﻣﻌﺔ‬ ‫ﻓﻲ‬ ‫اﻟﮭﻨﺪﺳﺔ‬ ‫ﻛﻠﯿﺔ‬ ‫إﻟﻰ‬ ‫ﻣﻘﺪﻣﺔ‬–‫ھﻨﺪﺳﺔ‬ ‫ﻓﻲ‬ ‫اﻟﻤﺎﺟﺴﺘﯿﺮ‬ ‫ﺷﮭﺎدة‬ ‫ﻧﯿﻞ‬ ‫ﻣﺘﻄﻠﺒﺎت‬ ‫ﻣﻦ‬ ‫ﻛﺠﺰء‬ ‫أرﺑﯿﻞ‬
‫اﻟﺒﺮاﻣﺠﯿﺎت‬
‫ﻗﺒﻞ‬ ‫ﻣﻦ‬
‫ﻋﺒﺪﷲ‬ ‫ﻓﺎﺋﻖ‬ ‫ﻋﯿﺴﻰ‬،‫ھﻨﺪﺳﺔ‬ ‫ﻓﻲ‬ ‫ﺑﻜﺎﻟﻮرﯾﻮس‬‫و‬ ‫اﻟﺤﺎﺳﺒﺎت‬‫اﻟﺒﺮاﻣﺠﯿﺎت‬–‫اﻟ‬‫ﺠﺎ‬‫ﻣﻌﺔ‬‫اﻟﻤﺴﺘﻨﺼﺮﯾﺔ‬–‫ﺑﻐﺪاد‬2006
‫ﺑﺈﺷﺮاف‬
.‫.د‬ ‫م‬ .‫أ‬‫ﯾﻮﺳﻒ‬ ‫زھﯿﺮ‬ ‫رﻏﺪ‬ .‫.د‬ ‫م‬ .‫أ‬‫اﺳﻤﺎﻋﯿﻞ‬ ‫ﻏﻨﻲ‬ ‫اﯾﺎد‬
‫ر‬‫ﺷﻤﻲ‬،2711‫ﻛﺮدي‬‫اﻟﺜﺎﻧﻲ‬ ‫رﺑﯿﻊ‬،1433‫ھﺠﺮي‬‫ﺷﺒﺎط‬،2012‫ﻣﯿﻼدي‬
Chapter One
Introduction
Chapter One Introduction
۲
Chapter One
Introduction
1.1 Motivation
The controlling and monitoring machines from remote location are very
important in these days due to increasing the factories and plants. The
automation systems and embedded control system are used when the accurate
and quick decision required, and when the human life being in hazard for doing
some jobs inside electrical power stations and chemical plants.
The purpose of this thesis is to design and implement a complete
embedded automation software system that can be used to control a Gas
Reduction System automatically through a GUI and from remote location by
using programmable interface controller (PIC16F877A).
The GRS (Gas Reduction System) is one of the units in a power station,
which is responsible on controlling gas pressure and gas temperature. The main
problem in GRS is that ,all operations of monitoring and controlling of GRS is
handled by technician (human driven control) who has some experience and
certain level of skill in the status that might the GRS machine undergoes
,hence this type of monitoring may subjected to human fault due to inaccuracy
of human driven control which involves taking wrong decisions or late
response to certain critical events ,taken in consideration that the monitoring
and control processes of GRS are done from far location (about 150m) from
GRS and control room.
The microcontrollers are widely used because microcontrollers are easy to
embed into larger electronic circuit designs. Their ability to store and run
unique programs makes them extremely versatile. For instance, one can
program a microcontroller to make decisions and perform functions based on
situations (I/O line logic) and events. The math and logic functions allow the
microcontroller to mimic sophisticated logic and electronic circuits.
A Microcontroller is an inexpensive single-chip computer; it means that
the entire computer system lies within the confines of the (Interacted Circuit
Chip). The microcontroller is capable of storing and executing programs (its
most important feature). the microcontroller contains a CPU (Central
Processing Unit), RAM (Random Access Memory) ROM (Read Only
Memory), I/O (Input/Output), lines , Serial and parallel ports ,Timers and some
times A/D (Analog-to-Digital) and D/A (Digital-to-Analog) Converters [1].
Chapter One Introduction
۳
The PIC16F877A is useful as a reference device because it has a minimal
instruction set but a full range of peripheral features. The general approach to
microcontroller application design in this thesis is to develop a design using a
chip that has spare capacity, and then later select a related device that has the
set of features most closely matching the application requirements.
The proposed system architecture, considering both the hardware and
software elements involved is essential in this new era.
Automation and remote control systems have been introduced to help and
protect workers from hazardous working environments [2].
The proposed system technology could be used as a cost effective and
more flexible way of monitoring and controlling GRS machine. The PIC
microcontroller can perform all functions and activities of the original system.
The block diagram of proposed system shown in figure (1.1), in which the
signals to/from GRS are exchanged with the PIC through I/O interfacing
circuits .Thus the PIC executes the instructions come from GUI and generate
control signals to control the proposed machine.
Figure (1.1) the block diagram of proposed system
In order to reduce the size, weight and power consumption of the
system, the PIC 16F877A (single chip Reduced Instruction Set Computer
(RISC) based architecture microcontroller) was chosen.
The final proposed system integrates both H/W and S/W sub-systems
aiming to convert all operations which were done manually by human to full
computerized operation from remote location through a special GUI.
Chapter One Introduction
٤
1.2 Introduction to GRS machine
The GRS is a Gas Reduction System which is designed to receive the
natural gas from the incoming gas pipeline, treat and condition the gas to meet
the operating conditions specified by the manufacturer of the gas consumers.
The GRS works in power station, the power station use the output of GRS as a
fuel to operate the power station.
1.2.1 Elements of GRS Machine
The GRS consist of the following elements:
1. Separator System The main purpose of the fuel gas
filter/separator removes solid contaminants and liquid (condensed
gas constituents) from the incoming gas flow. The filter elements
are designed for continuous operation with max. 60°C.
2. Boilers The purpose of boilers is used to providing the desired
heating for the water system.
3. Pressure Regulating The pressure of Gas can be regulate
through adjusting valve into desired value.
4. Hot Water System The hot water system produces hot water for
the gas heating system.
5. Local Control Panel The local control panel receives all status
and alarm signals from the fuel gas supply system.
1.2.2 GRS Functional Description
To heat up the fuel gas for the power station, a hot water system is
used as a heat transfer medium. The hot water circuit is designed for a flow
temperature of 90°C and a return temperature of 70°C. Natural fuel gas is
applied as heating medium. The heat is generated by means of a hot water
heater and a forced draft burner. The flue gas is conducted to a chimney. The
hot water is circulated by an electrically driven pump, while the gas pressure is
regulate through mechanical adjusting valve.
1.3 Embedded Software System Technique
Embedded systems are finding widespread application including
communication systems, factory automation, graphics and imaging systems,
medical equipment and even household appliances. With the increasing
emergence of mixed hardware/software systems, it is important to ensure the
correctness of such a system formally, particularly for real-time and safety
critical applications. The embedded system is regarded as a product which
contains a microprocessor programmed to carry out some control functions but
which is not a computer [3]. An embedded system encompasses a broad class
Chapter One Introduction
٥
of systems, ranging, in principle, from a simple microprocessor based
apparatus to complex systems controlling large plants, aircrafts and the like, in
general the embedded is [4]:
(1) An embedded system is an electronic system embedded within a given
plant or external process. The external process comprises both a physical
system (usually consisting of different subsystems) and also humans
performing some supervising or parameter setting tasks.
(2) Most embedded systems must fulfill stringent reliability requirements,
usually detailed according to a set of functions to be performed.
1.4 Difference between Microprocessor and Microcontroller
Essentially these two devices are similar, but with a little bit of
difference. A CPU which is the heart of these devices needs a host of external
devices to make it communicate with real-world.
A typical system would need a system to read the inputs from keyboard,
and write outputs to a terminal, store intermediate processing data into some
memory, and to keep permanent information into some safe place [5].
These devices which are independent circuits, work in harmony with the
CPU, to make one system. In a typical Personal Computer these devices are
attached to the CPU, using hard-wired connections. This makes the system
more flexible that means it can add more memory, change capacity of hard
drives, sound cards etc. A microcontroller on the other hand is made up of most
of these devices built exactly within the same package. The microcontroller
will therefore contain, the CPU, RAM, ROM, Timers, I/O etc. all packed
within one integrated circuit. This facilitates the development process, as well
as reduces the requirements of external components; however this also means
the ability of changing, the number and type of integrated devices. The
applications where a microcontroller will be used vary.
They are usually quite simple, and do not require as much processing
power as a PC does, so the microcontrollers with varying amounts of RAM,
ROM, I/O lines and timers etc have been made available. Essentially all are
almost same, and they only vary in the number of resources available on them.
So for a particular application that chose a microcontroller, not the one which
has maximum resources, but the one which has just enough to do the job.
Figure (1.2) shows the microprocessor and the microcontroller [6].
Chapter One Introduction
٦
Figure (2.1) the microprocessor and microcontroller
Figure (1.2) microprocessor and the microcontroller
Thus a microcontroller is a complete, small scale computer with all the
necessary devices on-board. All needed is the external hardware, which can be
used to drive, like sensors and motors etc.
1.5 Literature Survey
• Rajesh Luharuka, Robert X. Gao, Sundar Krishnamurty [7] have
discussed a microcontroller-based portable data logger for physiological
sensing. The device is configured to receive skin conductance data from
a commercial instrument, store them on its on-board memory, and relay
them to a computer via the RS-232 serial port. The focus of the design is
on portability and low power consumption for battery-driven ambulatory
applications. A PIC microcontroller was used as the central control unit
for the data flow coordination.
• Mohd Suhaimi B. Sulaiman [8] developed GUI Based Remote On/Off
Control and Monitoring Single lamp Phase. The proposed system
developed by a PIC 16F877 microcontroller. The software uses Visual
Basic to monitor and control the lamps. This project explain how to
develop and design an asynchronous serial data communication link
Chapter One Introduction
۷
between the site and central station using a microcontroller and to build
a low cost GUI based remote on/off control.
• Mohd Noor [9] Proposed a method for monitoring the Water Level and
Temperature Status by utilized the PIC16F877 and MPLAB IDE
software for programming. The project was designed to detect level and
temperature of the water in a pool. The system functions when the level
of water and the temperature in pool exceed the desired limits.
• Lock K.A [10] developed a system that controls a switch for lamp, door
and alarm system using Visual Basic software. Visual Basic was chosen
because it can easily communicate between computer and mobile phone.
The system used computer and mobile phone to send and receive the
text messages.
• Ea Ai Choon [11] showed the DC motor speed control system by using
microcontroller PIC 16F877A. It is a real time control system. A
program in Visual Basic 6.0 is developed to provide a graphic user
interface (GUI) for the user to enter desired speed at computer ,also the
system shows a graph of motor speed versus time to let the user monitor
the performance of the system easily.
• Herdawatie A. Kadir [12] investigated the GSM-based one of the main
source of power of energy to operate control home appliances for smart
home such as light, air conditioner etc. The system was integrated with
PIC16F877A, the microcontroller unit automatically controls the
electrical home appliances by switching ON or OFF the device
according to the user order.
• R. Garrido and R. Miranda [13] proposed a new method for closed
loop identification of position controlled dc servomechanisms. The loop
around the servo is closed using a Proportional Derivative (PD)
controller. A model of the servo is simultaneously controlled using a
second PD controller. Properties of the identification scheme are studied
using Lyapunov stability theory.
• W. Aung [14] described the analysis on modeling and simulink of DC
motor and its driving system, hardware and software. For DC Motor
Modeling, it can be analyzed with control techniques of Step response,
Impulse response and Bode plot by using MATLAB Simulink. All data
based on the internal circuit of a simple DC Motor and its features can
be analyzed both by Control System design calculation and by
MATLAB software.
Chapter One Introduction
۸
• Hanafi et al., [15] presented an active axis controller for a conventional
CNC machine. To develop the system, a two-stage approach has been
taken. In stage one; a generic external axis controller is designed to
bring the machine under the real-time control of an external computer.
Stage two is the design of the active axis controller. To achieve this, a
sensor feedback loop is added to the external controller to enable visual
servoing.
• Konar and A.K. Mandal [16] had given a microprocessor based
automatic position control scheme. They had designed for controlling
the azimuth angle of an optimally tilted photovoltaic flat type solar
panel or a cylindrical parabolic reflector to get the illuminating surface
appropriately positioned for the collection of maximum solar irradiance.
The proposed system resulted in saving of energy.
• Zeroual et al. [17] had designed an automatic sun-tracker system for
optimum solar energy collection. The system used the electro-optical
sensors for sun finding and a microcontroller unit for data processing
and for control of the mechanical drive system. This system allowed
solar energy collectors to follow the sun position for optimum
efficiency. The system had been tested for a long period in variable
illumination. The result showed that it operated satisfactorily with high
accuracy.
• Dogan Ibrahim. [18] had developed a Microcontroller-Based
Temperature Monitoring the Control system involved the use of
microcontrollers in measurement and control systems .The system
implemented by using a GUI based on visual basic and programming
the PIC16F877A using the C-language.
• Theerawut Jinayim et al. [19] proposed an efficient low power
consumption tracking solar cells for white LED-based lighting system in
2007. In this system, they used the dc power generated by fixed solar
cells module to energize white LED light sources that were operated by
directly connected white LED with current limitation resistors.
• Craig Steiner [20] discussed about the 8051 family of microcontrollers.
In addition to the types of memory, special function registers, basic
registers, basic registers, addressing modes discussed in this tutorial
additional features including introduction to 8052 and timers are also
described.
Chapter One Introduction
۹
1.6 Aim of Thesis
The aim of the work is to design and implement a remote control system
that works from PC based on Windows platform, performed successfully
transmitting and receiving the data between the computer and the PIC
microcontroller, through GUI for controlling and monitoring the GRS machine
to satisfy the following goals:
1. Convert all the manually control operations of GRS machine into
computerized operations.
2. Monitoring and controlling of the GRS machine from remote location
through GUI.
3. Limiting the probability of Fault and error in the system.
4. Add automatic operation mode as a command Push button to the GRS
machine in the GUI which allow automatic operations without human
interactions.
5. Simulate the local manual control panel of GRS machine in to similar
view but in software package form as a GUI for the system operator.
6. Designing and implementing an integration software and hardware
proposal system.
1.7 Thesis Outline
This thesis is organized in five chapters. The contents of the following
chapters are briefly reviewed here as follows:
Chapter two: This chapter devoted to preliminary work required for
implementation of the GUI Based Remote Control of (Gas Reduction System)
using PIC Microcontroller and embedded software system that accessed and
automated by a prorate GUI by using a PIC microcontroller, Several hardware
and software related issues are customizing tools and devices for
implementation are treated in this chapter.
Chapter three: provides details for the implementation of the final
integration hardware and dual software programming techniques, also this
chapter describes the steps of design and implementation step by step which
lead to implement a proposed intelligent system that able to convert the manual
operations of GRS which were done by human manually into full computerize
operations, and from remote location.
Chapter One Introduction
۱۰
Chapter four: presents the system experimental test and results , this
chapter illustrates the real implementation and testing performed by connecting
the final integration H/W and S/W with the GRS machine to replace the
manual traditional operations of GRS machine, also in this chapter the
oscilloscope waveforms of the input and the output signals have been
presented.
Chapter five: The final conclusions have been made from the design stages
test and system results. Finally some highlights on some future works have
been presented.
Appendix A: The data sheet for PIC 16F877A
Appendix B: The data sheet for PIC Programmer
Appendix C: The data sheet for transistor type (2N3904)
Chapter Two
Hardware and Software
Components for Controlling
GRS
Chapter Two Hardware and Software Components for Controlling GRS
Chapter Two
Hardware and Software Components for Controlling
GRS
2.1 Introduction
The GRS system is a unit in electrical power station which is responsible on
controlling gas pressure and temperature. This chapter focuses on some key
devices and tools (H/W and S/W) used for monitoring & controlling The (GRS)
unit. A detailed description is presented for (PIC16F877A) Microcontroller which
is the core of proposal embedded system for implementing a full computerize
control from remote location that is compatible with aspects of a (GRS) .Finally
the embedded software system is accessed and automated by a prorate GUI ,this
GUI(built in Visual Basic) is presented and explained in details.
2.2 Overview of GRS System
The GRS is a Gas Reduction System which is used to control the gas
pressure and the gas temperature, the GRS works in Erbil power station, the power
station uses the output of GRS as a fuel to operate the power station, the GRS
system is shown in figure (2.1)
Figure (2.1) view of GRS system
12
Chapter Two Hardware and Software Components for Controlling GRS
The GRS system contains boilers for heating inlet gas into desired set point.
Figure (2.2) shows the local control panel inside GRS system.
The GRS control panel contains two types of digital signals the first one
involves LED Light Emitting Diodes as a signals indicators while the second type
involves the ON-OFF switches.
There are three types of LED indicators; Green LEDs refer to the normal
operations, Red LEDs to indicate fault or alarm cases, and Yellow LEDs for event
of proper operation.
Whereas, the ON-OFF switches consist of two types of switches the push
buttons switches, and mode selector switches.
Figure (2.2) local control panel of GRS
13
Chapter Two Hardware and Software Components for Controlling GRS
The main problem in GRS is that ,all operations of monitoring and
controlling of GRS are handled by technician (human driven control) who has
some experience and certain level of skill in controlling GRS machine ,this type
of monitoring may subjected to human fault due to inaccuracy of human driven
control which may include wrong decisions or late response to certain critical
events ,taken in consideration that the monitoring and control processes of GRS
are done from far off location about(150m) from GRS and control room.
Hence the computer driven control for GRS system is achieved by using
dual software programming techniques, each techniques works in a different
software level of proposed system, the first level of software programming
technique is the embedded software which used for programming the PIC
microcontroller by using C-language that default software debugs environment of
the PIC manufactory cooperation.
The second level of software programming technique include designing
special graphical interfacing GUI by using Visual Basic which enables remote
controlling and monitoring of GRS because of the final GUI is similar to the real
control board panel of GRS , so the operator will not find it strange from the panel
he used to work on with added facilities like automatic control mode which is
derived from the idea of the auto-pilot navigation system presented in aircraft that
enables the pilot to suspend manual control and activate automatic control.
In the presented controller, this mode is activated by clicking special push
button (Automatic System mode) that allows automatic operation of GRS system.
Hence, this interactive interfacing media for the operator (human) facilitate the
controlling of GRS and reduce the faults and errors space in the system operation.
The final system integrates both of H/W and S/W system to convert all
operations which were done manually by human to full computerize operation and
from remote location.
2.3 GRS System Control Status
The sequences of events for GRS are described in the flow chart depicted in
figure (2.3). The initial status represent the last events happened in the GRS
system, the system saves the recent status unless the system status changed by the
operator.
14
Chapter Two Hardware and Software Components for Controlling GRS
The following flow chart in figure (2.3) depicts the manual control
operations of GRS by classifying these operations to the following actions:
starting, resetting, checking, monitoring operation.
Figure (2.3) Flow chart of GRS operations
Reset Fault
Boiler Ready to start ?
Starting Sequence of Events
Boiler started?
Assign certain Set Point(SP)
Actual Tempreture <= SP
Increasing bolier tempreture
Boiler temp>2*SPBoiler tempreture<2*SP||Boiler tempreture >SP
Boiler Tempreture<SP
Trip the Boiler
Check Conditions
Stop incresing boiler tempreture
NO
Yes
Yes
YesYes
Yes
Yes
NO
NO
NO
NO
NO
Initial status
Energized main power Manually
15
Chapter Two Hardware and Software Components for Controlling GRS
Before staring GRS machine the operator must identifies errors and faults
in system results from its previous operation .Errors and faults must be handled
with a suitable action. Then after the operation of energizing main power is
started, any faults and errors result from this operation will be rested by pushing
the rest push button, in order to prepare the GRS for entering its ordinary sequence
of operation.
The system becomes ready to start if there is no fault or an error in the GRS
machine after the completion of resetting action, if the system not ready to start
the checking and resetting actions should be repeated again.
Then after the boiler of GRS system starts its action, for that some desired
temperature should selected as a temperature set point, the range of temperature
set point is extended from (0-100) Cº centigrade degree . According to the set
point value, the system starts to increase or decrease its temperature, by comparing
the desired set point (selected previously) with the actual current temperature.
If the actual temperature of GRS boiler less than the set point temperature
the sequence process starts increasing the temperature to reach the desired
temperature. Then if the actual temperature equals to the set point temperature the
sequence of process waits till temperature drop.
When the actual temperature of GRS boiler is very high (high-high) more
than (100) Cº temperature, the sequence of process stops immediately the
increment of temperature and shut downing the GRS boiler to prevent the hazards.
After system stopping, the check (maintenance) phase is activated to handle the
fault, and then reset the system to enable it to restart again.
If the actual temperature of GRS boiler is higher than the set point
temperature (high-statues), the sequence of process waits till the actual
temperature of GRS boiler decrease to the level less than set point temperature.
In the case where the actual temperature of GRS boiler is less than the set
point temperature, the system fault should reset manually by human to enable the
boiler of GRS to start again. Else the sequence of process waits for temperature
dropping.
16
Chapter Two Hardware and Software Components for Controlling GRS
2.3 Microcontrollers
A microcontroller is defined as an integrated circuit (IC) which consists of
a processor core (CPU), non-volatile program memory which is either ROM or
flash, volatile memory for the input/output peripherals, a clock and the control unit
for input/output (I/O)[ 2,4]
A Microcontroller is an inexpensive single-chip computer; Single chip
computer mean that the entire computer system lays within the confines of the
(Interacted Circuit Chip).The microcontroller is capable of storing and running a
program (its most important feature). The microcontroller contains a CPU (Central
Processing Unit), RAM (Random Access Memory) ROM (Read Only Memory),
I/O (Input/Output), lines , Serial and parallel ports ,Timers and some times A/D
(Analog-to-Digital) and D/A (Digital-to-Analog) Converters . [21]
A generic view of a microcontroller is shown in Figure (2.4) a special
category of microprocessor emerged that was intended for control activities, not
for crunching big numbers. After a while this type of microprocessor gained an
identity of its own, and became called a ‘microcontroller’. The microcontroller
took over the role of the embedded computer in embedded systems. [22]
Figure (2.4) a generic microcontroller
The microcontrollers are widely used because microcontrollers are easy to
embed into larger electronic circuit designs. Their ability to store and run unique
17
Chapter Two Hardware and Software Components for Controlling GRS
programs makes them extremely versatile. For instance, one can program a
microcontroller to make decisions and perform functions based on situations (I/O
line logic) and events. The math and logic functions allow the microcontroller to
mimic sophisticated logic and electronic circuits. [23]
2.3.1 PIC Microcontroller
PIC is a family of Harvard architecture microcontrollers made by
Microchip Technology. The name PIC initially referred to "Programmable
Interface Controller” [24]
2.3.2 Harvard architecture of the PIC microcontroller
Harvard architecture is newer concept than Von-Neumann’s. It rose out of
the need to speed up the work of the microcontroller. In Harvard architecture, data
bus and address bus are separate. Figure (2.5) shows the Harvard architecture
versus von-Neumann. Thus a greater flow of data is possible through the central
processing unit, and of course, a greater speed of work. [3, 25]
Figure (2.5) Harvard and Von-Neumann's architecture
Separating a program from data memory makes it further possible for
instructions not to have to be 8-bit words. PIC 16F877A uses 14 bits for
instructions which allows for all instructions to be one word instructions. [22]
18
Chapter Two Hardware and Software Components for Controlling GRS
It is also typical for Harvard architecture to have fewer instructions than
Von Neumann’s and to have instructions to be executed in one cycle. The major
advantage with this architecture is that while an instruction is being executed the
next can be fetched .The execution speed is doubled. This architecture has been
found in PIC16F877A. PIC uses Harvard architecture, so the size of an instruction
can be different from the size of the data.[25]
2.4 Types of Internal Memory of PIC microcontrollers and
PIC Family
In general the PIC microcontroller may be contained three Types of internal
memory : PIC XX C XXX(Mean EPROM) ,PIC XX CR XXX (Mean ROM) ,PIC
XX F XXX(Mean FLASH MEMORY) [26].
2.4.1 Families of PIC microcontrollers
The PIC microcontrollers can be classifying into three Families, Table (2.1)
shows a comparison among 8-bit PIC families The Three Families are [22]:
2.4.1.1 Baseline family
The baseline PIC microcontroller family represents the most direct
descendant of the General Instruments ancestors, and displays the core features of
the original PIC design.
The first Microchip baseline microcontrollers were coded 16C5X,
following the General Instruments 1650 and 1655 numbering. Now, however,
there are also 10 and 12 Series microcontrollers which fall into this category. [24]
With only a two-level stack and no interrupts, there are real limits to the
program and hardware complexity that can be developed. For example, without
interrupts there is restriction on the type of on-chip peripheral that can be included,
as most peripherals use interrupts to enhance their interface with the CPU.
Baseline devices are ideal for really tiny applications, being packaged in
small ICs (right down to only six pins, for example). Despite their small size and
simple architecture, baseline microcontrollers carry some interesting peripherals,
including analog-to-digital converters and EEPROM (Electrically Erasable
Programmable Read-Only Memory).
19
Chapter Two Hardware and Software Components for Controlling GRS
2.4.1.2 Mid-range family
The mid-range family contains several simple but important developments,
when compared to the baseline devices. Interrupts (albeit with a single interrupt
vector) are introduced and the stack size is increased. The instruction set is a slight
extension of the baseline set.
The introduction of interrupts allows interfacing both with more
sophisticated peripherals and with larger numbers of peripherals.
Mid-range devices include all of the 16 Series except those coded 16C5XX
or 16F5XX, and some of the 12 Series. Avery wide range has been developed,
with many different peripherals and technical enhancements. The larger devices,
with multiple peripherals and significant on-chip memory, are both powerful and
versatile.[26]
2.4.1.3 The high-performance family
In this family Microchip has come to grips with some of the issues of
sophisticated processors. The instruction set is significantly increased, now to 75
instructions, and is designed to facilitate use of the C programming language.
In certain versions there is also an ‘extended’ instruction set, with a further
small set of instructions. There are two interrupt vectors, which can be prioritized
the high-performance family is made up only of 18 Series microcontrollers. It is a
powerful family and new members are continuously being added to the range. [25]
Table (2.1) Comparison of 8-bit PIC families
20
Chapter Two Hardware and Software Components for Controlling GRS
2.5 (PIC16F877A) Microcontroller Units: [27,28]
PIC is A Programmable Interface Controller which has wide use areas and
are preferred mainly due to low cost, wide availability, free development
environments, and easy to access experiences. Figure (2.6) shows the pin
schematics of (PIC 16F877A) produced by Microchip Technology Inc. that is used
in this thesis.
The name PIC initially referred to “Programmable interface controller”, but
shortly thereafter was renamed as “Programmable Intelligent
Computer”. PIC (re-programming with flash memory) capability.
Figure (2.6) PIC 16F877A pin diagram
Generally, PIC microprocessor consist of program memory, EEPROM,
RAM, 5-PORTS (A,B,C,D,E) ,free-run timer and central processing unit: [26]
21
Chapter Two Hardware and Software Components for Controlling GRS
(i) Program memory (FLASH) – is used for storing a written program. Using
flash technology, the memory can be programmed and cleared more than once. It
makes this microcontroller suitable for device development.
(ii) EEPROM - data memory that needs to be saved when there is no supply. It is
usually used for storing important data that must not be lost if power supply
suddenly stops. For instance, one such data is an assigned temperature in
temperature regulators. If during a loss of power supply this data was lost, we
would have to make the adjustment once again upon return of supply. Thus our
device looses on self-reliance.
(iii) RAM - data memory used by a program during its execution. In RAM, it
stored all inter-results or temporary data during runtime.
(iv) PORTS (A, B, C, D, E) are physical connections between the microcontroller
and the outside world. And each port contains 8-pins.
(v) FREE-RUN TIMER is an 8-bit register inside a microcontroller that works
independently of the program. On every fourth clock of the oscillator it increments
its value until it reaches the maximum (255), and then it starts counting over again
from zero. As we know the exact timing between each two increments of the timer
contents, timer can be used for measuring time which is very useful with some
devices.
(vi) CENTRAL PROCESSING UNIT has a role of connective element between
other blocks in the microcontroller. It coordinates the work of other blocks and
executes the user program.
2.5.1 PIC 16F877A MCU Features
The range of microcontrollers now available are developed because the
features of the MCU used in any particular circuit must be as closely matched as
possible to the actual needs of the application. Some of the main features to
consider are:[27]
• 100,000 erase/write cycle Enhanced Flash program memory typical.
• 1,000,000 erase/write cycle Data EEPROM memory typical.
• Power saving Sleep mode.
• Nonvolatile data memory
• Selectable oscillator options.
22
Chapter Two Hardware and Software Components for Controlling GRS
• Range of interfaces.
• Programmable code protection.
• Cost and availability.
The PIC16F877A is useful as a reference device because it has a minimal
instruction set but a full range of peripheral features. The general approach to
microcontroller application design followed here is to develop a design using a
chip that has spare capacity, and then later select a related device that has the set
of features most closely matching the application requirements. If necessary, we
can drop down to a lower range (PIC10/12 series), or if it becomes clear that more
power is needed, we can move up to a higher specification chip (PIC18/24 series).
This is possible as all devices have the same core architecture and compatible
instructions sets. [30]
Figure (2.7) the internal architecture of PIC16F877A
23
Chapter Two Hardware and Software Components for Controlling GRS
The most significant variation among PIC chips is the instruction size,
which can be 12, 14, or 16 bits. The A suffix indicates that the chip has a
maximum clock speed of 20 MHz [31].The internal architecture of 16F877A is
shown in the in Figure (2.7)
2.5.2 Why PIC 16F877 has been Selected
The Device which selected is the PIC 16F877 Microcontroller, there are 40-
pin, and these pins are divided into five PORTS (A, B, C, D, E), so each port
contain contains 8-pins. (Appendix A)
Most of these features that are likely found in the family of
microcontrollers from Microchip Technology manufactures with internal
Programmable Flash Memory. [32]
Table (2.2) illustrate PIC16f877 and others PICs
24
Chapter Two Hardware and Software Components for Controlling GRS
2.5.3 PIC16F877A Operating System
As microcontroller operating programs become more complex,
consideration must be given to the best method of organizing the program
response to input, memory management, and output timing. Three main methods
are used to handle input and output events, which after all, is the primary
requirement of a real-time system. In order of complexity, they are I/O polling,
interrupts, and the real-time operating system (RTOS). [31]
2.5.3.1 Polled I/O
This is the easiest, and may be considered the default, method of input and
output, where operations are simply scheduled as part of the main loop. they have
been deliberately kept simple. The basic principle is illustrated in figure (2.8) .This
option is fine if the delay that occurs between input signal and output response is
not critical to the correct overall operation of the system[31].
Figure (2.8) Polled I/O Process
The input processing may vary significantly, depending on the input data or
programmed options within the loop. For example, a test on the data may result in
an optional sequence being executed, or not, depending on the value. In fact, this
is pretty much inevitable in most real programs.
25
Chapter Two Hardware and Software Components for Controlling GRS
2.5.3.2 Interrupts
Interrupts are internally or externally generated asynchronous hardware
signals that force the processor to stop its current (background) task and carry out
the interrupt service routine (ISR), a higher-priority (foreground) task.
The processor “context” (current register contents and status) must be saved
and the current program address stored on the stack so that the background task
can be resumed when the ISR has finished. Figure (2.9) describes the interrupt
operation.
Figure (2.9) Interrupt Operation
If the program uses multiple interrupts, one ISR may be interrupted by
another.
The interrupts may need to be assigned an order of priority, so that a less
important task does not interrupt a more important one. When the higher-priority
ISR is being executed, the lower-priority interrupt can be disabled, or masked,
until it is finished.
An operating system (OS) provides an alternative to interrupts as a means
of providing a more predictable time response in the microcontroller system but
again is typically implemented in the higher-power MCU type [31].
26
Chapter Two Hardware and Software Components for Controlling GRS
2.5.3.3 PIC Real-Time Operating System
The principle of operation of a simple RTOS, as implemented by CCSC, is
shown in Figure (2.10). The program is divided into separate tasks, which are
executed in turn.
A timer interrupt causes the task switching, but interrupts are otherwise not
used, When a task is suspended, its context (file register state) is saved and
restored when it is restarted the next time around.
Simultaneously, and the I/O timing is more predictable. More sophisticated
systems incorporate task priority and implement more complex task management
strategies. All that remains then is to start up the RTOS in the main block, and the
tasks are executed in turn, with the frequency and duration specified for each. The
CCS implementation is classified as a cooperative, multitasking RTOS. This
means that the tasks return control to the scheduler voluntarily to allow the next to
run[31].
Figure (2.10) Basic RTOS Operation
27
Chapter Two Hardware and Software Components for Controlling GRS
2.6 PIC16F877A Program Execution
The chip has 8 KB (8096 = 14 bits) of flash ROM program memory, which
has to be programmed via the serial programming pins PGM (pin No.36), PGC
(pin No.39), and PGD (pin No.40). Figure (2.11) Shows PIC16F877A block
diagram with 40 pin-out explanation.
The fixed-length instructions contain both the operation code and operand
(immediate data, register address, or jump address). The mid-range PIC has a
limited number of instructions (34) and is therefore classified as a RISC (reduced
instruction set computer) processor. [31]
Looking at the internal architecture in figure (2.7). The blocks involved in
program execution. The program memory ROM contains the machine code, in
locations numbered from 0000 h to 1FFFh (8kbyte). The program counter holds
the address of the current instruction and is incremented or modified after each
step. On reset or power up, it is reset to zero and the first instruction at address
0000 is loaded into the instruction register, decoded, and executed. The program
then proceeds in sequence, operating on the contents of the file registers ( 000h–
1FFh ), executing data movement instructions to transfer data between ports and
file registers or arithmetic and logic instructions to process it. The CPU has one
main working register (W), through which all the data must pass.
If a branch instruction (conditional jump) is decoded, a bit test is carried
out; and if the result is true, the destination address included in the instruction is
loaded into the program counter to force the jump. If the result is false, the
execution sequence continues unchanged. In assembly language, when CALL and
RETURN are used to implement subroutines, a similar process occurs. The stack
is used to store return addresses, so that the program can return automatically to
the original program position. However, this mechanism is not used by the CCS C
compiler, as it limits the number of levels of subroutine (or C functions) to eight,
which is the depth of the stack. Instead, a simple GOTO instruction is used for
function calls and returns, with the return address computed by the compiler.
28
Chapter Two Hardware and Software Components for Controlling GRS
Figure (2.11) Show PIC16F877A block diagram with 40 pin-out
2.7 RS-232 Serial Channel Communication between PIC and PC
PIC 16F877 has a dedicated hardware RS232 port, but CCS C allows any
pin to be set up as an RS232 port, providing functions to generate the signals in
software. The basic form of the signal has 8 data bits and a stop and start bit. [31]
Figure (2.12) shows that.
29
Chapter Two Hardware and Software Components for Controlling GRS
Figure (2.12) start and stop bits[31]
A PIC microcontroller provides I/O ports to interface with any other
peripheral hardware but their use depend on the design and the selected
communication scheme. The RS-232 serial channel communication is perhaps the
most preferred communication scheme between a standard personal computer and
such microcontrollers. For this reason, this section is devoted to the RS-
232communication details referenced in this thesis. This infrastructure is
constructed before any software related implementations.
In order to connect a microcontroller to a serial port on a PC computer, we
need to adjust the level of the signals so communications can take place. The
signal level on a PC is -10V for logic zero, and +10V for logic one. Since the
signal level on the microcontroller is +5V for logic one and 0V for logic zero, we
need an intermediary stage that will convert the levels. One chip specially
designed for this task is MAX232. This chip receives signals from -10 to +10V
and converts them into 0 and 5V. [31]
PIC 16F877A includes a USART (Universal Synchronous Asynchronous
Receiver Transmitter) module capable of operating in one of the asynchronous-full
duplex, synchronous-master-half duplex or synchronous-slave-half duplex modes.
[31] The 9-pins of RS-232 Serial Communication are shown in figure (2.13)
Figure (2.13) illustrate the RS-232 Serial Communication[7]
30
Chapter Two Hardware and Software Components for Controlling GRS
The asynchronous mode is mainly used for communicating with personal
computers whereas synchronous configuration provides communication with other
peripheral devices such as external A/D or D/A converters, serial EEPROMs, etc.
The connection of PC to the PIC through RS-232 is indicated in Figure (2.14)
The universal synchronous/asynchronous receive transmit (USART) of
Device is typically used in asynchronous mode to implement off- board, one-to-
one connections. The term asynchronous means no separate clock signal is needed
to time the data reception, so only a data send, data receive, and ground wires are
needed. It is quick and simple to implement if a limited data bandwidth is
acceptable. A common application is connecting the PIC chip to a host PC for
uploading data acquired by the MCU subsystem USART operation. The USART
link can send data up to 100meters by converting the signal to higher-voltage
levels (typically = 12 V). The digital
Signal is inverted and shifted to become bipolar (symmetrical about 0 V, line
negative when inactive) for transmission. [7]
Figure (2.14) illustrate Connection PIC and PC
2.8 Power Supply Unit
Power Supply Unit (PSU) is an electronic device or system that supplies
electrical or other types of energy to one or more components, for the appliances
that require low voltage, Power Supply Unit is a device that converts one form of
electrical energy to another desired form and voltage [33].Actually in this system
two power supplies are used:
2.8.1 The power Supply of PIC
Like any electronic circuit, a microcontroller and the overall embedded system
need to be supplied with electrical power. Traditionally, much logic circuitry is
31
Chapter Two Hardware and Software Components for Controlling GRS
supplied at 5V, arising from the voltage specified for the TTL (Transistor
Transistor Logic) logic family. With the growth in battery-powered equipment and
developments in electronic technology, supply voltages have been pushed down,
and 3.3 and 3.0V supplies are now common. Operating conditions for electronic
components are specified in the manufacturer’s data sheet. In terms of power
supply there are two important issues: the supply voltage required and the current
that the device will then take from the supply. This supply current will be
dependent on operating frequency. Also given are absolute maximum ratings,
which give voltage and power dissipation levels beyond which the device must not
be taken [34].
The PIC take its Power supply Direct from computer USB port connection,
the PIC work with (5) VDC and the PIC operation power Supply voltage range
between (2 to 6) VDC.
2.8.2 The power supply Switching relays
The Relay which is connected with the output signal needs a power supply
voltage of (12) VDC. A computer Power supply can provide this voltage
2.9 The input and output circuits
The PIC deals with TTL level voltage (0-5) VDC the voltage more than (6)
VDC might burn the PIC so, to prevent the PIC from burring there is a needs to
break down voltage (decrease) the input signals voltage level by using a zener
diode. A zener diode is a special kind of diode which allows current to flow in the
forward direction in the same manner as an ideal diode, but will also permit it to
flow in the reverse direction when the voltage is above a certain value known as
the break down voltage, "zener knee voltage" or "zener voltage." The device was
named after Clarence Zener, who discovered this electrical property.
2.9.1 Input reduction signals voltage Using Zener Diodes
The purpose of using the zener diode is to break down voltage (decrease)
the (24) VDC from the (GRS) machine into (5) VDC as an input signals to (PIC) ,
figure (2.15) show the electronic design of (5.1) V zener with resistance 30KΩ.
Figure (2.15) zener diode break down voltage input circuit
32
Chapter Two Hardware and Software Components for Controlling GRS
2.9.2 Output Switching Circuit (Relay Component)
Relay is an electromagnetic switch and it is chosen over transistor due to its
fully on/off characteristic. In addition, conventional PNP transistor switching
circuit couldn't perform the switching operation in the situation where the emitter
voltage is higher than the base voltage (5V from PIC). [34] the design of
electronic circuit contain: NPN transistor type (2N3904), Schottkey diode and
resistor 10 KΩ. .See Appendix (C). The electronic design of relay switch circuit is
shown in figure (2.16)
Figure (2.16) the Relay Switch circuit
The aim of employing relays is to enable the PIC controlling the switching
remotely and automatically by replacing traditional manual switches in the GRS
system.
2.10 Programming PIC in C-Language Using MPLAB IDE
Compiler Environment
MPLAB is a Microchip’s Technology Integrated Development
Environment, it is includes an editor and a simulator and interfaces with many
compilers, including the CCS compiler (Custom Computer Service) which is
specializes in compilers for PIC microcontrollers.
MLPAB allows the editing, compilation, download the embedded software
to PIC, and testing of a sample C program to demonstrate the basic process and the
generated file set analyzed [31]. Figure (2.17) illustrates simple C Program
created in MPLAB environment.
Also, MPLAB includes the assembler for, assembly code is more
cumbersome to write, in the first place, and also more difficult to maintain.
230VAC
2N3904
10 KΩ
33
Chapter Two Hardware and Software Components for Controlling GRS
The C language eliminates the need to learn the PIC16 assembly language
and frees the user from managing all the details.[31]
Figure (2.17) illustrates C program writing in MPLAB
The PIC microcontroller program comprises a list of machine code
instructions, decoded and executed in sequence, resulting in data movement
between registers, and arithmetic with logic operations. MCU reset starts
execution at address zero, and the instructions are executed in address order until a
program branch is decoded, at which point a new target address is derived from
the instruction. A decision is made to take the branch or continue in sequence
based on the result of a bit condition test. [22]
C-Language has become the universal language for microcontrollers. It
allows the MCU memory and peripherals to be controlled directly, while
simplifying peripheral setup, calculations, and other program functions. All
computer languages need an agreed set of programming language rules.
34
Chapter Two Hardware and Software Components for Controlling GRS
2.10.1 MPLAB C project [31]
The primary function of the compiler is to take a source text file PROJNAME.C
and convert it to machine code, PROJNAME.HEX. The hex file can then be
downloaded to the PIC MCU. The source file must be written in the correct form.
As Showed in Figure (2.17).
In this source code, statement (# include 16F877A. h). This defines the
specific chip for which the program is created and refers to a header file supplied
with the compiler. This file must be included because it holds information about
the chip register addresses, labeling, and so on.
The file should be copied from the devices folder in the CCS C program
file folder set into the project folder. It can then be attached to this project by right
clicking on the Header Files folder. The code now is ready to compile the program
by clicking on the compile button in the MPLAB main toolbar. The compiler
execution dialog briefly appears and, ideally, a “build succeeded” message is
displayed.
2.10.2 MPLAB Project file
Some of files created in the project folder, which are concerned with
MPLAB project management are described as the following:[31]
● outbyte.c The source code file is created in a text edit window, in line with the
compiler and ANSI C syntax rules. For viewing outside MPLAB, it can be “
opened with ” (right click) Notepad.
● outbyte.hex The hex file, the program download file as it is displayed in a text
editor. The fact that it is readable shows that it is stored as ASCII characters. It
must be converted by the program downloading utility to actual binary code for
loading into program flash memory in the MCU.
● outbyte.lst This contains the intermediate assembly language version of the
program, plus the configuration fuse settings.
● outbyte.cof This file contains the machine code plus source file information
that allows debugging tools to display the source code and variables using their
original labels. This file is attached to the MCU to support source code debugging.
● outbyte.err The error file provides debugging messages, which are displayed in
the Output, Build window after compilation.
35
Chapter Two Hardware and Software Components for Controlling GRS
● outbyte.sym The symbol map shows the register locations in which the program
variables are stored.
● outbyte.mcp This is the MPLAB project information file.
● outbyte.mcw This is the MPLAB workspace information file.
● outbyte.pjt This is the CCS compiler project information file.
2.11 Hardware Board Kit for PIC Development & Programming:
The EasyPIC6 development system is an extraordinary development tool
suitable for programming and experimenting with PIC microcontroller from
MICROCHIP .The EasyPIC6 Kit illustrate in Figure (2.18).The board includes an
on board programmer with ICD support (In Circuit Debugger) providing an
interface between the microcontroller PIC and PC. See Appendix (B)
Figure (2.18) the development EasyPIC6 Kit Board
36
Chapter Two Hardware and Software Components for Controlling GRS
The (.hex) code file can loaded to PIC Through USB cable by using
EasyPIC6 Kit Board, this board can used to programming the PIC and also can
used as interfacing media between PC and the machine . See Appendix (B)
2.12 Ethernet IP Network
Ethernet is a family of frame-based computer networking technologies for
local area networks (LANs). The name comes from the physical concept of the
Ether. It defines a number of wiring and signaling standards for the Physical Layer
of the OSI networking model, through means of network access at the Media
Access Control (MAC) /Data Link Layer, and a common addressing format.
The topology which implemented is bus topology and RJ45 Ethernet Cable
STP (Shielded Twisted Pair) Cat5 to prevent the noise in the industrial
environment and grantee more distance than UTP. Figure (2.19) show RJ45
Ethernet Cable. [35]
Figure (2.19): Standard RJ45 Ethernet Cable.
37
Chapter Three
A Proposed Design of GUI
Based Remote Control for
GRS
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Chapter Three
A Proposed Design of GUI Based Remote Control for
GRS
3.1 Introduction
This chapter describes the steps of design and implementation for the GRS
machine remote controlling and monitoring both of software and hardware
components. All software tools and hardware devices which mentioned in chapter
two integrated together in proposed intelligent system that convert the manual
operations of GRS which were done by human manually into full computerize
operations ,
3.2 Procedure of System Design and Implementation
The steps followed in designing generic integrated H/W and S/W
systems are shown in flow chart depicted in figure (3.1)
System design and implementation start by determining H/W and S/W
components specifications for the proposed system .After collecting the design
related information, the next step will be hardware design in which the hardware
components must be compatible with all action done by GRS system.
As the stage of hardware design is complete a review for the hardware
design elements is made. If the hardware elements selected are compatible with
GRS machines control signals, the software construction is started if not, the
hardware elements selection is repeated till it satisfies the system design.
The software presented in the proposed system design can be classified into
two types software techniques: the embedded software technique (PIC software)
and the interfacing user technique (GUI software)
Both of software methods must be test and reviewed. The final step in
proposed system design concerned with integrating both of hardware components
and software tools.
These steps described before will be discussed in details in the coming
sections:
39
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Figure (3.1) flow chart of designing generic integrated H/W and S/W design
System Design Specification
Collect all Design Related
information
Design Proposal Hardware
Components
Design Proposal Software
Components
All H/W
Components
considered
(Review)
All S/W
Components
considered
(Review)
Integrate H/W & S/W
Prototype
Implement the Final
Integration System
N
N
Y
Y
Start
End
40
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.3 System Design Specification
The system design specification is the first and most important step in the
system design process, in this step the GRS machine hardware components are
selected and specified for the design and implementation of the proposal automatic
system GRS machine. Figure (3.2) shows the original local control Panel of (GRS)
that will be converted into full computerized operation and monitoring from
remote location.
Figure (3.2) the (GRS) machine panel
Also in this stage of system design process, the hardware component and
software tools should be specified before moving to the next step of the system
design. According to the requirement of proposal system the hardware component
and software tools should be compatible with all actions done by GRS machine.
41
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.4 Collect Design Related Information
In this step of system design process, the information related to the system
operation is collected. The operation environment and the system reaction for the
alarm signals and faults represent the main and the first information should be
collected.
There are three recourses of information which must be collected for GRS
machine, the first is the set of documents (manuals) from the GRS manufactory
company which contains all possible fault and failure events in the system while
the second source of information comes from the monitoring of real GRS machine
action ,by taking photos and recording video for monitoring the system in work
behavior in order to cover all system status and manual reaction to it during
different operation conditions. The third source of information is gathering
information from the operator that responsible on operate and monitor the GRS
machine manually. The information gathered was about the events of faults and a
failure has been faced, to translate these events into software to enable the
proposed microcontroller (PIC) to control the machine.
Figure (3.3) shows the GRS control panel graph in which each component
is assigned a number. The action of each component (indicated by its
corresponding number) is depicted in table (3.1)
Figure (3.3) GRS diagram with I/O Signals description
According to “Rotaring” Manufacture Company
42
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
The description of Figure (3.3) I/O signals is listed in table (3.1) below:
Table (3.1) the GRS machine signals
Signal
NO.# Signal Description
1 H11 CIRCULATION PUMP OVERLOAD
2 H5 CIRCULATION PUMP IN OPERATION
3 CIRCULATION PUMP SELECTOR SWITCH
4A H1 IGNITION GAS
4B H15 LEAKAGE ALARM GAS VALVE AA005
4 H12 BURNER MOTOR OVERLOAD
5 H3 BURNER START
6 13 BURNER DISTURB
7 H4 BURNER IN OPERATION
8 S2 BURNER START LOCAL
9 S3 BURNER STOP LOCAL
10 S8 RESET BURNER CONTROL
11 S9 BURNER OPERATION LOCAL REMOTE
12 N1 TEMPERATUR CONTROL
13 S10 TEST FLAME DETECTOR
14 S11 BURNER OPERATION MODE
15 H7 LSA- 00EKT21CL081
16 H10 PSA- 00EKT21CP083
17 H9 PSA+ 00EKT21CP082
18 H14 EM/SAFETY CIRCUIT BURNER CONTROL
19 S7 ALARM RECEIPT
20 H2 LOW GAS PRESSURE
21 H6 TS+ 00EKT21CT081
22 H8 TA+ 00EKT21CT082
23 S5 TEST TA+ 00EKT21CT082
25 S12 LAMP TEST
26 S6 EMERGENCY STOP
27 Q1 MAIN SWITCH
28 S1 THERMOSTAT (INSIDE DOOR)
29 M1 SWITCHBOARD FAN + AIR INLET
30 AIR OUTLET FILTER
43
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.4.1 Mapping GRS Input and Output signals to PIC Pins
The input and output signals to /from GRS are digital signals (0-1) describe
(ON-OFF) states. Each input signal from GRS machine to the PIC microcontroller
and each output signal from PIC to the GRS machine will be assigned in to special
pin of the (PIC). Table (3.2) lists the PIC pins assignment with signals description.
Table (3.2) the PIC pin identification
No.#
(PIC)
Pins Label Indication Type Description
1 RA0 LED1 Fault Digital in CIRCULATION PUMP OVERLOAD
2 RA1 LED2 Run OK Digital in CIRCULATION PUMP IN OPERATION
3 RA2 LED4A Run Digital in IGNITION GAS
4 RA3 LED4B Fault Digital in LEAKAGE ALARM GAS VALVE
5 RA4 LED4 Fault Digital in BURNER MOTOR OVERLOAD
6 RA5 LED5 Run Digital in BURNER START
7 RB0 LED6 Fault Digital in BURNER DISTURB
8 RB1 LED7 Run Digital in BURNER IN OPERATION
9 RB2 LED15 Fault Digital in LSA- 00EKT21CL081
10 RB3 LED16 Fault Digital in PSA- 00EKT21CP083
11 RB4 LED17 Fault Digital in PSA+ 00EKT21CP082
12 RB5 LED18 Fault Digital in SAFETY CIRCUIT BURNER CONTROL
13 RB6 LED20 Fault Digital in LOW GAS PRESSURE
14 RB7 LED21 Fault Digital in TS+ 00EKT21CT081
15 RE0 LED22 Fault Digital in TA+ 00EKT21CT082
16 RC0
SWITCH3 SELECTOR Digital out SELECTOR SWITCH LOCAL/REMOTE
17 RC1
18 RC2 Buttom8 start Digital out BURNER START LOCAL
19 RC3 Buttom9 stop Digital out BURNER STOP LOCAL
20 RC4
RESET
Buttom10 RESET Digital out RESET BURNER CONTROL
21 RC5
SWITCH11 SELECTOR Digital out
BURNER OPERATION LOCAL
REMOTE22 RC6
23 RC7 Buttom13 TEST Digital out TEST FLAME DETECTOR
24 RD0
SWITCH14 SELECTOR Digital out BURNER OPERATION MODE25 RD1
26 RD2
27 RD3 Buttom19 RESET Digital out ALARM RECEIPT
28 RD4 Buttom23 TEST Digital out TEST TA+ 00EKT21CT082
29 RD5 Buttom25 TEST Digital out LAMP TEST
30 RD6 SWITCH26
EMERGENCY
STOP Digital out EMERGENCY STOP
44
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
The (PIC16F877A) has five-Ports named (A,B,C,D,E)denoted
as(RA,RB,RC,RD,RE) and each port of these five-Ports contains 8-Pins,So the
total number of Pins in (PIC16F877A) is 40-Pins.
According to table (3.2) .The input signals from GRS to PIC will be
mapped into 15-Pins of PIC (ports (RA0-RA5, RB0-RB7, pinE0), while the output
signals from PIC to the GRS have been mapped to another 15-Pins of PIC (ports
(RC0-RC7, RD0-RD6), So the total number of used Pins from (PIC16F877A) in
proposed system becomes 30-Pins out of 40-Pins available in PIC.
Figure (3.4) shows the digital input signals from (GRS) system to (PIC) and
the digital output signals from (PIC) to (GRS) system according to Table (3.2).
Figure (3.4) illustrate the digital I/O
Figure (3.4) the input and output signals of PIC16F877A
Digital I/P from
GRS to PIC
Digital I/P from
GRS to PIC
Digital O/P from
PIC to GRS
Digital O/P from
PIC to GRS
45
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.5 Hardware Design Implementation
After collecting all design related information which is necessary for
designing a full computerized system that aimed for controlling and monitoring
the (GRS) machine, the next step in the system design implementation is to select
the perfect and compatible H/W components to control GRS machine.
3.5.1 PIC16F877A
It is a Programmable Interface Controller which represents the brain of the
proposed system in this thesis; the (PIC16F877A) has been selected for many
reasons which explained before (chapter two). The (PIC16F877A) can be
considered as a very small size IC according to its dimensions (5) cm length and
(1.5) cm width. The following figure (3.5) shows the actual dimensions of
PIC16F877A
Figure (3.5) hardware Chip of PIC16F877A
3.5.2 The Development PIC Board KIT EasyPIC6
The Development PIC Board KIT EasyPIC6 will be used as a programmer
for the (PIC16F877A) through (USB) cable, also the Development PIC Board KIT
EasyPIC6 will used as interfacing media to connect the PIC with the inputs and
outputs signals of GRS machine and to connect the PIC with the PC which
contains a GUI through (RS232) cable as a final system implementation. See
appendix (B)
46
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.5.3 Input Electronic Interface Circuit from GRS to PIC
The PIC deals with TTL level voltage (0-5) VDC, when the (0) VDC
represents logic (0) and the (5) VDC represents logic (1) to PIC. Thus the input
voltage which has a voltage value more than (6) VDC that might burn the PIC ,
each input signal to PIC from (GRS) is rated on (24)VDC and this incompatibility
in DC voltage level is solved by using Zener diodes to protect PIC from high
inputs (24) VDC by convert it to (5)VDC .The proposed protection interface h/w
is depicted in figure(3.6) it contains zener diodes each of 5.1 V break down
voltage . 30KΩ input resistance is connected to input signal to reduce the amount
of voltage at the input of each zener diode into (5) VDC.
Figure (3.6) I/P conversion from (24) VDC to (5) VDC
47
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
The digital I/P from (GRS) to (PIC) after I/P conversion is shown in figure (3.7)
Figure (3.7) the digital I/P from GRS to PIC after the hardware design of
conversion circuit (from 24-to-5) VDC
3.5.4 The output relay circuit from PIC to GRS
The relay is one of devices used in this thesis used in order to provide the
circuit with flexible connections between PIC and the GRS Machine which has
been used as an output device switched ON or switched OFF according to the
enable signal generated from PIC microcontroller. Figure (3.8) shows the
hardware output circuit design.
Digital
I/P from
GRS to
PIC
Digital I/P
from GRS
to PIC
Digital I/P
conversion
circuit from
(24) VDC to
(5) VDC
Digital I/P
conversion
circuit from
(24) VDC to
(5) VDC
48
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Figure (3.8) H/W output circuit of relay
The relay circuit in this thesis replaces the manual switches of GRS in to
computerized switching, Such that the enable signal from PIC can handle a (230)
VAC High Voltage. The output enable command of switching ON or switching
OFF will be accessed from presented GUI by programming software push buttons.
The digital outputs enable commands from (PIC) to (GRS) are shown in
Figure (3.9)
49
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Figure (3.9) the digital O/Ps from PIC to GRS after the H/W design of output relay
circuit
3.5.5 H/W Design Review and Test
After hardware design components implementation, a design review is
needed. It’s very important and final stage before starting the S/W design. The
microcontroller input /output signals were tested by applying test signals and
monitoring system response. Also in this stage the future expansion is considered
to make the system capable for upgrading, the design at this stage it is easy to
modify if there is any requirements before implementation, if the H/W
components design completed the S/W design of proposed system design could be
initiated according to H/W requirements.
Digital O/P from
PIC to GRS
Digital O/P from
PIC to GRS
The output relay
circuit from PIC to
GRS
The output relay
circuit from PIC to
GRS
50
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.6 Software Design Implementation
There are dual software programming techniques implemented in this
thesis the first one is the embedded system programming technique for PIC
microcontroller and the second one is the programming and designing of GUI
interactive graphical user interface.
3.6.1 The Embedded Programming Technique
The embedded programming technique represents the intelligent software
product that will be invisible programming part to the end user of system which
has been written in source code called MPlab based on C-Language codes and
environment. The code written will be loaded in the PIC flash memory.
The purpose of an embedded system program is to read input data, the
processing input through predefined software code, then generate an output signals
that control the GRS remotely.
Figure (3.10) Illustrates C program writing in MPLAB Version 8.33
51
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
The embedded program is written using MPLAB Microchip’s Technology
Integrated Development Environment. As shown in Figure (3.10)
The C-Language is a high-level language used for creating the system
firmware for low-complexity embedded systems, it is a user-friendly programming
technique and it needs only less detailed hardware knowledge.
After writing the program in C-Language the MPLAB will edit, check errors
and compile the C-language source code into (file. hex) and loaded to PIC flash
memory.
3.6.2 Loading (file. hex) to PIC
The EasyPIC6 Programmer Kit which explained before will be used for
loading, verifying and testing the (.hex) code to the PIC flash memory through
USB cable by installing CD driver which loads the private proposed program by
the EasyPIC6 Kit as shown in figure (3.11).
Figure (3.11) EasyPIC6 Kit loading program
52
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
The following figure (3.12) illustrates the load operation of embedded
software (.hex) code file
Figure (3.12) loading (.hex) code file
3.6.3 GUI Programming Technique using VB
The graphical user interface is a tool that creates an effective
communication medium between human and computer; in fact this programming
technique of GUI represents the Visible Programming because the user can use the
GUI design for remote monitoring and controlling (GRS) system.
The Visual Basic program is used in this thesis to design an interactive
GUI.
53
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
The GUI design is presented in figure (3.13).The final GUI designed does
not need extra training because the user can recognize it easily; this results from
the high similarity between it and the original machine.
Figure (3.13) the GUI design for monitoring and controlling GRS
In this proposed GUI there are two new push buttons added ,the first is
called (Auto operation system mode) which allows a full computerized automatic
system mode selection and operation, while the second new push button is called
(general reset) which allows resetting all system faults and alarms by just one
click . These two functions are not found in the original GRS panel.
The proposed GUI is not used only for monitoring it is also used to display
the system status through some indicators for input signals and also content a push
buttons which acts for output signals.
54
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
In presented GUI it is possible to use mouse and keyboard for managing
and controlling the (GRS) system. Figure (3.14) shows the similarity between the
original machine panel and the proposed GUI.
Figure (3.14) the previous GRS and current status after developing the GUI
The GUI gets an input indication signals and send an output signals via
push buttons to the PIC through the Serial port (RS232) which represents the
communication channel between PIC and PC.
55
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.6.4 S/W Design Review (Verification)
At this stage the C-program is verified and tested by using IDE simulation
program. Figure (3.15) shows the simulation program of PIC. The simulation
environment allows loading and compilation of C-program which was written in
MPLAB with the ability of program execution step by step.
Figure (3.15) PIC Simulator IDE
Also the development PIC Board KIT EasyPIC6 allows testing and review
for the dual S/W techniques through the bush buttons switch and LED indicator
built in the KIT EasyPIC6.
After the completion of verification stage and S/W design , the review stage
is the next stage involves integrating both the H/W and S/W components.
56
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.7 System Integration H/W and S/W
In this stage integration of proposed system both hardware and software
components will be integrated together in order to control the GRS machine
Figure (3.16) shows the Easy PIC6 Kit connected with the I/P and O/P
circuit after loading the compile C-language program to the programmable PIC
memory.
Figure (3.16) the Easy PIC6 with I/P and O/P hardware circuits
3.7.1 The integration H/W Components
The I/P, O/P and PIC Kit circuits are connected to a power supply to
provide the necessary power for the hardware components. Figure (3.17) show
these circuits with a power supply
57
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Figure (3.17) H/W components with power supply
3.7.3 Final package
All hardware components with the deriving software are embedded inside
computer case .The interface with the deriving computer is done through input /
output cables, serial cable (RS232) for transmitting and receiving signals and
instructions, while the USB cable is used for loading embedded software to the
PIC .Figure (3.18) shows the proposed hardware.
58
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Figure (3.18) final hardware system
Figure (3.19) shows the interface between the computer over which the
GUI is installed and the proposed hardware through serial communication port
(RS232) and (USB) cable for programming and supply the power to the PIC
59
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Figure (3.19) H/W and S/W system integration
3.8 Remote access through IP Network configuration
The aim of IP network that was used in this thesis is to enable GRS remote
controlling and monitoring after converting it to full computerize operations.
Figure (3.20) shows HTML page developed which allows transferring the
instructions to/from GUI to the GRS system from remote location, about (150)m
distance from GRS to control room ,through IP bus network authorized using user
name and password.
60
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Figure (3.20) illustrate HTML page for remote access
Any boiler of GRS can be selected and certain instruction can be
transmitted to it by clicking on the its hyper link ,hence when clicking on remote
panel -2 for example the GUI for second GRS is displayed. The HTML page
designed to make the access to the remote system easier with out needing to the
network configuration each time to access by saving the network setting.
61
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
3.9 Final System Design Algorithm
The algorithm of the final proposed design starts by reading the set up
process initialized for serial transmission before GUI can be interfaced via RS232.
The algorithm of Programming the PIC microcontroller and exchanging of
the data and signals between the human and the GUI is:
Initialize:
Selecting the Programmable Interface Controller = PIC16F877A
Define the Header file for the "PIC16F877A"
Set frequency of Crystal Clock oscillator = 8000000 Hz
Enable Interrupts ( )
Define the (PIC) used Pins:
Define Pins A0-A7
Define Pins B0-B7
Define Pins C0-C7
Define Pins D0-D7
Define Pins E0-E2
Input: A (A0-A5) Read the input signals from GRS to port A of PIC.
B (B0-B7) Read the input signals from GRS to Port B of PIC.
E (E0) Read the input signals from GRS to pin E0 of PIC.
Output: C (C0-C7) Activate Pins of PIC as output Instructions to GRS.
D (D0-D6) Activate Pins of PIC as output Instructions to GRS.
Begin
Set up baud rate speed = 9600/bps for RS232 port
again While there is an input signals from GRS do
If input signal = logic 1
Then
identify the logic 1 signal in to ASCII code character
send the ASCII code Character via RS232 port and
display it on GUI
Read new input signal from GRS
Else
send the (ASCII+1)mode 26 via RS232 port and
display it on GUI
62
Chapter Three A Proposed Design of GUI Based Remote Control for GRS
Read new input signal from GRS
While there is an output signals command instruction from
GUI do
If send output signal ASCII from GUI via RS232 port = logic1
Then
Comparing ASCII which send with previous identified ASCII
If both ASCII are matched
Then
Send Output PIC command through output pins and switch
ON a specific relay
Else Send Output PIC command through output pins and switch
OFF a specific relay
End while
If "Auto Operations Mode" selected
Then
Read fault input signals
Reset all GRS fault by activate output relays
Start GRS system with automatic mode
End while
Return again
End
63
Chapter four System Experimental & Results
Chapter Four
System Experimental and Results
4.1 Introduction
In this chapter, the real operation and testing results for proposed remote
controller based on PIC microcontroller with graphical user interface are
presented. Thus the proposed controller (H/W and S/W) is connected with a real
GRS machine at Erbil power station, it responds successfully to all alarm signals
considered and presented by machine manual. Also the ASCII code which assigns
to the input or output signals given for each control has been tested by using
(oscilloscope) waveform plotter.
4.2 Testing H/W and S/W Components
The stage of testing H/W and S/W components of proposed controller is
performed before connecting it to the GRS machine in "Erbil Power Station".
Hence, all system reactions for certain events are tested separately, the testing step
is important before real system implementation.
The S/W level in proposed system is based on Windows platform,
performed successfully in transmitting serial data between the computer and the
PIC microcontroller.
The GUI, based on Windows platform, provides the use of the serial
computer port to the system. The GUI was developed for monitoring and
controlling GRS machine from remote location.
4.3 Descriptions of final GUI of GRS
In general the final proposed GUI consist of two types of functions the first
one represent the color indicators , which either refer to fault in the GRS machine
or refer to the events in the system, that will used for monitoring the GRS machine
from remote location. While the second function of GUI represent by commands
push buttons, these push buttons can be select from GUI to take some actions on
the system as example if the user of system from remote location want to change
the system mode, reset the system fault and errors or start the machine.
65
Chapter four System Experimental & Results
The descriptions of the final proposed GUI for controlling and monitoring
the GRS machine from remote location shown in figure (4.1).
Figure (4.1) descriptions of the GUI for GRS
According to the final GUI the red, yellow, green and white LED will be
used for monitoring the GRS machine operations, while the push buttons will used
to send command which can select by the system user.
Fault LED Sequence LED Start LED Events LED
Mode select
Reset faults
Start operation
Pump options
Stop operation
Local /remote Operation mode
Reset Test Reset
Test
TestTemp. setting
66
Chapter four System Experimental & Results
4.4 GUI Commands Push Buttons and LED Indications
The GUI uses the command buttons to activate the selected port of the
microcontroller that controls the GRS machine as output instruction commands
while, the LED indicators refer to the input status as illustrated in figure (4.1).
Thus every command button and LED on the GUI represents certain ASCII
code from the keyboard. The program waits for another ASCII code to be entered
by the mouse or keyboard.
4.4.1 Interfacing GUI with Serial RS-232 and USB Port
The communication port between the PC and the microcontroller can be
interfaced either directly via an RS-232 port or the PC USB port. Since computers
today are developed with the USB (Universal Serial Bus) port, the GUI based on
Windows platforms is designed to be capable of transferring and receiving data via
such ports.
The USB port of a personal computer is developed to assist the connection
of peripheral devices to the computer, improve communication speed and
simultaneously support the attachment of multiple devices. The USB-to-RS232
converter is used for interfacing with the USB port of the computer with the
system developed.
The driver of USB-to-RS232 converter initializes the USB port as a serial
port protocol. The use of the converter from a serial interface to the USB port will
release a serial communication port to other applications. This allows the devices
to be unchanged, making the converter responsible for treating the differences
between the protocols. This converter is responsible for transmitting ASCII
(American Standard Code for Information Interchange) data from GUI to PIC
microcontroller.
67
Chapter four System Experimental & Results
4.5 Identifying ASCII Code Character for each Input/Output
Signals
Each input and output signal from the GRS machine will named and
identify as a special ASCII code character in order to recognize each signal alone.
Table (4.1) shows the ASCII code for each signal.
Table (4.1) identification ASCII for each I/O signal
No.#
(PIC)
Pins ASCII code Character Description
1 RA0
97
a CIRCULATION PUMP OVERLOAD
2 RA1
98
b CIRCULATION PUMP IN OPERATION
3 RA2
99
c IGNITION GAS
4 RA3
100
d LEAKAGE ALARM GAS VALVE
5 RA4
101
e BURNER MOTOR OVERLOAD
6 RA5
102
f BURNER START
7 RB0
103
g BURNER DISTURB
8 RB1
104
h BURNER IN OPERATION
9 RB2
104
i LSA- 00EKT21CL081
10 RB3
106
j PSA- 00EKT21CP083
11 RB4
107
k PSA+ 00EKT21CP082
12 RB5
108
l
SAFETY CIRCUIT BURNER
CONTROL
13 RB6
109
m LOW GAS PRESSURE
14 RB7
110
n TS+ 00EKT21CT081
15 RE0
111
o TA+ 00EKT21CT082
16 RC0 122
z
SELECTOR SWITCH
LOCAL/REMOTE
17 RC1
18 RC2 121 y BURNER START LOCAL
19 RC3
120
x BURNER STOP LOCAL
20 RC4
119
w RESET BURNER CONTROL
21 RC5
118 v
BURNER OPERATION LOCAL
REMOTE
22 RC6
23 RC7
117
u TEST FLAME DETECTOR
24 RD0
116 t BURNER OPERATION MODE25 RD1
26 RD2
27 RD3
115
s ALARM RECEIPT
28 RD4
114
r TEST TA+ 00EKT21CT082
29 RD5
113
q LAMP TEST
30 RD6
112
p EMERGENCY STOP
68
Chapter four System Experimental & Results
4.5.1 GUI Input/Outputs ASCII codes Instructions
Each input and output signal is assigned in to different character form
ASCII code, the speed rate of bits transmitted and received through the RS232 is
9600 bits per second. The microcontroller compares its reference ASCII code
character with the data received and controls the GRS machine when the data
received matches the reference ASCII code character which is embedded in the
PIC microcontroller.
Since data is transmitted using an asynchronous form, the start bit and stop
bit indicate the beginning and ending of the data and between the start and stop bit
the ASCII code of character in binary form as mentioned before
The example of four input and output signals assignment is shown in table
(4.2). The signals is mapped into lower case English characters as an example (a,
b) have been selected to represent input signals while (y, z) represents output
signals.
Table (4.2) four characters with ASCII and Binary code
char. Signal ASCII Binary
a O/P 97 1100001
b O/P 98 1100010
y I/P 121 1111001
z I/P 122 1111010
4.5.2 Result of output commands Signals waveform
Figure (4.2) shows the waveform traced by the oscilloscope of ASCII ‘a’
character received on the RS232 port sent by the command button “START”. The
command button “START” represents the ASCII code ‘a’ for switching on GRS
that is controlled by the microcontroller. The microcontroller compares its
reference ASCII code character with the data received and switches on the
switching transistor when the data received matches the reference ASCII code
character saved in the microcontroller.
69
Chapter four System Experimental & Results
Figure (4.2) oscilloscope waveform of character "a"
Since the data is transmitted using an asynchronous form, the start bit and
stop bit indicate the beginning and ending of the data. Figure (4.3 ) shows the
waveform traced by the oscilloscope for the ASCII character ‘b’ sent by GUI by
clicking the command button “STOP” and the same ASCII character received at
the microcontroller port. Microcontroller detects data in the TTL form, which is
compatible for the USART.
Figure (4.3) oscilloscope waveform of character "b"
Start Bit Stop BitASCII "a"
Start Bit Stop Bit BitASCII "b"
70
Chapter four System Experimental & Results
4.5.3 Result of Input LED waveform
In the following two figures examples of input signal from GRS machine to
PIC microcontroller will display as LED indication on GUI.
Figure (4.4) shows the waveform of ASCII character ‘y’ of LED that
represent an indication of GUI "circulation pump over load"
Figure (4.4) oscilloscope waveform of character "y"
Figure (4.5) shows the waveform of ASCII character ‘z’ of LED that
represent an indication of GUI "circulation pump in operation"
Figure (4.5) oscilloscope waveform of character "z"
Start Bit t Stop BitASCII "y"
Start Bit Stop BitASCII "z"
71
Chapter four System Experimental & Results
4.6 Proving the computerize and automatic operation of GRS
The proving stage is done by connecting the final integration H/W and S/W
system to the real GRS machine, the machine successfully started through the final
GUI with high efficiency ,accurate and quick response time so, it is proved that
all operations of GRS now can doing computerize and automatic by user from the
GUI.
Figure (4.6) shows system user can operate and control the GRS from PC
using interfacing GUI and embedded PIC software.
Figure (4.6) operate GRS from PC
72
Chapter four System Experimental & Results
4.7 Proving the GRS Operation Performed from Remote
Location
After satisfying the goal of converting all operation and monitoring of GRS
from manual operation in to computerize and automatic operations, the another
important goal that should be prove the operation and monitoring of GRS should
be performed from remote location.
Two PCs are connected through bus LAN network one PC at the GRS
machine and the other in the remote location to allow access from remote location.
Figure (4.7) show the PC at the GRS panel connected to LAN network STP
cable.
Figure (4.7) local PC at GRS machine
Figure (4.8) show the login page from HTML page of remote PC that will
used to access to the PC at the GRS machine panel.
STP Network
cable
73
Chapter four System Experimental & Results
Figure (4.8) the login to the remote PC
Both PCs have a static IP address, the IP address of the first PC is
(192.168.1.10) while, the IP address of the second PC is (192.168.1.20) and both
of PCs authored by user name and password.
Figure (4.9) show the remote PC after login to another PC which allow
monitoring and controlling GRS machine through GUI and from remote location.
Network cable from
first PC
74
Chapter four System Experimental & Results
Figure (4.9) the remote PC after login
In the final GUI a new push buttons added (Auto Operation Mode) which
allow operate the GRS machine with complete auto operations by clicking only
one push button which it (Auto Operation Mode). Figure (4.10) show selecting the
(Auto Operation Mode) command push buttons of GRS machine from GUI and
from remote location.
IP of remote PC
192.168.10.10
75
Chapter four System Experimental & Results
Figure (4.10) selecting Auto operation mode
The successfully operating and response of GRS machine through GUI
from remote location show in figure (4.11).
Figure (4.11) successfully operate GRS remotely from GUI
76
Chapter four System Experimental & Results
4.8 Result of testing and operating a proposed system
The result of testing and operating the final proposed system by using GUI
will illustrate by selecting a four scenarios to achieve to the goals of this thesis ,
which controlling and monitoring the GRS machine from remote location through
a special GUI using a PIC microcontroller. Each scenario contains the status of the
local panel of GRS and in the same time the status of GUI, the first scenario refer
to the initial status of GUI as shown in figure (4.12)and the initial status result of
GRS panel before staring shown in figure (4.13)
Figure (4.12) result of first scenario "initial status" on GUI
Figure (4.13) result of first scenario "initial status" of GRS panel
77
Chapter four System Experimental & Results
The second scenario represents the system status when selecting the "Auto
Operation Mode" from GUI The indication of "circulation pump" will be active as
green indication in both of GUI and the GRS panel figure (4.14) show the GUI
status, while figure (4.15) show the result on the GRS control panel.
Figure (4.14) result of selecting "Auto operation mode" from GUI
Figure (4.15) result of GRS after selecting "Auto operation mode"
78
Chapter four System Experimental & Results
The third scenario represent the progress of operations of GRS machine,
this scenario show the yellow indication of "Ignition Gas" and the white indication
of "burner Start" are active in both of GUI as well as in the GRS panel as result.
Figure (4.16) show the result on the GUI, and figure(4.17) show the result in same
time on the GRS panel.
Figure (4.16) result of the yellow and white indications on GUI
Figure (4.17) result of the yellow and white indications on GRS panel
79
Chapter four System Experimental & Results
The fourth scenario refer to the system when the indication of "ignition
Gas” is (OFF) and when the indication of "Burner in operation" is (ON). Figure
(4.18) show the result on the GUI while figure (4.19) shows the result on the GRS
panel.
Figure (4.18) result of forth scenario on GUI
Figure (4.19) result of forth scenario on GRS panel
80
Chapter four System Experimental & Results
4.9 Comparison Proposed System with other work
By comparison the proposal system with nearest related work[8], it found
the proposal system in this thesis overcome from other work by many aspects as
shown in table (4.3)
Table (4.3) comparative between the proposal design and the GUI of home
lighting
The GUI of
Home Lighting
The Proposal DesignFeature
Single phase LampsGRS Machine in Erbil powre StationApplication
NoneIncludeGUI Feed Back
Serial CableAccess Through IP NetworkRemote
MPASMMPLAB Version (8.33) based on CEmbedded S/W
More InstructionLess InstructionInstruction Set
Just Output signalsSatisfy Both I/O signalsI/O Signals
NoYesGUI Auto operation
Only PushbuttonsPushbuttons, Indicators shapes and
display text box
GUI elements
81
Chapter Five
Conclusions and Future
Work Directions
Chapter Five Conclusions &Future Work Directions
Chapter Five
Conclusions and Future Work Directions
5.1 Introduction
After completing the design of final proposed system ,A real testing
and implementation performed to the system, by connecting the final
integration H/W and S/W with the GRS machine to enhance the manual
traditional operations of GRS machine into automatic and computerize
operations. The proving stage is done by interfacing the final integration
H/W and S/W system in the real world with the GRS machine, the machine
is successfully controlled and monitored through the final GUI from remote
location via IP Ethernet STP cable network with high efficiency, accurate
and quick response time so, it is proved that all operations of GRS now can
be done by executing GUI from remote location.
5.2 Conclusions
The rapid spreading of embedded systems and remote automatic
remote control systems enables the researchers to find new embedded
programming software techniques methods or algorithms which allow
controlling and monitoring machines from remote locations. Today, most
new technology products consist of a mixture of hardware and software
components, also in the final proposed system both of hardware and
software components were implemented and integrated as a complete
compatible system. An embedded system is regarded as a product which
contains a microprocessor programmed to carry out some control functions
which works as a complete computer system. This thesis was implemented
as a remote machine control through a GUI which is based on PIC
microcontroller, the controller circuit used to implement this system has
been designed with a minimal number of components. So the following
conclusions can be noted:
1. The GUI using VB provides the process for transmitting the
ASCII character data. It is shown that GUI using the Visual
Basic program, is performed excellently in transmitting data to
83
Chapter Five Conclusions &Future Work Directions
the PIC microcontroller. It can be concluded that GUI using
Visual Basic can be interfaced with RS232 port of a computer.
2. The operation and monitoring of the GRS machine is huddled
and enhanced by utilizing the features of (PIC16F877A)
microcontroller, which create a better solution for the GRS
problems, so the (PIC) can be used as an interfacing device
between the PC and the Machine.
3. The important part in the final proposed design is the GUI, the
GUI facilitates the Engineer work in order to enable a
monitoring and controlling of the GRS machine from remote
location, hence it is play a vital role as a interfacing media
between the human and the machine which named in the
industrial factories and plat as Human Machine Interface
(HMI).
4. This thesis presents a dual software programming techniques as
a final proposed system implementation. The embedded
software which used for programming and loading the C-
language program to the PIC microcontroller flash memory by
using MPLAB debugger which is the more efficient and easy is
the more efficient and easy language for programming a (PIC) ,
and the another important part of software programming
techniques is designing special graphical interfacing GUI by
using Visual Basic as an interfacing media between the human
and the machine.
5. A remote controlling machine is located on the devices casing
as it may require control and observation from the operator
from time to time , also if the process control contains
hazardous environment for doing some jobs like (power plants,
chemical factories) and a long distant controller may be useful
for the application of this drive system.
6. The PIC microcontroller has been used in this thesis due to its
low cost , availability in local market, low power consumption,
and easy to program using C-Language .
84
Chapter Five Conclusions &Future Work Directions
5.2 Future Work Directions
1. Using a fiber optical cable instead of using STP cable which allows
more Bandwidth, It uses properties of light to transmit data, reduces the
noise because it is made from glass and plastic.
2. The zenor diode which is used as input reduction voltage to the PIC can be
replaced by optical couple electronic elements that allow more flexibility
with voltage range fluctuating.
3. The system can be accessed through internet if the static IP address of LAN
network replaced by a Public IP address, so the system can be accessed
with full controlling from any place in the world.
4. Using a strong security methods and protocols for security instead of
simple user name and password to avoid attackers and hackers.
5. The controlling and monitoring of GRS machine can be done by using
touch screen instead of using the mouse and keyboard due to future
requirements.
6. It is possible also to use a wireless network instead of using the wire
network which allows accessing GRS machine from remote location.
7. The hardware which is used to interface the PIC microcontroller with
the PC can be enhanced, for example, RS232 port can be replaced
with USB or LAN ports interface to enhance the system speed and
increase the compatibility and ease of use.
85
ْ‫ﻦ‬َ‫ﻣ‬ َ‫ﻚ‬ْ‫ﻠ‬ُ‫ﻤ‬ْ‫ﻟ‬‫ا‬‫ﻲ‬ِ‫ﺗ‬ْ‫ﺆ‬ُ‫ﺗ‬ ِ‫ﻚ‬ْ‫ﻠ‬ُ‫ﻤ‬ْ‫ﻟ‬‫ا‬ َ‫ﻚ‬ِ‫ﺎﻟ‬َ‫ﻣ‬‫ﱠ‬‫ﻢ‬ُ‫ﻬ‬‫ﱠ‬‫ﻠ‬‫اﻟ‬ ِ‫ﻞ‬ُ‫ـ‬‫ﻗ‬
ْ‫ﻦ‬َ‫ﻣ‬ ‫ﱡ‬‫ﺰ‬ِ‫ﻌ‬ُ‫ﺗ‬َ‫و‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬ ْ‫ﻦ‬‫ﱠ‬‫ﻤ‬ِ‫ﻣ‬ َ‫ﻚ‬ْ‫ﻠ‬ُ‫ﻤ‬ْ‫ﻟ‬‫ا‬ ُ‫ع‬ِ‫ﺰ‬ْ‫ﻨ‬َ‫ﺗ‬َ‫و‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬
َ‫ﻚ‬‫ﱠ‬‫ﻧ‬ِ‫إ‬ ُ‫ﺮ‬ْ‫ﻴ‬َ‫ﺨ‬ْ‫ﻟ‬‫ا‬ َ‫ك‬ِ‫ﺪ‬َ‫ﻴ‬ِ‫ﺑ‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬ ْ‫ﻦ‬َ‫ﻣ‬‫ﱡ‬‫ل‬ِ‫ﺬ‬ُ‫ﺗ‬َ‫و‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬
ٌ‫ﻳﺮ‬ِ‫ﺪ‬َ‫ﻗ‬ ٍ‫ء‬ْ‫ﻲ‬َ‫ﺷ‬‫ﱢ‬‫ﻞ‬ُ‫ﻛ‬ ‫ﻰ‬َ‫ﻠ‬َ‫ﻋ‬
‫آﯿﺔ‬ ) ‫ان‬‫ر‬‫ﻋﻤ‬ ‫آل‬ ‫ة‬‫ﺴور‬٢٦(
I
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60
56758-60

Weitere ähnliche Inhalte

Was ist angesagt?

IRJET - Two Axis with Four Sensors Solar Tracking System
IRJET -  	  Two Axis with Four Sensors Solar Tracking SystemIRJET -  	  Two Axis with Four Sensors Solar Tracking System
IRJET - Two Axis with Four Sensors Solar Tracking SystemIRJET Journal
 
Project Report for Solar Technology
Project Report for Solar TechnologyProject Report for Solar Technology
Project Report for Solar TechnologySOUMYA DATTA
 
REPORT ON SOLAR TRACKING SYSTEM
REPORT ON SOLAR TRACKING SYSTEMREPORT ON SOLAR TRACKING SYSTEM
REPORT ON SOLAR TRACKING SYSTEMBhautik Sanandiya
 
Dual axis solar tracker
Dual axis solar tracker Dual axis solar tracker
Dual axis solar tracker Aditya SHAH
 
Arduino solar tracker using ldr sensor &amp; servo motor
Arduino solar tracker using ldr sensor &amp; servo motorArduino solar tracker using ldr sensor &amp; servo motor
Arduino solar tracker using ldr sensor &amp; servo motorselvalakshmi24
 
Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...
Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...
Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...IJMREMJournal
 
Making model of dual axis solar tracking with Maximum Power Point Tracking
Making model of dual axis solar tracking with Maximum Power Point TrackingMaking model of dual axis solar tracking with Maximum Power Point Tracking
Making model of dual axis solar tracking with Maximum Power Point Trackingijsrd.com
 
Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...
Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...
Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...Mahfuza Mansura
 
Universal solar tracker final report
Universal solar tracker final reportUniversal solar tracker final report
Universal solar tracker final reportVassos Tapakoudes
 
IRJET - Dual Axis Solar Tracking System
IRJET -  	  Dual Axis Solar Tracking SystemIRJET -  	  Dual Axis Solar Tracking System
IRJET - Dual Axis Solar Tracking SystemIRJET Journal
 
Sun tracker report satyam
Sun tracker report satyam Sun tracker report satyam
Sun tracker report satyam sam shivhare
 
Presentration dual axis solar tracking system.
Presentration dual axis solar tracking system.Presentration dual axis solar tracking system.
Presentration dual axis solar tracking system.AnayetHossain4
 
An Efficient Microcontroller Based Sun Tracker Control for Solar Cell Systems
An Efficient Microcontroller Based Sun Tracker Control for Solar Cell SystemsAn Efficient Microcontroller Based Sun Tracker Control for Solar Cell Systems
An Efficient Microcontroller Based Sun Tracker Control for Solar Cell SystemsIJECEIAES
 
Solar Tracking system
Solar Tracking systemSolar Tracking system
Solar Tracking systemnavreet singh
 
SOLAR ENERGY TRACKER SYSTEM SEMINAR REPORT
SOLAR ENERGY TRACKER SYSTEM  SEMINAR REPORTSOLAR ENERGY TRACKER SYSTEM  SEMINAR REPORT
SOLAR ENERGY TRACKER SYSTEM SEMINAR REPORTeeeraviriet
 
Design and Development of Reliable Solar Tracking System with Rotation and Ti...
Design and Development of Reliable Solar Tracking System with Rotation and Ti...Design and Development of Reliable Solar Tracking System with Rotation and Ti...
Design and Development of Reliable Solar Tracking System with Rotation and Ti...IRJET Journal
 

Was ist angesagt? (20)

IRJET - Two Axis with Four Sensors Solar Tracking System
IRJET -  	  Two Axis with Four Sensors Solar Tracking SystemIRJET -  	  Two Axis with Four Sensors Solar Tracking System
IRJET - Two Axis with Four Sensors Solar Tracking System
 
Solar Tracking System
Solar Tracking SystemSolar Tracking System
Solar Tracking System
 
Project Report for Solar Technology
Project Report for Solar TechnologyProject Report for Solar Technology
Project Report for Solar Technology
 
REPORT ON SOLAR TRACKING SYSTEM
REPORT ON SOLAR TRACKING SYSTEMREPORT ON SOLAR TRACKING SYSTEM
REPORT ON SOLAR TRACKING SYSTEM
 
Dual axis solar tracker
Dual axis solar tracker Dual axis solar tracker
Dual axis solar tracker
 
Arduino solar tracker using ldr sensor &amp; servo motor
Arduino solar tracker using ldr sensor &amp; servo motorArduino solar tracker using ldr sensor &amp; servo motor
Arduino solar tracker using ldr sensor &amp; servo motor
 
Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...
Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...
Fabrication and Performance Analysis of Solar Tracking System by Using By-Pas...
 
Making model of dual axis solar tracking with Maximum Power Point Tracking
Making model of dual axis solar tracking with Maximum Power Point TrackingMaking model of dual axis solar tracking with Maximum Power Point Tracking
Making model of dual axis solar tracking with Maximum Power Point Tracking
 
Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...
Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...
Design and Construction of Automatic Dual-Axis Solar Tracking System Using Li...
 
Universal solar tracker final report
Universal solar tracker final reportUniversal solar tracker final report
Universal solar tracker final report
 
Dhaval Patel
Dhaval PatelDhaval Patel
Dhaval Patel
 
IRJET - Dual Axis Solar Tracking System
IRJET -  	  Dual Axis Solar Tracking SystemIRJET -  	  Dual Axis Solar Tracking System
IRJET - Dual Axis Solar Tracking System
 
Sun tracker report satyam
Sun tracker report satyam Sun tracker report satyam
Sun tracker report satyam
 
Presentration dual axis solar tracking system.
Presentration dual axis solar tracking system.Presentration dual axis solar tracking system.
Presentration dual axis solar tracking system.
 
Project ii
Project iiProject ii
Project ii
 
An Efficient Microcontroller Based Sun Tracker Control for Solar Cell Systems
An Efficient Microcontroller Based Sun Tracker Control for Solar Cell SystemsAn Efficient Microcontroller Based Sun Tracker Control for Solar Cell Systems
An Efficient Microcontroller Based Sun Tracker Control for Solar Cell Systems
 
Solar tracking system - Report
Solar tracking system - ReportSolar tracking system - Report
Solar tracking system - Report
 
Solar Tracking system
Solar Tracking systemSolar Tracking system
Solar Tracking system
 
SOLAR ENERGY TRACKER SYSTEM SEMINAR REPORT
SOLAR ENERGY TRACKER SYSTEM  SEMINAR REPORTSOLAR ENERGY TRACKER SYSTEM  SEMINAR REPORT
SOLAR ENERGY TRACKER SYSTEM SEMINAR REPORT
 
Design and Development of Reliable Solar Tracking System with Rotation and Ti...
Design and Development of Reliable Solar Tracking System with Rotation and Ti...Design and Development of Reliable Solar Tracking System with Rotation and Ti...
Design and Development of Reliable Solar Tracking System with Rotation and Ti...
 

Ähnlich wie 56758-60

Embedded Patient Monitoring System
Embedded Patient Monitoring System Embedded Patient Monitoring System
Embedded Patient Monitoring System ijesajournal
 
Power system automation
Power system automationPower system automation
Power system automationAbbas Ali
 
Industrial monitoring and control system using android application
Industrial monitoring and control system using android applicationIndustrial monitoring and control system using android application
Industrial monitoring and control system using android applicationAvinash Vemula
 
PLC and SCADA summer training report- government engineering college ajmer
PLC and SCADA summer training report- government engineering college ajmerPLC and SCADA summer training report- government engineering college ajmer
PLC and SCADA summer training report- government engineering college ajmerNemichand sencha
 
SOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNET
SOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNETSOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNET
SOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNETcseij
 
Graduation Project Documentation.PDF
Graduation Project Documentation.PDFGraduation Project Documentation.PDF
Graduation Project Documentation.PDFMostafa Elhoushi
 
My thesis work on Cognitive automation of Electric appliances
My thesis work on Cognitive automation of Electric appliancesMy thesis work on Cognitive automation of Electric appliances
My thesis work on Cognitive automation of Electric appliancesAkhil Reddy Rondla
 
Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...
Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...
Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...IJTET Journal
 
PLC SCADA report Paras Singhal
PLC SCADA report Paras SinghalPLC SCADA report Paras Singhal
PLC SCADA report Paras SinghalPARAS SINGHAL
 
IEEE Embedded Linux
IEEE Embedded LinuxIEEE Embedded Linux
IEEE Embedded LinuxMohamed K
 
IJSRED-V2I2P59
IJSRED-V2I2P59IJSRED-V2I2P59
IJSRED-V2I2P59IJSRED
 

Ähnlich wie 56758-60 (20)

Embedded Patient Monitoring System
Embedded Patient Monitoring System Embedded Patient Monitoring System
Embedded Patient Monitoring System
 
Power system automation
Power system automationPower system automation
Power system automation
 
Industrial monitoring and control system using android application
Industrial monitoring and control system using android applicationIndustrial monitoring and control system using android application
Industrial monitoring and control system using android application
 
EIOT Unit 1n.pdf
EIOT Unit 1n.pdfEIOT Unit 1n.pdf
EIOT Unit 1n.pdf
 
PLC and SCADA summer training report- government engineering college ajmer
PLC and SCADA summer training report- government engineering college ajmerPLC and SCADA summer training report- government engineering college ajmer
PLC and SCADA summer training report- government engineering college ajmer
 
DISTRIBUTED CONTROL SYSTEMS
DISTRIBUTED   CONTROL  SYSTEMSDISTRIBUTED   CONTROL  SYSTEMS
DISTRIBUTED CONTROL SYSTEMS
 
SOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNET
SOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNETSOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNET
SOCIAL NETWORK FOR SMART DEVICES USING EMBEDDED ETHERNET
 
C5241719
C5241719C5241719
C5241719
 
Matter new
Matter newMatter new
Matter new
 
Graduation Project Documentation.PDF
Graduation Project Documentation.PDFGraduation Project Documentation.PDF
Graduation Project Documentation.PDF
 
My thesis work on Cognitive automation of Electric appliances
My thesis work on Cognitive automation of Electric appliancesMy thesis work on Cognitive automation of Electric appliances
My thesis work on Cognitive automation of Electric appliances
 
Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...
Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...
Arm Based Real Time Monitoring and Controlling of Industrial Parameters Using...
 
E044081720
E044081720E044081720
E044081720
 
PLC SCADA report Paras Singhal
PLC SCADA report Paras SinghalPLC SCADA report Paras Singhal
PLC SCADA report Paras Singhal
 
DCCSreview
DCCSreviewDCCSreview
DCCSreview
 
Distributed Computer Control System
Distributed Computer Control SystemDistributed Computer Control System
Distributed Computer Control System
 
PLC
PLCPLC
PLC
 
IEEE Embedded Linux
IEEE Embedded LinuxIEEE Embedded Linux
IEEE Embedded Linux
 
Src 147
Src 147Src 147
Src 147
 
IJSRED-V2I2P59
IJSRED-V2I2P59IJSRED-V2I2P59
IJSRED-V2I2P59
 

Mehr von Ayad Ghany Ismaeel

CV of Baquba Technical Institute
CV of Baquba Technical InstituteCV of Baquba Technical Institute
CV of Baquba Technical InstituteAyad Ghany Ismaeel
 
CV of Baquba Technical Institute
CV of Baquba Technical InstituteCV of Baquba Technical Institute
CV of Baquba Technical InstituteAyad Ghany Ismaeel
 
CV of Engineering College -Salahalddine University
CV of Engineering College -Salahalddine UniversityCV of Engineering College -Salahalddine University
CV of Engineering College -Salahalddine UniversityAyad Ghany Ismaeel
 
Adminstrative Decision of Sceintific rank of Professor-English-Kurdish
Adminstrative Decision of Sceintific rank of Professor-English-KurdishAdminstrative Decision of Sceintific rank of Professor-English-Kurdish
Adminstrative Decision of Sceintific rank of Professor-English-KurdishAyad Ghany Ismaeel
 
Recommendation of Prof. Abdul Monem S. Rahma
Recommendation of Prof. Abdul Monem S. RahmaRecommendation of Prof. Abdul Monem S. Rahma
Recommendation of Prof. Abdul Monem S. RahmaAyad Ghany Ismaeel
 

Mehr von Ayad Ghany Ismaeel (10)

Al kitab university
Al kitab universityAl kitab university
Al kitab university
 
CV of EPU2 with sign
CV of EPU2 with signCV of EPU2 with sign
CV of EPU2 with sign
 
CV of EPU2 with sign
CV of EPU2 with signCV of EPU2 with sign
CV of EPU2 with sign
 
CV of Baquba Technical Institute
CV of Baquba Technical InstituteCV of Baquba Technical Institute
CV of Baquba Technical Institute
 
CV of Baquba Technical Institute
CV of Baquba Technical InstituteCV of Baquba Technical Institute
CV of Baquba Technical Institute
 
CV of Engineering College -Salahalddine University
CV of Engineering College -Salahalddine UniversityCV of Engineering College -Salahalddine University
CV of Engineering College -Salahalddine University
 
Adminstrative Decision of Sceintific rank of Professor-English-Kurdish
Adminstrative Decision of Sceintific rank of Professor-English-KurdishAdminstrative Decision of Sceintific rank of Professor-English-Kurdish
Adminstrative Decision of Sceintific rank of Professor-English-Kurdish
 
Dr. Peter Sapaty
Dr. Peter SapatyDr. Peter Sapaty
Dr. Peter Sapaty
 
Recommendation of Prof. Abdul Monem S. Rahma
Recommendation of Prof. Abdul Monem S. RahmaRecommendation of Prof. Abdul Monem S. Rahma
Recommendation of Prof. Abdul Monem S. Rahma
 
Prof. Al-Hamami
Prof. Al-Hamami Prof. Al-Hamami
Prof. Al-Hamami
 

56758-60

  • 1. Kurdistan Region-Iraq Ministry of High Education and Scientific Research Salahaddin University-Erbil GUI Based Remote Control of (Gas Reduction System) using PIC Microcontroller A Thesis Submitted to the Council of the College of Engineering at Salahaddin University-Erbil in Partial Fulfillment of the Requirements for the Degree of Master in Software Engineering By Essa Faiq Abdallh, B.Sc. in Computer Engineering- Al-Mustansuria University- 2006 Supervised by Asst. Prof. Dr. Raghad Zuhair YousifAsst. Prof. Dr. Ayad Ghany Ismaeel
  • 2. February 2012 A.D. Rabi Al Thani 1433 Al-H. Rashme 2711 K. ·]iàÄÑÁ“:Í€ˇËÑÌ‚G—2¬ ]d:ÍfiÅflˇËÁ|:ÍhÏÑÜÏÊ˚:8âfiÜ:ÎÏÊÌflËɡËÁh:Ê ‡ËÄÄÌt˜Ìà:ΡÁ”fiÜGÖˇÈ÷ÊÌ‚ :‘ˇÈ÷ı�1fiˆ“:Ífi]flˇÈ‚Ñ]“Ìd:Ìd:Ü]∆:Í€ÈiâÈà:ÑÌàÌd:ÎÑÊÊÄ:Ìd:ÑÊÊÄ:Í÷ı1fiˆ“ ›ÖöıÖl:ˆd:ˇÎÜ]âd Ì“ÌËÌ⁄]fi::‡ËÄÄÌt˜Ìà:ΡÁ”fiÜ:Ì÷:ÏÊÖ“:ÎÑ]ËÜÅfiÌÒ:ÎÉÈ÷ˇÁ“:ÍfiÌ⁄Áß ÌÒ:ÍåÌ”çˇÈl–::‘ˇÈåÌd:’ÏÊ:ÖˇÈ÷ÊÌ‚ ÎÜ]à:›ÖöˇÊ�Öl:ÎÑ]ËÜÅfiÌÒ:Ì÷:ÑÌià]⁄:ÎÌ◊l:Ífi]flˇÈ‚:jàÏÄÌd:Ífi]“ÌÈiâËÊÅˇÈl:Ì÷ ·Ì˘:Ì÷ ! Åe¬:–Ò] :ÓâȬÎÑ]ËÜÅfiÌÒ:Ì÷:ãˇÁËÑˇÁ÷]“Ìd:F:Ê:ÖËÊÄÑ]‚:ÎÜ]à:›ÖöˇÊ�Öl:G:ÌÈËÖâfiÌiàÁ⁄:ΡÁ”fiÜG::::Å∆Ìd 2006 8åÑÌlÑÌàÌd : : Ä:HÎ:HoÿȬ]3:9∆:Ä]Ë^:H:HÄ:HÎ:Ho:‫زھﯾر‬ ‫رﻏد‬‫ﯾوﺳف‬
  • 3. åÏÑÌˇÍ⁄:::F2711:ÔÄÑÁ“:::::::::::::::::::::Í√ÈdÏÑ:ÄÊ›ÏÊ::F1433:ÓîˇÁ“::::::::::::::::::::::::::::k]dÁå:F2012:ÓflË:Ü: ‫ﻛﻮردﺳﺘﺎن‬ ‫إﻗﻠﯿﻢ‬–‫اﻟﻌﺮاق‬ ‫اﻟﻌﻠﻤﻲ‬ ‫واﻟﺒﺤﺚ‬ ‫اﻟﻌﺎﻟﻲ‬ ‫اﻟﺘﻌﻠﯿﻢ‬ ‫وزارة‬ ‫اﻟﺪﯾﻦ‬ ‫ﺻﻼح‬ ‫ﺟﺎﻣﻌﺔ‬–‫أرﺑﯿﻞ‬ ‫ﻏﺎز‬ ‫ﺑﻤﻨﻈﻮﻣﺔ‬ ‫ﺑﻌﺪ‬ ‫ﻋﻦ‬ ‫اﻟﺘﺤﻜﻢ‬‫ﯾﺔ‬‫ﻟﻠﺒﺮﻣﺠﺔ‬ ‫ﻗﺎﺑﻞ‬ ‫ﻣﺘﺤﻜﻢ‬ ‫ﺑﺈﺳﺘﺨﺪام‬ ‫رﺳﺎﻟﺔ‬ ‫اﻟﺪﯾﻦ‬ ‫ﺻﻼح‬ ‫ﺟﺎﻣﻌﺔ‬ ‫ﻓﻲ‬ ‫اﻟﮭﻨﺪﺳﺔ‬ ‫ﻛﻠﯿﺔ‬ ‫إﻟﻰ‬ ‫ﻣﻘﺪﻣﺔ‬–‫ھﻨﺪﺳﺔ‬ ‫ﻓﻲ‬ ‫اﻟﻤﺎﺟﺴﺘﯿﺮ‬ ‫ﺷﮭﺎدة‬ ‫ﻧﯿﻞ‬ ‫ﻣﺘﻄﻠﺒﺎت‬ ‫ﻣﻦ‬ ‫ﻛﺠﺰء‬ ‫أرﺑﯿﻞ‬ ‫اﻟﺒﺮاﻣﺠﯿﺎت‬ ‫ﻗﺒﻞ‬ ‫ﻣﻦ‬ ‫ﻋﺒﺪﷲ‬ ‫ﻓﺎﺋﻖ‬ ‫ﻋﯿﺴﻰ‬،‫ھﻨﺪﺳﺔ‬ ‫ﻓﻲ‬ ‫ﺑﻜﺎﻟﻮرﯾﻮس‬‫و‬ ‫اﻟﺤﺎﺳﺒﺎت‬‫اﻟﺒﺮاﻣﺠﯿﺎت‬–‫اﻟ‬‫ﺠﺎ‬‫ﻣﻌﺔ‬‫اﻟﻤﺴﺘﻨﺼﺮﯾﺔ‬–‫ﺑﻐﺪاد‬2006 ‫ﺑﺈﺷﺮاف‬ .‫.د‬ ‫م‬ .‫أ‬‫ﯾﻮﺳﻒ‬ ‫زھﯿﺮ‬ ‫رﻏﺪ‬ .‫.د‬ ‫م‬ .‫أ‬‫اﺳﻤﺎﻋﯿﻞ‬ ‫ﻏﻨﻲ‬ ‫اﯾﺎد‬
  • 6. Chapter One Introduction ۲ Chapter One Introduction 1.1 Motivation The controlling and monitoring machines from remote location are very important in these days due to increasing the factories and plants. The automation systems and embedded control system are used when the accurate and quick decision required, and when the human life being in hazard for doing some jobs inside electrical power stations and chemical plants. The purpose of this thesis is to design and implement a complete embedded automation software system that can be used to control a Gas Reduction System automatically through a GUI and from remote location by using programmable interface controller (PIC16F877A). The GRS (Gas Reduction System) is one of the units in a power station, which is responsible on controlling gas pressure and gas temperature. The main problem in GRS is that ,all operations of monitoring and controlling of GRS is handled by technician (human driven control) who has some experience and certain level of skill in the status that might the GRS machine undergoes ,hence this type of monitoring may subjected to human fault due to inaccuracy of human driven control which involves taking wrong decisions or late response to certain critical events ,taken in consideration that the monitoring and control processes of GRS are done from far location (about 150m) from GRS and control room. The microcontrollers are widely used because microcontrollers are easy to embed into larger electronic circuit designs. Their ability to store and run unique programs makes them extremely versatile. For instance, one can program a microcontroller to make decisions and perform functions based on situations (I/O line logic) and events. The math and logic functions allow the microcontroller to mimic sophisticated logic and electronic circuits. A Microcontroller is an inexpensive single-chip computer; it means that the entire computer system lies within the confines of the (Interacted Circuit Chip). The microcontroller is capable of storing and executing programs (its most important feature). the microcontroller contains a CPU (Central Processing Unit), RAM (Random Access Memory) ROM (Read Only Memory), I/O (Input/Output), lines , Serial and parallel ports ,Timers and some times A/D (Analog-to-Digital) and D/A (Digital-to-Analog) Converters [1].
  • 7. Chapter One Introduction ۳ The PIC16F877A is useful as a reference device because it has a minimal instruction set but a full range of peripheral features. The general approach to microcontroller application design in this thesis is to develop a design using a chip that has spare capacity, and then later select a related device that has the set of features most closely matching the application requirements. The proposed system architecture, considering both the hardware and software elements involved is essential in this new era. Automation and remote control systems have been introduced to help and protect workers from hazardous working environments [2]. The proposed system technology could be used as a cost effective and more flexible way of monitoring and controlling GRS machine. The PIC microcontroller can perform all functions and activities of the original system. The block diagram of proposed system shown in figure (1.1), in which the signals to/from GRS are exchanged with the PIC through I/O interfacing circuits .Thus the PIC executes the instructions come from GUI and generate control signals to control the proposed machine. Figure (1.1) the block diagram of proposed system In order to reduce the size, weight and power consumption of the system, the PIC 16F877A (single chip Reduced Instruction Set Computer (RISC) based architecture microcontroller) was chosen. The final proposed system integrates both H/W and S/W sub-systems aiming to convert all operations which were done manually by human to full computerized operation from remote location through a special GUI.
  • 8. Chapter One Introduction ٤ 1.2 Introduction to GRS machine The GRS is a Gas Reduction System which is designed to receive the natural gas from the incoming gas pipeline, treat and condition the gas to meet the operating conditions specified by the manufacturer of the gas consumers. The GRS works in power station, the power station use the output of GRS as a fuel to operate the power station. 1.2.1 Elements of GRS Machine The GRS consist of the following elements: 1. Separator System The main purpose of the fuel gas filter/separator removes solid contaminants and liquid (condensed gas constituents) from the incoming gas flow. The filter elements are designed for continuous operation with max. 60°C. 2. Boilers The purpose of boilers is used to providing the desired heating for the water system. 3. Pressure Regulating The pressure of Gas can be regulate through adjusting valve into desired value. 4. Hot Water System The hot water system produces hot water for the gas heating system. 5. Local Control Panel The local control panel receives all status and alarm signals from the fuel gas supply system. 1.2.2 GRS Functional Description To heat up the fuel gas for the power station, a hot water system is used as a heat transfer medium. The hot water circuit is designed for a flow temperature of 90°C and a return temperature of 70°C. Natural fuel gas is applied as heating medium. The heat is generated by means of a hot water heater and a forced draft burner. The flue gas is conducted to a chimney. The hot water is circulated by an electrically driven pump, while the gas pressure is regulate through mechanical adjusting valve. 1.3 Embedded Software System Technique Embedded systems are finding widespread application including communication systems, factory automation, graphics and imaging systems, medical equipment and even household appliances. With the increasing emergence of mixed hardware/software systems, it is important to ensure the correctness of such a system formally, particularly for real-time and safety critical applications. The embedded system is regarded as a product which contains a microprocessor programmed to carry out some control functions but which is not a computer [3]. An embedded system encompasses a broad class
  • 9. Chapter One Introduction ٥ of systems, ranging, in principle, from a simple microprocessor based apparatus to complex systems controlling large plants, aircrafts and the like, in general the embedded is [4]: (1) An embedded system is an electronic system embedded within a given plant or external process. The external process comprises both a physical system (usually consisting of different subsystems) and also humans performing some supervising or parameter setting tasks. (2) Most embedded systems must fulfill stringent reliability requirements, usually detailed according to a set of functions to be performed. 1.4 Difference between Microprocessor and Microcontroller Essentially these two devices are similar, but with a little bit of difference. A CPU which is the heart of these devices needs a host of external devices to make it communicate with real-world. A typical system would need a system to read the inputs from keyboard, and write outputs to a terminal, store intermediate processing data into some memory, and to keep permanent information into some safe place [5]. These devices which are independent circuits, work in harmony with the CPU, to make one system. In a typical Personal Computer these devices are attached to the CPU, using hard-wired connections. This makes the system more flexible that means it can add more memory, change capacity of hard drives, sound cards etc. A microcontroller on the other hand is made up of most of these devices built exactly within the same package. The microcontroller will therefore contain, the CPU, RAM, ROM, Timers, I/O etc. all packed within one integrated circuit. This facilitates the development process, as well as reduces the requirements of external components; however this also means the ability of changing, the number and type of integrated devices. The applications where a microcontroller will be used vary. They are usually quite simple, and do not require as much processing power as a PC does, so the microcontrollers with varying amounts of RAM, ROM, I/O lines and timers etc have been made available. Essentially all are almost same, and they only vary in the number of resources available on them. So for a particular application that chose a microcontroller, not the one which has maximum resources, but the one which has just enough to do the job. Figure (1.2) shows the microprocessor and the microcontroller [6].
  • 10. Chapter One Introduction ٦ Figure (2.1) the microprocessor and microcontroller Figure (1.2) microprocessor and the microcontroller Thus a microcontroller is a complete, small scale computer with all the necessary devices on-board. All needed is the external hardware, which can be used to drive, like sensors and motors etc. 1.5 Literature Survey • Rajesh Luharuka, Robert X. Gao, Sundar Krishnamurty [7] have discussed a microcontroller-based portable data logger for physiological sensing. The device is configured to receive skin conductance data from a commercial instrument, store them on its on-board memory, and relay them to a computer via the RS-232 serial port. The focus of the design is on portability and low power consumption for battery-driven ambulatory applications. A PIC microcontroller was used as the central control unit for the data flow coordination. • Mohd Suhaimi B. Sulaiman [8] developed GUI Based Remote On/Off Control and Monitoring Single lamp Phase. The proposed system developed by a PIC 16F877 microcontroller. The software uses Visual Basic to monitor and control the lamps. This project explain how to develop and design an asynchronous serial data communication link
  • 11. Chapter One Introduction ۷ between the site and central station using a microcontroller and to build a low cost GUI based remote on/off control. • Mohd Noor [9] Proposed a method for monitoring the Water Level and Temperature Status by utilized the PIC16F877 and MPLAB IDE software for programming. The project was designed to detect level and temperature of the water in a pool. The system functions when the level of water and the temperature in pool exceed the desired limits. • Lock K.A [10] developed a system that controls a switch for lamp, door and alarm system using Visual Basic software. Visual Basic was chosen because it can easily communicate between computer and mobile phone. The system used computer and mobile phone to send and receive the text messages. • Ea Ai Choon [11] showed the DC motor speed control system by using microcontroller PIC 16F877A. It is a real time control system. A program in Visual Basic 6.0 is developed to provide a graphic user interface (GUI) for the user to enter desired speed at computer ,also the system shows a graph of motor speed versus time to let the user monitor the performance of the system easily. • Herdawatie A. Kadir [12] investigated the GSM-based one of the main source of power of energy to operate control home appliances for smart home such as light, air conditioner etc. The system was integrated with PIC16F877A, the microcontroller unit automatically controls the electrical home appliances by switching ON or OFF the device according to the user order. • R. Garrido and R. Miranda [13] proposed a new method for closed loop identification of position controlled dc servomechanisms. The loop around the servo is closed using a Proportional Derivative (PD) controller. A model of the servo is simultaneously controlled using a second PD controller. Properties of the identification scheme are studied using Lyapunov stability theory. • W. Aung [14] described the analysis on modeling and simulink of DC motor and its driving system, hardware and software. For DC Motor Modeling, it can be analyzed with control techniques of Step response, Impulse response and Bode plot by using MATLAB Simulink. All data based on the internal circuit of a simple DC Motor and its features can be analyzed both by Control System design calculation and by MATLAB software.
  • 12. Chapter One Introduction ۸ • Hanafi et al., [15] presented an active axis controller for a conventional CNC machine. To develop the system, a two-stage approach has been taken. In stage one; a generic external axis controller is designed to bring the machine under the real-time control of an external computer. Stage two is the design of the active axis controller. To achieve this, a sensor feedback loop is added to the external controller to enable visual servoing. • Konar and A.K. Mandal [16] had given a microprocessor based automatic position control scheme. They had designed for controlling the azimuth angle of an optimally tilted photovoltaic flat type solar panel or a cylindrical parabolic reflector to get the illuminating surface appropriately positioned for the collection of maximum solar irradiance. The proposed system resulted in saving of energy. • Zeroual et al. [17] had designed an automatic sun-tracker system for optimum solar energy collection. The system used the electro-optical sensors for sun finding and a microcontroller unit for data processing and for control of the mechanical drive system. This system allowed solar energy collectors to follow the sun position for optimum efficiency. The system had been tested for a long period in variable illumination. The result showed that it operated satisfactorily with high accuracy. • Dogan Ibrahim. [18] had developed a Microcontroller-Based Temperature Monitoring the Control system involved the use of microcontrollers in measurement and control systems .The system implemented by using a GUI based on visual basic and programming the PIC16F877A using the C-language. • Theerawut Jinayim et al. [19] proposed an efficient low power consumption tracking solar cells for white LED-based lighting system in 2007. In this system, they used the dc power generated by fixed solar cells module to energize white LED light sources that were operated by directly connected white LED with current limitation resistors. • Craig Steiner [20] discussed about the 8051 family of microcontrollers. In addition to the types of memory, special function registers, basic registers, basic registers, addressing modes discussed in this tutorial additional features including introduction to 8052 and timers are also described.
  • 13. Chapter One Introduction ۹ 1.6 Aim of Thesis The aim of the work is to design and implement a remote control system that works from PC based on Windows platform, performed successfully transmitting and receiving the data between the computer and the PIC microcontroller, through GUI for controlling and monitoring the GRS machine to satisfy the following goals: 1. Convert all the manually control operations of GRS machine into computerized operations. 2. Monitoring and controlling of the GRS machine from remote location through GUI. 3. Limiting the probability of Fault and error in the system. 4. Add automatic operation mode as a command Push button to the GRS machine in the GUI which allow automatic operations without human interactions. 5. Simulate the local manual control panel of GRS machine in to similar view but in software package form as a GUI for the system operator. 6. Designing and implementing an integration software and hardware proposal system. 1.7 Thesis Outline This thesis is organized in five chapters. The contents of the following chapters are briefly reviewed here as follows: Chapter two: This chapter devoted to preliminary work required for implementation of the GUI Based Remote Control of (Gas Reduction System) using PIC Microcontroller and embedded software system that accessed and automated by a prorate GUI by using a PIC microcontroller, Several hardware and software related issues are customizing tools and devices for implementation are treated in this chapter. Chapter three: provides details for the implementation of the final integration hardware and dual software programming techniques, also this chapter describes the steps of design and implementation step by step which lead to implement a proposed intelligent system that able to convert the manual operations of GRS which were done by human manually into full computerize operations, and from remote location.
  • 14. Chapter One Introduction ۱۰ Chapter four: presents the system experimental test and results , this chapter illustrates the real implementation and testing performed by connecting the final integration H/W and S/W with the GRS machine to replace the manual traditional operations of GRS machine, also in this chapter the oscilloscope waveforms of the input and the output signals have been presented. Chapter five: The final conclusions have been made from the design stages test and system results. Finally some highlights on some future works have been presented. Appendix A: The data sheet for PIC 16F877A Appendix B: The data sheet for PIC Programmer Appendix C: The data sheet for transistor type (2N3904)
  • 15. Chapter Two Hardware and Software Components for Controlling GRS
  • 16. Chapter Two Hardware and Software Components for Controlling GRS Chapter Two Hardware and Software Components for Controlling GRS 2.1 Introduction The GRS system is a unit in electrical power station which is responsible on controlling gas pressure and temperature. This chapter focuses on some key devices and tools (H/W and S/W) used for monitoring & controlling The (GRS) unit. A detailed description is presented for (PIC16F877A) Microcontroller which is the core of proposal embedded system for implementing a full computerize control from remote location that is compatible with aspects of a (GRS) .Finally the embedded software system is accessed and automated by a prorate GUI ,this GUI(built in Visual Basic) is presented and explained in details. 2.2 Overview of GRS System The GRS is a Gas Reduction System which is used to control the gas pressure and the gas temperature, the GRS works in Erbil power station, the power station uses the output of GRS as a fuel to operate the power station, the GRS system is shown in figure (2.1) Figure (2.1) view of GRS system 12
  • 17. Chapter Two Hardware and Software Components for Controlling GRS The GRS system contains boilers for heating inlet gas into desired set point. Figure (2.2) shows the local control panel inside GRS system. The GRS control panel contains two types of digital signals the first one involves LED Light Emitting Diodes as a signals indicators while the second type involves the ON-OFF switches. There are three types of LED indicators; Green LEDs refer to the normal operations, Red LEDs to indicate fault or alarm cases, and Yellow LEDs for event of proper operation. Whereas, the ON-OFF switches consist of two types of switches the push buttons switches, and mode selector switches. Figure (2.2) local control panel of GRS 13
  • 18. Chapter Two Hardware and Software Components for Controlling GRS The main problem in GRS is that ,all operations of monitoring and controlling of GRS are handled by technician (human driven control) who has some experience and certain level of skill in controlling GRS machine ,this type of monitoring may subjected to human fault due to inaccuracy of human driven control which may include wrong decisions or late response to certain critical events ,taken in consideration that the monitoring and control processes of GRS are done from far off location about(150m) from GRS and control room. Hence the computer driven control for GRS system is achieved by using dual software programming techniques, each techniques works in a different software level of proposed system, the first level of software programming technique is the embedded software which used for programming the PIC microcontroller by using C-language that default software debugs environment of the PIC manufactory cooperation. The second level of software programming technique include designing special graphical interfacing GUI by using Visual Basic which enables remote controlling and monitoring of GRS because of the final GUI is similar to the real control board panel of GRS , so the operator will not find it strange from the panel he used to work on with added facilities like automatic control mode which is derived from the idea of the auto-pilot navigation system presented in aircraft that enables the pilot to suspend manual control and activate automatic control. In the presented controller, this mode is activated by clicking special push button (Automatic System mode) that allows automatic operation of GRS system. Hence, this interactive interfacing media for the operator (human) facilitate the controlling of GRS and reduce the faults and errors space in the system operation. The final system integrates both of H/W and S/W system to convert all operations which were done manually by human to full computerize operation and from remote location. 2.3 GRS System Control Status The sequences of events for GRS are described in the flow chart depicted in figure (2.3). The initial status represent the last events happened in the GRS system, the system saves the recent status unless the system status changed by the operator. 14
  • 19. Chapter Two Hardware and Software Components for Controlling GRS The following flow chart in figure (2.3) depicts the manual control operations of GRS by classifying these operations to the following actions: starting, resetting, checking, monitoring operation. Figure (2.3) Flow chart of GRS operations Reset Fault Boiler Ready to start ? Starting Sequence of Events Boiler started? Assign certain Set Point(SP) Actual Tempreture <= SP Increasing bolier tempreture Boiler temp>2*SPBoiler tempreture<2*SP||Boiler tempreture >SP Boiler Tempreture<SP Trip the Boiler Check Conditions Stop incresing boiler tempreture NO Yes Yes YesYes Yes Yes NO NO NO NO NO Initial status Energized main power Manually 15
  • 20. Chapter Two Hardware and Software Components for Controlling GRS Before staring GRS machine the operator must identifies errors and faults in system results from its previous operation .Errors and faults must be handled with a suitable action. Then after the operation of energizing main power is started, any faults and errors result from this operation will be rested by pushing the rest push button, in order to prepare the GRS for entering its ordinary sequence of operation. The system becomes ready to start if there is no fault or an error in the GRS machine after the completion of resetting action, if the system not ready to start the checking and resetting actions should be repeated again. Then after the boiler of GRS system starts its action, for that some desired temperature should selected as a temperature set point, the range of temperature set point is extended from (0-100) Cº centigrade degree . According to the set point value, the system starts to increase or decrease its temperature, by comparing the desired set point (selected previously) with the actual current temperature. If the actual temperature of GRS boiler less than the set point temperature the sequence process starts increasing the temperature to reach the desired temperature. Then if the actual temperature equals to the set point temperature the sequence of process waits till temperature drop. When the actual temperature of GRS boiler is very high (high-high) more than (100) Cº temperature, the sequence of process stops immediately the increment of temperature and shut downing the GRS boiler to prevent the hazards. After system stopping, the check (maintenance) phase is activated to handle the fault, and then reset the system to enable it to restart again. If the actual temperature of GRS boiler is higher than the set point temperature (high-statues), the sequence of process waits till the actual temperature of GRS boiler decrease to the level less than set point temperature. In the case where the actual temperature of GRS boiler is less than the set point temperature, the system fault should reset manually by human to enable the boiler of GRS to start again. Else the sequence of process waits for temperature dropping. 16
  • 21. Chapter Two Hardware and Software Components for Controlling GRS 2.3 Microcontrollers A microcontroller is defined as an integrated circuit (IC) which consists of a processor core (CPU), non-volatile program memory which is either ROM or flash, volatile memory for the input/output peripherals, a clock and the control unit for input/output (I/O)[ 2,4] A Microcontroller is an inexpensive single-chip computer; Single chip computer mean that the entire computer system lays within the confines of the (Interacted Circuit Chip).The microcontroller is capable of storing and running a program (its most important feature). The microcontroller contains a CPU (Central Processing Unit), RAM (Random Access Memory) ROM (Read Only Memory), I/O (Input/Output), lines , Serial and parallel ports ,Timers and some times A/D (Analog-to-Digital) and D/A (Digital-to-Analog) Converters . [21] A generic view of a microcontroller is shown in Figure (2.4) a special category of microprocessor emerged that was intended for control activities, not for crunching big numbers. After a while this type of microprocessor gained an identity of its own, and became called a ‘microcontroller’. The microcontroller took over the role of the embedded computer in embedded systems. [22] Figure (2.4) a generic microcontroller The microcontrollers are widely used because microcontrollers are easy to embed into larger electronic circuit designs. Their ability to store and run unique 17
  • 22. Chapter Two Hardware and Software Components for Controlling GRS programs makes them extremely versatile. For instance, one can program a microcontroller to make decisions and perform functions based on situations (I/O line logic) and events. The math and logic functions allow the microcontroller to mimic sophisticated logic and electronic circuits. [23] 2.3.1 PIC Microcontroller PIC is a family of Harvard architecture microcontrollers made by Microchip Technology. The name PIC initially referred to "Programmable Interface Controller” [24] 2.3.2 Harvard architecture of the PIC microcontroller Harvard architecture is newer concept than Von-Neumann’s. It rose out of the need to speed up the work of the microcontroller. In Harvard architecture, data bus and address bus are separate. Figure (2.5) shows the Harvard architecture versus von-Neumann. Thus a greater flow of data is possible through the central processing unit, and of course, a greater speed of work. [3, 25] Figure (2.5) Harvard and Von-Neumann's architecture Separating a program from data memory makes it further possible for instructions not to have to be 8-bit words. PIC 16F877A uses 14 bits for instructions which allows for all instructions to be one word instructions. [22] 18
  • 23. Chapter Two Hardware and Software Components for Controlling GRS It is also typical for Harvard architecture to have fewer instructions than Von Neumann’s and to have instructions to be executed in one cycle. The major advantage with this architecture is that while an instruction is being executed the next can be fetched .The execution speed is doubled. This architecture has been found in PIC16F877A. PIC uses Harvard architecture, so the size of an instruction can be different from the size of the data.[25] 2.4 Types of Internal Memory of PIC microcontrollers and PIC Family In general the PIC microcontroller may be contained three Types of internal memory : PIC XX C XXX(Mean EPROM) ,PIC XX CR XXX (Mean ROM) ,PIC XX F XXX(Mean FLASH MEMORY) [26]. 2.4.1 Families of PIC microcontrollers The PIC microcontrollers can be classifying into three Families, Table (2.1) shows a comparison among 8-bit PIC families The Three Families are [22]: 2.4.1.1 Baseline family The baseline PIC microcontroller family represents the most direct descendant of the General Instruments ancestors, and displays the core features of the original PIC design. The first Microchip baseline microcontrollers were coded 16C5X, following the General Instruments 1650 and 1655 numbering. Now, however, there are also 10 and 12 Series microcontrollers which fall into this category. [24] With only a two-level stack and no interrupts, there are real limits to the program and hardware complexity that can be developed. For example, without interrupts there is restriction on the type of on-chip peripheral that can be included, as most peripherals use interrupts to enhance their interface with the CPU. Baseline devices are ideal for really tiny applications, being packaged in small ICs (right down to only six pins, for example). Despite their small size and simple architecture, baseline microcontrollers carry some interesting peripherals, including analog-to-digital converters and EEPROM (Electrically Erasable Programmable Read-Only Memory). 19
  • 24. Chapter Two Hardware and Software Components for Controlling GRS 2.4.1.2 Mid-range family The mid-range family contains several simple but important developments, when compared to the baseline devices. Interrupts (albeit with a single interrupt vector) are introduced and the stack size is increased. The instruction set is a slight extension of the baseline set. The introduction of interrupts allows interfacing both with more sophisticated peripherals and with larger numbers of peripherals. Mid-range devices include all of the 16 Series except those coded 16C5XX or 16F5XX, and some of the 12 Series. Avery wide range has been developed, with many different peripherals and technical enhancements. The larger devices, with multiple peripherals and significant on-chip memory, are both powerful and versatile.[26] 2.4.1.3 The high-performance family In this family Microchip has come to grips with some of the issues of sophisticated processors. The instruction set is significantly increased, now to 75 instructions, and is designed to facilitate use of the C programming language. In certain versions there is also an ‘extended’ instruction set, with a further small set of instructions. There are two interrupt vectors, which can be prioritized the high-performance family is made up only of 18 Series microcontrollers. It is a powerful family and new members are continuously being added to the range. [25] Table (2.1) Comparison of 8-bit PIC families 20
  • 25. Chapter Two Hardware and Software Components for Controlling GRS 2.5 (PIC16F877A) Microcontroller Units: [27,28] PIC is A Programmable Interface Controller which has wide use areas and are preferred mainly due to low cost, wide availability, free development environments, and easy to access experiences. Figure (2.6) shows the pin schematics of (PIC 16F877A) produced by Microchip Technology Inc. that is used in this thesis. The name PIC initially referred to “Programmable interface controller”, but shortly thereafter was renamed as “Programmable Intelligent Computer”. PIC (re-programming with flash memory) capability. Figure (2.6) PIC 16F877A pin diagram Generally, PIC microprocessor consist of program memory, EEPROM, RAM, 5-PORTS (A,B,C,D,E) ,free-run timer and central processing unit: [26] 21
  • 26. Chapter Two Hardware and Software Components for Controlling GRS (i) Program memory (FLASH) – is used for storing a written program. Using flash technology, the memory can be programmed and cleared more than once. It makes this microcontroller suitable for device development. (ii) EEPROM - data memory that needs to be saved when there is no supply. It is usually used for storing important data that must not be lost if power supply suddenly stops. For instance, one such data is an assigned temperature in temperature regulators. If during a loss of power supply this data was lost, we would have to make the adjustment once again upon return of supply. Thus our device looses on self-reliance. (iii) RAM - data memory used by a program during its execution. In RAM, it stored all inter-results or temporary data during runtime. (iv) PORTS (A, B, C, D, E) are physical connections between the microcontroller and the outside world. And each port contains 8-pins. (v) FREE-RUN TIMER is an 8-bit register inside a microcontroller that works independently of the program. On every fourth clock of the oscillator it increments its value until it reaches the maximum (255), and then it starts counting over again from zero. As we know the exact timing between each two increments of the timer contents, timer can be used for measuring time which is very useful with some devices. (vi) CENTRAL PROCESSING UNIT has a role of connective element between other blocks in the microcontroller. It coordinates the work of other blocks and executes the user program. 2.5.1 PIC 16F877A MCU Features The range of microcontrollers now available are developed because the features of the MCU used in any particular circuit must be as closely matched as possible to the actual needs of the application. Some of the main features to consider are:[27] • 100,000 erase/write cycle Enhanced Flash program memory typical. • 1,000,000 erase/write cycle Data EEPROM memory typical. • Power saving Sleep mode. • Nonvolatile data memory • Selectable oscillator options. 22
  • 27. Chapter Two Hardware and Software Components for Controlling GRS • Range of interfaces. • Programmable code protection. • Cost and availability. The PIC16F877A is useful as a reference device because it has a minimal instruction set but a full range of peripheral features. The general approach to microcontroller application design followed here is to develop a design using a chip that has spare capacity, and then later select a related device that has the set of features most closely matching the application requirements. If necessary, we can drop down to a lower range (PIC10/12 series), or if it becomes clear that more power is needed, we can move up to a higher specification chip (PIC18/24 series). This is possible as all devices have the same core architecture and compatible instructions sets. [30] Figure (2.7) the internal architecture of PIC16F877A 23
  • 28. Chapter Two Hardware and Software Components for Controlling GRS The most significant variation among PIC chips is the instruction size, which can be 12, 14, or 16 bits. The A suffix indicates that the chip has a maximum clock speed of 20 MHz [31].The internal architecture of 16F877A is shown in the in Figure (2.7) 2.5.2 Why PIC 16F877 has been Selected The Device which selected is the PIC 16F877 Microcontroller, there are 40- pin, and these pins are divided into five PORTS (A, B, C, D, E), so each port contain contains 8-pins. (Appendix A) Most of these features that are likely found in the family of microcontrollers from Microchip Technology manufactures with internal Programmable Flash Memory. [32] Table (2.2) illustrate PIC16f877 and others PICs 24
  • 29. Chapter Two Hardware and Software Components for Controlling GRS 2.5.3 PIC16F877A Operating System As microcontroller operating programs become more complex, consideration must be given to the best method of organizing the program response to input, memory management, and output timing. Three main methods are used to handle input and output events, which after all, is the primary requirement of a real-time system. In order of complexity, they are I/O polling, interrupts, and the real-time operating system (RTOS). [31] 2.5.3.1 Polled I/O This is the easiest, and may be considered the default, method of input and output, where operations are simply scheduled as part of the main loop. they have been deliberately kept simple. The basic principle is illustrated in figure (2.8) .This option is fine if the delay that occurs between input signal and output response is not critical to the correct overall operation of the system[31]. Figure (2.8) Polled I/O Process The input processing may vary significantly, depending on the input data or programmed options within the loop. For example, a test on the data may result in an optional sequence being executed, or not, depending on the value. In fact, this is pretty much inevitable in most real programs. 25
  • 30. Chapter Two Hardware and Software Components for Controlling GRS 2.5.3.2 Interrupts Interrupts are internally or externally generated asynchronous hardware signals that force the processor to stop its current (background) task and carry out the interrupt service routine (ISR), a higher-priority (foreground) task. The processor “context” (current register contents and status) must be saved and the current program address stored on the stack so that the background task can be resumed when the ISR has finished. Figure (2.9) describes the interrupt operation. Figure (2.9) Interrupt Operation If the program uses multiple interrupts, one ISR may be interrupted by another. The interrupts may need to be assigned an order of priority, so that a less important task does not interrupt a more important one. When the higher-priority ISR is being executed, the lower-priority interrupt can be disabled, or masked, until it is finished. An operating system (OS) provides an alternative to interrupts as a means of providing a more predictable time response in the microcontroller system but again is typically implemented in the higher-power MCU type [31]. 26
  • 31. Chapter Two Hardware and Software Components for Controlling GRS 2.5.3.3 PIC Real-Time Operating System The principle of operation of a simple RTOS, as implemented by CCSC, is shown in Figure (2.10). The program is divided into separate tasks, which are executed in turn. A timer interrupt causes the task switching, but interrupts are otherwise not used, When a task is suspended, its context (file register state) is saved and restored when it is restarted the next time around. Simultaneously, and the I/O timing is more predictable. More sophisticated systems incorporate task priority and implement more complex task management strategies. All that remains then is to start up the RTOS in the main block, and the tasks are executed in turn, with the frequency and duration specified for each. The CCS implementation is classified as a cooperative, multitasking RTOS. This means that the tasks return control to the scheduler voluntarily to allow the next to run[31]. Figure (2.10) Basic RTOS Operation 27
  • 32. Chapter Two Hardware and Software Components for Controlling GRS 2.6 PIC16F877A Program Execution The chip has 8 KB (8096 = 14 bits) of flash ROM program memory, which has to be programmed via the serial programming pins PGM (pin No.36), PGC (pin No.39), and PGD (pin No.40). Figure (2.11) Shows PIC16F877A block diagram with 40 pin-out explanation. The fixed-length instructions contain both the operation code and operand (immediate data, register address, or jump address). The mid-range PIC has a limited number of instructions (34) and is therefore classified as a RISC (reduced instruction set computer) processor. [31] Looking at the internal architecture in figure (2.7). The blocks involved in program execution. The program memory ROM contains the machine code, in locations numbered from 0000 h to 1FFFh (8kbyte). The program counter holds the address of the current instruction and is incremented or modified after each step. On reset or power up, it is reset to zero and the first instruction at address 0000 is loaded into the instruction register, decoded, and executed. The program then proceeds in sequence, operating on the contents of the file registers ( 000h– 1FFh ), executing data movement instructions to transfer data between ports and file registers or arithmetic and logic instructions to process it. The CPU has one main working register (W), through which all the data must pass. If a branch instruction (conditional jump) is decoded, a bit test is carried out; and if the result is true, the destination address included in the instruction is loaded into the program counter to force the jump. If the result is false, the execution sequence continues unchanged. In assembly language, when CALL and RETURN are used to implement subroutines, a similar process occurs. The stack is used to store return addresses, so that the program can return automatically to the original program position. However, this mechanism is not used by the CCS C compiler, as it limits the number of levels of subroutine (or C functions) to eight, which is the depth of the stack. Instead, a simple GOTO instruction is used for function calls and returns, with the return address computed by the compiler. 28
  • 33. Chapter Two Hardware and Software Components for Controlling GRS Figure (2.11) Show PIC16F877A block diagram with 40 pin-out 2.7 RS-232 Serial Channel Communication between PIC and PC PIC 16F877 has a dedicated hardware RS232 port, but CCS C allows any pin to be set up as an RS232 port, providing functions to generate the signals in software. The basic form of the signal has 8 data bits and a stop and start bit. [31] Figure (2.12) shows that. 29
  • 34. Chapter Two Hardware and Software Components for Controlling GRS Figure (2.12) start and stop bits[31] A PIC microcontroller provides I/O ports to interface with any other peripheral hardware but their use depend on the design and the selected communication scheme. The RS-232 serial channel communication is perhaps the most preferred communication scheme between a standard personal computer and such microcontrollers. For this reason, this section is devoted to the RS- 232communication details referenced in this thesis. This infrastructure is constructed before any software related implementations. In order to connect a microcontroller to a serial port on a PC computer, we need to adjust the level of the signals so communications can take place. The signal level on a PC is -10V for logic zero, and +10V for logic one. Since the signal level on the microcontroller is +5V for logic one and 0V for logic zero, we need an intermediary stage that will convert the levels. One chip specially designed for this task is MAX232. This chip receives signals from -10 to +10V and converts them into 0 and 5V. [31] PIC 16F877A includes a USART (Universal Synchronous Asynchronous Receiver Transmitter) module capable of operating in one of the asynchronous-full duplex, synchronous-master-half duplex or synchronous-slave-half duplex modes. [31] The 9-pins of RS-232 Serial Communication are shown in figure (2.13) Figure (2.13) illustrate the RS-232 Serial Communication[7] 30
  • 35. Chapter Two Hardware and Software Components for Controlling GRS The asynchronous mode is mainly used for communicating with personal computers whereas synchronous configuration provides communication with other peripheral devices such as external A/D or D/A converters, serial EEPROMs, etc. The connection of PC to the PIC through RS-232 is indicated in Figure (2.14) The universal synchronous/asynchronous receive transmit (USART) of Device is typically used in asynchronous mode to implement off- board, one-to- one connections. The term asynchronous means no separate clock signal is needed to time the data reception, so only a data send, data receive, and ground wires are needed. It is quick and simple to implement if a limited data bandwidth is acceptable. A common application is connecting the PIC chip to a host PC for uploading data acquired by the MCU subsystem USART operation. The USART link can send data up to 100meters by converting the signal to higher-voltage levels (typically = 12 V). The digital Signal is inverted and shifted to become bipolar (symmetrical about 0 V, line negative when inactive) for transmission. [7] Figure (2.14) illustrate Connection PIC and PC 2.8 Power Supply Unit Power Supply Unit (PSU) is an electronic device or system that supplies electrical or other types of energy to one or more components, for the appliances that require low voltage, Power Supply Unit is a device that converts one form of electrical energy to another desired form and voltage [33].Actually in this system two power supplies are used: 2.8.1 The power Supply of PIC Like any electronic circuit, a microcontroller and the overall embedded system need to be supplied with electrical power. Traditionally, much logic circuitry is 31
  • 36. Chapter Two Hardware and Software Components for Controlling GRS supplied at 5V, arising from the voltage specified for the TTL (Transistor Transistor Logic) logic family. With the growth in battery-powered equipment and developments in electronic technology, supply voltages have been pushed down, and 3.3 and 3.0V supplies are now common. Operating conditions for electronic components are specified in the manufacturer’s data sheet. In terms of power supply there are two important issues: the supply voltage required and the current that the device will then take from the supply. This supply current will be dependent on operating frequency. Also given are absolute maximum ratings, which give voltage and power dissipation levels beyond which the device must not be taken [34]. The PIC take its Power supply Direct from computer USB port connection, the PIC work with (5) VDC and the PIC operation power Supply voltage range between (2 to 6) VDC. 2.8.2 The power supply Switching relays The Relay which is connected with the output signal needs a power supply voltage of (12) VDC. A computer Power supply can provide this voltage 2.9 The input and output circuits The PIC deals with TTL level voltage (0-5) VDC the voltage more than (6) VDC might burn the PIC so, to prevent the PIC from burring there is a needs to break down voltage (decrease) the input signals voltage level by using a zener diode. A zener diode is a special kind of diode which allows current to flow in the forward direction in the same manner as an ideal diode, but will also permit it to flow in the reverse direction when the voltage is above a certain value known as the break down voltage, "zener knee voltage" or "zener voltage." The device was named after Clarence Zener, who discovered this electrical property. 2.9.1 Input reduction signals voltage Using Zener Diodes The purpose of using the zener diode is to break down voltage (decrease) the (24) VDC from the (GRS) machine into (5) VDC as an input signals to (PIC) , figure (2.15) show the electronic design of (5.1) V zener with resistance 30KΩ. Figure (2.15) zener diode break down voltage input circuit 32
  • 37. Chapter Two Hardware and Software Components for Controlling GRS 2.9.2 Output Switching Circuit (Relay Component) Relay is an electromagnetic switch and it is chosen over transistor due to its fully on/off characteristic. In addition, conventional PNP transistor switching circuit couldn't perform the switching operation in the situation where the emitter voltage is higher than the base voltage (5V from PIC). [34] the design of electronic circuit contain: NPN transistor type (2N3904), Schottkey diode and resistor 10 KΩ. .See Appendix (C). The electronic design of relay switch circuit is shown in figure (2.16) Figure (2.16) the Relay Switch circuit The aim of employing relays is to enable the PIC controlling the switching remotely and automatically by replacing traditional manual switches in the GRS system. 2.10 Programming PIC in C-Language Using MPLAB IDE Compiler Environment MPLAB is a Microchip’s Technology Integrated Development Environment, it is includes an editor and a simulator and interfaces with many compilers, including the CCS compiler (Custom Computer Service) which is specializes in compilers for PIC microcontrollers. MLPAB allows the editing, compilation, download the embedded software to PIC, and testing of a sample C program to demonstrate the basic process and the generated file set analyzed [31]. Figure (2.17) illustrates simple C Program created in MPLAB environment. Also, MPLAB includes the assembler for, assembly code is more cumbersome to write, in the first place, and also more difficult to maintain. 230VAC 2N3904 10 KΩ 33
  • 38. Chapter Two Hardware and Software Components for Controlling GRS The C language eliminates the need to learn the PIC16 assembly language and frees the user from managing all the details.[31] Figure (2.17) illustrates C program writing in MPLAB The PIC microcontroller program comprises a list of machine code instructions, decoded and executed in sequence, resulting in data movement between registers, and arithmetic with logic operations. MCU reset starts execution at address zero, and the instructions are executed in address order until a program branch is decoded, at which point a new target address is derived from the instruction. A decision is made to take the branch or continue in sequence based on the result of a bit condition test. [22] C-Language has become the universal language for microcontrollers. It allows the MCU memory and peripherals to be controlled directly, while simplifying peripheral setup, calculations, and other program functions. All computer languages need an agreed set of programming language rules. 34
  • 39. Chapter Two Hardware and Software Components for Controlling GRS 2.10.1 MPLAB C project [31] The primary function of the compiler is to take a source text file PROJNAME.C and convert it to machine code, PROJNAME.HEX. The hex file can then be downloaded to the PIC MCU. The source file must be written in the correct form. As Showed in Figure (2.17). In this source code, statement (# include 16F877A. h). This defines the specific chip for which the program is created and refers to a header file supplied with the compiler. This file must be included because it holds information about the chip register addresses, labeling, and so on. The file should be copied from the devices folder in the CCS C program file folder set into the project folder. It can then be attached to this project by right clicking on the Header Files folder. The code now is ready to compile the program by clicking on the compile button in the MPLAB main toolbar. The compiler execution dialog briefly appears and, ideally, a “build succeeded” message is displayed. 2.10.2 MPLAB Project file Some of files created in the project folder, which are concerned with MPLAB project management are described as the following:[31] ● outbyte.c The source code file is created in a text edit window, in line with the compiler and ANSI C syntax rules. For viewing outside MPLAB, it can be “ opened with ” (right click) Notepad. ● outbyte.hex The hex file, the program download file as it is displayed in a text editor. The fact that it is readable shows that it is stored as ASCII characters. It must be converted by the program downloading utility to actual binary code for loading into program flash memory in the MCU. ● outbyte.lst This contains the intermediate assembly language version of the program, plus the configuration fuse settings. ● outbyte.cof This file contains the machine code plus source file information that allows debugging tools to display the source code and variables using their original labels. This file is attached to the MCU to support source code debugging. ● outbyte.err The error file provides debugging messages, which are displayed in the Output, Build window after compilation. 35
  • 40. Chapter Two Hardware and Software Components for Controlling GRS ● outbyte.sym The symbol map shows the register locations in which the program variables are stored. ● outbyte.mcp This is the MPLAB project information file. ● outbyte.mcw This is the MPLAB workspace information file. ● outbyte.pjt This is the CCS compiler project information file. 2.11 Hardware Board Kit for PIC Development & Programming: The EasyPIC6 development system is an extraordinary development tool suitable for programming and experimenting with PIC microcontroller from MICROCHIP .The EasyPIC6 Kit illustrate in Figure (2.18).The board includes an on board programmer with ICD support (In Circuit Debugger) providing an interface between the microcontroller PIC and PC. See Appendix (B) Figure (2.18) the development EasyPIC6 Kit Board 36
  • 41. Chapter Two Hardware and Software Components for Controlling GRS The (.hex) code file can loaded to PIC Through USB cable by using EasyPIC6 Kit Board, this board can used to programming the PIC and also can used as interfacing media between PC and the machine . See Appendix (B) 2.12 Ethernet IP Network Ethernet is a family of frame-based computer networking technologies for local area networks (LANs). The name comes from the physical concept of the Ether. It defines a number of wiring and signaling standards for the Physical Layer of the OSI networking model, through means of network access at the Media Access Control (MAC) /Data Link Layer, and a common addressing format. The topology which implemented is bus topology and RJ45 Ethernet Cable STP (Shielded Twisted Pair) Cat5 to prevent the noise in the industrial environment and grantee more distance than UTP. Figure (2.19) show RJ45 Ethernet Cable. [35] Figure (2.19): Standard RJ45 Ethernet Cable. 37
  • 42. Chapter Three A Proposed Design of GUI Based Remote Control for GRS
  • 43. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.1 Introduction This chapter describes the steps of design and implementation for the GRS machine remote controlling and monitoring both of software and hardware components. All software tools and hardware devices which mentioned in chapter two integrated together in proposed intelligent system that convert the manual operations of GRS which were done by human manually into full computerize operations , 3.2 Procedure of System Design and Implementation The steps followed in designing generic integrated H/W and S/W systems are shown in flow chart depicted in figure (3.1) System design and implementation start by determining H/W and S/W components specifications for the proposed system .After collecting the design related information, the next step will be hardware design in which the hardware components must be compatible with all action done by GRS system. As the stage of hardware design is complete a review for the hardware design elements is made. If the hardware elements selected are compatible with GRS machines control signals, the software construction is started if not, the hardware elements selection is repeated till it satisfies the system design. The software presented in the proposed system design can be classified into two types software techniques: the embedded software technique (PIC software) and the interfacing user technique (GUI software) Both of software methods must be test and reviewed. The final step in proposed system design concerned with integrating both of hardware components and software tools. These steps described before will be discussed in details in the coming sections: 39
  • 44. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Figure (3.1) flow chart of designing generic integrated H/W and S/W design System Design Specification Collect all Design Related information Design Proposal Hardware Components Design Proposal Software Components All H/W Components considered (Review) All S/W Components considered (Review) Integrate H/W & S/W Prototype Implement the Final Integration System N N Y Y Start End 40
  • 45. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.3 System Design Specification The system design specification is the first and most important step in the system design process, in this step the GRS machine hardware components are selected and specified for the design and implementation of the proposal automatic system GRS machine. Figure (3.2) shows the original local control Panel of (GRS) that will be converted into full computerized operation and monitoring from remote location. Figure (3.2) the (GRS) machine panel Also in this stage of system design process, the hardware component and software tools should be specified before moving to the next step of the system design. According to the requirement of proposal system the hardware component and software tools should be compatible with all actions done by GRS machine. 41
  • 46. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.4 Collect Design Related Information In this step of system design process, the information related to the system operation is collected. The operation environment and the system reaction for the alarm signals and faults represent the main and the first information should be collected. There are three recourses of information which must be collected for GRS machine, the first is the set of documents (manuals) from the GRS manufactory company which contains all possible fault and failure events in the system while the second source of information comes from the monitoring of real GRS machine action ,by taking photos and recording video for monitoring the system in work behavior in order to cover all system status and manual reaction to it during different operation conditions. The third source of information is gathering information from the operator that responsible on operate and monitor the GRS machine manually. The information gathered was about the events of faults and a failure has been faced, to translate these events into software to enable the proposed microcontroller (PIC) to control the machine. Figure (3.3) shows the GRS control panel graph in which each component is assigned a number. The action of each component (indicated by its corresponding number) is depicted in table (3.1) Figure (3.3) GRS diagram with I/O Signals description According to “Rotaring” Manufacture Company 42
  • 47. Chapter Three A Proposed Design of GUI Based Remote Control for GRS The description of Figure (3.3) I/O signals is listed in table (3.1) below: Table (3.1) the GRS machine signals Signal NO.# Signal Description 1 H11 CIRCULATION PUMP OVERLOAD 2 H5 CIRCULATION PUMP IN OPERATION 3 CIRCULATION PUMP SELECTOR SWITCH 4A H1 IGNITION GAS 4B H15 LEAKAGE ALARM GAS VALVE AA005 4 H12 BURNER MOTOR OVERLOAD 5 H3 BURNER START 6 13 BURNER DISTURB 7 H4 BURNER IN OPERATION 8 S2 BURNER START LOCAL 9 S3 BURNER STOP LOCAL 10 S8 RESET BURNER CONTROL 11 S9 BURNER OPERATION LOCAL REMOTE 12 N1 TEMPERATUR CONTROL 13 S10 TEST FLAME DETECTOR 14 S11 BURNER OPERATION MODE 15 H7 LSA- 00EKT21CL081 16 H10 PSA- 00EKT21CP083 17 H9 PSA+ 00EKT21CP082 18 H14 EM/SAFETY CIRCUIT BURNER CONTROL 19 S7 ALARM RECEIPT 20 H2 LOW GAS PRESSURE 21 H6 TS+ 00EKT21CT081 22 H8 TA+ 00EKT21CT082 23 S5 TEST TA+ 00EKT21CT082 25 S12 LAMP TEST 26 S6 EMERGENCY STOP 27 Q1 MAIN SWITCH 28 S1 THERMOSTAT (INSIDE DOOR) 29 M1 SWITCHBOARD FAN + AIR INLET 30 AIR OUTLET FILTER 43
  • 48. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.4.1 Mapping GRS Input and Output signals to PIC Pins The input and output signals to /from GRS are digital signals (0-1) describe (ON-OFF) states. Each input signal from GRS machine to the PIC microcontroller and each output signal from PIC to the GRS machine will be assigned in to special pin of the (PIC). Table (3.2) lists the PIC pins assignment with signals description. Table (3.2) the PIC pin identification No.# (PIC) Pins Label Indication Type Description 1 RA0 LED1 Fault Digital in CIRCULATION PUMP OVERLOAD 2 RA1 LED2 Run OK Digital in CIRCULATION PUMP IN OPERATION 3 RA2 LED4A Run Digital in IGNITION GAS 4 RA3 LED4B Fault Digital in LEAKAGE ALARM GAS VALVE 5 RA4 LED4 Fault Digital in BURNER MOTOR OVERLOAD 6 RA5 LED5 Run Digital in BURNER START 7 RB0 LED6 Fault Digital in BURNER DISTURB 8 RB1 LED7 Run Digital in BURNER IN OPERATION 9 RB2 LED15 Fault Digital in LSA- 00EKT21CL081 10 RB3 LED16 Fault Digital in PSA- 00EKT21CP083 11 RB4 LED17 Fault Digital in PSA+ 00EKT21CP082 12 RB5 LED18 Fault Digital in SAFETY CIRCUIT BURNER CONTROL 13 RB6 LED20 Fault Digital in LOW GAS PRESSURE 14 RB7 LED21 Fault Digital in TS+ 00EKT21CT081 15 RE0 LED22 Fault Digital in TA+ 00EKT21CT082 16 RC0 SWITCH3 SELECTOR Digital out SELECTOR SWITCH LOCAL/REMOTE 17 RC1 18 RC2 Buttom8 start Digital out BURNER START LOCAL 19 RC3 Buttom9 stop Digital out BURNER STOP LOCAL 20 RC4 RESET Buttom10 RESET Digital out RESET BURNER CONTROL 21 RC5 SWITCH11 SELECTOR Digital out BURNER OPERATION LOCAL REMOTE22 RC6 23 RC7 Buttom13 TEST Digital out TEST FLAME DETECTOR 24 RD0 SWITCH14 SELECTOR Digital out BURNER OPERATION MODE25 RD1 26 RD2 27 RD3 Buttom19 RESET Digital out ALARM RECEIPT 28 RD4 Buttom23 TEST Digital out TEST TA+ 00EKT21CT082 29 RD5 Buttom25 TEST Digital out LAMP TEST 30 RD6 SWITCH26 EMERGENCY STOP Digital out EMERGENCY STOP 44
  • 49. Chapter Three A Proposed Design of GUI Based Remote Control for GRS The (PIC16F877A) has five-Ports named (A,B,C,D,E)denoted as(RA,RB,RC,RD,RE) and each port of these five-Ports contains 8-Pins,So the total number of Pins in (PIC16F877A) is 40-Pins. According to table (3.2) .The input signals from GRS to PIC will be mapped into 15-Pins of PIC (ports (RA0-RA5, RB0-RB7, pinE0), while the output signals from PIC to the GRS have been mapped to another 15-Pins of PIC (ports (RC0-RC7, RD0-RD6), So the total number of used Pins from (PIC16F877A) in proposed system becomes 30-Pins out of 40-Pins available in PIC. Figure (3.4) shows the digital input signals from (GRS) system to (PIC) and the digital output signals from (PIC) to (GRS) system according to Table (3.2). Figure (3.4) illustrate the digital I/O Figure (3.4) the input and output signals of PIC16F877A Digital I/P from GRS to PIC Digital I/P from GRS to PIC Digital O/P from PIC to GRS Digital O/P from PIC to GRS 45
  • 50. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.5 Hardware Design Implementation After collecting all design related information which is necessary for designing a full computerized system that aimed for controlling and monitoring the (GRS) machine, the next step in the system design implementation is to select the perfect and compatible H/W components to control GRS machine. 3.5.1 PIC16F877A It is a Programmable Interface Controller which represents the brain of the proposed system in this thesis; the (PIC16F877A) has been selected for many reasons which explained before (chapter two). The (PIC16F877A) can be considered as a very small size IC according to its dimensions (5) cm length and (1.5) cm width. The following figure (3.5) shows the actual dimensions of PIC16F877A Figure (3.5) hardware Chip of PIC16F877A 3.5.2 The Development PIC Board KIT EasyPIC6 The Development PIC Board KIT EasyPIC6 will be used as a programmer for the (PIC16F877A) through (USB) cable, also the Development PIC Board KIT EasyPIC6 will used as interfacing media to connect the PIC with the inputs and outputs signals of GRS machine and to connect the PIC with the PC which contains a GUI through (RS232) cable as a final system implementation. See appendix (B) 46
  • 51. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.5.3 Input Electronic Interface Circuit from GRS to PIC The PIC deals with TTL level voltage (0-5) VDC, when the (0) VDC represents logic (0) and the (5) VDC represents logic (1) to PIC. Thus the input voltage which has a voltage value more than (6) VDC that might burn the PIC , each input signal to PIC from (GRS) is rated on (24)VDC and this incompatibility in DC voltage level is solved by using Zener diodes to protect PIC from high inputs (24) VDC by convert it to (5)VDC .The proposed protection interface h/w is depicted in figure(3.6) it contains zener diodes each of 5.1 V break down voltage . 30KΩ input resistance is connected to input signal to reduce the amount of voltage at the input of each zener diode into (5) VDC. Figure (3.6) I/P conversion from (24) VDC to (5) VDC 47
  • 52. Chapter Three A Proposed Design of GUI Based Remote Control for GRS The digital I/P from (GRS) to (PIC) after I/P conversion is shown in figure (3.7) Figure (3.7) the digital I/P from GRS to PIC after the hardware design of conversion circuit (from 24-to-5) VDC 3.5.4 The output relay circuit from PIC to GRS The relay is one of devices used in this thesis used in order to provide the circuit with flexible connections between PIC and the GRS Machine which has been used as an output device switched ON or switched OFF according to the enable signal generated from PIC microcontroller. Figure (3.8) shows the hardware output circuit design. Digital I/P from GRS to PIC Digital I/P from GRS to PIC Digital I/P conversion circuit from (24) VDC to (5) VDC Digital I/P conversion circuit from (24) VDC to (5) VDC 48
  • 53. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Figure (3.8) H/W output circuit of relay The relay circuit in this thesis replaces the manual switches of GRS in to computerized switching, Such that the enable signal from PIC can handle a (230) VAC High Voltage. The output enable command of switching ON or switching OFF will be accessed from presented GUI by programming software push buttons. The digital outputs enable commands from (PIC) to (GRS) are shown in Figure (3.9) 49
  • 54. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Figure (3.9) the digital O/Ps from PIC to GRS after the H/W design of output relay circuit 3.5.5 H/W Design Review and Test After hardware design components implementation, a design review is needed. It’s very important and final stage before starting the S/W design. The microcontroller input /output signals were tested by applying test signals and monitoring system response. Also in this stage the future expansion is considered to make the system capable for upgrading, the design at this stage it is easy to modify if there is any requirements before implementation, if the H/W components design completed the S/W design of proposed system design could be initiated according to H/W requirements. Digital O/P from PIC to GRS Digital O/P from PIC to GRS The output relay circuit from PIC to GRS The output relay circuit from PIC to GRS 50
  • 55. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.6 Software Design Implementation There are dual software programming techniques implemented in this thesis the first one is the embedded system programming technique for PIC microcontroller and the second one is the programming and designing of GUI interactive graphical user interface. 3.6.1 The Embedded Programming Technique The embedded programming technique represents the intelligent software product that will be invisible programming part to the end user of system which has been written in source code called MPlab based on C-Language codes and environment. The code written will be loaded in the PIC flash memory. The purpose of an embedded system program is to read input data, the processing input through predefined software code, then generate an output signals that control the GRS remotely. Figure (3.10) Illustrates C program writing in MPLAB Version 8.33 51
  • 56. Chapter Three A Proposed Design of GUI Based Remote Control for GRS The embedded program is written using MPLAB Microchip’s Technology Integrated Development Environment. As shown in Figure (3.10) The C-Language is a high-level language used for creating the system firmware for low-complexity embedded systems, it is a user-friendly programming technique and it needs only less detailed hardware knowledge. After writing the program in C-Language the MPLAB will edit, check errors and compile the C-language source code into (file. hex) and loaded to PIC flash memory. 3.6.2 Loading (file. hex) to PIC The EasyPIC6 Programmer Kit which explained before will be used for loading, verifying and testing the (.hex) code to the PIC flash memory through USB cable by installing CD driver which loads the private proposed program by the EasyPIC6 Kit as shown in figure (3.11). Figure (3.11) EasyPIC6 Kit loading program 52
  • 57. Chapter Three A Proposed Design of GUI Based Remote Control for GRS The following figure (3.12) illustrates the load operation of embedded software (.hex) code file Figure (3.12) loading (.hex) code file 3.6.3 GUI Programming Technique using VB The graphical user interface is a tool that creates an effective communication medium between human and computer; in fact this programming technique of GUI represents the Visible Programming because the user can use the GUI design for remote monitoring and controlling (GRS) system. The Visual Basic program is used in this thesis to design an interactive GUI. 53
  • 58. Chapter Three A Proposed Design of GUI Based Remote Control for GRS The GUI design is presented in figure (3.13).The final GUI designed does not need extra training because the user can recognize it easily; this results from the high similarity between it and the original machine. Figure (3.13) the GUI design for monitoring and controlling GRS In this proposed GUI there are two new push buttons added ,the first is called (Auto operation system mode) which allows a full computerized automatic system mode selection and operation, while the second new push button is called (general reset) which allows resetting all system faults and alarms by just one click . These two functions are not found in the original GRS panel. The proposed GUI is not used only for monitoring it is also used to display the system status through some indicators for input signals and also content a push buttons which acts for output signals. 54
  • 59. Chapter Three A Proposed Design of GUI Based Remote Control for GRS In presented GUI it is possible to use mouse and keyboard for managing and controlling the (GRS) system. Figure (3.14) shows the similarity between the original machine panel and the proposed GUI. Figure (3.14) the previous GRS and current status after developing the GUI The GUI gets an input indication signals and send an output signals via push buttons to the PIC through the Serial port (RS232) which represents the communication channel between PIC and PC. 55
  • 60. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.6.4 S/W Design Review (Verification) At this stage the C-program is verified and tested by using IDE simulation program. Figure (3.15) shows the simulation program of PIC. The simulation environment allows loading and compilation of C-program which was written in MPLAB with the ability of program execution step by step. Figure (3.15) PIC Simulator IDE Also the development PIC Board KIT EasyPIC6 allows testing and review for the dual S/W techniques through the bush buttons switch and LED indicator built in the KIT EasyPIC6. After the completion of verification stage and S/W design , the review stage is the next stage involves integrating both the H/W and S/W components. 56
  • 61. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.7 System Integration H/W and S/W In this stage integration of proposed system both hardware and software components will be integrated together in order to control the GRS machine Figure (3.16) shows the Easy PIC6 Kit connected with the I/P and O/P circuit after loading the compile C-language program to the programmable PIC memory. Figure (3.16) the Easy PIC6 with I/P and O/P hardware circuits 3.7.1 The integration H/W Components The I/P, O/P and PIC Kit circuits are connected to a power supply to provide the necessary power for the hardware components. Figure (3.17) show these circuits with a power supply 57
  • 62. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Figure (3.17) H/W components with power supply 3.7.3 Final package All hardware components with the deriving software are embedded inside computer case .The interface with the deriving computer is done through input / output cables, serial cable (RS232) for transmitting and receiving signals and instructions, while the USB cable is used for loading embedded software to the PIC .Figure (3.18) shows the proposed hardware. 58
  • 63. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Figure (3.18) final hardware system Figure (3.19) shows the interface between the computer over which the GUI is installed and the proposed hardware through serial communication port (RS232) and (USB) cable for programming and supply the power to the PIC 59
  • 64. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Figure (3.19) H/W and S/W system integration 3.8 Remote access through IP Network configuration The aim of IP network that was used in this thesis is to enable GRS remote controlling and monitoring after converting it to full computerize operations. Figure (3.20) shows HTML page developed which allows transferring the instructions to/from GUI to the GRS system from remote location, about (150)m distance from GRS to control room ,through IP bus network authorized using user name and password. 60
  • 65. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Figure (3.20) illustrate HTML page for remote access Any boiler of GRS can be selected and certain instruction can be transmitted to it by clicking on the its hyper link ,hence when clicking on remote panel -2 for example the GUI for second GRS is displayed. The HTML page designed to make the access to the remote system easier with out needing to the network configuration each time to access by saving the network setting. 61
  • 66. Chapter Three A Proposed Design of GUI Based Remote Control for GRS 3.9 Final System Design Algorithm The algorithm of the final proposed design starts by reading the set up process initialized for serial transmission before GUI can be interfaced via RS232. The algorithm of Programming the PIC microcontroller and exchanging of the data and signals between the human and the GUI is: Initialize: Selecting the Programmable Interface Controller = PIC16F877A Define the Header file for the "PIC16F877A" Set frequency of Crystal Clock oscillator = 8000000 Hz Enable Interrupts ( ) Define the (PIC) used Pins: Define Pins A0-A7 Define Pins B0-B7 Define Pins C0-C7 Define Pins D0-D7 Define Pins E0-E2 Input: A (A0-A5) Read the input signals from GRS to port A of PIC. B (B0-B7) Read the input signals from GRS to Port B of PIC. E (E0) Read the input signals from GRS to pin E0 of PIC. Output: C (C0-C7) Activate Pins of PIC as output Instructions to GRS. D (D0-D6) Activate Pins of PIC as output Instructions to GRS. Begin Set up baud rate speed = 9600/bps for RS232 port again While there is an input signals from GRS do If input signal = logic 1 Then identify the logic 1 signal in to ASCII code character send the ASCII code Character via RS232 port and display it on GUI Read new input signal from GRS Else send the (ASCII+1)mode 26 via RS232 port and display it on GUI 62
  • 67. Chapter Three A Proposed Design of GUI Based Remote Control for GRS Read new input signal from GRS While there is an output signals command instruction from GUI do If send output signal ASCII from GUI via RS232 port = logic1 Then Comparing ASCII which send with previous identified ASCII If both ASCII are matched Then Send Output PIC command through output pins and switch ON a specific relay Else Send Output PIC command through output pins and switch OFF a specific relay End while If "Auto Operations Mode" selected Then Read fault input signals Reset all GRS fault by activate output relays Start GRS system with automatic mode End while Return again End 63
  • 68. Chapter four System Experimental & Results Chapter Four System Experimental and Results 4.1 Introduction In this chapter, the real operation and testing results for proposed remote controller based on PIC microcontroller with graphical user interface are presented. Thus the proposed controller (H/W and S/W) is connected with a real GRS machine at Erbil power station, it responds successfully to all alarm signals considered and presented by machine manual. Also the ASCII code which assigns to the input or output signals given for each control has been tested by using (oscilloscope) waveform plotter. 4.2 Testing H/W and S/W Components The stage of testing H/W and S/W components of proposed controller is performed before connecting it to the GRS machine in "Erbil Power Station". Hence, all system reactions for certain events are tested separately, the testing step is important before real system implementation. The S/W level in proposed system is based on Windows platform, performed successfully in transmitting serial data between the computer and the PIC microcontroller. The GUI, based on Windows platform, provides the use of the serial computer port to the system. The GUI was developed for monitoring and controlling GRS machine from remote location. 4.3 Descriptions of final GUI of GRS In general the final proposed GUI consist of two types of functions the first one represent the color indicators , which either refer to fault in the GRS machine or refer to the events in the system, that will used for monitoring the GRS machine from remote location. While the second function of GUI represent by commands push buttons, these push buttons can be select from GUI to take some actions on the system as example if the user of system from remote location want to change the system mode, reset the system fault and errors or start the machine. 65
  • 69. Chapter four System Experimental & Results The descriptions of the final proposed GUI for controlling and monitoring the GRS machine from remote location shown in figure (4.1). Figure (4.1) descriptions of the GUI for GRS According to the final GUI the red, yellow, green and white LED will be used for monitoring the GRS machine operations, while the push buttons will used to send command which can select by the system user. Fault LED Sequence LED Start LED Events LED Mode select Reset faults Start operation Pump options Stop operation Local /remote Operation mode Reset Test Reset Test TestTemp. setting 66
  • 70. Chapter four System Experimental & Results 4.4 GUI Commands Push Buttons and LED Indications The GUI uses the command buttons to activate the selected port of the microcontroller that controls the GRS machine as output instruction commands while, the LED indicators refer to the input status as illustrated in figure (4.1). Thus every command button and LED on the GUI represents certain ASCII code from the keyboard. The program waits for another ASCII code to be entered by the mouse or keyboard. 4.4.1 Interfacing GUI with Serial RS-232 and USB Port The communication port between the PC and the microcontroller can be interfaced either directly via an RS-232 port or the PC USB port. Since computers today are developed with the USB (Universal Serial Bus) port, the GUI based on Windows platforms is designed to be capable of transferring and receiving data via such ports. The USB port of a personal computer is developed to assist the connection of peripheral devices to the computer, improve communication speed and simultaneously support the attachment of multiple devices. The USB-to-RS232 converter is used for interfacing with the USB port of the computer with the system developed. The driver of USB-to-RS232 converter initializes the USB port as a serial port protocol. The use of the converter from a serial interface to the USB port will release a serial communication port to other applications. This allows the devices to be unchanged, making the converter responsible for treating the differences between the protocols. This converter is responsible for transmitting ASCII (American Standard Code for Information Interchange) data from GUI to PIC microcontroller. 67
  • 71. Chapter four System Experimental & Results 4.5 Identifying ASCII Code Character for each Input/Output Signals Each input and output signal from the GRS machine will named and identify as a special ASCII code character in order to recognize each signal alone. Table (4.1) shows the ASCII code for each signal. Table (4.1) identification ASCII for each I/O signal No.# (PIC) Pins ASCII code Character Description 1 RA0 97 a CIRCULATION PUMP OVERLOAD 2 RA1 98 b CIRCULATION PUMP IN OPERATION 3 RA2 99 c IGNITION GAS 4 RA3 100 d LEAKAGE ALARM GAS VALVE 5 RA4 101 e BURNER MOTOR OVERLOAD 6 RA5 102 f BURNER START 7 RB0 103 g BURNER DISTURB 8 RB1 104 h BURNER IN OPERATION 9 RB2 104 i LSA- 00EKT21CL081 10 RB3 106 j PSA- 00EKT21CP083 11 RB4 107 k PSA+ 00EKT21CP082 12 RB5 108 l SAFETY CIRCUIT BURNER CONTROL 13 RB6 109 m LOW GAS PRESSURE 14 RB7 110 n TS+ 00EKT21CT081 15 RE0 111 o TA+ 00EKT21CT082 16 RC0 122 z SELECTOR SWITCH LOCAL/REMOTE 17 RC1 18 RC2 121 y BURNER START LOCAL 19 RC3 120 x BURNER STOP LOCAL 20 RC4 119 w RESET BURNER CONTROL 21 RC5 118 v BURNER OPERATION LOCAL REMOTE 22 RC6 23 RC7 117 u TEST FLAME DETECTOR 24 RD0 116 t BURNER OPERATION MODE25 RD1 26 RD2 27 RD3 115 s ALARM RECEIPT 28 RD4 114 r TEST TA+ 00EKT21CT082 29 RD5 113 q LAMP TEST 30 RD6 112 p EMERGENCY STOP 68
  • 72. Chapter four System Experimental & Results 4.5.1 GUI Input/Outputs ASCII codes Instructions Each input and output signal is assigned in to different character form ASCII code, the speed rate of bits transmitted and received through the RS232 is 9600 bits per second. The microcontroller compares its reference ASCII code character with the data received and controls the GRS machine when the data received matches the reference ASCII code character which is embedded in the PIC microcontroller. Since data is transmitted using an asynchronous form, the start bit and stop bit indicate the beginning and ending of the data and between the start and stop bit the ASCII code of character in binary form as mentioned before The example of four input and output signals assignment is shown in table (4.2). The signals is mapped into lower case English characters as an example (a, b) have been selected to represent input signals while (y, z) represents output signals. Table (4.2) four characters with ASCII and Binary code char. Signal ASCII Binary a O/P 97 1100001 b O/P 98 1100010 y I/P 121 1111001 z I/P 122 1111010 4.5.2 Result of output commands Signals waveform Figure (4.2) shows the waveform traced by the oscilloscope of ASCII ‘a’ character received on the RS232 port sent by the command button “START”. The command button “START” represents the ASCII code ‘a’ for switching on GRS that is controlled by the microcontroller. The microcontroller compares its reference ASCII code character with the data received and switches on the switching transistor when the data received matches the reference ASCII code character saved in the microcontroller. 69
  • 73. Chapter four System Experimental & Results Figure (4.2) oscilloscope waveform of character "a" Since the data is transmitted using an asynchronous form, the start bit and stop bit indicate the beginning and ending of the data. Figure (4.3 ) shows the waveform traced by the oscilloscope for the ASCII character ‘b’ sent by GUI by clicking the command button “STOP” and the same ASCII character received at the microcontroller port. Microcontroller detects data in the TTL form, which is compatible for the USART. Figure (4.3) oscilloscope waveform of character "b" Start Bit Stop BitASCII "a" Start Bit Stop Bit BitASCII "b" 70
  • 74. Chapter four System Experimental & Results 4.5.3 Result of Input LED waveform In the following two figures examples of input signal from GRS machine to PIC microcontroller will display as LED indication on GUI. Figure (4.4) shows the waveform of ASCII character ‘y’ of LED that represent an indication of GUI "circulation pump over load" Figure (4.4) oscilloscope waveform of character "y" Figure (4.5) shows the waveform of ASCII character ‘z’ of LED that represent an indication of GUI "circulation pump in operation" Figure (4.5) oscilloscope waveform of character "z" Start Bit t Stop BitASCII "y" Start Bit Stop BitASCII "z" 71
  • 75. Chapter four System Experimental & Results 4.6 Proving the computerize and automatic operation of GRS The proving stage is done by connecting the final integration H/W and S/W system to the real GRS machine, the machine successfully started through the final GUI with high efficiency ,accurate and quick response time so, it is proved that all operations of GRS now can doing computerize and automatic by user from the GUI. Figure (4.6) shows system user can operate and control the GRS from PC using interfacing GUI and embedded PIC software. Figure (4.6) operate GRS from PC 72
  • 76. Chapter four System Experimental & Results 4.7 Proving the GRS Operation Performed from Remote Location After satisfying the goal of converting all operation and monitoring of GRS from manual operation in to computerize and automatic operations, the another important goal that should be prove the operation and monitoring of GRS should be performed from remote location. Two PCs are connected through bus LAN network one PC at the GRS machine and the other in the remote location to allow access from remote location. Figure (4.7) show the PC at the GRS panel connected to LAN network STP cable. Figure (4.7) local PC at GRS machine Figure (4.8) show the login page from HTML page of remote PC that will used to access to the PC at the GRS machine panel. STP Network cable 73
  • 77. Chapter four System Experimental & Results Figure (4.8) the login to the remote PC Both PCs have a static IP address, the IP address of the first PC is (192.168.1.10) while, the IP address of the second PC is (192.168.1.20) and both of PCs authored by user name and password. Figure (4.9) show the remote PC after login to another PC which allow monitoring and controlling GRS machine through GUI and from remote location. Network cable from first PC 74
  • 78. Chapter four System Experimental & Results Figure (4.9) the remote PC after login In the final GUI a new push buttons added (Auto Operation Mode) which allow operate the GRS machine with complete auto operations by clicking only one push button which it (Auto Operation Mode). Figure (4.10) show selecting the (Auto Operation Mode) command push buttons of GRS machine from GUI and from remote location. IP of remote PC 192.168.10.10 75
  • 79. Chapter four System Experimental & Results Figure (4.10) selecting Auto operation mode The successfully operating and response of GRS machine through GUI from remote location show in figure (4.11). Figure (4.11) successfully operate GRS remotely from GUI 76
  • 80. Chapter four System Experimental & Results 4.8 Result of testing and operating a proposed system The result of testing and operating the final proposed system by using GUI will illustrate by selecting a four scenarios to achieve to the goals of this thesis , which controlling and monitoring the GRS machine from remote location through a special GUI using a PIC microcontroller. Each scenario contains the status of the local panel of GRS and in the same time the status of GUI, the first scenario refer to the initial status of GUI as shown in figure (4.12)and the initial status result of GRS panel before staring shown in figure (4.13) Figure (4.12) result of first scenario "initial status" on GUI Figure (4.13) result of first scenario "initial status" of GRS panel 77
  • 81. Chapter four System Experimental & Results The second scenario represents the system status when selecting the "Auto Operation Mode" from GUI The indication of "circulation pump" will be active as green indication in both of GUI and the GRS panel figure (4.14) show the GUI status, while figure (4.15) show the result on the GRS control panel. Figure (4.14) result of selecting "Auto operation mode" from GUI Figure (4.15) result of GRS after selecting "Auto operation mode" 78
  • 82. Chapter four System Experimental & Results The third scenario represent the progress of operations of GRS machine, this scenario show the yellow indication of "Ignition Gas" and the white indication of "burner Start" are active in both of GUI as well as in the GRS panel as result. Figure (4.16) show the result on the GUI, and figure(4.17) show the result in same time on the GRS panel. Figure (4.16) result of the yellow and white indications on GUI Figure (4.17) result of the yellow and white indications on GRS panel 79
  • 83. Chapter four System Experimental & Results The fourth scenario refer to the system when the indication of "ignition Gas” is (OFF) and when the indication of "Burner in operation" is (ON). Figure (4.18) show the result on the GUI while figure (4.19) shows the result on the GRS panel. Figure (4.18) result of forth scenario on GUI Figure (4.19) result of forth scenario on GRS panel 80
  • 84. Chapter four System Experimental & Results 4.9 Comparison Proposed System with other work By comparison the proposal system with nearest related work[8], it found the proposal system in this thesis overcome from other work by many aspects as shown in table (4.3) Table (4.3) comparative between the proposal design and the GUI of home lighting The GUI of Home Lighting The Proposal DesignFeature Single phase LampsGRS Machine in Erbil powre StationApplication NoneIncludeGUI Feed Back Serial CableAccess Through IP NetworkRemote MPASMMPLAB Version (8.33) based on CEmbedded S/W More InstructionLess InstructionInstruction Set Just Output signalsSatisfy Both I/O signalsI/O Signals NoYesGUI Auto operation Only PushbuttonsPushbuttons, Indicators shapes and display text box GUI elements 81
  • 85. Chapter Five Conclusions and Future Work Directions
  • 86. Chapter Five Conclusions &Future Work Directions Chapter Five Conclusions and Future Work Directions 5.1 Introduction After completing the design of final proposed system ,A real testing and implementation performed to the system, by connecting the final integration H/W and S/W with the GRS machine to enhance the manual traditional operations of GRS machine into automatic and computerize operations. The proving stage is done by interfacing the final integration H/W and S/W system in the real world with the GRS machine, the machine is successfully controlled and monitored through the final GUI from remote location via IP Ethernet STP cable network with high efficiency, accurate and quick response time so, it is proved that all operations of GRS now can be done by executing GUI from remote location. 5.2 Conclusions The rapid spreading of embedded systems and remote automatic remote control systems enables the researchers to find new embedded programming software techniques methods or algorithms which allow controlling and monitoring machines from remote locations. Today, most new technology products consist of a mixture of hardware and software components, also in the final proposed system both of hardware and software components were implemented and integrated as a complete compatible system. An embedded system is regarded as a product which contains a microprocessor programmed to carry out some control functions which works as a complete computer system. This thesis was implemented as a remote machine control through a GUI which is based on PIC microcontroller, the controller circuit used to implement this system has been designed with a minimal number of components. So the following conclusions can be noted: 1. The GUI using VB provides the process for transmitting the ASCII character data. It is shown that GUI using the Visual Basic program, is performed excellently in transmitting data to 83
  • 87. Chapter Five Conclusions &Future Work Directions the PIC microcontroller. It can be concluded that GUI using Visual Basic can be interfaced with RS232 port of a computer. 2. The operation and monitoring of the GRS machine is huddled and enhanced by utilizing the features of (PIC16F877A) microcontroller, which create a better solution for the GRS problems, so the (PIC) can be used as an interfacing device between the PC and the Machine. 3. The important part in the final proposed design is the GUI, the GUI facilitates the Engineer work in order to enable a monitoring and controlling of the GRS machine from remote location, hence it is play a vital role as a interfacing media between the human and the machine which named in the industrial factories and plat as Human Machine Interface (HMI). 4. This thesis presents a dual software programming techniques as a final proposed system implementation. The embedded software which used for programming and loading the C- language program to the PIC microcontroller flash memory by using MPLAB debugger which is the more efficient and easy is the more efficient and easy language for programming a (PIC) , and the another important part of software programming techniques is designing special graphical interfacing GUI by using Visual Basic as an interfacing media between the human and the machine. 5. A remote controlling machine is located on the devices casing as it may require control and observation from the operator from time to time , also if the process control contains hazardous environment for doing some jobs like (power plants, chemical factories) and a long distant controller may be useful for the application of this drive system. 6. The PIC microcontroller has been used in this thesis due to its low cost , availability in local market, low power consumption, and easy to program using C-Language . 84
  • 88. Chapter Five Conclusions &Future Work Directions 5.2 Future Work Directions 1. Using a fiber optical cable instead of using STP cable which allows more Bandwidth, It uses properties of light to transmit data, reduces the noise because it is made from glass and plastic. 2. The zenor diode which is used as input reduction voltage to the PIC can be replaced by optical couple electronic elements that allow more flexibility with voltage range fluctuating. 3. The system can be accessed through internet if the static IP address of LAN network replaced by a Public IP address, so the system can be accessed with full controlling from any place in the world. 4. Using a strong security methods and protocols for security instead of simple user name and password to avoid attackers and hackers. 5. The controlling and monitoring of GRS machine can be done by using touch screen instead of using the mouse and keyboard due to future requirements. 6. It is possible also to use a wireless network instead of using the wire network which allows accessing GRS machine from remote location. 7. The hardware which is used to interface the PIC microcontroller with the PC can be enhanced, for example, RS232 port can be replaced with USB or LAN ports interface to enhance the system speed and increase the compatibility and ease of use. 85
  • 89. ْ‫ﻦ‬َ‫ﻣ‬ َ‫ﻚ‬ْ‫ﻠ‬ُ‫ﻤ‬ْ‫ﻟ‬‫ا‬‫ﻲ‬ِ‫ﺗ‬ْ‫ﺆ‬ُ‫ﺗ‬ ِ‫ﻚ‬ْ‫ﻠ‬ُ‫ﻤ‬ْ‫ﻟ‬‫ا‬ َ‫ﻚ‬ِ‫ﺎﻟ‬َ‫ﻣ‬‫ﱠ‬‫ﻢ‬ُ‫ﻬ‬‫ﱠ‬‫ﻠ‬‫اﻟ‬ ِ‫ﻞ‬ُ‫ـ‬‫ﻗ‬ ْ‫ﻦ‬َ‫ﻣ‬ ‫ﱡ‬‫ﺰ‬ِ‫ﻌ‬ُ‫ﺗ‬َ‫و‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬ ْ‫ﻦ‬‫ﱠ‬‫ﻤ‬ِ‫ﻣ‬ َ‫ﻚ‬ْ‫ﻠ‬ُ‫ﻤ‬ْ‫ﻟ‬‫ا‬ ُ‫ع‬ِ‫ﺰ‬ْ‫ﻨ‬َ‫ﺗ‬َ‫و‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬ َ‫ﻚ‬‫ﱠ‬‫ﻧ‬ِ‫إ‬ ُ‫ﺮ‬ْ‫ﻴ‬َ‫ﺨ‬ْ‫ﻟ‬‫ا‬ َ‫ك‬ِ‫ﺪ‬َ‫ﻴ‬ِ‫ﺑ‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬ ْ‫ﻦ‬َ‫ﻣ‬‫ﱡ‬‫ل‬ِ‫ﺬ‬ُ‫ﺗ‬َ‫و‬ ُ‫ﺎء‬َ‫ﺸ‬َ‫ﺗ‬ ٌ‫ﻳﺮ‬ِ‫ﺪ‬َ‫ﻗ‬ ٍ‫ء‬ْ‫ﻲ‬َ‫ﺷ‬‫ﱢ‬‫ﻞ‬ُ‫ﻛ‬ ‫ﻰ‬َ‫ﻠ‬َ‫ﻋ‬ ‫آﯿﺔ‬ ) ‫ان‬‫ر‬‫ﻋﻤ‬ ‫آل‬ ‫ة‬‫ﺴور‬٢٦( I