DT003a Final Report - The Design and Build of a Non-contact Extensometer for ...
PLC Based Electrical Load Management System
1. PLC BASED ELECTRICAL LOAD
MANAGEMENT SYSTEM
B.E (EL) PROJECT REPORT
BATCH: 2010-2011
Prepared By:
Burhanuddin (EL-10107)
Rizwan Jafar (EL-10105)
Kashif Balol (EL-10133)
Ijlal Siddiqui (EL-10134)
Internal Advisor:
Dr. Ghous Baksh Narejo
Associate Professor
NEDUET
External Advisor:
Juzer Mobin
Sr. Executive Engineer
Siemens Pakistan
NOVEMBER 2014
Department Of Electronics Engineering
NED University of Engineering & Technology
Karachi – 75270
2. b
ABSTRACT
In the industries worldwide, the plants need to be shed in order to
meet with the supply and often this results in a “not up to the standard” batch of
the good. This happens because of care not being taken in shedding the loads, at
times switching off essential loads or mistiming the shedding.
Shedding is inevitable because if the loads are not shed then all will
turn off eventually due to lack of supply. To overcome this problem non-essential
loads are often shed following a certain scheme developed after thorough
understanding of the product in production.
The idea behind the project is to build an automatic load shedding
system with the help of a PLC, which actually comes in action in the event of
generator tripping and sheds off non-essential loads ( as defined by the plant
engineers) thereby restoring the balance between the consumption and
generation.
3. c
DEDICATION
We would like to dedicate this project to our
parents, whose unconditional love and
support has brought us where we are today.
4. d
ACKNOWLEDGEMENT
Apart from team efforts, accomplishment of any project rests
principally on the encouragement, inspiration, motivation and advices of several
others. We take this opportunity to convey our thanks to the individuals and
organizations who have been instrumental in the successful completion of this
project.
We wish to express our gratitude to the Chairman of Electronics
Department Dr. Ataullah Khawaja, for his faith, accepting behavior and support
to us in finishing this project.
We are also grateful to our external advisor Juzer Mobin whose
backing, supervision, and help from the initial to the final level allowed us to
grow an understanding of the topic. We also wish to communicate our deepest
appreciation to the internal advisor Dr. Ghous Baksh Narejo for his indispensable
suggestions and guidance.
Appreciation and thanks to the staff at Department of Electronics
Engineering, NED University of Engineering & Technology for granting us the
resources.
5. e
Table of Contents
Abstract.........................................................................................................................................b
Dedication.................................................................................................................................... c
Acknowledgement....................................................................................................................d
List of Figures.............................................................................................................................g
List of Tables...............................................................................................................................h
Chapter 1: Introduction
Introduction..................................................................................................................1
Objective ........................................................................................................................1
Motivation .....................................................................................................................2
Scope of the project ...................................................................................................2
Chapter 2: Literature Review
Automation ...................................................................................................................4
Load Management......................................................................................................4
Programmable Logic Controllers .........................................................................8
Features ........................................................................................................12
Scan Cycle Length......................................................................................12
System Scale................................................................................................14
User Interface .............................................................................................14
Communication..........................................................................................15
Programming..............................................................................................15
Security..........................................................................................................17
Simulation....................................................................................................17
Redundancy.................................................................................................18
Circuit Elements.......................................................................................................18
PIC 16F877A................................................................................................18
Seven Segment............................................................................................20
7. g
List of Figures
F.1: Pin configuration of PIC 16F877A ..............................................................................i
F.2: Digit displays on 7-Segment..........................................................................................i
F.3: 10k Thermistor Curve ....................................................................................................ii
F.4: Relay......................................................................................................................................ii
SIMATIC Step7 Coding Screenshots................................................................................. iii
Human Machine Interface Screenshots...........................................................................vi
Panel .......................................................................................................................................... vii
PCB Layout ..............................................................................................................................viii
Circuit Schematics ...................................................................................................................ix
8. h
List of Tables
T.1: Characteristics of 16F877A..........................................................................................x
T.2: PORTB Codes for 7-Segment Display.......................................................................x
9. 1
Chapter 1
Introduction
Chapter 1
INTRODUCTION
Introduction
Industries usually run on multiple power sources. It could be a
combination of generators as well as the local utility supply. While running on
multiple sources, there could be an event of one or more sources going down and
this could result in overloading of the other running sources. To avoid these
overloading, loads must be shed as soon as the tripping occurs.
However, care must be taken in deciding which loads are to be shed
and which are the ones that are absolutely pivotal to the current process.
Objective
The primary objective of the project is to build an automatic shedding
system which keeps track of the power available and matches it with the running
load and then runs through its algorithm to decide which loads could be and
should be shed thereby ceasing the plant from being out of operation.
A Human Machine Interface (HMI) is also to be developed for this
system which helps the engineers on the plant to monitor the process and make
tweaks in the priority list.
10. 2
Chapter 1
Introduction
Motivation
This system has been designed in a way that all the industries working
on multiple power sources can use this on their plants to manage shedding in
events of tripping hence keeping the plant in normal operation.
Scope Of The Project
With the ongoing state of energy crisis worldwide and especially in
Pakistan, industries are often at the mercy of the local utility supplies or power
distribution authorities. This is due to the fact that there exists a short fall
between the demand and supply of electric power. Therefore, most industries
prefer to operate on generators along with the local utility supply.
In case of tripping, loads at the plant need to be shed in order to meet
with the supply, and often, this results in a “not up to the standard” batch of the
good. This happens because of care not being taken in shedding the loads, by
switching off essential loads, or mistiming the shedding.
Shedding is vital because if the loads are not shed then all will shut
down eventually due to lack of supply. To overcome this problem, non‐essential
loads are often shed following a certain scheme developed after thorough
understanding of the product in production.
11. 3
Chapter 1
Introduction
Internationally efforts are being made to implement such a model on to
the residential consumers as well and this is the road leading to Smart Grid.
Many independent organizations are working on this including Siemens.
This project can further be extended to include features such as black
start which helps the plant to come in normal operation from a state of total shut
down. Trending can also be included that can help avoiding such tripping in the
future.
12. 4
Chapter 2
Literature Review
Chapter 2
Literature Review
Automation
Automation and automatic control is the use of various control devices
to make things such as machinery, factories, furnaces, heat treatment equipment,
management processes, and stabilization of the mobile networks, ships, aircrafts
and other applications, to be run with minimal human intervention.
The biggest advantage of automation is that it saves labor, but it is also
used to save energy and materials, and to improve the quality, precision and
accuracy.
Automation is commonly deployed in various ways, such as pneumatic,
electrical, mechanical, hydraulic, and electronic as well as computer. Complex
systems, such as modern factories, aircraft and ships generally use all of these
techniques in combination.
Load Management
Load management is the process of balancing the electricity supply on
the grid to the electrical loads by adjusting the load, instead of the central power
generation. This is also well known as demand-side management (DSM).
13. 5
Chapter 2
Literature Review
As the name suggests, the job is done by making changes at the
demand side or consumption side rather than the generation end. This can be
done through direct action of the power distribution authority in real time using
a frequency sensitive relay that triggers the line contactor (also known as ripple
control), time-interval based shedding, or special prices to affect consumer
behavior.
Load management provides the utility authorities with tools to limit
power demand at peak times, which in turn, reduces the need for top-fired
power plants costs. In addition, the plant running at its peak often poses a
challenge if the system goes offline unexpectedly.
Load management can also help to reduce harmful emissions, because
the full-loaded plants or standby generators are often more toxic, eco-destructive
and less efficient than the basic power plant.
New and more advanced methods are being regularly ripened by many
well-known private as well as public institutions and evolution is on its way.
As electricity is a form of energy which cannot be efficiently stored in
bulk, it should be produced, distributed and consumed right away. If the system
load is close to the maximum capacity, operators should find more energy
sources or ways to get around and restrict the load. If this fails, the system is
unstable and cause power outages.
14. 6
Chapter 2
Literature Review
Load management planning may start by making refined models to
portray the properties of the distribution network that is capacity, topology, as
well as other characteristics of the lines, and the load behavior.
The analysis consist of scenarios that account for the anticipated
impact of projected load shed instructions, weather forecasts, expected time to
fix offline equipment, & other factors. For industries having seasonal
manufacturing of products, these factors may come into action.
The use of load management may facilitate a power plant to get higher
capacity factor, the measure of average rate. The capacity factor is a measure of
the production of power plant relative to the maximum production of that power
plant. Load factor is defined as the ratio of the average load to peak load. Higher
load factor is beneficial since the plant is just less efficient at low load factors.
If the load factor is affected during unplanned interruption, non-
availability of fuel, maintenance shut-down, or reduction in demand (i.e.
consumption pattern vary during the day), the generation should be in sync, as
grid energy storage is very costly.
Small utilities that purchase electricity instead of its own generation,
they could also benefit from the installation of load management system. The
penalties for peak usage be paid to the supplier will be significantly reduced. It is
reported, a load management system reimburse for itself in a season.
15. 7
Chapter 2
Literature Review
The wholesale price of energy, in a free market, differs considerably all
over the day. As the system reaches its maximum capacity and power plants use
the most expensive peak periods, the cost will increase during the day, free
market economy should increase the price. Corresponding decrease in the
demand for the product must comply with the decline in prices. While this works
as expected in short supply, many of the scenes take place in a matter of seconds
due to unforeseen disturbances system. To avoid the blackout it should be
resolved in the similar timeframe.
The biggest electrical load management system is implemented in
Florida & is operated by Florida Power and Light. It utilizes 800 K load control
transponders LCT and controls one thousand Mega Watt (in an urgent situation
two thousand Mega Watt). FPL has now been able to avoid the development of
several new power plants due to its load management programs.
The first phase of a program to manage the energy consumption of the
system is to know when and how each device consumes energy. Compute the
demand and the consumption of the largest motor of a plant, surprised by the
results, a 100 HP motor can cost up to millions per month as run constantly.
During the day, the rate at which energy is used varies, depending on
various factors, such as the need of the distribution system and tank levels for
water, or load of waste water treatment plants. Draw a daily load as a function of
time under different conditions, also note that large equipment can be used off-
16. 8
Chapter 2
Literature Review
peak hours. Look through all payment schemes available to decide what are the
lowest relevant to functional changes in the price offer.
To enhance the efficiency of the equipment that should run in peak
period, look for opportunities such as improving pump efficiency or
advancement of a wastewater plant's ventilation system.
Various large loads can be considered to operate during off-peak
periods. Avoid using large-scale equipment at the same time, two 25 kW pumps
that run only two hours a day may contribute 50 kilowatts, if run simultaneously.
Low power factor is often caused by a spinning motor at less burdened.
That also costs energy as the efficiency of the motor drops off below full load. It
may be corrected by the installation of a capacitor in parallel with the offending
equipment.
Programmable Logic Controller
The programmable logic controller or PLC is a digital computer that
can be used for typical industrial automation, assembly lines, manufacturing, or
electro-mechanical processes as well as lighting control. PLCs are used in almost
all industries. PLC is designed such that their immunity to electrical noise is
plausible, and is quite resistant to vibration and shock and can handle several
tables of analog & digital inputs & outputs, also extended temperature range, and
17. 9
Chapter 2
Literature Review
insensitivity to environmental variables is a plus. Programs that control the
operation of the machine is stored in non-volatile memory.
PLC is an example of a system that is expected to respond in a certain
period of time depending on the input conditions because the later the result
comes, the more useless will it be.
Before PLC was born, the control, sequencing, and safety interlocking
logic was mainly build of relays, timers, sequencers, and dedicated closed-loop
controllers. Because this could mean hundreds or even thousands of these
components, the process of updating or yearly model change could lead to
extensive changes in the arrangements, as the personnel need to rewire the
system for change in its operating characteristics.
Soon, general purpose computers were deployed to the control of
industrial processes. The first computers required specialist programmers and
rigorous controlling systems for cleanliness, quality of the power and
temperature. Protecting these computers from the plant floor conditions was not
an easy task.
The industrial control computer can have several advantages:
(i) it would tolerate the shop-floor environment,
(ii) it would not require years of training to use
(iii) it would permit its operation to be monitored
18. 10
Chapter 2
Literature Review
(iv) it would support discrete (bit-form) input and output in an easily
extensible manner
The response time for all computer systems must be fast enough to be
in control. However, the final desired speed will depend on the type of process.
Since many industrial processes have a response time of few
milliseconds, they can be easily facilitated by modern electronic components that
are fast, small and reliable and allows to simplify the construction of large
systems.
The first ever Programmable Logic Controller was named as 084
because it was Bedford Associates’ 84th projects. After its tremendous success in
the market, Bedford Associates started to focus on the development, production,
sale and service of this new product under the name of a new company
“Modicon”. One of the people who worked on this project was Dick Morley, who
then went on to be known as the "father" of the PLC.
The Modicon brand was sold in 1977 to Gould Electronics, and then to
a German company AEG which was eventually acquired by the French company
Schneider Electric, who, to this date, remains to be the owner.
The first machines until the mid-1990s were programmed in their
proprietary programming panels or special programming terminals, which often
19. 11
Chapter 2
Literature Review
had dedicated function keys signifying logical elements of PLC program. Most of
these elements were represented by graphical symbols but use of normal ASCII
characters was also common. Cassette tape cartridges were used to store
program. Facilities for documentation & printing were minimal owing to lack of
storage capacity. The old controllers used non-volatile magnetic core memory.
Nowadays, the controllers is burned with the help of proprietary PC
software, which now uses standard graphical symbols for logical operations and
elements. The computer is coupled with a PLC with the help of either Ethernet,
RS-232 or RS-485. The programming software also allows entry and editing of
the older ladder style programming.
In general, the software are loaded with tools to debug and
troubleshoot the code. This is done, for example, by marking the region of code
in current operation or by highlighting the current values of input, outputs and
intermediate variables. The same software is also used to upload & download the
algorithm into the PLC which can then later be used to backup and restore the
controller. With some models of PLC, the programming is done via a
programming board which is to be connected to a personal computer and it
burns the code into a removable EEPROM or EPROM
20. 12
Chapter 2
Literature Review
Features
The key difference of PLC with other general purpose computers is that
PLCs are robust and are prone to severe conditions of moisture, cold, dust & heat
and have the provision for extendable input output arrangements. These are
then used to connect the controller with sensors and actuators.
At the sensor (input) side, the PLC reads analog process variables
(pressure and temperature), limit switches, and the positions of complex
positioning systems. Whereas, on the actuator (output) side, PLCs operate relays,
electric motors, solenoids, hydraulic or pneumatic cylinders as well as analog
outputs often with an isolating opto-coupler in between for added protection.
Scan Cycle Length
The controlling algorithm normally executes repeatedly for as long as
the process in running and the plant is in operation. The physical condition or
the current status of the inputs is stored on the memory in form of a table
normally referred to as “I/O Image Table". The program then runs from the first
scene to the last instruction one by one. The processor then makes changes to
the outputs on the basis of the latest fetched values of the inputs and the running
algorithm. But these changes require some time to come in effect counting from
the beginning of the scan cycle. This may be a few milliseconds for a short code
and a speedy processor, but older PLCs running very large programs require
21. 13
Chapter 2
Literature Review
more time and may near 100ms per run cycle. The higher this duration is, the
more meaningless the output becomes.
With the passage of time, things changed and new technologies started
appearing of the face of earth. So was the fate of PLC systems. More advanced
techniques were fashioned to reform the execution of ladder programs. This
happened in the shape of subroutines. This simplified technique could be used to
reduce the cycle length for the processes requiring outputs at high speed. For
example, the parts of the program dedicated to the startup of the system may be
shifted to another subroutine so that they don’t re-execute every time over and
over again thereby saving some valuable scan time and increasing the response
speed.
Special modules for I / O like counter, timer, encoder and converters
may be used if the cycle time of the processor is too long to collect reliable
information, for example, count the pulses. A slower PLC is still capable of
interpreting count values but the accumulation of pulses from a separate module
would make sure that there is no effect of the execution speed of the program.
22. 14
Chapter 2
Literature Review
System Scale
PLC comes with a built-in small fixed number of ports for inputs and
outputs. Typically, expansions are available if the ports are insufficient to model
the process.
Modular PLC have an extension chassis also known as rack, which is
used to connect expansion modules to the PLC to maybe perform different
functions. The processor and the selection of I/O module is respective of the
particular application. Multiple racks can be administered by a single processor,
and may handle thousands of outputs and inputs. A fast serial I/O link is used so
that racks can be distributed away from the PLC, reducing the wiring costs for
large plants.
User Interface
PLCs are often required to interact with the humans (engineers on the
plant) for alarm reporting, everyday control and configuration. A human-
machine interface (HMI) is used for this purpose. HMI can be understood as a
kind of user interface (GUI).
For a simple system, buttons and lights can be used to interact with the
user. However, text displays are also available as well as graphical touch screen.
More complex systems use programming and monitoring software installed on
the computer, with a PLC connected via a communication interface.
23. 15
Chapter 2
Literature Review
Communication
PLCs come with integrated communication ports, usually 9-pin RS-232,
or EIA-485, but optionally Ethernet as well. Modbus is also usually present as
one of its communication protocols. Other options include DeviceNet or Profibus.
Most modern controllers can be networked to another system, such as
a computer running a SCADA (Supervisory Control and Data Acquisition) system
or web browser to communicate with the system.
PLCs employed in bigger I/O systems may have peer-to-peer (P2P)
communication amongst processors. This permits segregated parts of a complex
process to have individual control while consenting the subsystems to co-
ordinate over the communication link. These communication links are also often
used for HMI devices like PC-type workstations.
Programming
PLC programs are typically written in a special application for the
personal computer and then download by means of a direct cable connection or
via a network to the PLC. The program is stored in the controller on a nonvolatile
flash memory. Usually, a single PLC can be programmed to substitute thousands
of relays.
24. 16
Chapter 2
Literature Review
According to the IEC 61131-3 standard, PLCs can be programmed in
five standards-based programming languages. A graphical programming
notation called Sequential Function Charts is available on certain programmable
controllers. Initially most PLCs utilized Ladder Logic programming model, which
emulated electromechanical control devices (such as contacts and coils) the
model is still common.
According to IEC 61131-3, the following are the five standard PLC
programming language:
(i) function block diagram (FBD)
(ii) ladder diagram (LD)
(iii) structured text (similar to Pascal programming language)
(iv) instruction list (similar to assembly language)
(v) sequential function chart (SFC).
Although the basic concepts of PLC programming are common to all
manufacturers, differences in I/O addressing, memory organization and
instruction set allows the PLC program to not be fully interchangeable with other
manufacturers. Even different models of the same product family are not directly
compatible with each other.
25. 17
Chapter 2
Literature Review
Security
Before the discovery of the Stuxnet computer virus in June 2010, little
attention was paid to the safety and security of PLC from Cyber-attacks. PLCs
normally contains a real-time operating system such as OS-9 or VxWorks, for
which exploits exist just as they do for other operating systems like Windows.
PLCs can also be attacked by gaining control of a computer they communicate
with.
Simulation
To understand how the PLC operates, a lot of time is to be spent
programming, testing and debugging PLC programs. PLC Systems are expensive,
and downtime are often very expensive. Also, if the PLC programming is
incorrect or has a bug, it can result in loss of productivity and in dangerous
conditions.
Software for PLC simulation is a valuable tool for understanding and
learning the PLCs operation and it helps keep knowledge constantly renewed
and updated. The benefits of using simulation tools such as PLCSim is that they
save time in the design of algorithm and can help increase level of safety
associated with apparatus since various "what if" scenarios can be tried and
tested before the system is activated.
26. 18
Chapter 2
Literature Review
Redundancy
Some special procedures require 24x7 operation and down-time for
those systems is unacceptable. It is therefore necessary to have a system that is
fault-tolerant and can handle the process with partially defective modules. For
this case, the availability of the system can be made certain even if a hardware
component fails, by using redundant processors and I/ O with the same functions
to prevent total or partial process shut down due to hardware failure from any
kind.
Circuit Elements
PIC 16F877A
PIC 16F877A is a 40-pin 8-Bit Microcontroller from Microchip. The
core architecture is high-performance RISC CPU with only 35 single word
instructions. Since it follows the RISC architecture, all single cycle instructions
take only a single instruction cycle except for program branches which take two
cycles. 16F877A comes with three functional speeds with 20, 8, or 4 MHz clock
input. For 20MHz crystal, each instruction takes 0.2 µs as one instruction takes
four clock cycles.
It has two types of internal memories: data memory and program
memory. Program memory is provided by 8K words of FLASH memory, and data
27. 19
Chapter 2
Literature Review
memory has two sources. One type is a 368-byte RAM and the other is 256-byte
EEPROM. The main feature includes power saving SLEEP mode, interrupt
capability up to 14 sources, and single 5V In-Circuit Serial Programming (ICSP)
capability. The sink/source current, which indicates a driving power from I/O
port, is high with 25mA. Power intake is less than 2 mA in 5V operating
condition.
The peripheral features include:
(a) Three time blocks: Timer0 for 8-bit timer/counter; Timer1 for 16-
bit timer/counter; and Timer2: 8-bit timer/counter with 8-bit period
register, pre-scalar and post-scalar.
(b) Two Capture, Compare, PWM modules for capturing, comparing
16-bit, and PWM generation with 10-bit resolution.
(c) 10-bit multi-channel (max 8) ADC module.
(d) Synchronous Serial Port (SSP) with SPI (Master Mode) and I2C2
(e) Universal Synchronous Asynchronous Receiver Transmitter
(USART/SCI) with 9-bit address detection.
(f) Parallel Slave Port (PSP) 8-bits wide.
(g) I/O ports.
Few other important properties of PIC 16F877A are listed in table T.1.
28. 20
Chapter 2
Literature Review
Pin and Package:
There are three types of packaging available: PLCC, DIP, and QFP. The
commonly used one is the DIP because of its best fit to proto-board or
breadboard.
Refer to figure F.1 for its detailed pin configuration and functionality.
7-Segment Display
A Light Emitting Diode or LED, is a solid state optical PN-junction diode
that emits light energy in the form of “photons” when it is forward biased by a
voltage allowing current to move across its junction, and this process, in
electronics, is known as electroluminescence.
7-segment display
LEDs have many benefits over lamps and traditional bulbs, with the
key ones being their long life, small size, cheapness, and various colors as well as
are readily available, and they are easy to interface with many other electronic
components.
29. 21
Chapter 2
Literature Review
But the core feature of LED is that because of their small die size, a
number of them can be connected together in one small and compact package
making what is generally called a 7-segment Display.
The 7-segment display, comprises of 7 LEDs organized in a rectangular
shape as presented in the above picture. Each of the seven LEDs is known as a
segment because when lightened the segment forms part of a numerical digit to
be showed. Another 8th LED, for decimal point indication, is sometimes used
within the same package when two or more 7-segment displays are linked
together to display numbers greater than ten.
Each one of the seven LEDs in the display is given a positional segment
with one of its connecting pins being taken out of the plastic package. These
individual LED pins are marked as a, b, c, d, e, f & g representing each separate
segment. The other LED pins are coupled together to form a common pin.
So by forward biasing the appropriate pins of the LED segments in a
specific order, some LEDs will be bright and others will be dark allowing the
wanted character pattern of the number to be generated on the display. This
allows us to display each of the ten decimal digits 0 to 9 on the same 7-segment
display.
The displays common pin is normally used to discover which type of 7-
segment display it is. As each segment has 2 legs (pins), one called the “Cathode”
30. 22
Chapter 2
Literature Review
and the other called the “Anode”, therefore there are two types of LED 7-segment
display, known as: Common Anode (CA) & Common Cathode (CC)
The dissimilarity between the two displays, as suggested by their
name, is that the common cathode contains all the cathodes of the 7-segments
coupled directly together and on the other hand the common anode has all the
anodes of the 7-segments coupled together and is illuminated as follows.
1. The Common Cathode (CC) – In the common cathode display, all the
cathode connections of the LED segments are joined together to logic “LOW” or
logic “0” or simply ground. The single segments are glowed by applying a “HIGH”,
or logic “1” signal by a current limiting resistor to forward bias the individual
anode terminals.
2. The Common Anode (CA) – In this type of display, all the anode pins
of the LED segments are tied together to logic “HIGH”. The single segments are
31. 23
Chapter 2
Literature Review
lightened by the application of a ground, logic “0” or logic “LOW” signal through a
suitable current limiting resistor to the Cathode of the particular segment.
Generally, CA 7-segments are more demanded as most of the logic
circuits can draw more current than they can provide. Also remember that a
common cathode 7-segment cannot be replaced, in a circuit, directly by a
common anode and vice versa, as it is the same as connecting the LEDs in
reverse, and hence no emission will take place.
Depending upon the decimal digit to be presented, the specific
combination of segments is forward biased. For instance, to display the
numerical digit 3, we will have to light up five of the seven segments
corresponding to a, b, c, d, and g. And the various digits i.e. from ‘zero’
through ‘nine’ can be expressed by a 7-segment display as shown in figure F.2.
32. 24
Chapter 2
Literature Review
Driving a 7-segment Display
Although a 7-segment display can be assumed as a single display, but it
is still seven separate segments LEDs in one package & these LEDs need
protection from over current. LEDs yield light after it is forward biased with the
quantity of light radiated being proportional to the forward current.
This means that an LED’s light strength increases in an almost linear
routine with an increasing current. So this forward current should be controlled
and restricted to a safe value by an external resistor to avoid loss of the LED
segments.
The forward voltage drop across a red LED segment is very low at
about 2 to 2.2 volts, (blue and white LEDs can be as high as 3.6 volts) so to
illuminate correctly, the LED segments should be connected to a voltage source
in excess of this forward voltage value with a series resistance used to limit the
forward current to a desirable value. Typically for a standard red colored 7-
segment display, each LED segment can draw about 15 mA to illuminated
correctly, so on a 5 volt digital logic circuit, the value of the current limiting
resistor would be about 200Ω (5v – 2v)/15mA, or 220Ω to the nearest higher
preferred value.
So to understand how the segments of the display are connected to
a 220Ω current limiting resistor consider the circuit in the next diagram.
33. 25
Chapter 2
Literature Review
In this example, the segments of a common anode display are
illuminated using the switches. If switch “a” is closed, current will flow through
the “a” segment of the LED to the current limiting resistor connected to
pin “a” and to 0 volts, making the circuit. Then only segment “a” will be
illuminated. So a LOW condition (switch to ground) is required to activate the
LED segments on this common anode display.
But suppose we want the decimal number “4” to illuminate on the
display. Then switches b, c, f and g would be closed to light the corresponding
LED segments. Likewise, for a decimal number 7, switches a, b, c would be
closed. But illuminating 7-segment displays using individual switches is not very
practical and neither is it done that way. Rather a preceding circuit drives the
seven-segment display like a micro controller.
34. 26
Chapter 2
Literature Review
Thermistors
These are thermally sensitive resistors whose prime function is to
exhibit a large, predictable and precise change in electrical resistance when
subjected to a corresponding change in body temperature. Negative
Temperature Coefficient (NTC) thermistors exhibit a decrease in electrical
resistance when subjected to an increase in body temperature and Positive
Temperature Coefficient (PTC) thermistors exhibit an increase in electrical
resistance when subjected to an increase in body temperature.
Because of their very predictable characteristics and their excellent
long term stability, thermistors are generally accepted to be the most
advantageous sensor for many applications including temperature measurement
and control.
Since the negative temperature coefficient of silver sulfide was first
observed by Michael Faraday in 1833, there has been a continual improvement
in thermistor technology. The most important characteristic of a thermistor is,
without question, it’s extremely high temperature coefficient of resistance.
Modern thermistor technology results in the production of devices with
extremely precise resistance versus temperature characteristics, making them
the most advantageous sensor for a wide variety of applications.
A thermistor's change in electrical resistance due to a corresponding
temperature change is evident whether the thermistor's body temperature is
changed as a result of conduction or radiation from the surrounding
35. 27
Chapter 2
Literature Review
environment or due to "self-heating" brought about by power dissipation within
the device.
When a thermistor is used in a circuit where the power dissipated
within the device is not sufficient to cause "self-heating", the thermistor's body
temperature will follow that of the environment. Thermistors are not "self-
heated" for use in applications such as temperature measurement, temperature
control or temperature compensation.
When a thermistor is used in a circuit where the power dissipated
within the device is sufficient to cause "self-heating", the thermistor's body
temperature will be dependent upon the thermal conductivity of its environment
as well as its temperature. Thermistors are "self-heated" for use in application
such as liquid level detection, air flow detection and thermal conductivity
measurement.
The curve for temperature v/s resistance of a 10k Thermistor is given
in figure F.3.
Relays
Relays are switches that open and close circuits electromechanically or
electronically. Relays control one electrical circuit by opening and closing
contacts in another circuit. As relay diagram of figure F.4 shows, the terminal
36. 28
Chapter 2
Literature Review
named “normally open” (NO) is an open contact with the “common” and the
terminal named “normally closed” (NC) is a closed contact when the relay is not
energized. Similarly, when a relay contact is energized, the NC gets open and NO
gets closed with the common. In either case, applying electrical current to the
contacts will change their state.
Relays are generally used to switch smaller currents in a control circuit
and do not usually control power consuming devices except for small motors and
solenoids that draw low currents. Nevertheless, relays can "control" high
voltages and currents by a low voltage applied to a relays coil that can result in a
high voltage being switched by the contacts.
Protective relays can prevent equipment damage by detecting
electrical abnormalities, including overcurrent, undercurrent, overloads and
reverse currents. In addition, relays are also widely used to switch starting coils,
heating elements, pilot lights and audible alarms.
Electromechanical Relays:
Basic parts and functions of electromechanical relays include:
Frame: Heavy-duty frame that contains and supports the parts of the relay.
Coil: Wire is wound around a metal core. The coil of wire causes an
electromagnetic field.
Armature: A relays moving part. The armature opens and closes the
contacts. An attached spring returns the armature to its original position.
37. 29
Chapter 2
Literature Review
Contacts: The conducting part of the switch that makes (closes) or breaks
(opens) a circuit.
A Relay’s Contact Life.
A relays useful life depends upon its contacts. Once contacts burn out,
the relays contacts or the entire relay has to be replaced. Mechanical Life is the
number of operations (openings and closings) a contact can perform without
electrical current. A relays mechanical life is relatively long, offering up to
1,000,000 operations. A relays Electrical life is the number of operations
(openings and closings) the contacts can perform with electrical current at a
given current rating. A relays Contact electrical life ratings range from 100,000 to
500,000 cycles.
Opto-Coupler
We can provide electrical isolation between an input source and an
output load using just light by using a very common and valuable electronic
component called an Opto-coupler.
An Opto-coupler, also known as a photo-coupler or Opto-isolator, is an
electronic components that interconnects two separate electrical circuits by
means of a light sensitive optical interface.
38. 30
Chapter 2
Literature Review
The basic design of an Opto-coupler consists of an LED that produces
infra-red light and a semiconductor photo-sensitive device that is used to detect
the emitted infra-red beam. Both the LED and photo-sensitive device are
enclosed in a black body or package with metal legs with the electrical
connections.
An Opto-coupler or Opto-isolator consists of a light emitter, the LED
and a light sensitive receiver which can be a single photo-diode, photo-resistor,
photo-transistor, photo-SCR, or a photo-TRIAC and the basic operation of an
Opto-coupler is very simple to understand.
Phototransistor Opto-coupler
Assume a photo-transistor device
as shown. Current from the source signal
passes through the input LED which emits an
infra-red light whose intensity is
proportional to the electrical signal.
This emitted light falls upon the base of the photo-transistor, causing it
to switch-ON and conduct in a similar way to a normal bipolar transistor.
The base connection of the photo-transistor can be left open for
maximum sensitivity or connected to ground via a suitable external resistor to
control the switching sensitivity making it more stable.
39. 31
Chapter 2
Literature Review
When the current flowing through the LED is interrupted, the infra-red
emitted light is cut-off, causing the photo-transistor to stop conducting. The
photo-transistor can be used to switch current in the output circuit. The spectral
response of the LED and the photo-sensitive device are closely matched being
separated by a transparent medium such as glass, plastic or air. Since there is no
direct electrical connection between the input and output of an Opto-coupler,
electrical isolation up to 10kV is achieved.
Opto-couplers are available in four general types, each one having an
infra-red LED source but with different photo-sensitive devices. The four Opto-
couplers are called the: Photo-transistor, Photo-darlington, Photo-SCR and Photo-
triac as shown below.
40. 32
Chapter 2
Literature Review
The photo-transistor and photo-Darlington devices are mainly for use
in DC circuits while the photo-SCR and photo-TRIAC allow AC powered circuits
to be controlled. There are many other kinds of source-sensor combinations,
such as LED-photodiode, LED-LASER, and lamp-photo resistor pairs, reflective
and slotted Opto-couplers.
Simple homemade Opto-couplers can be constructed by using
individual components. An LED and a photo-transistor are inserted into a rigid
plastic tube or encased in heat-shrinkable tubing. The advantage of this home-
made Opto-coupler is that tubing can be cut to any length you want and even
bent around corners. Obviously, tubing with a reflective inner would be more
efficient than dark black tubing.
2N3904
The 2N3904 is a common NPN bipolar junction transistor used for
general purpose low-power amplifying or switching applications. The type was
registered by Motorola Semiconductor in the mid-sixties, together with the
complementary PNP type 2N3906, and represented a significant performance /
cost improvement, with the plastic TO-92 case replacing metal cans. It is
designed for low current and power, medium voltage, and can operate at
moderately high speeds. This transistor is low cost, widely available and
sufficiently robust to be of use by experimenters.
41. 33
Chapter 2
Literature Review
It is a 200 mA, 40 volt, and 625 mW transistor with a transition
frequency of 300 MHz, with a minimum beta or current gain of 100 at a collector
current of 10 mA. It is used in a variety of analog amplification and switching
applications.
Electrically similar devices are available in a variety of small through-
hole and surface mount packages including TO-92, SOT-23, and SOT-223, with
package-dependent thermal ratings from 625 mW to 1 watt.
A 2N3906 is a complementary (PNP) transistor for the 2N3904.
The 2N2222 is an NPN transistor that can safely switch three times as much
current as the 2N3904 but has otherwise similar characteristics. Nevertheless, in
many applications such as variable frequency oscillators where lower currents
are used to minimize thermal heating and consequent thermal drift of the
fundamental frequency, the greater current capacity of the 2N2222 gives it no
advantage. Whereas the 2N2222 is optimized to reach its highest gain at currents
of around 150 mA, the 2N3904 is optimized for currents of around 10 mA.
The 2N3904 is used very frequently in hobby electronics circuits
including home-made ham radios, code practice oscillators and as an interfacing
device for microcontroller.
42. 34
Chapter 3
Methodology
Chapter 3
Methodology
Project Division:
The project can be divided into five major portions.
The first is to understand the process thoroughly to develop load
shedding schemes as per requirement of the industry and the product being
manufactured.
After the first task is accomplished, the next step is to develop fail-safe
algorithms to manage the load of industry as per available electric power.
To aid in understanding of the management and visual representation, a
measurable amount of efforts were made to develop a graphical user interface
using WinCC.
Then comes a prototype hardware to demonstrate the plc shedding
algorithm with the help of switches and panel lights.
43. 35
Chapter 3
Methodology
Industrial Survey
First task to be targeted is the industrial survey and to understand the
process being carried out at the industry so a suitable shedding algorithm can be
developed.
In this project, Siemens provided with the information of the loads of
PARCO plant in Multan. The job then was to design a shedding algorithm keeping
in mind the loads of PARCO and the generators installed there.
The loads that were considered for shedding in this project are as follows:
Housing Colony
Workshops, Lab, Stores
Copper Air Compressor
Raw Water Tube Well
Effluent Treatment & Dispose
Motors
Urea Plant
Nitric Acid Line-C
Admin Bldg. &Offices
Old Cooling Tower
New C/T Motors (2201-JD)
New Copper Air Compressor
New C/T Fans
Nitric Acid Motors
Nitric Acid Line-A
Nitric Acid Line-B
New C/T Motors (2208-JD)
NH3 Storage Comp.
Ammonia Plant
LT Air Compressor
GTG Auxiliaries
NitroPhos Plant
Demineralization Plant
The PARCO plant is also equipped with six generators and a seventh
small diesel generator that can be used to startup the plant in a case of total
blackout as this generator does not have auxiliaries that first need to be powered
44. 36
Chapter 3
Methodology
up unlike the main generators. PARCO has three steam generators and three gas
turbine generators.
A priority scheme has been developed for the shedding of this plant,
with a provision to change the priorities in runtime.
After successful completion of this part of the project by March 2014,
all the attention went on to building an efficient and perfectly working algorithm
to meet the above requirements.
Algorithm on Step7
The backbone of this project or any task carried out by PLC is the
algorithm running in the background.
The software used is SIMATIC Step7 V5.5 which is a proprietary
software by Siemens for their PLCs. It comes with an integrated version of
PLCSim, the software used for simulation of the algorithm. No code is considered
to be working until and unless it goes through simulation where all kinds of
extremes and routines are checked for the algorithm. This is thoroughly done
and is of most importance because a failure of PLC in operation is totally
unacceptable and can cause great losses of both lives & money.
45. 37
Chapter 3
Methodology
The model of the CPU used in this project is “S7-300 IFM 314-5AE03-
0ABO” powered by an integrated 2 Amp power supply PS-307-1BA00-0AA0 and
comes with a set of built-in I/O Ports as follows:
Analog Inputs: 4 (12-Bit Resolution)
Analog Outputs: 1 (12-Bit Resolution)
Digital Inputs: 20
Digital Outputs: 16
The internal architecture of PLC allows multiple organizational blocks
to be used. Each organizational block can then be referred into another OB for
references and thus a program can be built which is easier to understand. Also,
OB35 is an interrupt OB which can be used to handle interrupts.
The data can be sorted into different data blocks for easy access and
monitoring as well as for systematic storage. In this project, several data blocks
were used like one for saving the load values, one for the values of inhibit
switches and a lot others. These then came useful while building an HMI.
Simple AND, OR blocks were the main part of the code, with other SR
latches used every now and then. Also, the arithmetic blocks came into play
while comparing the load with generation as well as while for the relation of the
ambient temperature to available generation.
46. 38
Chapter 3
Methodology
The primary concept of foreign key in the database system is also used
here to provide the option of changeable priority list by making a fixed lookup
table of all the loads and another table with keys from the fixed table.
A few screenshots of the code have been inserted in this report.
Human Machine Interface
A human machine interface to a PLC code is just as good as windows
over DOS. A PLC code is written with logical characters and numbers lighting up
in green during execution. To a person who has developed the code himself,
these visions might make some sense but to an alien observer, these are just
useless and understanding them is a hectic job. For this reason, an HMI is
developed which uses graphical symbols and images for better understanding of
the process.
Siemens have their own software WinCC to develop the HMI. This
software is automatically integrated with Step7 and PLCSim. In this project, four
different HMI screens have been developed.
(i) Face Plate: This main screen holds the priority list as well as
buttons for navigating to other screens. The buttons to change
the priority lists also are placed on the same screen.
47. 39
Chapter 3
Methodology
The screen also has a list of all the loads and their current status
whether they are on or off and how much load is it consuming.
The screen also displays the status of the generators and their
available generations.
(ii) Line Diagram: This screen gives an overview of the entire plant
and what loads are running and which ones are switched off.
Color coding is also implemented on the lines to make it more
readable.
(iii) Alarm: This screen will be used to address the alarms logged in
the past and the alarm currently ringing (if one). Alarms are
again color coded to indicate the level of alert.
(iv) Simulation Window: This will be used to simulate the effects
that are anticipated to occur in the actual implementation. At
the time of simulation, this window can be used to simulate the
switches of loads, temperature variations of the generator
room. Other parasitic effects can also be simulated using this
window. It should be clear that this window is not a part of the
original project and is not expected to be supplied to the client
but will be used by the design engineer for simulation
procedure.
Live tagging and trending of past events is also done in HMI and can be
useful to avoid the tripping in the generators. Few screenshots are attached in
this report.
48. 40
Chapter 3
Methodology
Hardware
The basic hardware display unit is a panel with LEDs to indicate status
of loads and simple switches to perform the job of actual switches used in the
industry. Few pictures of this panel are placed at the end of this text.
To operate these LEDs with the PLC, an interface circuitry has been
built using discrete components like relays, resistors, transistors and opto-
coupler (for safety through electrical isolation).
To simulate the temperature sensing done on actual plant, thermistors
have been used and the output of this circuit is fed to the PLC. But to display their
output (temperature reading) on a 7-segment display, PIC Microcontroller has
been used.
First, a voltage divider arrangement is used with thermistor to get a
modulated output with respect to the temperature. For information on
thermistors, refer to appendix A1. Their circuit and the characteristics of
thermistor are attached in this report. This voltage is then supplied to the PLC at
its analog input where it is processed to get the respective value of temperature.
This temperature can then be fed into the GT Curve of the generator to get the
value of maximum generation available.
However, to display this output on a 7-segment display, the voltage
from the thermistor circuit is also fed to the microcontroller, which senses the
voltage with its 10-bit ADC and then processes it to get the value of temperature
and then the respective generation. However, the most important step in this
49. 41
Chapter 3
Methodology
coding is to break the decimal number (stored in binary format in the controller)
into separate digits for hundreds, tens and units. For this, an algorithm known as
DOUBLE DABBLE has been used which uses shift and add operations to separate
the digits of a decimal number that is it converts binary into BCD. For further
information on this algorithm, please refer to appendix A2. Then, codes were
generated for the 7-segment display (a, b, c, d, e, f, and g) for each digit (0-9) and
are listed in T.2. Time division multiplexing has been used to drive the seven
segments using just one port for the digit and a separate bit controlling the
common pin of the display. This common pin then activates a given segment
while all other remain switched off. The digit to be displayed is placed on the
PORTB. The activated display lights up to display the desired digit. It stays active
for 2ms and then goes off and the second in line gets active. In this way each gets
active one after another for 2ms each. The end result is that they all look lighted
up to naked eye but actually they are blinking at a rate too high for human eye to
detect. Using this multiplexing technique, nine displays are being handled with a
single micro controller and just 17 pins instead of 56.
To connect the PLC with hardware, separate interfacing circuitry were
used and their schematics have been attached. These circuitry are used for both
the switching purposes and feedback to the PLC.
50. 42
Chapter
Conclusion
Chapter 4
Conclusion
This project is implementable in a lot of industries using multiple
sources of power. The system will make sure that in the case of tripping of a
generator, the entire plant does not shut down. This can help avoid a lot of losses
like raw material, machines and most importantly valuable time.
Since the action in this event is required to be quick, an automatic
system is the most suitable rather than a human personnel shedding the loads.
The trending feature can help to avoid these events in the future and
the feature of alarm logging is useful because it tells which generator has gone
off and what loads are shed in the reaction. This information can then be passed
on to the engineers for quick rectification.
Also, the flexibility in the priority list can account for different
priorities at different times. This is required because the manufacturing is often
dependent on the seasons and other such factors. The display panel is also really
helpful to understand the current operation.
51. 43
Chapter
Conclusion
Result
An image of the HMI at time of execution is attached here in which the
plant in running in normal operation but the last logged tripping is also
displayed.
62. xi
Appendix
A-1: Thermistor
Assuming, as a first-order approximation, that the relationship
between resistance and temperature is linear, then:
Where,
= change in resistance
= change in temperature
= First-order temperature coefficient of resistance
Thermistors can be classified into two types, depending on the
classification of k. If k is positive, the resistance increases with increasing
temperature, and the device is called a positive temperature coefficient (PTC)
thermistor, or posistor. If is negative, the resistance decreases with increasing
temperature, and the device is called a negative temperature coefficient (NTC)
thermistor. Resistors that are not thermistors are designed to have an as close
to 0 as possible, so that their resistance remains nearly constant over a wide
temperature range.
Instead of the temperature coefficient k, sometimes the temperature
coefficient of resistance (alpha sub T) is used. It is defined as:
63. xii
A-2: Double Dabble
CONCEPT:
The Double-dabble method converts a binary number to a BCD number.
It shifts the binary number to the left and then checks if the number is
greater than four or not.
If the shifted number is greater than four it adds three to the number.
If the number is not greater than four it keeps shifting.
BASIC ALGORITHM:
1. If any column (100's, 10's, 1's, etc.) is 5 or greater, add 3 to that column.
2. Shift all #'s to the left 1 position.
3. If 8 shifts have been performed, it's done! Evaluate each column for the
BCD values.
4. Go to step 1.
An example for an 8-bit number is illustrated in table.
64. xiii
References
http://en.wikipedia.org/wiki/Thermistor
http://www.energy.ca.gov/process/pubs/eload.pdf
http://en.wikipedia.org/wiki/Load_management
Silver, H. Ward (2008). Circuit building do-it-yourself for Dummies.
http://en.wikipedia.org/wiki/Programmable_logic_controller
http://www.mwftr.com/book/Emb%20PIC%20Charles%20Kim%20Cha
p2.pdf
http://www.ussensor.com/technical-info/what-is-a-thermistor
http://en.wikipedia.org/wiki/2N3904
http://www.vishay.com/optocouplers/
http://www.futureelectronics.com/en/optoelectronics/optocouplers.asp
U.S. Patents 453 and 7,940,901 (Remote Management of Products and
Services) as well as Canadian Patent 1,155,243 (Apparatus and Method
for Remote Sensor Monitoring, Metering and Control)
Claverton Energy Experts Archived July 8, 2011 at the Wayback Machine