SlideShare a Scribd company logo
1 of 74
Download to read offline
- 1 -
CHAPTER 1
INTRODUCTION
1.1 LOAD MANAGEMENT
Load management is one means of reducing the maximum electricity
loads and hence also the cost of electricity. All the manufacturing industries
(HT consumers) mainly small-scale industries suffer from the problem of
exceeding the maximum demand KVA and when they do this they are
penalized by Electricity Board. Repeated exceeding of the maximum demand
KVA by industries may lead to the disconnection of the supply by the
Electricity Board.
Currently most of the industries avoid this by switching off the entire
loads when they are at the point of exceeding the maximum demand KVA or
manually switching off the unnecessary loads at that time. Manual Switching
needs a person to continuously monitor the load demand KVA. This way of
load management adopted by the industries to prevent from the penalty when
they exceed the maximum demand KVA is not effective and efficient. As it
simply Shedds the loads without any degree of importance to loads, this may
cause loss to the industry due to the unplanned shedding of the main process
loads.
In Adaptive Power Regulator the loads are shed based on their degree of
importance, which are categorized as High, Medium and Low hierarchy. The
hierarchical based load management is much effective and eliminates loss to the
industry.
- 2 -
1.2 TARIFF DETAILS OF TNEB
The tariff details of TNEB for various HT consumers are:
HT consumers under category Tariff I-A
This tariff is applicable to all the industrial establishments and registered
factories which include tea estates, textiles, fertilizers, steel plant, heavy water
plant, chemical plants, software industries, maintenance, training and service
institutions. From now on, this tariff is also applicable to Railway traction. In
view of the merger of existing tariff of Railway Traction I-B with that of I-A
tariff, the HT tariff category I-B is abolished.
Table 1.1 Tariff Details of TNEB for HT consumers
HT consumers under category Tariff II-A
This tariff is applicable to recognized educational institutions, hostels run
by the recognized educational institution, Government Hospitals and the
hospitals under the control of Panchayats, Municipalities and Corporations,
Veterinary hospitals, Leprosy Centre, Primary Health Centre, Orphanages,
Public Libraries, Water Works, Public Lightning, Public Sewerage Works by
Government/Local Bodies, Laboratories, Research Institutions, Studios,
Cinema Theaters, Ministry of Defense Establishments, Housing complexes and
such other institutions declared by the Commission from time to time.
Tariff Category Rate in rupees per KWHr
(unit)-Energy Charges
Rate in rupees per KVA of
Maximum Demand
Ht Tariff I-A 3.50 300
Ht Tariff II-A 3.50 200
Ht Tariff II-B 2.80 125
- 3 -
HT consumers under category Tariff II-B
This tariff is applicable to actual places of worship and specially notified
places of public interest, mutt, religious institutions, etc., declared by the
Commission from time to time.
HT consumers under category Tariff II-B
This tariff is applicable to all Commercial Establishments and other
categories of consumers not covered under HT tariffs I-A, II-A, II-B. Industries
requiring HT supply during construction period shall be charged under this
tariff.
1.3 POWER FACTOR INCENTIVE
The Electricity Board provides all the Industries (HT consumers)
incentives whenever they maintain the average power factor more than 0.95, the
incentive shall be given at the rate of 1% (one percent) of the amount of the
monthly energy bill (excluding FOCA charge, demand charge, electricity duty
and regulatory liability charge) for every 1% (one percent) improvement in the
power factor above 0.95. If the consumer is able achieve a PF of 0.99, the
effective incentive will amount to 5% (five percent) reduction in the energy bill
and for unity PF, the effective incentive will amount to 7% (seven percent)
reduction in the energy bill.
The Adaptive Power Regulator aims at attaining these incentives
for the user through Reactive Power Compensation, by bringing the power
factor to the required range which in turn will cut down the running cost of an
industry.
- 4 -
CHAPTER 2
ADAPTIVE POWER REGULATOR (APR)
2.1 INTRODUCTION
The Adaptive Power Regulator (APR) is a device that enables effective and
efficient channeling of available power. This device also aims to bring down the
electricity bill of a user by
• Eliminating the penalties due to lagging and leading power factor,
• Fetch incentives for the user by maintaining high power factor and
• Reducing the risk of exceeding the maximum KVA, which results in the
Electricity Board imposing penalties on the Industry.
The Adaptive Power Regulator performs the job of Priority Based Load
Shedding, Reactive Power Compensation and its functioning can be monitored
by a computer. The main features of the Adaptive Power Regulator are shown
in the block diagram given above.
Capacitor
Bank
M & I
Instruments
(CT & PT)
(APR)
Micro
Controller
Loads
PC
Figure 2.1 Outline of Adaptive Power Regulator
HT
Supply
- 5 -
The Adaptive Power Regulator consists of
• PIC microcontroller
• Power Factor Measurement Circuit
• Driver Circuit for Switching Capacitors and Connected Load.
• Power Supply Circuit
• Signal Conditioning Circuit
• Instrumentation Transformers
• Contactors
• MAX232A Serial Interface Circuit
• Light Sensor Circuit
The PIC microcontroller does the job of interfacing all the above
mentioned devices, receiving signals from them and performing the necessary
calculations. In other words the microcontroller forms the Kernel of the
Adaptive Power Regulator. The workings of these circuits are discussed in
detail in the following pages.
ADAPTIVE POWER
REGULATOR
REACTIVE POWER
COMPENSATOR
SENSOR BASED
PRIORITY CHANGERPC INTERFACE FOR
EASY MONITORING
LOAD
SHEDDING
Figure 2.2 An Overview
- 6 -
CHAPTER 3
COMPONENTS OF ADAPTIVE POWER REGULATOR
3.1 MICROCONTROLLER
The microcontroller is a very common component in modern electronic
systems. It is a device that integrates a number of the components of a
microprocessor system onto a single microchip.
Microcontroller differs from a microprocessor in many ways. First and
the most important is its functionality. In order for a microprocessor to be used,
other components such as memory, or components for receiving and sending
data must be added to it. In short that means that microprocessor is the very
heart of the computer.
On the other hand, microcontroller is designed to be all of that in one. No
other external components are needed for its application because all necessary
peripherals are already built into it. Thus, the time and space needed to
construct devices is saved.
A microcontroller combines onto the same microchip the CPU core,
memory (Both ROM and RAM) and some parallel digital I/O. Figure 5.1 shows
an unexpanded microcontroller, which contains a number of commonly used
sub-units.
Most microcontrollers will also combine other devices such as
• A Timer module to allow the microcontroller to perform tasks for
certain time periods.
• A serial I/O port to allow data, to flow between the microcontroller and
other devices such as a PC or another microcontroller.
• An ADC, to allow the microcontroller to accept analogue input data for
processing.
- 7 -
3.1.1 Parts of a Microcontroller
Memory Unit
This is where data is stored. Two concepts, addressing and memory
location, prop to the fore. Memory consists of all memory locations, and
addressing is nothing but selecting one of them. The memory will be divided up
into ROM and RAM, with typically more ROM than RAM. The amount of
ROM type memory will vary between around 512 bytes and 4096 bytes. ROM
type memory, as has already been mentioned, is used to store the program code.
ROM memory can be ROM (as in One Time Programmable memory),
EPROM, or EEPROM. The amount of RAM memory is usually somewhat
smaller, typically ranging between 25 bytes to 4 Kbytes. RAM is used for data
storage and stack management tasks. It is also used for register stacks.
Central Processing Unit
The heart of the microcontroller is the CPU core. Data arithmetic and
movement is done in the CPU.
Figure 3.1 Main components of a microcontroller
- 8 -
Bus
This refers to the ‘way’ for data. There are two types of buses: address
and data bus. The first one consists of as many lines as the amount of memory
we wish to address and the other one is as wide as data, in our case 8 bits, or the
connection line. First one serves to transmit address from CPU memory, and the
second to connect all blocks inside the microcontroller.
Figure 3.2 Microcontroller outline
- 9 -
Input-Output Unit
The digital I/O ports are the means by which the microcontroller
interfaces to the environment. Digital I/O tends to be grouped into byte wide
ports (8 digital bits) that can be configured as either input bits or output bits.
When working with it the port acts like a memory location. Something is
simply being written into or read from it, and it could be noticed on the pins of
the microcontroller.
Analog to Digital converter
As the peripheral signals usually are substantially different from the ones
that microcontroller can understand (zero and one), they have to be converted
into a pattern which can be comprehended by a microcontroller. This task is
performed by a block for analog to digital conversion or by an ADC. This block
is responsible for converting an information about some analog value to a
binary number and for follow it through to a CPU block so that CPU block can
further process it.
- 10 -
3.1.2 PIC Microcontroller
Adaptive Power Regulation Unit uses the PIC16F877A. Figure 2.5 shows
the pin configuration of the PIC16F877 microcontroller chip.
Figure 3.3 Pin Diagram for PIC 16F877A
Some features of this microcontroller include 35 single word instructions,
single cycle instructions (1s) except for program branches, 8 KB Flash Program
Memory, 368 Byte RAM Data Memory, 256 Byte EEPROM Data Memory, In-
circuit serial programming, 10-bit, 8-channel Analog-to-Digital converter, and
Universal Synchronous Asynchronous Receiver Transmitter with 9-bit address
detection. The PIC is self-reprogrammable under software control. We use the
PIC simulator IDE for programming the board and the PIC Basic language for
the software part.
- 11 -
Figure 3.4 Architecture of PIC 16F877A
- 12 -
Analog to Digital Conversion
For converting the analog input into digital format we use the A/D
converter module inside PIC. The analog input charges a sample and hold
capacitor. The output of the sample and hold capacitor is the input into the
converter. The converter then generates a digital result of this analog level via
successive approximation. The A/D conversion of the analog input signal
results in a corresponding 10-bit digital number. The A/D converter has a
unique feature of being able to operate while the device is in SLEEP mode. To
operate in sleep, the A/D clock must be derived from the A/D’s internal RC
oscillator.
The A/D module has four registers. These registers are:
• A/D Result High Register (ADRESH)
• A/D Result Low Register (ADRESL)
• A/D Control Register0 (ADCON0)
• A/D Control Register1 (ADCON1)
The ADRESH: ADRESL registers contain the 10-bit result of the A/D
conversion. When the A/D conversion is complete, the result is loaded into this
A/D result register pair, the GO/DONE bit (ADCON0<2>) is cleared and the
A/D interrupt flag bit ADIF is set. The ADCON1 and TRIS registers control the
operation of the A/D port pins. The port pins that are desired, as analog inputs
must have their corresponding TRIS bits set (input). If the TRIS bit is cleared
(output), the digital output level (VOH or VOL) will be converted.
The following steps should be followed for doing an A/D conversion:
1. Configure the A/D module:
• Configure analog pins / voltage reference / and digital I/O (ADCON1)
• Select A/D input channel (ADCON0)
• Select A/D conversion clock (ADCON0)
• Turn on A/D module (ADCON0)
- 13 -
2. Configure A/D interrupts (if desired):
• Clear ADIF bit
• Set ADIE bit
• Set GIE bit
3. Wait the required acquisition time.
4. Start conversion:
• Set GO/DONE bit (ADCON0)
5. Wait for A/D conversion to complete, by either:
• Polling for the GO/DONE bit to be cleared or
• Waiting for the A/D interrupt
6. Read A/D Result register pair (ADRESH: ADRESL) and clear ADIF bit if
required.
7. For next conversion, go to step 1 or step 2 as required. The A/D conversion
time per bit is defined as TAD. A minimum wait of 2TAD is required before
next acquisition starts.
- 14 -
3.2 SERIAL INTERFACE
3.2.1 Logic Signal Voltage
Serial RS-232 (V.24) communication works with voltages (-15V to -3V
for high) and +3V to +15V for low) which are not compatible with normal
computer logic voltages. On the other hand, classic TTL computer logic
operates between 0V and 5V (roughly 0V to +0.8V for low, +2V to +5V for
high). Modern low-power logic operates in the range of 0V to +3.3V or even
lower.
So, the maximum RS-232 signal levels are far too high for computer
logic electronics, and the negative RS-232 voltage for high can't be interpreted
at all by computer logic. Therefore, to receive serial data from an RS-232
interface the voltage has to be reduced, and the low and high voltage level
inverted. In the other direction (sending data from some logic over RS-232) the
low logic voltage has to be adjusted and a negative voltage has to be generated,
too.
TTL RS-232 Logic
+2V to +5V +3V to +15V High
0V to +0.8V -15V to -3V Low
All this can be done with conventional analog electronics, e.g. a
particular power supply and a couple of transistors or the once popular 1488
(transmitter) and 1489 (receiver) ICs. However, since more than a decade it has
become standard in amateur electronics to do the necessary signal level
conversion with an integrated circuit (IC) from the MAX232 family. (typically
a MAX232A or some clone). In fact, it is hard to find some RS-232 circuitry in
amateur electronics without a MAX232A or some clone.
Table 3.1 TTL to RS232 Conversion
- 15 -
3.2.2 Interfacing using the MAX232
Max232 IC is a specialized circuit which makes standard voltages as
required by RS232 standards. This IC provides best noise rejection and very
reliable against discharges and short circuits. If your project is more advanced
and has to reliable you must use specialized RS232 to TTL converter IC’s.
The basic connection of the PIC 16F877A to the computer using the
MAX232 is given below.
The MAX232 IC uses three 0.1uF capacitors (C5, C6, and C7) to operate.
The forth (C8) is what is called a 'decoupling cap'. As the MAX232 IC switches
various signals (from +/-12V to 0/5V) it uses bits of current. Because it needs
these bits of current in bursts, it can disrupt your 5V supply. The C8 0.1uF
capacitor helps 'decouple' or remove the ill effects of this IC (switching back
and forth) from your power supply. This decoupling cap should be placed near
the VCC and GND pins of the IC. This helps remove noise from your power
system.
Figure 3.5 PIC interface with RS232 Conversion
- 16 -
A decoupling cap is meant to provide a quick burst of energy if the power
supply dips down - sort of like a UPS system for your IC. The further the
decoupling cap is from the IC, the less ability it has to provide that quick burst
(long wires have intrinsic capacitance of their own).
A DB9 connector is called so because it contains 9 pins and is used
universally for serial connections. You'll need a male to female serial cable to
connect your circuits DB9 connector to the computer. The 'male' end of the
cable has the metal pins; the 'female' end has the black colored plastic that
receives the pins. If you look very close at a DB9 connector in real life, you can
just make out some small numbers next to the holes.
The microcontroller is going to send 5V signals to the MAX232 IC. The
MAX232 IC in turn will convert those 5V signals to +/-12V RS232 signals that
the computer can understand through the DB9 port on the back of the computer.
- 17 -
3.3 Power Supply Circuit
All the electronic components starting from diode to ICs only work
in a DC supply ranging from +5V to +12V. We are utilizing for the same, the
cheapest and commonly available energy source of 230V-50Hz. When AC is
applied to the primary winding of the transformer, it can be stepped down
depending upon the value of the DC needed. In our circuit the transformer of
230V/12V is used to perform step down operation where a 230V AC appears as
12V AC across the secondary winding. Apart from stepping down the voltage,
it gives isolation between the power source and the controller unit.
In the power supply circuit, rectification is normally achieved using
a solid state diode. Diodes have the property which will allow electron flow
easily in one direction at proper biasing condition. A commonly used circuit for
supplying large amounts of DC power is the bridge rectifier. A bridge rectifier
of four diodes (IN 4007 in our case) is used to achieve full wave rectification.
Two diodes will conduct during the negative half cycle and the other two will
conduct during the positive half cycle.The DC output has ripples and so a
capacitor is used to filter these ripples. The output of the filter circuit is given to
the regulator IC to get the desired output.
Figure 3.6 Power Supply Circuit
- 18 -
3.4 SIGNAL CONDITIONING CIRCUIT
The PIC microcontroller can tolerate a maximum voltage of +5V DC.
The input devices CT & PT will produce an ac voltage and also the level of
voltage will not be within the specifications of the microcontroller.
The signal conditioning circuit constructed with a bridge rectifier and a
zener diode will solve the above said problem.
3.5 OPTOCOUPLER AND DRIVER CIRCUIT
Optocoupler is a device which provides the perfect isolation between the
power and control circuit. The optocoupler IC consists of a LED and a photo
diode. The output signal from the microcontroller activates the led, which in
turn drives the photo diode. The optocoupler is in the form of IC MOC3021.
The photo diode of the optocoupler will trigger the gate of the Tirac and
this will turn on the contactor.
Figure 3.7 Signal conditioning circuit
Figure 3.8 Driver Circuit
- 19 -
3.6 LIGHT SENSOR CIRCUIT
This circuit is used to switch priority between the Secondary and the
Tertiary (Lighting) load. During the day if the work space in an industry has
sufficient sunlight, the lighting loads are given least priority. So when the KVA
limit is exceeded the lighting loads can be shed. But during the night the
priority of the lighting load is increased and some other load which is not
important is give least priority.
The circuit given above enables this operation. When the sunlight is
present the circuit gives an output voltage which is given to the microcontroller.
When there is no ambient light, the output voltage of the circuit is zero which is
sensed by the microcontroller and increases the priority of the lighting load.
Figure 3.9 Light sensor Circuit
- 20 -
3.7 CONTACTORS
A contactor is an electrically controlled switch (relay) used for switching
a power circuit. A contactor is activated by a control input which is a lower
voltage / current than that which the contactor is switching. Contactors come in
many forms with varying capacities and features. Unlike a circuit breaker a
contactor is not intended to interrupt a short circuit current.
Contactors range from having a breaking current of several amps and 110
volts to thousands of amps and many kilovolts. The physical size of contactors
ranges from a few inches to the size of a small car.
Contactors are used to control electric motors, lighting, heating, capacitor
banks, and other electrical loads.
3.7.1 Operating Principle
Unlike general-purpose relays, contactors are designed to be directly
connected to high-current load devices, not other control devices. Relays tend to
be of much lower capacity and are usually designed for both Normally Closed
and Normally Open applications. Devices switching more than 15 amperes or in
circuits rated more than a few kilowatts are usually called contactors. Apart
from optional auxiliary low current contacts, contactors are almost exclusively
fitted with Normally Open contacts.
When current passes through the electromagnet, a magnetic field is
produced which attracts ferrous objects, in this case the moving core of the
contactor is attracted to the stationary core. Since there is an air gap initially,
the electromagnet coil draws more current initially until the cores meet and
reduce the gap, increasing the inductive impedance of the circuit.
- 21 -
For contactors energized with alternating current, a small part of the core
is surrounded with a shading coil, which slightly delays the magnetic flux in the
core. The effect is to average out the alternating pull of the magnetic field and
so prevent the core from buzzing at twice line frequency.
Most motor control contactors at low voltages (600 volts and less) are
"air break" contactors, since ordinary air surrounds the contacts and
extinguishes the arc when interrupting the circuit. Modern medium-voltage
motor controllers use vacuum contactors.
3.8.2 Capacitor Switching Contactors-Features
• Excellent damping of inrush current
• Improved power quality (e.g. avoidance of voltage sags)
• Recall function of recorded values
• Longer useful life of main contacts of capacitor contactor
• Soft switching of capacitor and thus longer useful life
• Enhanced mean life expectancy
• Reduced ohmic losses
• Easy access for cable connection
- 22 -
3.8 INSTRUMENT TRANSFORMERS
Instrument transformers are used for measurement and protective
application, together with equipment such as meters and relays. Their role in
electrical systems is of primary importance as they are a means of "stepping
down" the current or voltage of a system to measurable values, such as 5A or
1A in the case of a current transformers or 110V or 100V in the case of a
voltage transformer. This offers the advantage that measurement and protective
equipment can be standardized on a few values of current and voltage.
3.8.1 CURRENT TRANSFORMER (CT)
Current transformer is used with its primary connected in series with the
line carrying the current to be measured and therefore the primary current is
dependent upon the load connected to the system and it is not determined by the
load connected to secondary winding of the transformer. The output voltage of
the transformer depends upon the current passing through the primary coil of
the transformer.
CT is used as an input device to measure the load current and to calculate
the load KVA.
3.8.2 POTENTIAL TRANSFORMER (PT)
Potential transformer is a simple step down transformer which converts
the high voltage to a measurable low voltage. The primary of the transformer is
connected in parallel to the loads and the secondary voltage induced will be
proportional to the load voltage.
PT is used as an input device to measure the load voltage and to calculate
the load KVA.
- 23 -
3.9 POWER FACTOR CIRCUIT
The main objective of the power factor circuit is to determine the
phase displacement between the current and the voltage waveform and
the type of displacement (leading or lagging). To perform these
operations the input voltage and current waveforms which are in AC are
to be converted into DC, preferably +5V DC. This is done by the clipper
and clamper circuits. The working of these circuits is discussed later in
detail in Chapter 6.
- 24 -
CHAPTER 4
WORKING OF ADAPTIVE POWER REGULATOR
4.1 BLOCK DIAGRAM EXPLANATION
The microcontroller does the job of integrating the signals obtained from
the various devices. On obtaining these signals the microcontroller does the
necessary operations based on the program inside it.
The signal conditioning circuit, as mentioned before conditions the input
from the CT and PT into a form that is recognizable by the microcontroller. In
other words it converts the signal into the voltage levels that are suitable for the
microcontroller. Here in our circuit it brings down the voltage from the CT and
PT to 5V dc. This is then given to the analog pins AN.0 and AN.1 of the
microcontroller. These signals are used by the microcontroller to calculate the
actual KVA consumed by the load. If the actual KVA is greater than the Set
Base maximum load KVA the microcontroller performs load shedding.
- 25 -
Load Shedding starts by removing the Tertiary loads first. This is done so
as to minimize the actual KVA and also allowing the Primary loads to continue
functioning. Here the basic idea is to give more importance to the load in an
industry which is very vital for the functioning of the industry at that time.
Consider a company that makes ceramic insulators where most of the work on
that day is on an Induction motor which is used for mixing the components for
manufacturing the ceramic. So the primary load is set as the induction motor on
that day. Also consider a tertiary lighting load which can be shed during the day
time. Similarly we consider the lighting load as the tertiary load during the day.
During the night time the light sensor circuit is used to switch priority between
the lighting load and some other load which can be shed (least important). Now
the least important load is made as the tertiary load and lighting load is given
second priority.
So whenever the KVA limit is exceeded, the microcontroller sends a
signal to the driver circuit which disconnects the least priority load first and
functioning of the other connected load continues. If the condition persists the
second priority load is now shed and a signal is sent by the microcontroller to
the alarm circuit to inform to the operating personnel.
The Power Factor circuit sends to the microcontroller three signals D1,
D2 and PWM signal, which indicates the phase-shift between the voltage and
current waveform. The CCP1 pin in the microcontroller receives this PWM
signal and calculates the phase-shift angle and thus the power factor. The
signals D1 and D2 help to determine whether the P.F is leading, lagging or
U.P.F.
- 26 -
- 27 -
The power factor range is preset inside the microcontroller which is used
to switch-on the necessary capacitors. Consider the system power factor range
is set to be between 0.95 and 0.97 inside the microcontroller. Now before
switching-on the banks the calculated power factor is say 0.72. The
microcontroller now switches the appropriate bank and then checks the power
factor. Now by performing switching-on of the capacitors in different
combinations and continuous checking of the power factor, the microcontroller
brings the power factor to the required range. Also when the power factor
exceeds the range, say is 0.98 in our case, the microcontroller switches off the
least connected capacitor and continues to do so till the p.f. is within required
range. Here again the driver circuit is used to interface the capacitor contactor
and the microcontroller, i.e. when the microcontroller sends the signal it
switches on the respective capacitor.
The MAX232A is used to send and receive signals, thereby enabling
serial communication between the microcontroller and the computer. The signal
sent to the computer is used to indicate the actual KVA, position of the
contactors, etc.
The general idea with which the system works is represented in the form
of a flowchart as shown below. The system gets two inputs, one for calculating
the KVA and the other is a pulse wave which gives the phase displacement
between the voltage and current. The below sequence is programmed in C using
a MikroC, which is given in Appendix 1.
- 28 -
START
Give the XOR
generated pulse to
PIC
Find phase difference
using capture mode
and calculate P.F
Get D-Flip-Flop
values
If V & I are
in phase
NO
Is the P.F in
desired range?
NO
Give V & I from
signal conditioner
circuit and
calculate KVA
YES
YES
Is KVA
greater than Set
max KVA?
Perform Load
shedding based on
priority
YES
NO
Figure4.3 Flowchart
Switch Capacitors
in Capacitor Bank
accordingly
- 29 -
CHAPTER 5
CAPACITOR BANK
5.1 SELECTION OF CAPACITORS
Power factor involves the relationship between two types of power
Active Power and Reactive Power. Active Power is measured in kilowatts
(KW) and Reactive Power is measured in kilovolt-amperes-reactive (KVAR).
Active power and reactive power together make up Apparent Power, which is
measured in kilovolt-amperes (KVA). Power factor is the ratio between active
power and apparent power. Active power does work and reactive power
produces an electromagnetic field for inductive loads.
This relationship is often illustrated using the familiar "power triangle"
that is shown in the following figure.
If the load is an electric motor or any other industrial AC loads, it will
have a lagging (inductive) power factor, which means that we'll have to correct
for it with a capacitor of appropriate size, wired in parallel. This correction will
not change the amount of true power consumed by the load, but it will result in
a substantial reduction of apparent power and of the total current drawn from
The KW, of all loads are measured along this axis
The KVA is measured along this
diagonal
The KVAR is
measured along
this vertical axis
Power Factor Angle
Reactive Power = [(Apparent Power) 2
- (Active Power) 2
)] ½
Figure 5.1 Power Triangle
- 30 -
the source. This lower total current will translate to less heat losses in the circuit
wiring, meaning greater system efficiency (less power wasted).
The installation of power factor correction capacitors will reduce the
KVA demand on the transformers, thereby allowing additional load to be added
without transformer resizing. Improved power factor will also help to reduce
losses and support the bus voltages.
P.F = [(Active Power)/ (Apparent Power)]
= [KW/ (KW2
- KVAR2
)] ½
The power triangle after adding capacitor is shown in the following
figure.
Angle 1 is the power factor angle, before adding capacitors
Angle 2 is the power factor angle, after adding capacitors
KVAR1 is the reactive power before capacitors
KVAR2 is the reactive power after adding capacitors
KVARC is the capacitor size needed to improve the power factor
Total Reactive Power = [Inductive KVAR- Capacitive KVAR]
i.e., KVAR2 = [KVAR1 – KVARC]
KVARC
KVAR2
KVAR1
Angle2
Angle1
Figure 5.2 Power Triangle
after adding Capacitor
- 31 -
By knowing the value of Inductive KVAR and the Total KVAR which is
needed to be attained the Capacitive KVAR can be calculated from the above
formulae.
Now by knowing the amount of reactive power the size of capacitor
needed to counteract its effects can be calculated by,
Xc = (Source Voltage) 2
/ KVARC
An Induction motor is used as highest priority load to display the
prioritized load shedding. The Capacitor values required for the Capacitor Bank
arrangement is calculated with the help of the Wattmeter and Ammeter readings
during the load test conducted on the Induction motor. The values obtained by
the load test are tabulated below.
From the above tabulation the value of the capacitor size (Xc) needed to
improve the power factor to the desired value can be calculated. It was
calculated that with a capacitor bank range of 45µF to 63µF for this particular
Induction motor the power factor can be maintained within a range of 0.95 to
0.98.
Voltage (V) Current (A) Active Power (KW)
230 No Load 4.85 0.2
230 5.5 0.68
230 6 0.88
230 7 1.12
230 8 1.4
230 9 1.6
230 Max Load 9.9 1.8
Table 5.1 Load test results
I.M rating (230V, 9.9A, 1.5KW/2HP)
- 32 -
5.2 RATINGS OF CAPACITORS USED
The bank consists of four 440VAC capacitors of the following ratings…
• 45 MFD
• 4 MFD
• 6 MFD
• 8 MFD
All the above capacitors have a range of ±5%.
where;
C1 4 MFD C3 8 MFD
C2 6 MFD C4 45 MFD
5.3 SWITCHING PATTERN
Based on the connected load, the choices of capacitor banks were made.
This ensures that the KVAR at any point of the switching does not make the
system overcompensated.
According to the program the capacitor C4 (45 MFD) is initially
connected to the system. The switching of C1, C2 and C3 is such that it causes
an incremental increase in the system power factor. Supposing the required
Figure 5.3 Capacitor Bank Connection
- 33 -
system power factor is in the range of 0.96 to 0.98 the total capacitance added is
augmented till the desired output is obtained.
The microcontroller sends signal to the driver circuit of the capacitor
when the target power factor has not yet been achieved. The switching starts
from an initial value (4 MFD in this case) and continues to increase till the
desired value has been reached.
5.4 ADVANTAGES OF SHUNT CAPACITOR BANKS
• The cost of an equivalent shunt capacitor bank is comparatively low.
• The losses in a capacitor are as low as less than 1 watt KVAR or 0.1%. In
a well designed synchronous condenser, the losses are around 3% up to 3
MVA output and 1½% for units between 50 and 100 MVA output.
• A shunt capacitor is mobile and flexible. It can be shifted to different
locations. Bank capacity can be increased in size in modular form.
• A single unit/section failure does not immobilize a capacitor bank.
• Capacitors might momentarily feed into a system short-circuits.
However, they do not increase the short circuit current to that extent
synchronous machines add to the sustained short-circuit current.
Therefore circuit breakers, CTs, bus ducts, etc. will have to be designed
for a higher short-circuit current duty on a bus where synchronous
machines are connected. This is not required in case of equivalent block
of capacitors on the same bus.
- 34 -
CHAPTER 6
PHASE DISPLACEMENT MEASUREMENT
6.1 PHASE MEASUREMENT TECHNIQUES
There are different methods for measuring the phase difference between
two sinusoidal waves. A few of these methods are
• Lissajous method,
• Zero Crossing method,
• Three Voltmeter method and
• Crossed Coil method.
Of the above mentioned methods we are implementing the Zero Crossing
method for obtaining the phase difference for the input waveforms, in our case
CT and PT.
6.1.1 Zero Crossing Method
This method is currently one of the most popular methods for
determining phase difference, largely because of the high accuracy achievable
(typically 0.02°). The process is illustrated by using two signals, denoted A and
B, which have the same frequency but different amplitudes. Each negative to
positive zero-crossing of signal A triggers the start of a rectangular pulse, while
each negative to positive zero-crossing of signal B triggers the end of the
rectangular pulse. The result is a pulse train with a pulse width proportional to
the phase angle between the two signals. The pulse train is passed through an
averaging filter to yield a measure of the phase difference. It is also worth
noting that if the positive to negative zero-crossings are also used in the same
- 35 -
fashion, and the two results are averaged, the effects of dc and harmonics can
be significantly reduced.
To implement the method practically, the analog input signals must first
be converted to digital signals that are “high” if the analog signal is positive and
“low” if the analog signal is negative. This can be done, for example, with a
Schmitt trigger, along with an RC stabilizing network at the output. In practice,
high-accuracy phase estimates necessitate that the switching of the output
between high and low be very sharp. One way to obtain these sharp transitions
is to have several stages of “amplify and clip” preceding the Schmitt trigger.
In the Power Factor Circuit of the Adaptive Power Regulator we
use a clipper, Clamper, XOR Gate and D Flip-flops to measure the phase
displacement value and the type of displacement (Leading or Lagging).
Figure 6.1 Zero crossing method
- 36 -
6.2 POWER FACTOR CIRCUIT-WORKING
The main objective of the power factor circuit is to determine the phase
displacement between the current and the voltage waveform and the type of
displacement (leading or lagging). To perform these operations the input
voltage and current waveforms which are in AC are to be converted into DC,
preferably +5V DC. This is done by the clipper and clamper circuits. Let us first
understand the working of these circuits in detail. Initially the current and
voltage waveforms are converted into square wave by the op-amp LM741, i.e.
voltage and current are now available as square wave with amplitude 14V
which is given to the clipper circuit.
As discussed before the power factor circuit consists of the following
• Clipper Circuit
• Clamper Circuit
• XOR Gate
• D Flip-Flop
6.2.1 Clipper Circuit
The clipper cuts off a part of the waveform retaining the desired portion.
The waveforms shown below explain the working of a clipper circuit.
Input Waveform
Positive Clipper
Negative Clipper
Dual Clipper
Figure 6.2 Clipper circuit example
- 37 -
- 38 -
6.2.2 Clamper Circuit
Certain applications in electronics require that the upper or lower
extremity of a wave be fixed at a specific value. In such applications, a
CLAMPING (or CLAMPER) circuit is used. A clamping circuit clamps or
restrains either the upper or lower extremity of a waveform to a fixed dc
potential. This circuit is also known as a DIRECT-CURRENT RESTORER or a
BASE-LINE STABILIZER. Such circuits are used in test equipment, radar
systems, electronic countermeasure systems, and sonar systems. Depending
upon the equipment, you could find negative or positive clampers with or
without bias. Figure given below illustrates some examples of waveforms
created by clampers.
Together the Clipper and Clamper circuits condition the input AC voltage
into the suitable +5V DC to be given to the XOR Gate. Now at the output of the
clamper circuit square waveform of the voltage and current are obtained.
Figure 6.4 Clamper Circuit example
- 39 -
6.2.3 XOR Gate Circuit
First let us see the basic functioning of the XOR Gate. The working of the
XOR Gate is given by its logic table. The logic table of the XOR Gate is given
below.
There is a variation on the OR logic called Exclusive OR or XOR.
Exclusive OR says the output will be ON if the inputs are different.
So when the square waveform of the current and voltage signal is given to
the XOR Gate, a PWM signal will be generated when the two signals differ
from each other. This pulse width signal denotes the phase shift between the
current and voltage waveforms, which in turn represents the power factor.
Thus the phase difference between the current and voltage waveform is
determined using the width of the pulse generated by the XOR Gate. Now this
PWM signal is given to two D Flip-Flops.
6.2.4 D Flip-Flop Circuit
The symbol of a D Flip-Flop is shown in the figure below.
Input 1 Input 2 Output
0 0 0
0 1 1
1 0 1
1 1 0
Table 6.1 XOR Logic Table
Figure 6.5 D Flip-Flop
- 40 -
The D Flip-Flop has an input CLK (Clock) signal and for the output it
has the next state, Q and the previous state.
The Q output always takes on the state of the D input at the moment of a
rising clock edge, and never at any other time. It is called the D flip-flop for this
reason, since the output takes the value of the D input or Data input, and Delays
it by one clock count. The D flip-flop can be interpreted as a primitive memory
cell, zero-order hold, or delay line.
Clock D Q Qprev
Rising
edge
0 0 X
Rising
edge
1 1 X
Non-
Rising
X
cons
tant
('X' denotes a don’t care condition, meaning the signal is irrelevant)
Waveform depicting the working of a D Flip-Flop is shown below.
As shown in the above waveform, the output, Q of the D Flip-Flop
retains the input value D. The value of the output Q is high whenever the value
of the input D is high and vice-versa.
Table 6.2 D Flip-Flop Truth Table
Figure 6.6 D Flip-Flop working
- 41 -
Similarly in our circuit the clock pulse for the two D Flip-Flops are
current and voltage square waveform, which is given through an RC filter
inorder to produce spikes as clock signal to form an edge triggered D Flip-Flop.
The D (input) is the PWM signal for both the flip flops. With this we can
determine the type of phase shift between the current and voltage waveform, in
turn determining whether the power factor is leading or lagging. The
explanation for this is given below.
Hence from the Power Factor circuit designed the D Flip-Flop output of
the two flop-flops for leading p.f, lagging p.f and u.p.f are as shown in table
below.
D Flip-Flop1
Q1
D Flip-Flop2
Q2
Lagging P.F High Low
Leading P.F Low High
U.P.F Low Low
For both the flip-flops are given with the XOR’s output is feed as D and
the Clock for D Flip-Flop1 is that of the voltage generated PWM and the
current generated PWM is given as the clock for D Flip-Flop2.
Table 6.3 D Flip-Flop’s output
- 42 -
CHAPTER 7
CONCLUSION
The Adaptive Power Regulator combines the operation of ‘Load
Shedding’ and ‘Reactive Power Management’, thereby making it a more
versatile and complete solution for the power problems in an industry.
The system effectively saves the consumer from the imminent penalties
of exceeding the maximum KVA limit and also for the maintenance of low
power factor by efficient priority based load shedding and reactive power
compensation. By doing so the system maximizes the profit for the consumer
by reducing the electricity bill. Also the system helps to fetch incentives by
maintaining a high power factor.
By maintaining high power factor, the system makes maximum use of the
available power.
The PC interface makes it easier for monitoring the functioning of the
system and also aids in future expansion.
We like to conclude with the quote ‘Till the search is on for alternate
energy sources, we need to utilize the available energy effectively’.
- 43 -
APPENDIX 1
PROGRAM CODE
unsigned short tl, totall, event, i, j, t[10], light, reset, d1, d2, bank;
unsigned int th, totalh;
long double time, period, phase, m, n;
unsigned long base, kva, volt, curr, a;
/*This interrupt is generated on every rising or falling edge of
RC2/CCP1. In this function the CCP1 is made to detect falling edge and
rising edge alternatively by changing the CCP1CON. For this the CCP1
interrupt has to be disabled when CCP1CON is changed or else it will
generate a fake interrupt*/
void interrupt( )
{
if ( PIR1.F2 == 1 ) //Checks if CCP1 interrupt flag is set
{
th = CCPR1H; //Stores the 16 bit captured time value
tl = CCPR1L; // which gives the pulse width
PIE1.F2 = 0; //Disables CCP1 interrupt
if ( CCP1CON == 5 ) //Checks if CCP1 is set to trigger on
{ //every rising edge
totalh = TMR1H; //Stores the 16 bit captured time value
totall = TMR1L; //which gives the total time period
TMR1H = 0; // Resets the two timer bytes of timer1
TMR1L = 0;
CCP1CON = 4; //Sets CCP1 to trigger on every falling
- 44 -
} //edge
else
{
CCP1CON = 5; //Changes CCP1 to detect rising edges
event = 1; //Raises a flag (event),if a falling edge
} //is detected
PIR1.F2 = 0; //Clears interrupt flag in PIR1 register
PIE1.F2 = 1; //Re-enables CCP1 interrupt
}
}
/* The Adc_Read( ) function represents the analog input by 10-bit
unsigned value. With the help signal conditioning circuit the voltage
value (230V) is made to be represented as 1023 (i.e. 1111111111 in
binary) when given to bit 0 of PORTA and the current value 15A (max
load current) is made to be represented as 1023 when given to bit 1 of
PORTA. The light sensor output is given to bit 3 of PORTA.
For Base KVA of 2800KVA, V 230V and I 12.17A i.e. V 1023 and
I 830. Therefore Base KVA=(1023*830)=849090*/
void shedding( )
{
volt = Adc_Read( 0 );
curr = Adc_Read( 1 );
light = Adc_Read( 3 );
base = 849090;
kva = volt * curr;
- 45 -
reset = PORTA.F5 & 1; //reset flag is high when input is given
if( reset == 1 )
{
PORTB.F7 = 0; // b7 Induction motor
PORTB.F6 = 0; //b6 Light load
PORTB.F5 = 0; //b5 Tertiary load
}
while( 1 )
{
if( kva > base )
{
if( light <= 613 ) //Then there is no natural light present
{ //613 is decimal representation of 3V
PORTB.F5=1;
delay_ms(10000);
volt = Adc_Read( 0 );
curr = Adc_Read( 1 );
base = 849090;
kva = volt * curr;
if(kva > base)
{
PORTB.F6=1;
break;
} else break;
}
else if( light > 613 ) //Natural light present
{
PORTB.F6=1;
delay_ms( 10000 );
- 46 -
volt = Adc_Read( 0 );
curr = Adc_Read( 1 );
base = 849090;
kva = volt * curr;
if( kva > base )
{
PORTB.F5 = 1;
PORTB.F6 = 1;
break;
}else break;
}
}
}
}
/*This function is called when PIC sends the data serially to PC. It
changes the values to be sent to it ASCII equivalent and then sends it
using Usart_Write( ) function.*/
void send( long double m )
{
a = m;
i = 0;
while( a != 0 )
{
a = a/10;
i = i++;
}
- 47 -
a = m;
for( j = 1; j <= i; j++ )
{
t[j] = a%10;
a = a/10;
}
for( j = i; j > 0; j-- )
{
Usart_Write( t[j]+48 );
}
Usart_Write( 46 ); //46 is the ASCII equivalent for ‘.’(dot)
n = m;
for( j = 0; j < (8-i); j++ )
{
n = n*10;
a = n;
Usart_Write( (a%10)+48 );
}
}
void main( )
{
ADCON1 = 0x84; //Except AN0,AN1 and AN3 all are set
TRISA = 0xFF; //as digital
TRISB = 0; //Port A is set as i/p port and Port B
TRISC = 0; //& C is set as o/p port
PORTA = 0;
- 48 -
PORTB = 0;
PORTC = 0;
TRISC.F2 = 1; //CCP1 port must be set as input
Usart_Init( 9600 ); // Initializes USART module with 9600
event = 0; // baud rate
bank = 0;
CCP1CON = 5; // Capture mode, every rising edge
T1CON = 0b00111001; //Set prescaler as 1:8 and enble
INTCON.F7 = 1; //oscillator and timer
INTCON.F6 = 1; //Set GIE and PEIE
PIE1.F2 = 1; //Set CCP1 interrupt enable bit
while( 1 )
{
if( event == 1 )
{
d1 = PORTA.F2; // D Flip Flop outputs to find if it is
d2 = PORTA.F4; // leading or lagging power factor
if( (d1 & 1 == 1) || (d2 & 1 == 1) )
{ //To check that they are not in phase
time = th << 8; //Pulse width is found by combining
time = time + tl; //the lower & higher timer byte
time = time / 5 //At 20MHz, internal clock = 20/4,
// so divide time by 5
time = time * (8); //Multiply by prescale value
time = time/(1000); //Changes the unit to msec
period = totalh << 8;
period = period + totall;
period = period / (5);
period = period * (8);
- 49 -
period = period / (1000);
phase =((time/period)*180); // θ=(duty cycle)*180
send( phase );
event = 0;
if( (d1 & 1 == 1) && (d2 & 1 == 0) )
{ //To check that power factor is lagging
if( (phase > 16.26) || (phase < 11.478) )
{ // power factor is between 0.96 to 0.98
if( phase > 16.26 )
{ //power factor is less than 0.96
if( bank == 0 )
{
PORTB.F4 = 0;
PORTB.F3 = 0;
PORTB.F2 = 0;
PORTB.F1 = 1;
bank = 1;
break;
}
else if( bank == 1 )
{
PORTB.F4 = 1;
PORTB.F3 = 0;
PORTB.F2 = 0;
PORTB.F1 = 1;
bank = 2;
break;
}
else if( bank == 2 )
- 50 -
{
PORTB.F4 = 0;
PORTB.F3 = 1;
PORTB.F2 = 0;
PORTB.F1 = 1;
bank = 3;
break;
}
else if( bank == 3 )
{
PORTB.F4 = 0;
PORTB.F3 = 0;
PORTB.F2 = 1;
PORTB.F1 = 1;
bank = 4;
break;
}
else if( bank == 4 )
{
PORTB.F4 = 1;
PORTB.F3 = 1;
PORTB.F2 = 0;
PORTB.F1 = 1;
bank = 5;
break;
}
else if( bank == 5 )
{
PORTB.F4 = 1;
- 51 -
PORTB.F3 = 0;
PORTB.F2 = 1;
PORTB.F1 = 1;
bank = 6;
break;
}
else if( bank == 6 )
{
PORTB.F4 = 0;
PORTB.F3 = 1;
PORTB.F2 = 1;
PORTB.F1 = 1;
bank = 7;
break;
}
else if( bank == 7 )
{
PORTB.F4 = 1;
PORTB.F3 = 1;
PORTB.F2 = 1;
PORTB.F1 = 1;
bank = 8;
break;
}
}
else if( phase < 11.478 )
{ //power factor is greater than 0.98
if( bank == 8 )
{
- 52 -
PORTB.F4 = 0;
PORTB.F3 = 1;
PORTB.F2 = 1;
PORTB.F1 = 1;
bank = 7;
break;
}
else if( bank == 7 )
{
PORTB.F4 = 1;
PORTB.F3 = 0;
PORTB.F2 = 1;
PORTB.F1 = 1;
bank = 6;
break;
}
else if( bank == 6 )
{
PORTB.F4 = 1;
PORTB.F3 = 1;
PORTB.F2 = 0;
PORTB.F1 = 1;
bank = 5;
break;
}
else if( bank == 5 )
{
PORTB.F4 = 0;
PORTB.F3 = 0;
- 53 -
PORTB.F2 = 1;
PORTB.F1 = 1;
bank = 4;
break;
}
else if( bank == 4 )
{
PORTB.F4 = 0;
PORTB.F3 = 1;
PORTB.F2 = 0;
PORTB.F1 = 1;
bank = 3;
break;
}
else if( bank == 3 )
{
PORTB.F4 = 1;
PORTB.F3 = 0;
PORTB.F2 = 0;
PORTB.F1 = 1;
bank = 2;
break;
}
else if( bank == 2 )
{
PORTB.F4 = 0;
PORTB.F3 = 0;
PORTB.F2 = 0;
PORTB.F1 = 1;
- 54 -
bank = 1;
break;
}
else if( bank == 1 )
{
PORTB.F4 = 0;
PORTB.F3 = 0;
PORTB.F2 = 0;
PORTB.F1 = 0;
bank = 0;
break;
}
}
}
}
if( (d1 & 1 == 0) && (d2 & 1 == 1) )
{ //To check that power factor is leading
PORTB.F4 = 0;
PORTB.F3 = 0;
PORTB.F2 = 0;
PORTB.F1 = 0;
bank = 0;
break;
}
}
}
shedding( );
}
}
- 55 -
APPENDIX 2
SOFTWARES USED
MIKROC COMPILER
MikroC is used to develop applications for PIC quickly and easily. This
is an advanced and comprehensive compiler used to compile program codes for
the PIC microcontroller. This uses a high level language, C programming in this
case to write programs into the PIC. The compiler then converts this high level
code into a Hex code suitable for the microcontroller.
Using this we can develop complex codes and program logics without the
difficulty of developing programs with Hex codes. Another feature of MikroC
is that error correction is easier and more efficient.
MikroC is a powerful, feature rich development tool for PICmicros. It is
designed to provide the easiest possible solution for developing applications for
embedded systems, without compromising performance or control. It also
provides a successful match featuring highly advanced IDE, ANSI compaliant
compiler, broad set of hardware libraries and comprehensive documentation.
MikroC allows you to quickly develop and deploy complex applications:
• The C source code is written using the highly advanced Code Editor
• The MikroC libraries can be used which speed up development, data
acquisition, memory, display, conversions, communication etc.
• The program structure, variables and functions can be monitored using the
Code Explorer. Both human-readable assembly and standard HEX can be
generated which is compatible with all programmers.
- 56 -
• The integrated Debugger. can be used to inspect the program flow, debug
executable logic and also to get detailed reports and graphs on code
statistics, assembly listing, calling tree etc.
MIKROC SPECIFICS
• MikroC diverges from the ANSI C standard in few areas, in which some are
improvements intended to facilitate PIC programming, while others are
result of PICmicro hardware limitations
• All PIC SFR registers are implicitly declated as global variables of volatile
unsigned short.
• Individuval bits of 8-bit variables, type char and unsigned short can be
accessed by simply using the direct member selector “.”(dot) with a variable,
followed by one of identifiers F0, F1,……., F7.
• Interrupts can be easily handled by means of reserved word interrupt. There
is a implicitly declared function interrupt which cannot be redeclared.
- 57 -
MIKROC SYNTAXES USED
STATEMENTS
Statements specify the flow of control as a program executes. In the
absence of specific jump and selection statements, statements are executed
sequentially in the order of appearance in the source code.
Statements can be roughly divided into:
• Labeled Statements
• Expression Statements
• Selection Statements
• Iteration Statements (Loops)
• Jump Statements
• Compound Statements (Blocks)
ADC LIBRARY
ADC (Analog to Digital Converter) module is available with a number of
PIC MCU models. Library function Adc_Read is included to provide you
comfortable work with the module.
Adc_Read
Prototype unsigned Adc_Read(unsigned short channel);
Returns 10-bit unsigned value read from the specified channel.
Description Initializes PIC’s internal ADC module to work with RC
clock. Parameter channel represents the channel from
which the analog value is to be acquired.
Requires PIC MCU with built-in ADC module. Before using the
function, be sure to configure the appropriate TRISA bits to
designate the pins as input
Example unsigned tmp;
tmp = Adc_Read(1); /* read analog value from channel 1
- 58 -
BUILT-IN ROUTINES
MikroC compiler provides a set of useful built-in utility functions. Built-
in functions do not require any header files to be included; you can use them in
any part of your project.
Delay_ms
Prototype void Delay_ms(const time_in_ms);
Returns Nothing.
Description Creates a software delay in duration of time_in_ms
milliseconds (a constant). Range of applicable constants
depends on the oscillator frequency.
Requires Nothing.
Example Delay_ms(1000); /* One second pause */
USART LIBRARY
USART hardware module is available with a number of PICmicros.
mikroC USART Library provides comfortable work with the Asynchronous
(full duplex) mode.
You can easily communicate with other devices via RS232 protocol (for
example with PC, see the figure at the end of the topic – RS232 HW
connection). You need a PIC MCU with hardware integrated USART, for
example PIC16F877. Then, simply use the functions listed below.
• Usart_Init
• Usart_Data_Ready
• Usart_Read
• Usart_Write
- 59 -
Certain PICmicros with two USART modules, such as P18F8520, require
you to specify the module you want to use. Simply append the number 1 or 2 to
a function name. For example, Usart_Write2(); Also, for the sake of backward
compabitility with previous compiler versions and easier code management,
MCU's with multiple USART modules have USART library which is identical
to USART1 (i.e. you can use Usart_Init() instead of Usart_Init1( ) for Usart
operations).
Usart_Init
Prototype void Usart_Init(const unsigned long baud_rate);
Returns Nothing.
Description Initializes hardware USART module with the desired baud
rate. Refer to the device data sheet for baud rates allowed
for specific Fosc. If you specify the unsupported baud rate,
compiler will report an error.
Requires You need PIC MCU with hardware USART. Usart_Init
needs to be called before using other functions from
USART Library.
Example This will initialize hardware USART and establish the
communication at 2400 bps:
Usart_Init(2400);
Usart_Data_Ready
Prototype unsigned short Usart_Data_Ready(void);
Returns Function returns 1 if data is ready or 0 if there is no data.
Description Use the function to test if data in receive buffer is ready.
Requires USART HW module must be initialized and
communication established before using this function.
- 60 -
Usart_Read
Prototype unsigned short Usart_Read(void);
Returns Returns the received byte. If byte is not received, returns 0.
Description Function receives a byte via USART. Use the function
Usart_Data_Ready to test if data is ready first.
Requires USART HW module must be initialized and
communication established before using this function. See
Usart_Init.
Usart_Write
Prototype void Usart_Write(unsigned short data);
Returns Nothing.
Description Function transmits a byte (data) via USART.
Requires USART HW module must be initialized and
communication established before using this function. See
Usart_Init.
Example int chunk = 0x1E;
Usart_Write(chunk); /* send chunk via USART */
- 61 -
Win PIC Programmer
This is a simple program for Win95/98/XP to program the PIC firmware
from a HEX-file into a PIC microcontroller. Most modern PICs can be
reprogrammed many times; because the program can be erased electrically (the
code is stored in a FLASH, not a simple ROM).
Some of the features worth mentioning about this programmer are the
• Bulk Erase feature and
• Compatibility with different types of interfaces.
The Bulk erase ("erase all") removes all bytes present in the PIC
microcontroller at once. And this programmer can work for both serial and
parallel interfaces make it more versatile.
- 62 -
APPENDIX 3
REGISTERS USED
PIE1 REGISTER (ADDRESS 8Ch)
The PIE1 register contains the individual enable bits for the peripheral
interrupts. Bit PEIE (INTCON<6>) must be set to enable any peripheral
interrupt.
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE
bit 7 bit 0
bit7 PSPIE Parallel Slave Port
Read/Write Interrupt
Enable bit(1)
1 = Enables the PSP read/write interrupt
0 = Disables the PSP read/write interruptNote 1: PSPIE is
reserved on PIC16F873A/876A devices; always maintain
this bit clear.
bit6 ADIE A/D Converter
Interrupt Enable bit
1 = Enables the A/D converter interrupt
0 = Disables the A/D converter interrupt
bit5 RCIE USART Receive
Interrupt Enable bit
1 = Enables the USART receive interrupt
0 = Disables the USART receive interrupt
bit4 TXIE USART Transmit
Interrupt Enable bit
1 = Enables the USART transmit interrupt
0 = Disables the USART transmit interrupt
bit3 SSPIE Synchronous Serial
Port Interrupt Enable
1 = Enables the SSP interrupt
0 = Disables the SSP interrupt
bit2 CCP1IE CCP1 Interrupt
Enable bit
1 = Enables the CCP1 interrupt
0 = Disables the CCP1 interrupt
bit1 TMR2IE TMR2 to PR2 Match
Interrupt Enable bit
1 = Enables the TMR2 to PR2 match interrupt
0 = Disables the TMR2 to PR2 match interrupt
bit0 TMR1IE TMR1 Overflow
Interrupt Enable bit
1 = Enables the TMR1 overflow interrupt
0 = Disables the TMR1 overflow interrupt
- 63 -
PIR1 REGISTER (ADDRESS 0Ch)
The PIR1 register contains the individual flag bits for the peripheral
interrupts. Interrupt flag bits are set when an interrupt condition occurs
regardless of the state of its corresponding enable bit or the global enable bit,
GIE (INTCON<7>). User software should ensure the appropriate interrupt bits
are clear prior to enabling an interrupt.
R/W-0 R/W-0 R-0 R-0 R/W-0 R/W-0 R/W-0 R/W-0
PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF
bit 7 bit 0
bit7 PSPIF
Parallel Slave Port
Read/Write Interrupt Flag
1 = Read/Write operation has taken place (must
be cleared by software)
0 = No Read/Write operation
bit6 ADIF A/D Converter Interrupt Flag
1 = An A/D conversion completed
0 = conversion not complete
bit5 RCIF
USART Receive Interrupt
Flag
1 = USART receive buffer is full
0 = USART receive buffer is empty
bit4 TXIF
USART Transmit Interrupt
Flag
1 = USART transmit buffer is empty
0 = USART transmit buffer is full
bit3 SSPIF
Synchronous Serial Port
(SSP) Interrupt Flag
1 = The SSP interrupt has occurred
0 = No interrupt
bit2 CCP1IF CCP1 Interrupt Flag
1 = TMR1 register capture has occurred (must be
cleared by software)
0 = No TMR1 register capture
bit1 TMR2IF
TMR2 to PR2 Match
Interrupt Flag
1 = TMR2 to PR2 match occurred (must be
cleared by software)
0 = No TMR2 to PR2 match
bit0 TMR1IF
TMR1 Overflow Interrupt
Flag
1 = TMR1 register overflowed (must be cleared
by software)
0 = No TMR1 overflow
- 64 -
CCP1CON REGISTER REGISTER (ADDRESS 17h)
The CCP1CON register controls the operation of CCP1. The special
event trigger is generated by a compare match and will reset Timer1.
U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — CCPxX CCPxY CCPxM3 CCPxM2 CCPxM1 CCPxM0
bit 0 bit 7
bit7-6 Unimplemented Read as ‘0’
bit5-4 CCPxX:CCPxY PWM Least
Significant bits
Capture mode: Unused.
Compare mode: Unused.
PWM mode: These bits are the two LSbs of the
PWM duty cycle. The eight MSbs are found in
CCPRxL.
bit3-0 CCPxM3:CCPx
M0
CCPx Mode
Select bits
0000 = Capture/Compare/PWM disabled
(resets CCPx module)
0100 = Capture mode, every falling edge
0101 = Capture mode, every rising edge
0110 = Capture mode, every 4th rising edge
0111 = Capture mode, every 16th rising edge
1000 = Compare mode, set output on match
(CCPxIF bit is set)
1001 = Compare mode, clear output on match
(CCPxIF bit is set)
1010 = Compare mode, generate software interrupt
on match (CCPxIF bit is set, CCPx pin is
unaffected)
1011 = Compare mode, trigger special event
(CCPxIF bit is set, CCPx pin is unaffected); CCP1
resets TMR1; CCP2 resets TMR1 and starts an A/D
conversion (if A/D module is enabled)
11xx = PWM mode
- 65 -
INTCON REGISTER (ADDRESS 0Bh, 8Bh, 10Bh, 18Bh)
The INTCON register is a readable and writable register, which contains
various enable and flag bits for the TMR0 register overflow, RB port change
and external RB0/INT pin interrupts. Interrupt flag bits are set when an
interrupt condition occurs regardless of the state of its corresponding enable bit
or the global enable bit, GIE (INTCON<7>). User software should ensure the
appropriate interrupt flag bits are clear prior to enabling an interrupt.
R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-x
GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF
bit 7 bit 0
bit7 GIE Global Interrupt Enable bit 1 = Enables all unmasked interrupts
0 = Disables all interrupts
bit6 PEIE Peripheral Interrupt Enable bit 1 = Enables all unmasked peripheral
interrupts
0 = Disables all peripheral interrupts
bit5 TMR0IE TMR0 Overflow Interrupt Enable
bit
1 = Enables the TMR0 interrupt
0 = Disables the TMR0 interrupt
bit4 INTE RB0/INT External Interrupt
Enable bit
1 = Enables the RB0/INT external interrupt
0 = Disables the RB0/INT external interrupt
bit3 RBIE RB Port Change Interrupt Enable
bit
1 = Enables the RB port change interrupt
0 = Disables the RB port change interrupt
bit2 TMR0IF TMR0 Overflow Interrupt Flag
bit
1 = TMR0 register has overflowed (must be
cleared in software)
0 = TMR0 register did not overflow
bit1 INTF RB0/INT External Interrupt Flag
bit
1 = The RB0/INT external interrupt
occurred (must be cleared in software)
0 = The RB0/INT external interrupt did not
occur
bit0 RBIF RB Port Change Interrupt Flag bit 1 = At least one of the RB7:RB4 lines
changed their state
0 = None state change on RB7:RB4 lines
- 66 -
T1CON: TIMER1 CONTROL REGISTER (ADDRESS 10h)
The Timer1 module is a 16-bit timer/counter consisting of two 8-bit
registers (TMR1H and TMR1L) which are readable and writable. The TMR1
register pair (TMR1H:TMR1L) increments from 0000h to FFFFh and rolls over
to 0000h. The TMR1 interrupt, if enabled, is generated on overflow which is
latched in interrupt flag bit, TMR1IF (PIR1<0>). This interrupt can be
enabled/disabled by setting/clearing TMR1 interrupt enable bit, TMR1IE
(PIE1<0>).Timer1 can operate in one of two modes:
• As a Timer
• As a Counter
U-0U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0
— — T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON
bit7 bit0
bit7-6 Unimplemented Read as ‘0’
bit5-4 T1CKPS1:T1CKPS0 Timer1 Input Clock
Prescale Select bits
11 = 1:8 prescale value
10 = 1:4 prescale value
01 = 1:2 prescale value
00 = 1:1 prescale value
bit3 T1OSCEN Timer1 Oscillator
Enable Control bit
1 = Oscillator is enabled
0 = Oscillator is shut-off
bit2 T1SYNC Timer1 External
Clock Input
Synchronization
Control bit
When TMR1CS = 1:
1 = Do not synchronize external clock
input
0 = Synchronize external clock input
When TMR1CS = 0:
This bit is ignored. Timer1 uses the
internal clock when TMR1CS = 0.
bit1 TMR1CS Timer1 Clock Source
Select bit
1 = External clock from pin
RC0/T1OSO/T1CKI (on the rising
edge)
0 = Internal clock (FOSC/4)
bit0 TMR1ON Timer1 On bit 1 = Enables Timer1
0 = Stops Timer1
Legend:
R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’
- n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
- 67 -
APPENDIX 4
REACTIVE POWER PLANNING-USER SIDE SELECTION OF
CAPACITORS
Purpose of Using Capacitors
The purpose for which electric power capacitors are being used must be
clear. The following points enunciate the various reasons for the use of
capacitors.
• Reduction of penalty in the electricity bill on account of low power factor.
• Reduction in billing demand charges.
• Support to bus voltage.
• Harmonic Reduction, when used with a filter.
• Tuned melting or Heating application in induction heat applications.
• Reduction in plant losses, when a plant is spread over a wide area, for
example, a pulp and paper plant; and
• Increased life and low maintenance, control and protection switch gear.
1) Reduction in Penalties
The reduction in penalties in the electricity bill is a prime consideration
for the majority of the consumers of power. The penalties are very stiff.
Typically a low voltage customer stands to recoup his investments on capacitors
and capacitor controls within a period of 3-6 months by his savings on the
penalty. This typical customer has an average p.f. of 0.76, while the p.f. below
which the penalty starts is 0.9.
2) Billing Demand Charges
When a customer asks for a new/additional connection, he gives the:
• Total connected load that he is putting up and
- 68 -
• Maximum estimated demand in KVA that he is likely to have-this demand is
treated as a base for contract demand.
The maximum demand meter registers the highest demand on an average
of 15 minutes. Any such single recording during that entire period of charging
attracts Maximum Demand (MD) charges.
Here the following two situations arise:
i. The customer’s actual recorded demand is way below his contract
demand. Then the billing MD is a fixed percentage of the contract
demand. This protects the utility.
A customer under this category derives no benefit from the
reduction of MD by using capacitors.
ii. On the other hand, the customer’s demand exceeds his billing
contract demand. His MD charging rate and charges, both rise up
drastically. It pays handsomely for a customer under this category
to put capacitors.
While getting a new/additional load connected, the EB makes it
compulsory for a customer to put in designated KVAR capacitors. The selection
of KVAR size is now taken out of the customer’s hands. The customer may
decide which make of the capacitor and its controls he can buy.
Under demand side management, the EB offers a sizeable reduction in the
electricity bill (on the energy consumed portion only), if he maintains an
average p.f. above a designated value, say, 0.95. It now pays for the customer to
put up additional capacitors and operate them correctly.
3) Support to system bus voltages and reduction in Plant losses
Both the above objectives are best realized when both the losses in
distribution as well as voltage drops in distribution are sizeable within a plant, it
spreads over a large area.
- 69 -
In smaller plants, these objectives for all practical purposes are not
implemented and stay academic.
4) Harmonic Reduction by Using a Filter Capacitor, i.e. a Capacitor with a
Tuned Series Reactor
Modern loads use power electronics as well as microelectronics. These
loads produce substantial harmonics. All over the world, there are standards
limiting the harmonic to within a declared percentage magnitudes of the
fundamental supply parameters like voltage and current. Abiding by these
parameters is voluntary, and in one’s own interest. Non-abidance may result in
a supply cut off. There are no graded penal charges.
Also Interruption of micro-processor based control system and
computers could be very costly. These two systems in a plant are rapidly
becoming an integral part of the industrial process. Also following these
standards result in lower maintenance and replacement costs.
5) Tuning Capacitors in Induction Melting and Heating
Maximum power is transferred to a resistor or heat dissipating element,
when the inductance of the heating coil is accurately tuned to resonate at the
operating frequency with a series connected matching capacitor. The melting
charge at the center of the induction coil has variable inductances depending on
its state of melting. This requires multiple steps of capacitors with an on-off
step control. The capacitor duty is vigorous.
6) Reduction in Plant Losses
Consider an old pulp and paper plant spread over hundreds of acres of
land. The main generator is in one place. Operations like log cutting are done
far away from the generator. Locating capacitors at these far off places is a must
to keep distribution losses low.
- 70 -
7) Low Maintenance and Lower Rate of Replacements
This is significant in plants where large sized motors turn on-off rather
frequently in a process. Each operation calls in for a high amplitude current
surge causing instant high spot temperature in cables and sparking across
starters. This also causes voltage dips. A capacitor across a motor reduces
starting currents and ensures maintenance free long life for these equipments.
How To Select A Capacitor: Deciding Factors
The following factors help us to decide on the size, type, assembly and
location of the capacitors to be used.
• KVAR requirements.
• Voltage levels where capacitors can be installed.
• Capacitor selection as per type of end-user.
• Nature of load and load characteristics.
• Harmonics from both within the plant and outside the plant.
• Ambience.
• Space available.
• Safety and Security.
• Cost Factor.
Let us see these factors in a broader purview.
1) KVAR Requirements
These requirements are worked out from a vector triangle wherein one
puts in the KVA and p.f. of a plant (or KW and KVAR) where capacitors are to
be put.
2) Voltage levels where p.f. Capacitors can be Installed
If there is a choice available for voltage level, one should adopt for the
higher voltage level for installing the capacitors.
- 71 -
3) Type of End-user
Small factories, individual establishments require small KVAR. They go
in for LT capacitors with manual switch. Irrigation pumps, small compressors
and other applications, wherein direct on line starters are used, go for small
capacitors. These are connected through a fusible cut-out directly across motor
terminals.
Medium size establishments generally opt for LV capacitor banks with
automatic controls. Larger establishments have both LT as well as HT
capacitors depending on the plant spread, type of process followed etc.
4) Type of Load and Load Characteristics:
There are some loads, which run at a steady power for a major
portion of the day for example; city water supplying pumps, irrigation
pumps, air compressors in an automobile shop, etc. The design margins
as well as the types of capacitors selected (metalized polypropylene,
mixed dielectric, etc.) are not very critical.
On the other hand there are loads which are characterized by jerky
operations all the time or which are frequently turned on and off. Those
loads produce transients. Selection of type of capacitor is critical. Safety
margins in their designs have to be high.
Another point which influences the selection of capacitors is the
load characteristic on a daily basis, as well as on a seasonal or yearly
basis. The size of a capacitor bank selected as per the monthly average
billing data will be very moderate. The actual load characteristic might
demand much higher KVAR, if one wants to hold down the maximum
demand during the peak operation period of the load. This type of load
will also require multiple steps of KVAR with automatic control.
- 72 -
5) Presence of Harmonics:
Harmonics might be generated within the plant itself or they
might be flowing from outside. These harmonics find an easy path
through capacitor and a major portion of them drains through p.f.
capacitors. These capacitors are over loaded. A safety margin by
specifying a higher rated voltages or capacitors is necessary.
6) Ambients:
Higher ambient temperature requires specific mention in the
capacitor specifications. A point to be noted is operating temperature that
a working capacitor is likely to attain. An HT capacitor at an elevated
structure is very well cooled even under the sun, because there is
normally sufficient air movement there. Sometimes a sunshade helps.
On the other hand, an LT capacitor within a confirmed
enclosure and with fuses and contactor coils adding to the heat liberated
inside a badly designed cubicle can raise the capacitor temperature to
dangerous levels. Thus specifying the next higher standard voltage level
on capacitors may give sufficient safety margins against these high
ambients. The ambient must be specified. This raises the cost of
capacitors.
7) Space:
Space within a building is costly. The capacitors and the control
systems be the LT or HT, have to be enclosed or raised on a high enough
platform. Enclosed capacitor banks require cable connections. Capacitor
banks will have to be selected according to the space available.
- 73 -
8) Safety and Security:
Of all the electrical equipments, the dielectric insulation inside the
capacitor has the highest voltage stress. The capacitors themselves quite
often lead to generation of transients, resonances, continuous high voltage
periods (at night times), etc. Thus capacitors are susceptible to early
failures. This aspect cannot be overlooked. A failure can cause an
explosion within a capacitor unit. Therefore while selecting a site for the
capacitors, one should avoid locations in close proximity to high voltage
CTs on incoming mains, power transformer, etc.
9) Cost Factor:
A capacitor and its control and location can be ideally organized if
due consideration is given to all the above factors. Yet it could be
rendered redundant if the costs are not justifiable. An optimal design,
which compromises in terms of the total costs, thus has to be worked out.
- 74 -
REFERENCES
1. Ajay V Deshmukh (2006) ‘Microcontrollers – Theory and Application’
New Delhi: Tata McGraw-Hill.
2. Ramakant A. Gayakward (2004) ‘Op-Amps and Linear Integrated
Circuits’ Pearson Education
3. Sunil S. Rao (2003) ‘Switch Gear Protection and Power Systems –
Theory, Practice and Solved Problems’ New Delhi: Khanna Publishers
4. Tagare D M (2004) ‘Reactive Power Management’ New Delhi: Tata
McGraw-Hill

More Related Content

What's hot

IRJET- Methods for Improved Efficiency in DC-DC Buck Converter
IRJET-  	  Methods for Improved Efficiency in DC-DC Buck ConverterIRJET-  	  Methods for Improved Efficiency in DC-DC Buck Converter
IRJET- Methods for Improved Efficiency in DC-DC Buck ConverterIRJET Journal
 
Prepaid energy meter with gsm interface
Prepaid energy meter with gsm interfacePrepaid energy meter with gsm interface
Prepaid energy meter with gsm interfaceEdgefxkits & Solutions
 
IRJET- Automatic HF Antenna Tuner
IRJET-  	  Automatic HF Antenna TunerIRJET-  	  Automatic HF Antenna Tuner
IRJET- Automatic HF Antenna TunerIRJET Journal
 
Smart Prepaid Energy Meter using ARM7 & and GSM
Smart Prepaid Energy Meter using ARM7 & and GSMSmart Prepaid Energy Meter using ARM7 & and GSM
Smart Prepaid Energy Meter using ARM7 & and GSMDarshak Patel
 
Ieeepro techno solutions ieee 2014 embedded project gsm based automatic e...
Ieeepro techno solutions    ieee 2014 embedded project  gsm based automatic e...Ieeepro techno solutions    ieee 2014 embedded project  gsm based automatic e...
Ieeepro techno solutions ieee 2014 embedded project gsm based automatic e...srinivasanece7
 
Low cost ppt final
Low cost ppt finalLow cost ppt final
Low cost ppt finalJeff Joseph
 
Dinie nur zayanislide fyp1
Dinie nur zayanislide fyp1Dinie nur zayanislide fyp1
Dinie nur zayanislide fyp1nabelnajib
 
Automatic meter reading nnb ppt
Automatic meter reading  nnb pptAutomatic meter reading  nnb ppt
Automatic meter reading nnb pptNagendraEEE
 
IRJET- Smart Prepaid Energy Meter using GSM Technology
IRJET- Smart Prepaid Energy Meter using GSM TechnologyIRJET- Smart Prepaid Energy Meter using GSM Technology
IRJET- Smart Prepaid Energy Meter using GSM TechnologyIRJET Journal
 
Intelligent Power Meter using GSM network and Android Application
Intelligent Power Meter using GSM  network and Android ApplicationIntelligent Power Meter using GSM  network and Android Application
Intelligent Power Meter using GSM network and Android Applicationshan km
 
Hardware prototype of smart home energy management system
Hardware prototype of smart home energy management systemHardware prototype of smart home energy management system
Hardware prototype of smart home energy management systemeSAT Journals
 
IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)
IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)
IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)IRJET Journal
 
document of prepaid energy meter using gsm
document of prepaid energy meter using gsmdocument of prepaid energy meter using gsm
document of prepaid energy meter using gsmudaypallyreddy
 
Automatic Meter reading (amr)
Automatic Meter reading (amr)Automatic Meter reading (amr)
Automatic Meter reading (amr)Tahir Rashid
 
Efficient Energy Harvesting and Transmission using Wireless Sensor Networks
Efficient Energy Harvesting and Transmission using Wireless Sensor NetworksEfficient Energy Harvesting and Transmission using Wireless Sensor Networks
Efficient Energy Harvesting and Transmission using Wireless Sensor NetworksIRJET Journal
 
Automatic meter reading
Automatic meter readingAutomatic meter reading
Automatic meter readingSajan Sahu
 
GSM Based wireless energy meter/sanjeet-1308143
GSM Based wireless energy meter/sanjeet-1308143GSM Based wireless energy meter/sanjeet-1308143
GSM Based wireless energy meter/sanjeet-1308143sanjeet kumar
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)theijes
 

What's hot (20)

IRJET- Methods for Improved Efficiency in DC-DC Buck Converter
IRJET-  	  Methods for Improved Efficiency in DC-DC Buck ConverterIRJET-  	  Methods for Improved Efficiency in DC-DC Buck Converter
IRJET- Methods for Improved Efficiency in DC-DC Buck Converter
 
Prepaid energy meter with gsm interface
Prepaid energy meter with gsm interfacePrepaid energy meter with gsm interface
Prepaid energy meter with gsm interface
 
IRJET- Automatic HF Antenna Tuner
IRJET-  	  Automatic HF Antenna TunerIRJET-  	  Automatic HF Antenna Tuner
IRJET- Automatic HF Antenna Tuner
 
Smart Prepaid Energy Meter using ARM7 & and GSM
Smart Prepaid Energy Meter using ARM7 & and GSMSmart Prepaid Energy Meter using ARM7 & and GSM
Smart Prepaid Energy Meter using ARM7 & and GSM
 
Ieeepro techno solutions ieee 2014 embedded project gsm based automatic e...
Ieeepro techno solutions    ieee 2014 embedded project  gsm based automatic e...Ieeepro techno solutions    ieee 2014 embedded project  gsm based automatic e...
Ieeepro techno solutions ieee 2014 embedded project gsm based automatic e...
 
Low cost ppt final
Low cost ppt finalLow cost ppt final
Low cost ppt final
 
Dinie nur zayanislide fyp1
Dinie nur zayanislide fyp1Dinie nur zayanislide fyp1
Dinie nur zayanislide fyp1
 
Automatic meter reading nnb ppt
Automatic meter reading  nnb pptAutomatic meter reading  nnb ppt
Automatic meter reading nnb ppt
 
IRJET- Smart Prepaid Energy Meter using GSM Technology
IRJET- Smart Prepaid Energy Meter using GSM TechnologyIRJET- Smart Prepaid Energy Meter using GSM Technology
IRJET- Smart Prepaid Energy Meter using GSM Technology
 
Single-bit modulator for wireless power transfer system
Single-bit modulator for wireless power transfer systemSingle-bit modulator for wireless power transfer system
Single-bit modulator for wireless power transfer system
 
Intelligent Power Meter using GSM network and Android Application
Intelligent Power Meter using GSM  network and Android ApplicationIntelligent Power Meter using GSM  network and Android Application
Intelligent Power Meter using GSM network and Android Application
 
Hardware prototype of smart home energy management system
Hardware prototype of smart home energy management systemHardware prototype of smart home energy management system
Hardware prototype of smart home energy management system
 
IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)
IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)
IRJET- Power Quality Improvement using Dynamic Voltage Restorer (DVR)
 
document of prepaid energy meter using gsm
document of prepaid energy meter using gsmdocument of prepaid energy meter using gsm
document of prepaid energy meter using gsm
 
Automatic Meter reading (amr)
Automatic Meter reading (amr)Automatic Meter reading (amr)
Automatic Meter reading (amr)
 
Substations
SubstationsSubstations
Substations
 
Efficient Energy Harvesting and Transmission using Wireless Sensor Networks
Efficient Energy Harvesting and Transmission using Wireless Sensor NetworksEfficient Energy Harvesting and Transmission using Wireless Sensor Networks
Efficient Energy Harvesting and Transmission using Wireless Sensor Networks
 
Automatic meter reading
Automatic meter readingAutomatic meter reading
Automatic meter reading
 
GSM Based wireless energy meter/sanjeet-1308143
GSM Based wireless energy meter/sanjeet-1308143GSM Based wireless energy meter/sanjeet-1308143
GSM Based wireless energy meter/sanjeet-1308143
 
The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)The International Journal of Engineering and Science (The IJES)
The International Journal of Engineering and Science (The IJES)
 

Similar to Adaptive power Regulator -Project Report

Joseph Staniowski - Design Project
Joseph Staniowski - Design ProjectJoseph Staniowski - Design Project
Joseph Staniowski - Design ProjectJoseph Staniowski
 
4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll newMainak Nandi
 
IRJET- Smart and Efficient Load Control System using Dynamic Tariff
IRJET- Smart and Efficient Load Control System using Dynamic TariffIRJET- Smart and Efficient Load Control System using Dynamic Tariff
IRJET- Smart and Efficient Load Control System using Dynamic TariffIRJET Journal
 
Digital energy meter
Digital energy meter Digital energy meter
Digital energy meter preeti naga
 
POWER CONSUMPTION DETECTING AND ALERTING SYSTEM
POWER CONSUMPTION DETECTING AND ALERTING SYSTEMPOWER CONSUMPTION DETECTING AND ALERTING SYSTEM
POWER CONSUMPTION DETECTING AND ALERTING SYSTEMIRJET Journal
 
Ppt gsm based automatic energy meter
Ppt gsm based automatic energy meterPpt gsm based automatic energy meter
Ppt gsm based automatic energy meterKhiti Ranjan jena
 
Power theft detection via plc
Power theft detection via plcPower theft detection via plc
Power theft detection via plcbbshashanka
 
GSM Based Wireless Load-Shedding Management System for Non Emergency Condition
GSM Based Wireless Load-Shedding Management System for Non Emergency ConditionGSM Based Wireless Load-Shedding Management System for Non Emergency Condition
GSM Based Wireless Load-Shedding Management System for Non Emergency ConditionEditor IJMTER
 
Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051embdnew
 
Using capacitive switch cum sensor made of reclaimed materials for preventing...
Using capacitive switch cum sensor made of reclaimed materials for preventing...Using capacitive switch cum sensor made of reclaimed materials for preventing...
Using capacitive switch cum sensor made of reclaimed materials for preventing...IRJET Journal
 
Transformer failure prevent
Transformer failure preventTransformer failure prevent
Transformer failure preventVitthal Adhav
 
AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA
AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA
AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA Ajesh Jacob
 
IRJET-IoT based Smart Electricity Meter and Power Theft Detection
IRJET-IoT based Smart Electricity Meter and Power Theft DetectionIRJET-IoT based Smart Electricity Meter and Power Theft Detection
IRJET-IoT based Smart Electricity Meter and Power Theft DetectionIRJET Journal
 
Modern Electricity Billing System.pptx
Modern Electricity Billing System.pptxModern Electricity Billing System.pptx
Modern Electricity Billing System.pptxSudhanshuNajawan1
 
Designing of an automated power meter reading
Designing of an automated power meter readingDesigning of an automated power meter reading
Designing of an automated power meter readingManoj Kollam
 
Designing of an automated power meter reading
Designing of an automated power meter readingDesigning of an automated power meter reading
Designing of an automated power meter readingManoj Kollam
 
Energy consumption of wsn
Energy consumption of wsnEnergy consumption of wsn
Energy consumption of wsnDeepaDasarathan
 
ADAPTIVE POWER REGULATOR
ADAPTIVE POWER REGULATORADAPTIVE POWER REGULATOR
ADAPTIVE POWER REGULATORSaketh Ram
 

Similar to Adaptive power Regulator -Project Report (20)

Joseph Staniowski - Design Project
Joseph Staniowski - Design ProjectJoseph Staniowski - Design Project
Joseph Staniowski - Design Project
 
4 Way traffic controll new
4 Way traffic controll new4 Way traffic controll new
4 Way traffic controll new
 
IRJET- Smart and Efficient Load Control System using Dynamic Tariff
IRJET- Smart and Efficient Load Control System using Dynamic TariffIRJET- Smart and Efficient Load Control System using Dynamic Tariff
IRJET- Smart and Efficient Load Control System using Dynamic Tariff
 
Digital energy meter
Digital energy meter Digital energy meter
Digital energy meter
 
POWER CONSUMPTION DETECTING AND ALERTING SYSTEM
POWER CONSUMPTION DETECTING AND ALERTING SYSTEMPOWER CONSUMPTION DETECTING AND ALERTING SYSTEM
POWER CONSUMPTION DETECTING AND ALERTING SYSTEM
 
Ppt gsm based automatic energy meter
Ppt gsm based automatic energy meterPpt gsm based automatic energy meter
Ppt gsm based automatic energy meter
 
E044081720
E044081720E044081720
E044081720
 
Power theft detection via plc
Power theft detection via plcPower theft detection via plc
Power theft detection via plc
 
GSM Based Wireless Load-Shedding Management System for Non Emergency Condition
GSM Based Wireless Load-Shedding Management System for Non Emergency ConditionGSM Based Wireless Load-Shedding Management System for Non Emergency Condition
GSM Based Wireless Load-Shedding Management System for Non Emergency Condition
 
Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051Doc speed control of a dc motor using micro controller 8051
Doc speed control of a dc motor using micro controller 8051
 
1.4
1.41.4
1.4
 
Using capacitive switch cum sensor made of reclaimed materials for preventing...
Using capacitive switch cum sensor made of reclaimed materials for preventing...Using capacitive switch cum sensor made of reclaimed materials for preventing...
Using capacitive switch cum sensor made of reclaimed materials for preventing...
 
Transformer failure prevent
Transformer failure preventTransformer failure prevent
Transformer failure prevent
 
AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA
AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA
AUTOMATIC VOLTAGE CONTROL OF TRANSFORMER USING MICROCONTROLLER AND SCADA
 
IRJET-IoT based Smart Electricity Meter and Power Theft Detection
IRJET-IoT based Smart Electricity Meter and Power Theft DetectionIRJET-IoT based Smart Electricity Meter and Power Theft Detection
IRJET-IoT based Smart Electricity Meter and Power Theft Detection
 
Modern Electricity Billing System.pptx
Modern Electricity Billing System.pptxModern Electricity Billing System.pptx
Modern Electricity Billing System.pptx
 
Designing of an automated power meter reading
Designing of an automated power meter readingDesigning of an automated power meter reading
Designing of an automated power meter reading
 
Designing of an automated power meter reading
Designing of an automated power meter readingDesigning of an automated power meter reading
Designing of an automated power meter reading
 
Energy consumption of wsn
Energy consumption of wsnEnergy consumption of wsn
Energy consumption of wsn
 
ADAPTIVE POWER REGULATOR
ADAPTIVE POWER REGULATORADAPTIVE POWER REGULATOR
ADAPTIVE POWER REGULATOR
 

Adaptive power Regulator -Project Report

  • 1. - 1 - CHAPTER 1 INTRODUCTION 1.1 LOAD MANAGEMENT Load management is one means of reducing the maximum electricity loads and hence also the cost of electricity. All the manufacturing industries (HT consumers) mainly small-scale industries suffer from the problem of exceeding the maximum demand KVA and when they do this they are penalized by Electricity Board. Repeated exceeding of the maximum demand KVA by industries may lead to the disconnection of the supply by the Electricity Board. Currently most of the industries avoid this by switching off the entire loads when they are at the point of exceeding the maximum demand KVA or manually switching off the unnecessary loads at that time. Manual Switching needs a person to continuously monitor the load demand KVA. This way of load management adopted by the industries to prevent from the penalty when they exceed the maximum demand KVA is not effective and efficient. As it simply Shedds the loads without any degree of importance to loads, this may cause loss to the industry due to the unplanned shedding of the main process loads. In Adaptive Power Regulator the loads are shed based on their degree of importance, which are categorized as High, Medium and Low hierarchy. The hierarchical based load management is much effective and eliminates loss to the industry.
  • 2. - 2 - 1.2 TARIFF DETAILS OF TNEB The tariff details of TNEB for various HT consumers are: HT consumers under category Tariff I-A This tariff is applicable to all the industrial establishments and registered factories which include tea estates, textiles, fertilizers, steel plant, heavy water plant, chemical plants, software industries, maintenance, training and service institutions. From now on, this tariff is also applicable to Railway traction. In view of the merger of existing tariff of Railway Traction I-B with that of I-A tariff, the HT tariff category I-B is abolished. Table 1.1 Tariff Details of TNEB for HT consumers HT consumers under category Tariff II-A This tariff is applicable to recognized educational institutions, hostels run by the recognized educational institution, Government Hospitals and the hospitals under the control of Panchayats, Municipalities and Corporations, Veterinary hospitals, Leprosy Centre, Primary Health Centre, Orphanages, Public Libraries, Water Works, Public Lightning, Public Sewerage Works by Government/Local Bodies, Laboratories, Research Institutions, Studios, Cinema Theaters, Ministry of Defense Establishments, Housing complexes and such other institutions declared by the Commission from time to time. Tariff Category Rate in rupees per KWHr (unit)-Energy Charges Rate in rupees per KVA of Maximum Demand Ht Tariff I-A 3.50 300 Ht Tariff II-A 3.50 200 Ht Tariff II-B 2.80 125
  • 3. - 3 - HT consumers under category Tariff II-B This tariff is applicable to actual places of worship and specially notified places of public interest, mutt, religious institutions, etc., declared by the Commission from time to time. HT consumers under category Tariff II-B This tariff is applicable to all Commercial Establishments and other categories of consumers not covered under HT tariffs I-A, II-A, II-B. Industries requiring HT supply during construction period shall be charged under this tariff. 1.3 POWER FACTOR INCENTIVE The Electricity Board provides all the Industries (HT consumers) incentives whenever they maintain the average power factor more than 0.95, the incentive shall be given at the rate of 1% (one percent) of the amount of the monthly energy bill (excluding FOCA charge, demand charge, electricity duty and regulatory liability charge) for every 1% (one percent) improvement in the power factor above 0.95. If the consumer is able achieve a PF of 0.99, the effective incentive will amount to 5% (five percent) reduction in the energy bill and for unity PF, the effective incentive will amount to 7% (seven percent) reduction in the energy bill. The Adaptive Power Regulator aims at attaining these incentives for the user through Reactive Power Compensation, by bringing the power factor to the required range which in turn will cut down the running cost of an industry.
  • 4. - 4 - CHAPTER 2 ADAPTIVE POWER REGULATOR (APR) 2.1 INTRODUCTION The Adaptive Power Regulator (APR) is a device that enables effective and efficient channeling of available power. This device also aims to bring down the electricity bill of a user by • Eliminating the penalties due to lagging and leading power factor, • Fetch incentives for the user by maintaining high power factor and • Reducing the risk of exceeding the maximum KVA, which results in the Electricity Board imposing penalties on the Industry. The Adaptive Power Regulator performs the job of Priority Based Load Shedding, Reactive Power Compensation and its functioning can be monitored by a computer. The main features of the Adaptive Power Regulator are shown in the block diagram given above. Capacitor Bank M & I Instruments (CT & PT) (APR) Micro Controller Loads PC Figure 2.1 Outline of Adaptive Power Regulator HT Supply
  • 5. - 5 - The Adaptive Power Regulator consists of • PIC microcontroller • Power Factor Measurement Circuit • Driver Circuit for Switching Capacitors and Connected Load. • Power Supply Circuit • Signal Conditioning Circuit • Instrumentation Transformers • Contactors • MAX232A Serial Interface Circuit • Light Sensor Circuit The PIC microcontroller does the job of interfacing all the above mentioned devices, receiving signals from them and performing the necessary calculations. In other words the microcontroller forms the Kernel of the Adaptive Power Regulator. The workings of these circuits are discussed in detail in the following pages. ADAPTIVE POWER REGULATOR REACTIVE POWER COMPENSATOR SENSOR BASED PRIORITY CHANGERPC INTERFACE FOR EASY MONITORING LOAD SHEDDING Figure 2.2 An Overview
  • 6. - 6 - CHAPTER 3 COMPONENTS OF ADAPTIVE POWER REGULATOR 3.1 MICROCONTROLLER The microcontroller is a very common component in modern electronic systems. It is a device that integrates a number of the components of a microprocessor system onto a single microchip. Microcontroller differs from a microprocessor in many ways. First and the most important is its functionality. In order for a microprocessor to be used, other components such as memory, or components for receiving and sending data must be added to it. In short that means that microprocessor is the very heart of the computer. On the other hand, microcontroller is designed to be all of that in one. No other external components are needed for its application because all necessary peripherals are already built into it. Thus, the time and space needed to construct devices is saved. A microcontroller combines onto the same microchip the CPU core, memory (Both ROM and RAM) and some parallel digital I/O. Figure 5.1 shows an unexpanded microcontroller, which contains a number of commonly used sub-units. Most microcontrollers will also combine other devices such as • A Timer module to allow the microcontroller to perform tasks for certain time periods. • A serial I/O port to allow data, to flow between the microcontroller and other devices such as a PC or another microcontroller. • An ADC, to allow the microcontroller to accept analogue input data for processing.
  • 7. - 7 - 3.1.1 Parts of a Microcontroller Memory Unit This is where data is stored. Two concepts, addressing and memory location, prop to the fore. Memory consists of all memory locations, and addressing is nothing but selecting one of them. The memory will be divided up into ROM and RAM, with typically more ROM than RAM. The amount of ROM type memory will vary between around 512 bytes and 4096 bytes. ROM type memory, as has already been mentioned, is used to store the program code. ROM memory can be ROM (as in One Time Programmable memory), EPROM, or EEPROM. The amount of RAM memory is usually somewhat smaller, typically ranging between 25 bytes to 4 Kbytes. RAM is used for data storage and stack management tasks. It is also used for register stacks. Central Processing Unit The heart of the microcontroller is the CPU core. Data arithmetic and movement is done in the CPU. Figure 3.1 Main components of a microcontroller
  • 8. - 8 - Bus This refers to the ‘way’ for data. There are two types of buses: address and data bus. The first one consists of as many lines as the amount of memory we wish to address and the other one is as wide as data, in our case 8 bits, or the connection line. First one serves to transmit address from CPU memory, and the second to connect all blocks inside the microcontroller. Figure 3.2 Microcontroller outline
  • 9. - 9 - Input-Output Unit The digital I/O ports are the means by which the microcontroller interfaces to the environment. Digital I/O tends to be grouped into byte wide ports (8 digital bits) that can be configured as either input bits or output bits. When working with it the port acts like a memory location. Something is simply being written into or read from it, and it could be noticed on the pins of the microcontroller. Analog to Digital converter As the peripheral signals usually are substantially different from the ones that microcontroller can understand (zero and one), they have to be converted into a pattern which can be comprehended by a microcontroller. This task is performed by a block for analog to digital conversion or by an ADC. This block is responsible for converting an information about some analog value to a binary number and for follow it through to a CPU block so that CPU block can further process it.
  • 10. - 10 - 3.1.2 PIC Microcontroller Adaptive Power Regulation Unit uses the PIC16F877A. Figure 2.5 shows the pin configuration of the PIC16F877 microcontroller chip. Figure 3.3 Pin Diagram for PIC 16F877A Some features of this microcontroller include 35 single word instructions, single cycle instructions (1s) except for program branches, 8 KB Flash Program Memory, 368 Byte RAM Data Memory, 256 Byte EEPROM Data Memory, In- circuit serial programming, 10-bit, 8-channel Analog-to-Digital converter, and Universal Synchronous Asynchronous Receiver Transmitter with 9-bit address detection. The PIC is self-reprogrammable under software control. We use the PIC simulator IDE for programming the board and the PIC Basic language for the software part.
  • 11. - 11 - Figure 3.4 Architecture of PIC 16F877A
  • 12. - 12 - Analog to Digital Conversion For converting the analog input into digital format we use the A/D converter module inside PIC. The analog input charges a sample and hold capacitor. The output of the sample and hold capacitor is the input into the converter. The converter then generates a digital result of this analog level via successive approximation. The A/D conversion of the analog input signal results in a corresponding 10-bit digital number. The A/D converter has a unique feature of being able to operate while the device is in SLEEP mode. To operate in sleep, the A/D clock must be derived from the A/D’s internal RC oscillator. The A/D module has four registers. These registers are: • A/D Result High Register (ADRESH) • A/D Result Low Register (ADRESL) • A/D Control Register0 (ADCON0) • A/D Control Register1 (ADCON1) The ADRESH: ADRESL registers contain the 10-bit result of the A/D conversion. When the A/D conversion is complete, the result is loaded into this A/D result register pair, the GO/DONE bit (ADCON0<2>) is cleared and the A/D interrupt flag bit ADIF is set. The ADCON1 and TRIS registers control the operation of the A/D port pins. The port pins that are desired, as analog inputs must have their corresponding TRIS bits set (input). If the TRIS bit is cleared (output), the digital output level (VOH or VOL) will be converted. The following steps should be followed for doing an A/D conversion: 1. Configure the A/D module: • Configure analog pins / voltage reference / and digital I/O (ADCON1) • Select A/D input channel (ADCON0) • Select A/D conversion clock (ADCON0) • Turn on A/D module (ADCON0)
  • 13. - 13 - 2. Configure A/D interrupts (if desired): • Clear ADIF bit • Set ADIE bit • Set GIE bit 3. Wait the required acquisition time. 4. Start conversion: • Set GO/DONE bit (ADCON0) 5. Wait for A/D conversion to complete, by either: • Polling for the GO/DONE bit to be cleared or • Waiting for the A/D interrupt 6. Read A/D Result register pair (ADRESH: ADRESL) and clear ADIF bit if required. 7. For next conversion, go to step 1 or step 2 as required. The A/D conversion time per bit is defined as TAD. A minimum wait of 2TAD is required before next acquisition starts.
  • 14. - 14 - 3.2 SERIAL INTERFACE 3.2.1 Logic Signal Voltage Serial RS-232 (V.24) communication works with voltages (-15V to -3V for high) and +3V to +15V for low) which are not compatible with normal computer logic voltages. On the other hand, classic TTL computer logic operates between 0V and 5V (roughly 0V to +0.8V for low, +2V to +5V for high). Modern low-power logic operates in the range of 0V to +3.3V or even lower. So, the maximum RS-232 signal levels are far too high for computer logic electronics, and the negative RS-232 voltage for high can't be interpreted at all by computer logic. Therefore, to receive serial data from an RS-232 interface the voltage has to be reduced, and the low and high voltage level inverted. In the other direction (sending data from some logic over RS-232) the low logic voltage has to be adjusted and a negative voltage has to be generated, too. TTL RS-232 Logic +2V to +5V +3V to +15V High 0V to +0.8V -15V to -3V Low All this can be done with conventional analog electronics, e.g. a particular power supply and a couple of transistors or the once popular 1488 (transmitter) and 1489 (receiver) ICs. However, since more than a decade it has become standard in amateur electronics to do the necessary signal level conversion with an integrated circuit (IC) from the MAX232 family. (typically a MAX232A or some clone). In fact, it is hard to find some RS-232 circuitry in amateur electronics without a MAX232A or some clone. Table 3.1 TTL to RS232 Conversion
  • 15. - 15 - 3.2.2 Interfacing using the MAX232 Max232 IC is a specialized circuit which makes standard voltages as required by RS232 standards. This IC provides best noise rejection and very reliable against discharges and short circuits. If your project is more advanced and has to reliable you must use specialized RS232 to TTL converter IC’s. The basic connection of the PIC 16F877A to the computer using the MAX232 is given below. The MAX232 IC uses three 0.1uF capacitors (C5, C6, and C7) to operate. The forth (C8) is what is called a 'decoupling cap'. As the MAX232 IC switches various signals (from +/-12V to 0/5V) it uses bits of current. Because it needs these bits of current in bursts, it can disrupt your 5V supply. The C8 0.1uF capacitor helps 'decouple' or remove the ill effects of this IC (switching back and forth) from your power supply. This decoupling cap should be placed near the VCC and GND pins of the IC. This helps remove noise from your power system. Figure 3.5 PIC interface with RS232 Conversion
  • 16. - 16 - A decoupling cap is meant to provide a quick burst of energy if the power supply dips down - sort of like a UPS system for your IC. The further the decoupling cap is from the IC, the less ability it has to provide that quick burst (long wires have intrinsic capacitance of their own). A DB9 connector is called so because it contains 9 pins and is used universally for serial connections. You'll need a male to female serial cable to connect your circuits DB9 connector to the computer. The 'male' end of the cable has the metal pins; the 'female' end has the black colored plastic that receives the pins. If you look very close at a DB9 connector in real life, you can just make out some small numbers next to the holes. The microcontroller is going to send 5V signals to the MAX232 IC. The MAX232 IC in turn will convert those 5V signals to +/-12V RS232 signals that the computer can understand through the DB9 port on the back of the computer.
  • 17. - 17 - 3.3 Power Supply Circuit All the electronic components starting from diode to ICs only work in a DC supply ranging from +5V to +12V. We are utilizing for the same, the cheapest and commonly available energy source of 230V-50Hz. When AC is applied to the primary winding of the transformer, it can be stepped down depending upon the value of the DC needed. In our circuit the transformer of 230V/12V is used to perform step down operation where a 230V AC appears as 12V AC across the secondary winding. Apart from stepping down the voltage, it gives isolation between the power source and the controller unit. In the power supply circuit, rectification is normally achieved using a solid state diode. Diodes have the property which will allow electron flow easily in one direction at proper biasing condition. A commonly used circuit for supplying large amounts of DC power is the bridge rectifier. A bridge rectifier of four diodes (IN 4007 in our case) is used to achieve full wave rectification. Two diodes will conduct during the negative half cycle and the other two will conduct during the positive half cycle.The DC output has ripples and so a capacitor is used to filter these ripples. The output of the filter circuit is given to the regulator IC to get the desired output. Figure 3.6 Power Supply Circuit
  • 18. - 18 - 3.4 SIGNAL CONDITIONING CIRCUIT The PIC microcontroller can tolerate a maximum voltage of +5V DC. The input devices CT & PT will produce an ac voltage and also the level of voltage will not be within the specifications of the microcontroller. The signal conditioning circuit constructed with a bridge rectifier and a zener diode will solve the above said problem. 3.5 OPTOCOUPLER AND DRIVER CIRCUIT Optocoupler is a device which provides the perfect isolation between the power and control circuit. The optocoupler IC consists of a LED and a photo diode. The output signal from the microcontroller activates the led, which in turn drives the photo diode. The optocoupler is in the form of IC MOC3021. The photo diode of the optocoupler will trigger the gate of the Tirac and this will turn on the contactor. Figure 3.7 Signal conditioning circuit Figure 3.8 Driver Circuit
  • 19. - 19 - 3.6 LIGHT SENSOR CIRCUIT This circuit is used to switch priority between the Secondary and the Tertiary (Lighting) load. During the day if the work space in an industry has sufficient sunlight, the lighting loads are given least priority. So when the KVA limit is exceeded the lighting loads can be shed. But during the night the priority of the lighting load is increased and some other load which is not important is give least priority. The circuit given above enables this operation. When the sunlight is present the circuit gives an output voltage which is given to the microcontroller. When there is no ambient light, the output voltage of the circuit is zero which is sensed by the microcontroller and increases the priority of the lighting load. Figure 3.9 Light sensor Circuit
  • 20. - 20 - 3.7 CONTACTORS A contactor is an electrically controlled switch (relay) used for switching a power circuit. A contactor is activated by a control input which is a lower voltage / current than that which the contactor is switching. Contactors come in many forms with varying capacities and features. Unlike a circuit breaker a contactor is not intended to interrupt a short circuit current. Contactors range from having a breaking current of several amps and 110 volts to thousands of amps and many kilovolts. The physical size of contactors ranges from a few inches to the size of a small car. Contactors are used to control electric motors, lighting, heating, capacitor banks, and other electrical loads. 3.7.1 Operating Principle Unlike general-purpose relays, contactors are designed to be directly connected to high-current load devices, not other control devices. Relays tend to be of much lower capacity and are usually designed for both Normally Closed and Normally Open applications. Devices switching more than 15 amperes or in circuits rated more than a few kilowatts are usually called contactors. Apart from optional auxiliary low current contacts, contactors are almost exclusively fitted with Normally Open contacts. When current passes through the electromagnet, a magnetic field is produced which attracts ferrous objects, in this case the moving core of the contactor is attracted to the stationary core. Since there is an air gap initially, the electromagnet coil draws more current initially until the cores meet and reduce the gap, increasing the inductive impedance of the circuit.
  • 21. - 21 - For contactors energized with alternating current, a small part of the core is surrounded with a shading coil, which slightly delays the magnetic flux in the core. The effect is to average out the alternating pull of the magnetic field and so prevent the core from buzzing at twice line frequency. Most motor control contactors at low voltages (600 volts and less) are "air break" contactors, since ordinary air surrounds the contacts and extinguishes the arc when interrupting the circuit. Modern medium-voltage motor controllers use vacuum contactors. 3.8.2 Capacitor Switching Contactors-Features • Excellent damping of inrush current • Improved power quality (e.g. avoidance of voltage sags) • Recall function of recorded values • Longer useful life of main contacts of capacitor contactor • Soft switching of capacitor and thus longer useful life • Enhanced mean life expectancy • Reduced ohmic losses • Easy access for cable connection
  • 22. - 22 - 3.8 INSTRUMENT TRANSFORMERS Instrument transformers are used for measurement and protective application, together with equipment such as meters and relays. Their role in electrical systems is of primary importance as they are a means of "stepping down" the current or voltage of a system to measurable values, such as 5A or 1A in the case of a current transformers or 110V or 100V in the case of a voltage transformer. This offers the advantage that measurement and protective equipment can be standardized on a few values of current and voltage. 3.8.1 CURRENT TRANSFORMER (CT) Current transformer is used with its primary connected in series with the line carrying the current to be measured and therefore the primary current is dependent upon the load connected to the system and it is not determined by the load connected to secondary winding of the transformer. The output voltage of the transformer depends upon the current passing through the primary coil of the transformer. CT is used as an input device to measure the load current and to calculate the load KVA. 3.8.2 POTENTIAL TRANSFORMER (PT) Potential transformer is a simple step down transformer which converts the high voltage to a measurable low voltage. The primary of the transformer is connected in parallel to the loads and the secondary voltage induced will be proportional to the load voltage. PT is used as an input device to measure the load voltage and to calculate the load KVA.
  • 23. - 23 - 3.9 POWER FACTOR CIRCUIT The main objective of the power factor circuit is to determine the phase displacement between the current and the voltage waveform and the type of displacement (leading or lagging). To perform these operations the input voltage and current waveforms which are in AC are to be converted into DC, preferably +5V DC. This is done by the clipper and clamper circuits. The working of these circuits is discussed later in detail in Chapter 6.
  • 24. - 24 - CHAPTER 4 WORKING OF ADAPTIVE POWER REGULATOR 4.1 BLOCK DIAGRAM EXPLANATION The microcontroller does the job of integrating the signals obtained from the various devices. On obtaining these signals the microcontroller does the necessary operations based on the program inside it. The signal conditioning circuit, as mentioned before conditions the input from the CT and PT into a form that is recognizable by the microcontroller. In other words it converts the signal into the voltage levels that are suitable for the microcontroller. Here in our circuit it brings down the voltage from the CT and PT to 5V dc. This is then given to the analog pins AN.0 and AN.1 of the microcontroller. These signals are used by the microcontroller to calculate the actual KVA consumed by the load. If the actual KVA is greater than the Set Base maximum load KVA the microcontroller performs load shedding.
  • 25. - 25 - Load Shedding starts by removing the Tertiary loads first. This is done so as to minimize the actual KVA and also allowing the Primary loads to continue functioning. Here the basic idea is to give more importance to the load in an industry which is very vital for the functioning of the industry at that time. Consider a company that makes ceramic insulators where most of the work on that day is on an Induction motor which is used for mixing the components for manufacturing the ceramic. So the primary load is set as the induction motor on that day. Also consider a tertiary lighting load which can be shed during the day time. Similarly we consider the lighting load as the tertiary load during the day. During the night time the light sensor circuit is used to switch priority between the lighting load and some other load which can be shed (least important). Now the least important load is made as the tertiary load and lighting load is given second priority. So whenever the KVA limit is exceeded, the microcontroller sends a signal to the driver circuit which disconnects the least priority load first and functioning of the other connected load continues. If the condition persists the second priority load is now shed and a signal is sent by the microcontroller to the alarm circuit to inform to the operating personnel. The Power Factor circuit sends to the microcontroller three signals D1, D2 and PWM signal, which indicates the phase-shift between the voltage and current waveform. The CCP1 pin in the microcontroller receives this PWM signal and calculates the phase-shift angle and thus the power factor. The signals D1 and D2 help to determine whether the P.F is leading, lagging or U.P.F.
  • 27. - 27 - The power factor range is preset inside the microcontroller which is used to switch-on the necessary capacitors. Consider the system power factor range is set to be between 0.95 and 0.97 inside the microcontroller. Now before switching-on the banks the calculated power factor is say 0.72. The microcontroller now switches the appropriate bank and then checks the power factor. Now by performing switching-on of the capacitors in different combinations and continuous checking of the power factor, the microcontroller brings the power factor to the required range. Also when the power factor exceeds the range, say is 0.98 in our case, the microcontroller switches off the least connected capacitor and continues to do so till the p.f. is within required range. Here again the driver circuit is used to interface the capacitor contactor and the microcontroller, i.e. when the microcontroller sends the signal it switches on the respective capacitor. The MAX232A is used to send and receive signals, thereby enabling serial communication between the microcontroller and the computer. The signal sent to the computer is used to indicate the actual KVA, position of the contactors, etc. The general idea with which the system works is represented in the form of a flowchart as shown below. The system gets two inputs, one for calculating the KVA and the other is a pulse wave which gives the phase displacement between the voltage and current. The below sequence is programmed in C using a MikroC, which is given in Appendix 1.
  • 28. - 28 - START Give the XOR generated pulse to PIC Find phase difference using capture mode and calculate P.F Get D-Flip-Flop values If V & I are in phase NO Is the P.F in desired range? NO Give V & I from signal conditioner circuit and calculate KVA YES YES Is KVA greater than Set max KVA? Perform Load shedding based on priority YES NO Figure4.3 Flowchart Switch Capacitors in Capacitor Bank accordingly
  • 29. - 29 - CHAPTER 5 CAPACITOR BANK 5.1 SELECTION OF CAPACITORS Power factor involves the relationship between two types of power Active Power and Reactive Power. Active Power is measured in kilowatts (KW) and Reactive Power is measured in kilovolt-amperes-reactive (KVAR). Active power and reactive power together make up Apparent Power, which is measured in kilovolt-amperes (KVA). Power factor is the ratio between active power and apparent power. Active power does work and reactive power produces an electromagnetic field for inductive loads. This relationship is often illustrated using the familiar "power triangle" that is shown in the following figure. If the load is an electric motor or any other industrial AC loads, it will have a lagging (inductive) power factor, which means that we'll have to correct for it with a capacitor of appropriate size, wired in parallel. This correction will not change the amount of true power consumed by the load, but it will result in a substantial reduction of apparent power and of the total current drawn from The KW, of all loads are measured along this axis The KVA is measured along this diagonal The KVAR is measured along this vertical axis Power Factor Angle Reactive Power = [(Apparent Power) 2 - (Active Power) 2 )] ½ Figure 5.1 Power Triangle
  • 30. - 30 - the source. This lower total current will translate to less heat losses in the circuit wiring, meaning greater system efficiency (less power wasted). The installation of power factor correction capacitors will reduce the KVA demand on the transformers, thereby allowing additional load to be added without transformer resizing. Improved power factor will also help to reduce losses and support the bus voltages. P.F = [(Active Power)/ (Apparent Power)] = [KW/ (KW2 - KVAR2 )] ½ The power triangle after adding capacitor is shown in the following figure. Angle 1 is the power factor angle, before adding capacitors Angle 2 is the power factor angle, after adding capacitors KVAR1 is the reactive power before capacitors KVAR2 is the reactive power after adding capacitors KVARC is the capacitor size needed to improve the power factor Total Reactive Power = [Inductive KVAR- Capacitive KVAR] i.e., KVAR2 = [KVAR1 – KVARC] KVARC KVAR2 KVAR1 Angle2 Angle1 Figure 5.2 Power Triangle after adding Capacitor
  • 31. - 31 - By knowing the value of Inductive KVAR and the Total KVAR which is needed to be attained the Capacitive KVAR can be calculated from the above formulae. Now by knowing the amount of reactive power the size of capacitor needed to counteract its effects can be calculated by, Xc = (Source Voltage) 2 / KVARC An Induction motor is used as highest priority load to display the prioritized load shedding. The Capacitor values required for the Capacitor Bank arrangement is calculated with the help of the Wattmeter and Ammeter readings during the load test conducted on the Induction motor. The values obtained by the load test are tabulated below. From the above tabulation the value of the capacitor size (Xc) needed to improve the power factor to the desired value can be calculated. It was calculated that with a capacitor bank range of 45µF to 63µF for this particular Induction motor the power factor can be maintained within a range of 0.95 to 0.98. Voltage (V) Current (A) Active Power (KW) 230 No Load 4.85 0.2 230 5.5 0.68 230 6 0.88 230 7 1.12 230 8 1.4 230 9 1.6 230 Max Load 9.9 1.8 Table 5.1 Load test results I.M rating (230V, 9.9A, 1.5KW/2HP)
  • 32. - 32 - 5.2 RATINGS OF CAPACITORS USED The bank consists of four 440VAC capacitors of the following ratings… • 45 MFD • 4 MFD • 6 MFD • 8 MFD All the above capacitors have a range of ±5%. where; C1 4 MFD C3 8 MFD C2 6 MFD C4 45 MFD 5.3 SWITCHING PATTERN Based on the connected load, the choices of capacitor banks were made. This ensures that the KVAR at any point of the switching does not make the system overcompensated. According to the program the capacitor C4 (45 MFD) is initially connected to the system. The switching of C1, C2 and C3 is such that it causes an incremental increase in the system power factor. Supposing the required Figure 5.3 Capacitor Bank Connection
  • 33. - 33 - system power factor is in the range of 0.96 to 0.98 the total capacitance added is augmented till the desired output is obtained. The microcontroller sends signal to the driver circuit of the capacitor when the target power factor has not yet been achieved. The switching starts from an initial value (4 MFD in this case) and continues to increase till the desired value has been reached. 5.4 ADVANTAGES OF SHUNT CAPACITOR BANKS • The cost of an equivalent shunt capacitor bank is comparatively low. • The losses in a capacitor are as low as less than 1 watt KVAR or 0.1%. In a well designed synchronous condenser, the losses are around 3% up to 3 MVA output and 1½% for units between 50 and 100 MVA output. • A shunt capacitor is mobile and flexible. It can be shifted to different locations. Bank capacity can be increased in size in modular form. • A single unit/section failure does not immobilize a capacitor bank. • Capacitors might momentarily feed into a system short-circuits. However, they do not increase the short circuit current to that extent synchronous machines add to the sustained short-circuit current. Therefore circuit breakers, CTs, bus ducts, etc. will have to be designed for a higher short-circuit current duty on a bus where synchronous machines are connected. This is not required in case of equivalent block of capacitors on the same bus.
  • 34. - 34 - CHAPTER 6 PHASE DISPLACEMENT MEASUREMENT 6.1 PHASE MEASUREMENT TECHNIQUES There are different methods for measuring the phase difference between two sinusoidal waves. A few of these methods are • Lissajous method, • Zero Crossing method, • Three Voltmeter method and • Crossed Coil method. Of the above mentioned methods we are implementing the Zero Crossing method for obtaining the phase difference for the input waveforms, in our case CT and PT. 6.1.1 Zero Crossing Method This method is currently one of the most popular methods for determining phase difference, largely because of the high accuracy achievable (typically 0.02°). The process is illustrated by using two signals, denoted A and B, which have the same frequency but different amplitudes. Each negative to positive zero-crossing of signal A triggers the start of a rectangular pulse, while each negative to positive zero-crossing of signal B triggers the end of the rectangular pulse. The result is a pulse train with a pulse width proportional to the phase angle between the two signals. The pulse train is passed through an averaging filter to yield a measure of the phase difference. It is also worth noting that if the positive to negative zero-crossings are also used in the same
  • 35. - 35 - fashion, and the two results are averaged, the effects of dc and harmonics can be significantly reduced. To implement the method practically, the analog input signals must first be converted to digital signals that are “high” if the analog signal is positive and “low” if the analog signal is negative. This can be done, for example, with a Schmitt trigger, along with an RC stabilizing network at the output. In practice, high-accuracy phase estimates necessitate that the switching of the output between high and low be very sharp. One way to obtain these sharp transitions is to have several stages of “amplify and clip” preceding the Schmitt trigger. In the Power Factor Circuit of the Adaptive Power Regulator we use a clipper, Clamper, XOR Gate and D Flip-flops to measure the phase displacement value and the type of displacement (Leading or Lagging). Figure 6.1 Zero crossing method
  • 36. - 36 - 6.2 POWER FACTOR CIRCUIT-WORKING The main objective of the power factor circuit is to determine the phase displacement between the current and the voltage waveform and the type of displacement (leading or lagging). To perform these operations the input voltage and current waveforms which are in AC are to be converted into DC, preferably +5V DC. This is done by the clipper and clamper circuits. Let us first understand the working of these circuits in detail. Initially the current and voltage waveforms are converted into square wave by the op-amp LM741, i.e. voltage and current are now available as square wave with amplitude 14V which is given to the clipper circuit. As discussed before the power factor circuit consists of the following • Clipper Circuit • Clamper Circuit • XOR Gate • D Flip-Flop 6.2.1 Clipper Circuit The clipper cuts off a part of the waveform retaining the desired portion. The waveforms shown below explain the working of a clipper circuit. Input Waveform Positive Clipper Negative Clipper Dual Clipper Figure 6.2 Clipper circuit example
  • 38. - 38 - 6.2.2 Clamper Circuit Certain applications in electronics require that the upper or lower extremity of a wave be fixed at a specific value. In such applications, a CLAMPING (or CLAMPER) circuit is used. A clamping circuit clamps or restrains either the upper or lower extremity of a waveform to a fixed dc potential. This circuit is also known as a DIRECT-CURRENT RESTORER or a BASE-LINE STABILIZER. Such circuits are used in test equipment, radar systems, electronic countermeasure systems, and sonar systems. Depending upon the equipment, you could find negative or positive clampers with or without bias. Figure given below illustrates some examples of waveforms created by clampers. Together the Clipper and Clamper circuits condition the input AC voltage into the suitable +5V DC to be given to the XOR Gate. Now at the output of the clamper circuit square waveform of the voltage and current are obtained. Figure 6.4 Clamper Circuit example
  • 39. - 39 - 6.2.3 XOR Gate Circuit First let us see the basic functioning of the XOR Gate. The working of the XOR Gate is given by its logic table. The logic table of the XOR Gate is given below. There is a variation on the OR logic called Exclusive OR or XOR. Exclusive OR says the output will be ON if the inputs are different. So when the square waveform of the current and voltage signal is given to the XOR Gate, a PWM signal will be generated when the two signals differ from each other. This pulse width signal denotes the phase shift between the current and voltage waveforms, which in turn represents the power factor. Thus the phase difference between the current and voltage waveform is determined using the width of the pulse generated by the XOR Gate. Now this PWM signal is given to two D Flip-Flops. 6.2.4 D Flip-Flop Circuit The symbol of a D Flip-Flop is shown in the figure below. Input 1 Input 2 Output 0 0 0 0 1 1 1 0 1 1 1 0 Table 6.1 XOR Logic Table Figure 6.5 D Flip-Flop
  • 40. - 40 - The D Flip-Flop has an input CLK (Clock) signal and for the output it has the next state, Q and the previous state. The Q output always takes on the state of the D input at the moment of a rising clock edge, and never at any other time. It is called the D flip-flop for this reason, since the output takes the value of the D input or Data input, and Delays it by one clock count. The D flip-flop can be interpreted as a primitive memory cell, zero-order hold, or delay line. Clock D Q Qprev Rising edge 0 0 X Rising edge 1 1 X Non- Rising X cons tant ('X' denotes a don’t care condition, meaning the signal is irrelevant) Waveform depicting the working of a D Flip-Flop is shown below. As shown in the above waveform, the output, Q of the D Flip-Flop retains the input value D. The value of the output Q is high whenever the value of the input D is high and vice-versa. Table 6.2 D Flip-Flop Truth Table Figure 6.6 D Flip-Flop working
  • 41. - 41 - Similarly in our circuit the clock pulse for the two D Flip-Flops are current and voltage square waveform, which is given through an RC filter inorder to produce spikes as clock signal to form an edge triggered D Flip-Flop. The D (input) is the PWM signal for both the flip flops. With this we can determine the type of phase shift between the current and voltage waveform, in turn determining whether the power factor is leading or lagging. The explanation for this is given below. Hence from the Power Factor circuit designed the D Flip-Flop output of the two flop-flops for leading p.f, lagging p.f and u.p.f are as shown in table below. D Flip-Flop1 Q1 D Flip-Flop2 Q2 Lagging P.F High Low Leading P.F Low High U.P.F Low Low For both the flip-flops are given with the XOR’s output is feed as D and the Clock for D Flip-Flop1 is that of the voltage generated PWM and the current generated PWM is given as the clock for D Flip-Flop2. Table 6.3 D Flip-Flop’s output
  • 42. - 42 - CHAPTER 7 CONCLUSION The Adaptive Power Regulator combines the operation of ‘Load Shedding’ and ‘Reactive Power Management’, thereby making it a more versatile and complete solution for the power problems in an industry. The system effectively saves the consumer from the imminent penalties of exceeding the maximum KVA limit and also for the maintenance of low power factor by efficient priority based load shedding and reactive power compensation. By doing so the system maximizes the profit for the consumer by reducing the electricity bill. Also the system helps to fetch incentives by maintaining a high power factor. By maintaining high power factor, the system makes maximum use of the available power. The PC interface makes it easier for monitoring the functioning of the system and also aids in future expansion. We like to conclude with the quote ‘Till the search is on for alternate energy sources, we need to utilize the available energy effectively’.
  • 43. - 43 - APPENDIX 1 PROGRAM CODE unsigned short tl, totall, event, i, j, t[10], light, reset, d1, d2, bank; unsigned int th, totalh; long double time, period, phase, m, n; unsigned long base, kva, volt, curr, a; /*This interrupt is generated on every rising or falling edge of RC2/CCP1. In this function the CCP1 is made to detect falling edge and rising edge alternatively by changing the CCP1CON. For this the CCP1 interrupt has to be disabled when CCP1CON is changed or else it will generate a fake interrupt*/ void interrupt( ) { if ( PIR1.F2 == 1 ) //Checks if CCP1 interrupt flag is set { th = CCPR1H; //Stores the 16 bit captured time value tl = CCPR1L; // which gives the pulse width PIE1.F2 = 0; //Disables CCP1 interrupt if ( CCP1CON == 5 ) //Checks if CCP1 is set to trigger on { //every rising edge totalh = TMR1H; //Stores the 16 bit captured time value totall = TMR1L; //which gives the total time period TMR1H = 0; // Resets the two timer bytes of timer1 TMR1L = 0; CCP1CON = 4; //Sets CCP1 to trigger on every falling
  • 44. - 44 - } //edge else { CCP1CON = 5; //Changes CCP1 to detect rising edges event = 1; //Raises a flag (event),if a falling edge } //is detected PIR1.F2 = 0; //Clears interrupt flag in PIR1 register PIE1.F2 = 1; //Re-enables CCP1 interrupt } } /* The Adc_Read( ) function represents the analog input by 10-bit unsigned value. With the help signal conditioning circuit the voltage value (230V) is made to be represented as 1023 (i.e. 1111111111 in binary) when given to bit 0 of PORTA and the current value 15A (max load current) is made to be represented as 1023 when given to bit 1 of PORTA. The light sensor output is given to bit 3 of PORTA. For Base KVA of 2800KVA, V 230V and I 12.17A i.e. V 1023 and I 830. Therefore Base KVA=(1023*830)=849090*/ void shedding( ) { volt = Adc_Read( 0 ); curr = Adc_Read( 1 ); light = Adc_Read( 3 ); base = 849090; kva = volt * curr;
  • 45. - 45 - reset = PORTA.F5 & 1; //reset flag is high when input is given if( reset == 1 ) { PORTB.F7 = 0; // b7 Induction motor PORTB.F6 = 0; //b6 Light load PORTB.F5 = 0; //b5 Tertiary load } while( 1 ) { if( kva > base ) { if( light <= 613 ) //Then there is no natural light present { //613 is decimal representation of 3V PORTB.F5=1; delay_ms(10000); volt = Adc_Read( 0 ); curr = Adc_Read( 1 ); base = 849090; kva = volt * curr; if(kva > base) { PORTB.F6=1; break; } else break; } else if( light > 613 ) //Natural light present { PORTB.F6=1; delay_ms( 10000 );
  • 46. - 46 - volt = Adc_Read( 0 ); curr = Adc_Read( 1 ); base = 849090; kva = volt * curr; if( kva > base ) { PORTB.F5 = 1; PORTB.F6 = 1; break; }else break; } } } } /*This function is called when PIC sends the data serially to PC. It changes the values to be sent to it ASCII equivalent and then sends it using Usart_Write( ) function.*/ void send( long double m ) { a = m; i = 0; while( a != 0 ) { a = a/10; i = i++; }
  • 47. - 47 - a = m; for( j = 1; j <= i; j++ ) { t[j] = a%10; a = a/10; } for( j = i; j > 0; j-- ) { Usart_Write( t[j]+48 ); } Usart_Write( 46 ); //46 is the ASCII equivalent for ‘.’(dot) n = m; for( j = 0; j < (8-i); j++ ) { n = n*10; a = n; Usart_Write( (a%10)+48 ); } } void main( ) { ADCON1 = 0x84; //Except AN0,AN1 and AN3 all are set TRISA = 0xFF; //as digital TRISB = 0; //Port A is set as i/p port and Port B TRISC = 0; //& C is set as o/p port PORTA = 0;
  • 48. - 48 - PORTB = 0; PORTC = 0; TRISC.F2 = 1; //CCP1 port must be set as input Usart_Init( 9600 ); // Initializes USART module with 9600 event = 0; // baud rate bank = 0; CCP1CON = 5; // Capture mode, every rising edge T1CON = 0b00111001; //Set prescaler as 1:8 and enble INTCON.F7 = 1; //oscillator and timer INTCON.F6 = 1; //Set GIE and PEIE PIE1.F2 = 1; //Set CCP1 interrupt enable bit while( 1 ) { if( event == 1 ) { d1 = PORTA.F2; // D Flip Flop outputs to find if it is d2 = PORTA.F4; // leading or lagging power factor if( (d1 & 1 == 1) || (d2 & 1 == 1) ) { //To check that they are not in phase time = th << 8; //Pulse width is found by combining time = time + tl; //the lower & higher timer byte time = time / 5 //At 20MHz, internal clock = 20/4, // so divide time by 5 time = time * (8); //Multiply by prescale value time = time/(1000); //Changes the unit to msec period = totalh << 8; period = period + totall; period = period / (5); period = period * (8);
  • 49. - 49 - period = period / (1000); phase =((time/period)*180); // θ=(duty cycle)*180 send( phase ); event = 0; if( (d1 & 1 == 1) && (d2 & 1 == 0) ) { //To check that power factor is lagging if( (phase > 16.26) || (phase < 11.478) ) { // power factor is between 0.96 to 0.98 if( phase > 16.26 ) { //power factor is less than 0.96 if( bank == 0 ) { PORTB.F4 = 0; PORTB.F3 = 0; PORTB.F2 = 0; PORTB.F1 = 1; bank = 1; break; } else if( bank == 1 ) { PORTB.F4 = 1; PORTB.F3 = 0; PORTB.F2 = 0; PORTB.F1 = 1; bank = 2; break; } else if( bank == 2 )
  • 50. - 50 - { PORTB.F4 = 0; PORTB.F3 = 1; PORTB.F2 = 0; PORTB.F1 = 1; bank = 3; break; } else if( bank == 3 ) { PORTB.F4 = 0; PORTB.F3 = 0; PORTB.F2 = 1; PORTB.F1 = 1; bank = 4; break; } else if( bank == 4 ) { PORTB.F4 = 1; PORTB.F3 = 1; PORTB.F2 = 0; PORTB.F1 = 1; bank = 5; break; } else if( bank == 5 ) { PORTB.F4 = 1;
  • 51. - 51 - PORTB.F3 = 0; PORTB.F2 = 1; PORTB.F1 = 1; bank = 6; break; } else if( bank == 6 ) { PORTB.F4 = 0; PORTB.F3 = 1; PORTB.F2 = 1; PORTB.F1 = 1; bank = 7; break; } else if( bank == 7 ) { PORTB.F4 = 1; PORTB.F3 = 1; PORTB.F2 = 1; PORTB.F1 = 1; bank = 8; break; } } else if( phase < 11.478 ) { //power factor is greater than 0.98 if( bank == 8 ) {
  • 52. - 52 - PORTB.F4 = 0; PORTB.F3 = 1; PORTB.F2 = 1; PORTB.F1 = 1; bank = 7; break; } else if( bank == 7 ) { PORTB.F4 = 1; PORTB.F3 = 0; PORTB.F2 = 1; PORTB.F1 = 1; bank = 6; break; } else if( bank == 6 ) { PORTB.F4 = 1; PORTB.F3 = 1; PORTB.F2 = 0; PORTB.F1 = 1; bank = 5; break; } else if( bank == 5 ) { PORTB.F4 = 0; PORTB.F3 = 0;
  • 53. - 53 - PORTB.F2 = 1; PORTB.F1 = 1; bank = 4; break; } else if( bank == 4 ) { PORTB.F4 = 0; PORTB.F3 = 1; PORTB.F2 = 0; PORTB.F1 = 1; bank = 3; break; } else if( bank == 3 ) { PORTB.F4 = 1; PORTB.F3 = 0; PORTB.F2 = 0; PORTB.F1 = 1; bank = 2; break; } else if( bank == 2 ) { PORTB.F4 = 0; PORTB.F3 = 0; PORTB.F2 = 0; PORTB.F1 = 1;
  • 54. - 54 - bank = 1; break; } else if( bank == 1 ) { PORTB.F4 = 0; PORTB.F3 = 0; PORTB.F2 = 0; PORTB.F1 = 0; bank = 0; break; } } } } if( (d1 & 1 == 0) && (d2 & 1 == 1) ) { //To check that power factor is leading PORTB.F4 = 0; PORTB.F3 = 0; PORTB.F2 = 0; PORTB.F1 = 0; bank = 0; break; } } } shedding( ); } }
  • 55. - 55 - APPENDIX 2 SOFTWARES USED MIKROC COMPILER MikroC is used to develop applications for PIC quickly and easily. This is an advanced and comprehensive compiler used to compile program codes for the PIC microcontroller. This uses a high level language, C programming in this case to write programs into the PIC. The compiler then converts this high level code into a Hex code suitable for the microcontroller. Using this we can develop complex codes and program logics without the difficulty of developing programs with Hex codes. Another feature of MikroC is that error correction is easier and more efficient. MikroC is a powerful, feature rich development tool for PICmicros. It is designed to provide the easiest possible solution for developing applications for embedded systems, without compromising performance or control. It also provides a successful match featuring highly advanced IDE, ANSI compaliant compiler, broad set of hardware libraries and comprehensive documentation. MikroC allows you to quickly develop and deploy complex applications: • The C source code is written using the highly advanced Code Editor • The MikroC libraries can be used which speed up development, data acquisition, memory, display, conversions, communication etc. • The program structure, variables and functions can be monitored using the Code Explorer. Both human-readable assembly and standard HEX can be generated which is compatible with all programmers.
  • 56. - 56 - • The integrated Debugger. can be used to inspect the program flow, debug executable logic and also to get detailed reports and graphs on code statistics, assembly listing, calling tree etc. MIKROC SPECIFICS • MikroC diverges from the ANSI C standard in few areas, in which some are improvements intended to facilitate PIC programming, while others are result of PICmicro hardware limitations • All PIC SFR registers are implicitly declated as global variables of volatile unsigned short. • Individuval bits of 8-bit variables, type char and unsigned short can be accessed by simply using the direct member selector “.”(dot) with a variable, followed by one of identifiers F0, F1,……., F7. • Interrupts can be easily handled by means of reserved word interrupt. There is a implicitly declared function interrupt which cannot be redeclared.
  • 57. - 57 - MIKROC SYNTAXES USED STATEMENTS Statements specify the flow of control as a program executes. In the absence of specific jump and selection statements, statements are executed sequentially in the order of appearance in the source code. Statements can be roughly divided into: • Labeled Statements • Expression Statements • Selection Statements • Iteration Statements (Loops) • Jump Statements • Compound Statements (Blocks) ADC LIBRARY ADC (Analog to Digital Converter) module is available with a number of PIC MCU models. Library function Adc_Read is included to provide you comfortable work with the module. Adc_Read Prototype unsigned Adc_Read(unsigned short channel); Returns 10-bit unsigned value read from the specified channel. Description Initializes PIC’s internal ADC module to work with RC clock. Parameter channel represents the channel from which the analog value is to be acquired. Requires PIC MCU with built-in ADC module. Before using the function, be sure to configure the appropriate TRISA bits to designate the pins as input Example unsigned tmp; tmp = Adc_Read(1); /* read analog value from channel 1
  • 58. - 58 - BUILT-IN ROUTINES MikroC compiler provides a set of useful built-in utility functions. Built- in functions do not require any header files to be included; you can use them in any part of your project. Delay_ms Prototype void Delay_ms(const time_in_ms); Returns Nothing. Description Creates a software delay in duration of time_in_ms milliseconds (a constant). Range of applicable constants depends on the oscillator frequency. Requires Nothing. Example Delay_ms(1000); /* One second pause */ USART LIBRARY USART hardware module is available with a number of PICmicros. mikroC USART Library provides comfortable work with the Asynchronous (full duplex) mode. You can easily communicate with other devices via RS232 protocol (for example with PC, see the figure at the end of the topic – RS232 HW connection). You need a PIC MCU with hardware integrated USART, for example PIC16F877. Then, simply use the functions listed below. • Usart_Init • Usart_Data_Ready • Usart_Read • Usart_Write
  • 59. - 59 - Certain PICmicros with two USART modules, such as P18F8520, require you to specify the module you want to use. Simply append the number 1 or 2 to a function name. For example, Usart_Write2(); Also, for the sake of backward compabitility with previous compiler versions and easier code management, MCU's with multiple USART modules have USART library which is identical to USART1 (i.e. you can use Usart_Init() instead of Usart_Init1( ) for Usart operations). Usart_Init Prototype void Usart_Init(const unsigned long baud_rate); Returns Nothing. Description Initializes hardware USART module with the desired baud rate. Refer to the device data sheet for baud rates allowed for specific Fosc. If you specify the unsupported baud rate, compiler will report an error. Requires You need PIC MCU with hardware USART. Usart_Init needs to be called before using other functions from USART Library. Example This will initialize hardware USART and establish the communication at 2400 bps: Usart_Init(2400); Usart_Data_Ready Prototype unsigned short Usart_Data_Ready(void); Returns Function returns 1 if data is ready or 0 if there is no data. Description Use the function to test if data in receive buffer is ready. Requires USART HW module must be initialized and communication established before using this function.
  • 60. - 60 - Usart_Read Prototype unsigned short Usart_Read(void); Returns Returns the received byte. If byte is not received, returns 0. Description Function receives a byte via USART. Use the function Usart_Data_Ready to test if data is ready first. Requires USART HW module must be initialized and communication established before using this function. See Usart_Init. Usart_Write Prototype void Usart_Write(unsigned short data); Returns Nothing. Description Function transmits a byte (data) via USART. Requires USART HW module must be initialized and communication established before using this function. See Usart_Init. Example int chunk = 0x1E; Usart_Write(chunk); /* send chunk via USART */
  • 61. - 61 - Win PIC Programmer This is a simple program for Win95/98/XP to program the PIC firmware from a HEX-file into a PIC microcontroller. Most modern PICs can be reprogrammed many times; because the program can be erased electrically (the code is stored in a FLASH, not a simple ROM). Some of the features worth mentioning about this programmer are the • Bulk Erase feature and • Compatibility with different types of interfaces. The Bulk erase ("erase all") removes all bytes present in the PIC microcontroller at once. And this programmer can work for both serial and parallel interfaces make it more versatile.
  • 62. - 62 - APPENDIX 3 REGISTERS USED PIE1 REGISTER (ADDRESS 8Ch) The PIE1 register contains the individual enable bits for the peripheral interrupts. Bit PEIE (INTCON<6>) must be set to enable any peripheral interrupt. R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 PSPIE(1) ADIE RCIE TXIE SSPIE CCP1IE TMR2IE TMR1IE bit 7 bit 0 bit7 PSPIE Parallel Slave Port Read/Write Interrupt Enable bit(1) 1 = Enables the PSP read/write interrupt 0 = Disables the PSP read/write interruptNote 1: PSPIE is reserved on PIC16F873A/876A devices; always maintain this bit clear. bit6 ADIE A/D Converter Interrupt Enable bit 1 = Enables the A/D converter interrupt 0 = Disables the A/D converter interrupt bit5 RCIE USART Receive Interrupt Enable bit 1 = Enables the USART receive interrupt 0 = Disables the USART receive interrupt bit4 TXIE USART Transmit Interrupt Enable bit 1 = Enables the USART transmit interrupt 0 = Disables the USART transmit interrupt bit3 SSPIE Synchronous Serial Port Interrupt Enable 1 = Enables the SSP interrupt 0 = Disables the SSP interrupt bit2 CCP1IE CCP1 Interrupt Enable bit 1 = Enables the CCP1 interrupt 0 = Disables the CCP1 interrupt bit1 TMR2IE TMR2 to PR2 Match Interrupt Enable bit 1 = Enables the TMR2 to PR2 match interrupt 0 = Disables the TMR2 to PR2 match interrupt bit0 TMR1IE TMR1 Overflow Interrupt Enable bit 1 = Enables the TMR1 overflow interrupt 0 = Disables the TMR1 overflow interrupt
  • 63. - 63 - PIR1 REGISTER (ADDRESS 0Ch) The PIR1 register contains the individual flag bits for the peripheral interrupts. Interrupt flag bits are set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the global enable bit, GIE (INTCON<7>). User software should ensure the appropriate interrupt bits are clear prior to enabling an interrupt. R/W-0 R/W-0 R-0 R-0 R/W-0 R/W-0 R/W-0 R/W-0 PSPIF(1) ADIF RCIF TXIF SSPIF CCP1IF TMR2IF TMR1IF bit 7 bit 0 bit7 PSPIF Parallel Slave Port Read/Write Interrupt Flag 1 = Read/Write operation has taken place (must be cleared by software) 0 = No Read/Write operation bit6 ADIF A/D Converter Interrupt Flag 1 = An A/D conversion completed 0 = conversion not complete bit5 RCIF USART Receive Interrupt Flag 1 = USART receive buffer is full 0 = USART receive buffer is empty bit4 TXIF USART Transmit Interrupt Flag 1 = USART transmit buffer is empty 0 = USART transmit buffer is full bit3 SSPIF Synchronous Serial Port (SSP) Interrupt Flag 1 = The SSP interrupt has occurred 0 = No interrupt bit2 CCP1IF CCP1 Interrupt Flag 1 = TMR1 register capture has occurred (must be cleared by software) 0 = No TMR1 register capture bit1 TMR2IF TMR2 to PR2 Match Interrupt Flag 1 = TMR2 to PR2 match occurred (must be cleared by software) 0 = No TMR2 to PR2 match bit0 TMR1IF TMR1 Overflow Interrupt Flag 1 = TMR1 register overflowed (must be cleared by software) 0 = No TMR1 overflow
  • 64. - 64 - CCP1CON REGISTER REGISTER (ADDRESS 17h) The CCP1CON register controls the operation of CCP1. The special event trigger is generated by a compare match and will reset Timer1. U-0 U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 — — CCPxX CCPxY CCPxM3 CCPxM2 CCPxM1 CCPxM0 bit 0 bit 7 bit7-6 Unimplemented Read as ‘0’ bit5-4 CCPxX:CCPxY PWM Least Significant bits Capture mode: Unused. Compare mode: Unused. PWM mode: These bits are the two LSbs of the PWM duty cycle. The eight MSbs are found in CCPRxL. bit3-0 CCPxM3:CCPx M0 CCPx Mode Select bits 0000 = Capture/Compare/PWM disabled (resets CCPx module) 0100 = Capture mode, every falling edge 0101 = Capture mode, every rising edge 0110 = Capture mode, every 4th rising edge 0111 = Capture mode, every 16th rising edge 1000 = Compare mode, set output on match (CCPxIF bit is set) 1001 = Compare mode, clear output on match (CCPxIF bit is set) 1010 = Compare mode, generate software interrupt on match (CCPxIF bit is set, CCPx pin is unaffected) 1011 = Compare mode, trigger special event (CCPxIF bit is set, CCPx pin is unaffected); CCP1 resets TMR1; CCP2 resets TMR1 and starts an A/D conversion (if A/D module is enabled) 11xx = PWM mode
  • 65. - 65 - INTCON REGISTER (ADDRESS 0Bh, 8Bh, 10Bh, 18Bh) The INTCON register is a readable and writable register, which contains various enable and flag bits for the TMR0 register overflow, RB port change and external RB0/INT pin interrupts. Interrupt flag bits are set when an interrupt condition occurs regardless of the state of its corresponding enable bit or the global enable bit, GIE (INTCON<7>). User software should ensure the appropriate interrupt flag bits are clear prior to enabling an interrupt. R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-x GIE PEIE TMR0IE INTE RBIE TMR0IF INTF RBIF bit 7 bit 0 bit7 GIE Global Interrupt Enable bit 1 = Enables all unmasked interrupts 0 = Disables all interrupts bit6 PEIE Peripheral Interrupt Enable bit 1 = Enables all unmasked peripheral interrupts 0 = Disables all peripheral interrupts bit5 TMR0IE TMR0 Overflow Interrupt Enable bit 1 = Enables the TMR0 interrupt 0 = Disables the TMR0 interrupt bit4 INTE RB0/INT External Interrupt Enable bit 1 = Enables the RB0/INT external interrupt 0 = Disables the RB0/INT external interrupt bit3 RBIE RB Port Change Interrupt Enable bit 1 = Enables the RB port change interrupt 0 = Disables the RB port change interrupt bit2 TMR0IF TMR0 Overflow Interrupt Flag bit 1 = TMR0 register has overflowed (must be cleared in software) 0 = TMR0 register did not overflow bit1 INTF RB0/INT External Interrupt Flag bit 1 = The RB0/INT external interrupt occurred (must be cleared in software) 0 = The RB0/INT external interrupt did not occur bit0 RBIF RB Port Change Interrupt Flag bit 1 = At least one of the RB7:RB4 lines changed their state 0 = None state change on RB7:RB4 lines
  • 66. - 66 - T1CON: TIMER1 CONTROL REGISTER (ADDRESS 10h) The Timer1 module is a 16-bit timer/counter consisting of two 8-bit registers (TMR1H and TMR1L) which are readable and writable. The TMR1 register pair (TMR1H:TMR1L) increments from 0000h to FFFFh and rolls over to 0000h. The TMR1 interrupt, if enabled, is generated on overflow which is latched in interrupt flag bit, TMR1IF (PIR1<0>). This interrupt can be enabled/disabled by setting/clearing TMR1 interrupt enable bit, TMR1IE (PIE1<0>).Timer1 can operate in one of two modes: • As a Timer • As a Counter U-0U-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 R/W-0 — — T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON bit7 bit0 bit7-6 Unimplemented Read as ‘0’ bit5-4 T1CKPS1:T1CKPS0 Timer1 Input Clock Prescale Select bits 11 = 1:8 prescale value 10 = 1:4 prescale value 01 = 1:2 prescale value 00 = 1:1 prescale value bit3 T1OSCEN Timer1 Oscillator Enable Control bit 1 = Oscillator is enabled 0 = Oscillator is shut-off bit2 T1SYNC Timer1 External Clock Input Synchronization Control bit When TMR1CS = 1: 1 = Do not synchronize external clock input 0 = Synchronize external clock input When TMR1CS = 0: This bit is ignored. Timer1 uses the internal clock when TMR1CS = 0. bit1 TMR1CS Timer1 Clock Source Select bit 1 = External clock from pin RC0/T1OSO/T1CKI (on the rising edge) 0 = Internal clock (FOSC/4) bit0 TMR1ON Timer1 On bit 1 = Enables Timer1 0 = Stops Timer1 Legend: R = Readable bit W = Writable bit U = Unimplemented bit, read as ‘0’ - n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
  • 67. - 67 - APPENDIX 4 REACTIVE POWER PLANNING-USER SIDE SELECTION OF CAPACITORS Purpose of Using Capacitors The purpose for which electric power capacitors are being used must be clear. The following points enunciate the various reasons for the use of capacitors. • Reduction of penalty in the electricity bill on account of low power factor. • Reduction in billing demand charges. • Support to bus voltage. • Harmonic Reduction, when used with a filter. • Tuned melting or Heating application in induction heat applications. • Reduction in plant losses, when a plant is spread over a wide area, for example, a pulp and paper plant; and • Increased life and low maintenance, control and protection switch gear. 1) Reduction in Penalties The reduction in penalties in the electricity bill is a prime consideration for the majority of the consumers of power. The penalties are very stiff. Typically a low voltage customer stands to recoup his investments on capacitors and capacitor controls within a period of 3-6 months by his savings on the penalty. This typical customer has an average p.f. of 0.76, while the p.f. below which the penalty starts is 0.9. 2) Billing Demand Charges When a customer asks for a new/additional connection, he gives the: • Total connected load that he is putting up and
  • 68. - 68 - • Maximum estimated demand in KVA that he is likely to have-this demand is treated as a base for contract demand. The maximum demand meter registers the highest demand on an average of 15 minutes. Any such single recording during that entire period of charging attracts Maximum Demand (MD) charges. Here the following two situations arise: i. The customer’s actual recorded demand is way below his contract demand. Then the billing MD is a fixed percentage of the contract demand. This protects the utility. A customer under this category derives no benefit from the reduction of MD by using capacitors. ii. On the other hand, the customer’s demand exceeds his billing contract demand. His MD charging rate and charges, both rise up drastically. It pays handsomely for a customer under this category to put capacitors. While getting a new/additional load connected, the EB makes it compulsory for a customer to put in designated KVAR capacitors. The selection of KVAR size is now taken out of the customer’s hands. The customer may decide which make of the capacitor and its controls he can buy. Under demand side management, the EB offers a sizeable reduction in the electricity bill (on the energy consumed portion only), if he maintains an average p.f. above a designated value, say, 0.95. It now pays for the customer to put up additional capacitors and operate them correctly. 3) Support to system bus voltages and reduction in Plant losses Both the above objectives are best realized when both the losses in distribution as well as voltage drops in distribution are sizeable within a plant, it spreads over a large area.
  • 69. - 69 - In smaller plants, these objectives for all practical purposes are not implemented and stay academic. 4) Harmonic Reduction by Using a Filter Capacitor, i.e. a Capacitor with a Tuned Series Reactor Modern loads use power electronics as well as microelectronics. These loads produce substantial harmonics. All over the world, there are standards limiting the harmonic to within a declared percentage magnitudes of the fundamental supply parameters like voltage and current. Abiding by these parameters is voluntary, and in one’s own interest. Non-abidance may result in a supply cut off. There are no graded penal charges. Also Interruption of micro-processor based control system and computers could be very costly. These two systems in a plant are rapidly becoming an integral part of the industrial process. Also following these standards result in lower maintenance and replacement costs. 5) Tuning Capacitors in Induction Melting and Heating Maximum power is transferred to a resistor or heat dissipating element, when the inductance of the heating coil is accurately tuned to resonate at the operating frequency with a series connected matching capacitor. The melting charge at the center of the induction coil has variable inductances depending on its state of melting. This requires multiple steps of capacitors with an on-off step control. The capacitor duty is vigorous. 6) Reduction in Plant Losses Consider an old pulp and paper plant spread over hundreds of acres of land. The main generator is in one place. Operations like log cutting are done far away from the generator. Locating capacitors at these far off places is a must to keep distribution losses low.
  • 70. - 70 - 7) Low Maintenance and Lower Rate of Replacements This is significant in plants where large sized motors turn on-off rather frequently in a process. Each operation calls in for a high amplitude current surge causing instant high spot temperature in cables and sparking across starters. This also causes voltage dips. A capacitor across a motor reduces starting currents and ensures maintenance free long life for these equipments. How To Select A Capacitor: Deciding Factors The following factors help us to decide on the size, type, assembly and location of the capacitors to be used. • KVAR requirements. • Voltage levels where capacitors can be installed. • Capacitor selection as per type of end-user. • Nature of load and load characteristics. • Harmonics from both within the plant and outside the plant. • Ambience. • Space available. • Safety and Security. • Cost Factor. Let us see these factors in a broader purview. 1) KVAR Requirements These requirements are worked out from a vector triangle wherein one puts in the KVA and p.f. of a plant (or KW and KVAR) where capacitors are to be put. 2) Voltage levels where p.f. Capacitors can be Installed If there is a choice available for voltage level, one should adopt for the higher voltage level for installing the capacitors.
  • 71. - 71 - 3) Type of End-user Small factories, individual establishments require small KVAR. They go in for LT capacitors with manual switch. Irrigation pumps, small compressors and other applications, wherein direct on line starters are used, go for small capacitors. These are connected through a fusible cut-out directly across motor terminals. Medium size establishments generally opt for LV capacitor banks with automatic controls. Larger establishments have both LT as well as HT capacitors depending on the plant spread, type of process followed etc. 4) Type of Load and Load Characteristics: There are some loads, which run at a steady power for a major portion of the day for example; city water supplying pumps, irrigation pumps, air compressors in an automobile shop, etc. The design margins as well as the types of capacitors selected (metalized polypropylene, mixed dielectric, etc.) are not very critical. On the other hand there are loads which are characterized by jerky operations all the time or which are frequently turned on and off. Those loads produce transients. Selection of type of capacitor is critical. Safety margins in their designs have to be high. Another point which influences the selection of capacitors is the load characteristic on a daily basis, as well as on a seasonal or yearly basis. The size of a capacitor bank selected as per the monthly average billing data will be very moderate. The actual load characteristic might demand much higher KVAR, if one wants to hold down the maximum demand during the peak operation period of the load. This type of load will also require multiple steps of KVAR with automatic control.
  • 72. - 72 - 5) Presence of Harmonics: Harmonics might be generated within the plant itself or they might be flowing from outside. These harmonics find an easy path through capacitor and a major portion of them drains through p.f. capacitors. These capacitors are over loaded. A safety margin by specifying a higher rated voltages or capacitors is necessary. 6) Ambients: Higher ambient temperature requires specific mention in the capacitor specifications. A point to be noted is operating temperature that a working capacitor is likely to attain. An HT capacitor at an elevated structure is very well cooled even under the sun, because there is normally sufficient air movement there. Sometimes a sunshade helps. On the other hand, an LT capacitor within a confirmed enclosure and with fuses and contactor coils adding to the heat liberated inside a badly designed cubicle can raise the capacitor temperature to dangerous levels. Thus specifying the next higher standard voltage level on capacitors may give sufficient safety margins against these high ambients. The ambient must be specified. This raises the cost of capacitors. 7) Space: Space within a building is costly. The capacitors and the control systems be the LT or HT, have to be enclosed or raised on a high enough platform. Enclosed capacitor banks require cable connections. Capacitor banks will have to be selected according to the space available.
  • 73. - 73 - 8) Safety and Security: Of all the electrical equipments, the dielectric insulation inside the capacitor has the highest voltage stress. The capacitors themselves quite often lead to generation of transients, resonances, continuous high voltage periods (at night times), etc. Thus capacitors are susceptible to early failures. This aspect cannot be overlooked. A failure can cause an explosion within a capacitor unit. Therefore while selecting a site for the capacitors, one should avoid locations in close proximity to high voltage CTs on incoming mains, power transformer, etc. 9) Cost Factor: A capacitor and its control and location can be ideally organized if due consideration is given to all the above factors. Yet it could be rendered redundant if the costs are not justifiable. An optimal design, which compromises in terms of the total costs, thus has to be worked out.
  • 74. - 74 - REFERENCES 1. Ajay V Deshmukh (2006) ‘Microcontrollers – Theory and Application’ New Delhi: Tata McGraw-Hill. 2. Ramakant A. Gayakward (2004) ‘Op-Amps and Linear Integrated Circuits’ Pearson Education 3. Sunil S. Rao (2003) ‘Switch Gear Protection and Power Systems – Theory, Practice and Solved Problems’ New Delhi: Khanna Publishers 4. Tagare D M (2004) ‘Reactive Power Management’ New Delhi: Tata McGraw-Hill