Вы находитесь на странице: 1из 70

Chapter 01

Introduction

1
1.1 Introduction

Electric power or energy has become an ultimate necessity nowadays; in today’s life
we can’t imagine life without electricity. By looking on the importance of electricity,
it is very important to discuss the means to use it efficiently so that the user feels at
ease.

Electrical system basically consists of two major components and those include
voltage and current. Electrical power can be actually defined as the product of applied
voltage and electrical current at any instant.

P ( t ) =v ( t ) . i( t)

Since, most modern electrical system is based on alternating current theory so for a
sinusoidal flow of current at any instant

v ( t )=Vm sin ( ωt +θv )

i ( t )=ℑ sin ⁡( ωt+θi )

Where, ω actually defines a full period of a sinusoidal wave, θi∧θv are their phase
angles and Vm∧ℑare their peak amplitudes .

2
1.2 What is Power Factor?

Power factor is actually the ratio of real i.e. working power and apparent power.
Power factor measurement actually includes phase angle delay between voltage and
current wave form.

Fig 1.1 Phase delay between Current and Voltage

Power factor can be measured according to mathematical calculation as

PF=cos ⁡(θ)

Where, θ is the phase delay between current and voltage waveforms.

Fig.1.2 Power Triangle

The concept of power factor can be made clearer using the power triangle as the
distribution system is composed of active (useful) and reactive (non-useful) power.
So, according to a power triangle

apparent power 2=real power 2+ reactive power 2

3
And

kW
Power factor=
kVA

1.3 Why Should We Be Concerned About Power Factor?

The main concern about power factor is based upon the fact that we are not able to
utilize the full electrical power being transmitted to us. Low power factor means that
you are wasting your power instead of making use of it. Low power factor means that
current waveform is either lagging or leading by some angle to voltage waveform.
The more the angle between the two waveforms it means the more energy you are
wasting.

There is another way of looking at this that the less the power factor is the higher the
current needed in order to perform the same amount of power factor. Low power
factor in transmission line means that you have to increase the size of the conductor in
order to transmit the same amount of real power at constant voltage as it has to carry
large current. Similarly, with the increase in current the I 2 R losses of the line
increases.

Fig 1.3 Power factor & current relation

Hence, the graph explains that the consumption of current is doubled when power
factor is decreased to half.

4
So, higher power factor can actually help in increasing the efficiency of your
electrical system as well as it may help in increasing the life span of your electrical
systems.

As the power factor decreases means the phase delay between the voltage and current
waveform increases which alternatively have an impact on the active and reactive
components of the current.

Considering a delay of about 30 degrees between the two we have active component
of the current as I∗cos 30=0.866 I and reactive component asI∗sin 30=0.5 I .
Similarly, if we consider a delay of about 60 degrees between the two we have active
component of the current as I∗cos 60=0.5 I and reactive component as
I∗sin 60=0.866 I. As, the delay increases active component of the current decreases
but the reactive component of the current increases and similarly, as the delay
decreases active component of the current increases but the reactive component of the
current decreases. So, actually power factor has great impact on kW and kVA
consumptions.

Another major concern is that when power factor falls below specific level, electrical
companies charge accordingly. So, you actually have to pay for the energy you don’t
utilize. So, improvements in power factor means that you only have to pay for the
energy utilized.

5
Fig 1.4 Power consumption comparison due to power factor

So we need to improve the power factor as close to unity as possible in order to


overcome such problems.

6
Chapter 2

Literature Review

7
2.1 Different Nature of Loads

The major of concern of power factor is with large industries and in electrical
distribution panels as they have to deal with much larger loads than the home
appliances used in local areas where the compensation of power factor is mostly of no
concern or say of very little concern that it can be ignored. So, in real world there are
three different kinds of loads that are resistive, inductive and capacitive. All these
loads show different behavior towards the distortion of power factor.

2.1.1 Resistive Load

In general resistive loads are considered to show unity power factor behavior.
Although the resistive loads have very limited existence in nature but they have no
impact on the distortion of current and voltage waveforms i.e. the phase delay
between the two is considered to be zero ideally in resistive loads.

Fig 2.1 Current and voltage waveforms behavior due to Resistive load

Since, the phase delay between the two waves is zero as shown in Fig 3.
So, θ=0
hence, cos (0)=1

So, resistive loads have unity power factor so there is no reason to deal with these
loads in terms of power factor hence no compensation is required in such loads.

8
2.1.2 Inductive load

Any kind of load that has coil in it is generally considered to be inductive. Examples
of inductive load are motors, solenoids, contactor coils, compressors, speakers, relays,
transformers, inductors.
Before understanding the inductive loads it is necessary to understand the basic
phenomena of induction. Electromagnetic induction is the phenomena in which
an electromotive force is produced across an electrical conductor because of a
changing magnetic field.

According to faraday’s law of electromagnetic induction any change in the magnetic


field of a coil of wire will cause an emf to be induced in the coil. This emf induced is
called induced emf and if the conductor circuit is closed, the current will also circulate
through the circuit and this current is called induced current. So, an induction
phenomenon actually generates some kind of magnetizing current means it draws
reactive power from alternating source.

In general inductive loads are considered to show lagging power factor behavior.
Most modern world has inductive nature of loads. When an inductive load is
introduced in an electrical system it starts to draw reactive power in demand for the
magnetizing current along with active power. So an inductive motor even at no load
shows 25 to 30 % of the full load current. All inductive system has similar behavior to
electric current. It actually distorts the current and voltage waveform. In inductive
loads the current lags the voltage by some angle θ which in case of resistive loads is
generally considered to be zero but for induction loads it is has some value so in such
kind of loads the power factor is always less than one due to the consumption of
reactive power.

9
Fig 2.2 Current and voltage waveforms behavior due to Inductive load

The above graph shows a behavior of partial inductive loads as in general the
inductive loads shows a poor power factor between 0.6 and 0.8. Hence, because of
such poor power factor the demand of magnetizing current increases and with that the
consumption of reactive power increases as the power factor falls below. So, the less
the power factor the more the current will flow through a machine ultimately at some
point the machine starts to resist it to a high extent and it will start to heat up thus
making the efficiency of its work too low that finally the machine will not be of any
use.

Fig 2.3 Induction motor showing consumption of active and reactive power

10
The figure clearly describes that how an induction motor draws active power along
with reactive power to finally make up apparent power.

But an ideal inductive load does not exhibit such kind of behavior. An ideal inductive
load leads the power to drop to drop to zero. So in an ideal inductive load the voltage
and current waveforms are 90 o apart from each other and hence an infinite amount of
current starts to flow through the electrical system. In an ideal inductive load there is
no active power consumption but the reactive power is fully consumed.

So, according to mathematical relations for ideal inductive load

Power factor=cos (90)=0

Or we can define it by using power triangle as

kW 0
Power factor= = =0
kVA 1

Since, the consumption of active power for ideal inductive load is 0 and that of
reactive power is 100%.

So, in case of inductive loads or say lagging power factor there is a severe need to
improve power factor as close to unity as possible in order for the electrical systems
to increase their efficiency thus making the system more and more perfect.

2.1.3 Capacitive Load

Although the most loads in real worlds are inductive and contribution of capacitive
loads are quite much smaller than the contribution of inductive loads. But still it is
necessary to understand these loads in order to overcome the problem of leading
power factor which generally does not occur but IT generators and AC power supplies
may exhibit capacitive nature and hence may leads towards the problem of leading
power factor. In order to understand it let’s consider the problem exhibition in IT
generators.

The generator controls its output voltage by constantly measuring it and adjusting the
current fed to the spinning electromagnet. If a load is suddenly applied to the

11
generator and the voltage drops, the regulator acts to slightly increase the
electromagnet current to maintain the desired output voltage. When the load has some
out-of-phase current, this current gives rise to a magnetic field within the generator
rotor that either adds to or partially cancels the magnetic field of the spinning
electromagnet. If the load has a leading out-of-phase current this actually adds to the
electromagnet field, and the regulator must reduce the excitation current to the
electromagnet to compensate. The voltage regulator has a limiting capacity of
maintaining the output voltage as the leading excitation current increases until a point
appears where the regulator stop delivering supply current. At this point the leading
out of phase current will be able to supply current to whole field and starts to produce
instability in output voltage. At this point the safety systems will shut down the whole
generation systems.

Fig 2.4 Single phase generator

So, as in nature the power factor distortion is because of two currents. One is the
excitation current while the other one is because of harmonics current. But this
problem of leading power factor is neither because of lagging reactive currents neither
because of harmonics current. Its reason is actually leading reactive currents that start
to supply making the actual source or supply of no use and causing problems.

The phase difference between voltage and current in leading power factor can be
shown by waveforms as

12
Fig 2.5 Current and voltage waveforms behavior due to capacitive load

As, the cos (θ) is generally able to define the power because of the difference between
the two waveforms but it does not decide whether it is leading or lagging so for an
ideal capacitive effect can be described to exhibit a power factor of zero as

Power factor=cos ( 90 )=0(leading)

Usually in transmission lines this problem occurs for a very small or no load because
of the line capacitance. So, in such cases receiving end voltage starts to increase as
compared to sending end voltage and hence the problem known as Ferranti effect
appears in transmission lines. Voltage rise due to leading power factor may give rise
to eddy current losses and hysteresis loss and may cause electrical stress on the
capacitor banks added in transmission lines.

Due to the increase in current due to leading power factor the line power losses
increases. There also rises heating issues in transformers due to increased current.

So, as in most cases the problem of leading power factor is ignored but there is a
crucial need for the detection and improvement of leading power factor as it makes
huge electrical stresses to the transmission line and backup generators.

2.2 COMPENSATION OF LAGGING & LEADING POWER


FACTORS

The compensation of resistive loads that usually have almost zero contribution in the
real world is not necessary but the compensation of leading and lagging power factor
as described in previous sections is necessary as their respective loads behavior can

13
cause serious problems. So, the before compensation the study for the methodology
for the compensation is a necessary requirement in order to implement it according to
the nature of loads.

There are two types of compensations in practical.

Passive Compensation

In passive compensation a low pass harmonic filter is


designed using the combination of capacitors and
inductors and added with the AC input. This method
generally is used for load of about 100W or smaller than
that.

Active Compensation

In active compensation control circuit such as


microcontroller based algorithm measures the phase
difference between voltage and current and hence
decides to add capacitors and inductors based on the
load using some sort of switching circuitries.

2.2.1 Power Factor Compensation of Lagging Loads

There are three types of compensations for lagging loads in general.

2.2.1.1 Capacitors Banks

The most common methodology of improvement of


lagging power factor is to use shunt capacitors with the
load. Adding the shunt capacitors in parallel with
inductive loads will help in decreasing the reactive
power hence improving the power factor. The
compensation of power factor through capacitors banks
results in decrease of consumption of current, increase
the power factor and improves the voltage regulation of

14
the systems. Capacitive compensation can be fixed or
either switched.

Fig 2.6 Reactive power consumption with & without capacitors

2.2.1.2 Synchronous Condensers

A synchronous motor takes a leading current when


over-excited and, therefore, behaves as a capacitor. An
over-excited synchronous motor running on no load is
known as synchronous condenser. When such a
machine is connected in parallel with the supply, it
takes a leading current which partly neutralizes the
lagging reactive component of the load. Thus the power

15
factor is improved using this methodology.

Fig 2.7 Synchronous Condenser

Synchronous condenser are generally used at large


industrial levels and the following points should be kept
in mind while installation of synchronous condenser.
I. Reliability of equipment installed.
II. Portable life
III. Capital cost
IV. Maintenance cost
V. Running cost
VI. Space required and ease of installation.

So, their applications and use become limited because of all these points and capacitor
bank make an advantage as most of these points are not of concern while adding
capacitor bank.

2.2.1.3 Phase Advancer

Phase advancers are used to improve the power factor of induction motors.
The low power factor of an induction motor is due to the fact that its stator
winding draws exciting current which lags be-hind the supply voltage by 90
degrees. If the exciting ampere turns can be provided from some other AC

16
source, then the stator winding will be relieved of exciting current and the
power factor of the motor can be improved. This job is accomplished by the
phase advancer which is simply an AC exciter. The phase advancer is
mounted on the same shaft as the main motor and is connected in the rotor
circuit of the motor. It provides exciting ampere turns to the rotor circuit at
slip frequency. By providing more ampere turns than required, the induction
motor can be made to operate on leading power factor like an over-excited
synchronous motor.

2.2.2 Power Factor Compensation of Leading Loads

The leading power factor as described is generally ignored in most practical works but
necessary actions are required in order to overcome this problem.

2.2.2.1 Removing load from generator

As, described in nature of loads that leading power


factor usually occurs in auto backup generators so to
overcome that first of all the load is removed from
generators in order to remove the source of out of phase
current. This actually leads the generator towards
stability as the current source is disconnected. Even if
the current is not fully vanished it will not cause as
much problem as less than 20% of the current is still
acceptable. It is a general rule to remove the devices
with highest capacitive ratings and then of low
capacitance.

2.2.2.2 Inductive Banks

An inductive load bank is simply a group of large


inductor coils placed on the generator bus. This
provides a fixed amount of lagging out-of-phase current
that can cancel the leading current due to the IT loads.
17
The inductive load bank is usually installed using
automatic switches methodology, which adds or
removes inductors as needed to balance the leading
reactive current.

Fig 2.8 Inductive Banks

18
Chapter 3

Hardware Design

19
Having dealt with the theoretical concepts and background of all the research work
that has been conducted now we come down to the hardware specifications of our
project. In this chapter we will explain to you about the components that have been
used and why they were effective in performing the required tasks. We will show
PCB designs and layouts to make you familiar with the internal workings of the
project.

3.1 Introduction

The hardware for the Automatic Power Factor Correction was designed in such a way
that individual boards performed separate functions, its hardware was broken down
into several logical chunks and the respective PCB’s were designed and fabricated
accordingly. This also meant that the user could easily understand the functioning of
each part and make a whole clear picture in his mind of how things are proceeding
logically.

Figure 3.1 Block Diagram of Hardware

20
3.1.1 Power Supply

In our project we needed three types of dc voltage levels. First of all we needed
positive 5V supply to power our microcontroller and current sensor. Then we needed
a positive 12V and negative 12V supply to give biasing to operational amplifiers used
in sine to square conversion. Positive 12V supply was also needed to power up relays.

All the power supplies and related designs were changed during project building due
to current limitation SIMCOM required 2A of current during SMS sending. Instead
any designed power supply we used a SMPS 5v and 2A.

3.1.1.1 Positive 5V supply

For a 5V supply we have used a 9V transformer which will provide an input of 9V to


rectifier stage after stepping down from 220V A.C. The rectifier stage will provide
pulsating DC which will be further smoothed by filtering capacitors. The filtering
capacitors are chosen according to datasheet recommendations (Reference Fig. 2 in
Appendix A). 4V will be dropped in to LM7805 whose maximum current handling
capacity is 1A. So, for the maximum current rating the power dissipation across IC
will be 4W and IC LM7805 has the capacity to withstand this dissipation but for
protection it is better to attach a heat sink along with it.

3.1.1.2 Positive 12V Supply

For a 12V supply we have used 18V transformer which will provide an input of 18V
to rectifier stage after stepping down 220V A.C. The rectifier stage will provide
pulsating DC which will be further smoothed by filtering capacitors. The filtering
capacitors are chosen according to datasheet recommendations (Reference Fig. 2 in
Appendix A). 6V will be dropped in to LM7812 whose maximum current handling
capacity is. So, for the maximum current rating the power dissipation across IC will
be 6W and IC LM7812 has the capacity to withstand this dissipation but for
protection it is better to attach a heat sink along with it.

21
3.1.1.3 Negative 12V Supply

For a negative 12V supply we have used a center tap 18V transformer which will
provide an input of 18V to rectifier stage after stepping down 220V A.C. The rectifier
stage will provide pulsating DC which will be further smoothed by filtering
capacitors. The filtering capacitors are chosen according to datasheet
recommendations (Reference Fig. 3 in Appendix A). 6V will be dropped in to
LM7912 whose maximum current handling capacity is 1A. So, for the maximum
current rating the power dissipation across IC will be 6W and IC LM7912 has the
capacity to withstand this dissipation but for protection it is better to attach a heat sink
along with it.

3.1.2 AC Transformers

3.1.2.1 Potential Transformers

Fig 3.2 Potential Transformer

In most of the cases where we have to measure or process the mains voltage we need
to step it down to a specified level so that we can easily work with it without any
danger so for that purpose mostly a potential transformer is used. The current in the
primary of potential transformer will be able to create a varying magnetic flux on the
secondary of the transformer which will induce voltage on the transformer with
respect to the number of turns given on primary and secondary side. So for the
measurement purpose it is necessary to induce step downed voltage according to our
requirement.

For the purpose of measurement in our project the potential transformer is connected
in parallel to our load.

22
We have designed 5V and 2A step down transformer.

Cross Sectional Area of formwork =3.3 cm∗3.8 cm=12.54 cm ².

42
Number of turn per volt = =3.349turn/ volt
12.54

Turns ∈ primary =3.349∗220=737 turns

Turns ∈secondary=3.349∗5=17 turns

Primary

For 10W power with 220V input, the current rating should be of 45mA as

P 10W
I= = =0.045 A
V 220 V

So, according to AWG standard wire gauge should be of 30. (Reference Table 1 in
Appendix A).

Secondary

For keeping the power constant at 10W and for a 5V step down requirement the
output current should be 2A.

P 10 W
I= = =2 A
V 5V

So, according to AWG standard wire gauge should be 18. (Reference Table 1 in
Appendix A).

3.1.2.2 Current Transformers

23
Fig 3.3 Current Transformer

A current transformer is similar to potential transformer but generally used for the
measurement purposes in order to measure the relative current of the load instead of
voltages but this relative current is converted to voltages using resistor of a specified
value and then it is fed in voltage form to further circuitries.

The current transformer is usually connected in series to load. We must ensure that
the current transformer is always in parallel with burden resistance and it should never
be an open circuit otherwise huge amount of voltage can be induced on secondary
side of a current transformer.

According to our estimated maximum load we calculated the current transformer


rating, as

S=0.85 kVA

S=VI

Primary

So,

S 850 VA
I= = =3.86 A
V 220 V

Secondary

For ratio of 1000:1

The current at the secondary should be 3.86mA.

Calculation burden resistance

Ip∗Rb
Eo=
Tr

5∗Rb
4=
1000

so , Rb=0.8 k Ω

24
As, the maximum input current is 3.86A and available transformer was of 5A so we
have selected it with the ratings of 5A to 5mA.

3.1.3 Zero Cross Detectors

In our most applications we require sensing and measurement of waveforms through a


microcontroller which gives us a decision based upon that waveforms but in our case
microcontroller requires a square wave to function properly so we have to convert our
sine wave to square wave through a circuit known as zero cross detector or sine to
square converter. It is a circuit which is used to convert sine wave to square wave so
that it can be fed into a microcontroller. There are two IC’s that can be used for sine
to square conversion. First is a comparator IC and other is op-amp. We have used op
amp because it is less costly and is widely used. We have used a 741 op amp IC for
that purpose. Its basic working principle is that op amp has two inputs so when one
input is greater than zero reference then it gives positive Vcc on output pin and when
it is less than zero reference we get negative Vcc on output pin. In our input side we
have used two diodes for the protection in case the voltage exceeds a level so that it
can clip the input voltage to 0.7 volts and -0.7 volts. We also have a resistor in series
in input to limit the current going to op amp. So in output we will get a square wave
between +Vcc and –Vcc with frequency same as that of AC mains i.e. 50 HZ.

25
Fig 3.4 Working of zero cross detector

3.1.4 Operational Amplifier

An operational amplifier got his name from ancient times when it was generally used
to perform all arithmetical operations.

LM741 is the most common operational amplifier used in today’s world. This is an
operational amplifier which means it works based on the difference between two
inputs. Although ideally it is considered when there is no difference between the two
inputs there should be no voltage at the output but in practical a DC offset appears
across the output. So to nullify such effects two offset null pins are embedded in
LM741. The input can be applied based on your applications to either of inverting or
non-inverting input. We have used non-inverting configurations as in our case both
the configurations work fine.

Fig 3.5 LM741 IC

3.1.5 Micro Controller board

The basic purpose of Microcontroller board is to power up and to provide necessary


clock required in order for the microcontroller to work properly.

Arduino Uno

The microcontroller we used in our project is Atmel 328 (Arduino Uno). The basic
purpose of giving it priority upon other controllers is its small size with number of
necessity pins required by us including two external interrupts used to detect the
difference between voltage and current zero crossings using the output of zero cross

26
detector as the input of external interrupts of microcontroller and 2 out of 6 ADC
channels are required for the measurement of incoming AC voltage and current
amplitude according to load.

Fig 3.6 Arduino Uno

3.1.6 16x2 LCD

We have used LCD of 16x2 in order to display voltage, current and power factor each
in separate row. There are 8 pins means 8 bits available for data but we have used
only 4 bits. The potentiometer is connected with it in order to control its brightness so
that the text on it is available.

Fig 3.7 20*4 LCD

27
3.1.7 Bridge Rectifier

Bridge rectifier is generally used in making power supplies to acquire pulsating DC


voltage but in our project we used it for acquiring the same pulsating DC but its
purpose is basically to serve ADC channel in order for it to measure the correct AC
voltage as ADC is able to work only upon DC voltage. For serving the purpose of
rectification we have selected 1N4007 diode as it is most commonly available and it’s
actually is a low frequency diode.

Fig 3.8 Bridge Rectifier

3.1.8 Voltage Divider

As, the voltage from bridge rectifier is a value higher than the voltage value
that can be fed to microcontroller so it is necessary for protection that it has to
catered using some mean so we used a potential divider in order to compensate
the voltage level. So we designed a voltage divider by using both the resistors
of same value in a configuration shown in fig. 14 so that every voltage level
that is the output of bridge rectifier should be divided in to half before it can be

28
fed to microcontroller as its input for further procedure based on
microcontroller algorithm.

Fig 3.9 Voltage divider

3.1.9 Switching Circuits

As, the compensation was required in two cases i.e. lagging and leading both but there
was no compensation required in resistive case. So, there will be two kinds of
circuitries to be designed accordingly.

3.1.9.1 Inductive load switching circuit

The switching circuitries of lagging load is designed in such a way that the load
remains in contact with the AC source in parallel. So, in order to do so AC phase is
connected to normally open of the relay and AC neutral is connected to one of the
terminals of the AC capacitor while the second terminal of the capacitor is connected
to the common terminal of the relay. For the operation of relay coil the normal
circuits are unable to provide sufficient current so to make the coil to perform its
operation it is necessary to provide the sufficient current by some means. Usually a
bipolar junction transistor will be able to provide this current from emitter to
collector. When sufficient power is applied at the base of the transistor the relay
connected to the collector of the transistor will be able to provide sufficient current to
the coil of the relay to energize and perform its electromagnetic operation to switch its
terminal. But we have used a 4 relays driver Module.

29
Fig 3.10 4xRelay Module

The common terminal which is actually the common emitter of all the bipolar
junction transistors is connected to 12V while a pulse is applied to the input (base of
the transistor) of the driver IC through a microcontroller which then further drives its
respective output (collector of the transistor).

3.1.9.2 Capacitive load switching circuit

The switching circuitries of leading load is designed in such a way that the load
remains in contact with the AC source in series. So, in order to do so AC phase is
connected to one of the terminals of load while AC neutral is connected the common
terminal of the relay. The load will be able to complete its path in two ways. First
when it is connected to the normally closed path of the relay bypassing the inductive
banks while the second through inductive banks which are further connected to the
normally open path of the relay. When sufficient current is provided at the INPUT of
the Relay module through a microcontroller pulse it allows the relay to energize its
coil in order to switch its contact between normally closed path to normally open path
and hence making the flow of current through capacitive loads ad inductive banks
combination instead of just allowing the flow of current through the load.

30
3.1.10 Compensation Calculation for Leading & Lagging Load

3.1.10.1 Lagging Load Compensation

0.6 Power Factor

I=358mA

θ=53.13

V=238V

S=VI*

S=VI∠ θ

S=51.12+68.16j

So

Pav =51.12W

Q 1=68.18 VAR

For improving to 0.99

θ=8.10

S=VI*

S=VI∠ θ

S=84.35+12.00j

Pav =84.35W

Q2=12.00 VAR

Q 1−Q 2=56.16VAR

E2
Q=
X

So,

31
X=1008

1
X=
2 πfC

1
C=
2 πXf

Hence

C=3.13uF

0.7 Power Factor

I=373mA

θ=45.57

V=238V

S=VI*

S=VI∠ θ

S=62.14+63.3j

So

Pav =62.14W

Q1=68.18 VA

For improving to 0.99

θ=8.10

S=VI*

S=VI∠ θ

S=87.8+12.5j

32
Pav =87.8W

Q 2=12.5 VAR

Q 1−Q2=50.8VAR

E2
Q=
X

So,

X=1115

1
X=
2 πfC

1
C=
2 πXf

Hence

C=2.85uF

0.8 Power Factor

I=234mA

θ=36.86

V=238V

S=VI*

S=VI∠ θ

S=44.5+33.4j

So

Pav =44.5W

33
Q 1=33.4 VA

For improving to 0.99

θ=8.10

S=VI*

S=VI∠ θ

S=55.13+7.8j

Pav =55.13W

Q2=7.8 VAR

Q 1−Q 2=25.6VAR

E2
Q=
X

So,

X=2212

1
X=
2 πfC

1
C=
2 πXf

Hence

C=1.43uF

34
3.1.11 Sim900A Module

SIM900A is a GSM based module works only at 2G/3G bandwidth, capable of


sending and receiving calls and SMS. This is Chinese module designed only for Asian
countries and works only in 1800/900 band.

Fig 3.11 SIM900A module pin diagram

3.1.11.1 Aspects of Node MCU:

 Dual-Band 900/ 1800 MHz


 GPRS multi-slot class 10/8
 GPRS mobile station class B
 Compliant to GSM phase 2/2+
o Class 4 (2 W @ 900 MHz)
o Class 1 (1 W @ 1800MHz)

 Dimensions: 24x24x3mm
 Weight: 3.4g

35
 Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced AT
Commands)
 SIM application toolkit
 Supply voltage range : 3.2 ... 4.8V
 Low power consumption: 1.0mA(sleep mode)
 Operation temperature: -40°C to +85 °C
 Interfaces
o Interface to external SIM 3V/ 1.8V
o Analog audio interface
o RTC backup
o SPI interface (option)
o Serial interface
o Antenna pad
o I2C
o GPIO
o PWM
o ADC

This Module interface with the Arduino with SPI (we are using Software Serial). To
communicate and configure this module we are using AT commands in Arduino and
sending them to SIMCOM over TX/RX lanes. This module will get the info about the
Power factor break down and it will send a message to the defined user. After the
correction of the power factor another message will be send to the same user that the
power factor is now correct. This module is configured in sms sending mode only for
this project.

3.1.11.2 Working

After uploading the Code in the Arduino there is a 1 min loop, a predefined loop time for
sim900a to register itself to the mobile network. After that a function is called and run all the
SIM900A configurations code line e.g. configure the SIMCOM to SMS mode only, set the user
mobile number and send a message to confirm all the setting are done correctly. If any
power factor issue appears another function will be called and low power factor related

36
message will be sent to the same user. After the correction is done another function will call
and inform the user that the power factor is corrected.

3.2 SCHEMATICS

Fig 3.12 5V Regulated Supply

Fig 3.13 complete Circuit Diagram

37
3.3 PCB LAYOUTS

Fig 3.14 complete PCB Layout

3.4 FINAL DESIGN

Fig 3.28 Power Supplies Hardware

38
Fig 3.29 Zero Cross Detectors Hardware

Fig 3.30 Generic Board Hardware

39
Fig 3.32 Current Sensor ACS712

Fig. 3.33 Full Hardware

40
Fig. 3.34 Both Lagging & Leading Load

41
Chapter 4

Software Implementation

42
4.1 Software Logic

The basic implementation of logic has been done on Arduino IDE software. In our
code firstly we are measuring our current and voltage values at supply end using ADC
channels. Voltage measuring is quite simple just note the ADC output and multiply it
with the some transfer functions of our design parameters, for current measure the
ADC value using sampling technique and obtain max and min value of ADC and we
subtract max value with min value to have the difference then from that difference we
measure the current.

We have supplied our output of zero cross detector of current and voltage to the
external interrupts. 1st rising edge of current and voltage decides the power factor of
leading or lagging. 1st rising edge start the timer and other rising edge stops the timer
and from that time difference we calculate the Cos (ϴ).

This Cos (ϴ) decides you power factor and how much compensation is required. After
that we have some ranges of power factor drop, according to load and power factor
we power up the switch in switching circuit to perform the compensation.

43
4.2 Software Logic Flow Chart

Fig 4.1 Functional Flow Chart

44
4.4 Software Logic of SIM900A

The software logic for sim900A is written in the Arduino code has it’s on board
cannot be program directly, instead it can be configured. The pre-written program of
sim900A allow us to configure the sim900a module with AT commands combination.
Arduino starts with its configuration settings. Sim900A module is set in the SMS
mode. User cell phone is then configure in it in international mobile number format.
During normal routine program, whenever power factor is dropped an alert is
generated and trigger the sim900a function to send the user a sms to inform that
power factor is reduce from its threshold. A power factor correction sub routine is
also call and correct this bad power factor and again call the sim900a to inform that
corrections have been made. All the configuration are send to the sim900a through
SPI (using a software serial). Sim900a support baud rate from 9600 to 115200.

4.5 Flow Chart of Sim900A

Initializing

Receiving
Configuration

Setup User
Phone Number

Send SMS as
notification to
user
Fig 4.2 SIM900A Flow Diagram

45
Conclusion:

Our project basically deals with both lagging power factor that is generally dealt in
practical along with leading power factor. There are practical limitations of this
project that capacitors and inductors of every rating are not available in market so we
had a great difficulty to improve power factor as a result our results were not very
accurate. Overall we had a great idea now that how power factor its compensation and
monitoring works.

46
Chapter 5

References

47
APPENDIX

APPENDIX A)

Tables & References

Reference Table 1

48
Reference Fig. 1

Reference Fig. 2

Reference Fig. 3

49
Reference Fig. 4

Reference Fig. 5

50
Reference Fig. 6

APPENDIX B)

Code for Power Factor Correction

// include the library code:

#include <LiquidCrystal.h> //LCD Library

#include <Math.h> // Sin Cos functions and other Mathematical calculations

#include <SoftwareSerial.h> // Sim800 communications

#include "ACS712.h"

// initialize the library by associating any needed LCD interface pin

51
// with the arduino pin number it is connected to

const int rs = 13, en = 12, d4 = 11, d5 = 10, d6 = 9, d7 = 8;

LiquidCrystal lcd(rs, en, d4, d5, d6, d7);

float theta = 0;

float theta_temp = 0;

float rad = 0;

float PF = 0;

float RF = 0;

float F_PF = 0;

int PulseRead = 2;

int R1 = A2;

int R2 = A3;

int R3 = A4;

int L1 = A5;

int L2 = 5;

int relay_count = 0;

int inductor_count = 0;

int Cin = 3;

int Vin = 4;

int Cout = A0;

int Vout = A1;

volatile byte LeadLag = 0; /// "0= lag, 1= lead"

52
volatile byte PF_LL =0;

volatile unsigned long duration = 0; // variable to measure Pulse width

volatile unsigned long duration_temp = 0;

unsigned long duration_sum = 0; //Eliminate run time errors

float theta_error = 0; //Error Correction

SoftwareSerial sim(6, 7); // Rx-6 & Tx-7

float High_peak,Low_peak; //Variables to measure or calculate

float Amps_Peak_Peak, Amps_RMS, Volts_RMS, Volts_Peak_Peak;

float V_res = 0.0048875;

volatile float A_Power = 0;

volatile float R_Power = 0;

float Real_Power = 0;

void setup() {

Serial.begin(9600);

sim.begin(9600);

Serial.println("Setup stared");

// XOR gate input

pinMode (PulseRead, INPUT);

53
// Lead or Lag identification reference siganl

pinMode (Cin, INPUT);

pinMode (Vin, INPUT);

pinMode (Cout, INPUT);

pinMode (Vout, INPUT);

///////relay outputs///////

pinMode (R1, OUTPUT); // cap 1

pinMode (R2, OUTPUT); // cap 2

pinMode (R3, OUTPUT); // cap 3

pinMode (L1, OUTPUT); // ind 1 (choke)

pinMode (L2, OUTPUT); // ind 3 (choke)

// set up the LCD's number of columns and rows:

lcd.begin(16, 2); //Turn On the LCD

lcd.cursor(); // turn on the cursor:

// Serial Communication start

// configure SIM Module

for(int i=1; i!=0; i--)

lcd.clear();

lcd.home();

lcd.print("wait for 1 min...");

//lcd.print(theta);

54
lcd.setCursor(0, 1);

lcd.print(i);

lcd.print(" secs");

delay(1000);

simConfig();

sei();

EICRA |= B00001100;

EIMSK |= B00000010;

//Serial.print("hello Starting the project\n");

//lcd.clear();

//lcd.home();

//lcd.print("LCD is");

// lcd.print(theta);

//lcd.setCursor(0, 1);

//lcd.print("ONNN");

//lcd.print(PF);

//delay(2000);

// GetPulse();

//theta_error = (2 * 180 * 50 * duration / 1000000); // find the angle in degrees

Serial.println("Setup Ended");

55
}

void loop() {

Serial.println("Loop stared");

// delay(100);

// cli();

// get zero crossing pulse

GetPulse(); // get pulse duration

Serial.println("Pulse Read complete");

read_Amps(); //Launch the read_Amps function

Serial.println("Current Read Complete");

Amps_RMS = (Amps_Peak_Peak*0.3536*0.06) - 0.1;


//Amps_Peak_Peak*0.3536*0.06 //0.1 is error current

Serial.println(Amps_RMS);

read_Volts();

Serial.println("Voltage Read Complete");

Volts_RMS = (Volts_Peak_Peak*2*24) - 2.3; // Volts_Peak_Peak*2*40 /// 2.3 is


error voltages

Serial.println(Volts_RMS);

theta = (2 * 180 * 50 * duration / 1000000); // find the angle in degrees

if (theta > 360)

theta = 360 - theta;


56
}

// if (theta_error > 360)

// {

// theta_error = 360 - theta_error;

// }

// if (theta < 0)

// {

// theta = theta * (-1);

// }

// if (theta_error < 0)

// {

// theta_error = theta_error * (-1);

// }

// //theta_error = 0.15 * theta; // error in theta

// theta = theta - theta_error; // error corrections

theta = abs(theta);

Serial.print("theta ="); Serial.println(theta);

// Serial.print("theta_error ="); Serial.println(theta_error);

rad = theta * (3.1415 / 180);

PF = cos(rad); // active power

RF = sin (rad); // reactive power

float A_power = ((Amps_RMS * Volts_RMS) * PF); // active power = power*cos(PF)

57
float R_power = Amps_RMS * Volts_RMS * RF; // reactive power = power*sin(PF)

lcd.clear();

lcd.home();

lcd.print("theta = ");

lcd.print(theta);

lcd.setCursor(0, 1);

lcd.print("PF = ");

lcd.print(PF);

delay(1000);

if (PF < 0.90) PFLowAlert();

if (PF_LL <= 2) Serial.println(" Lagging ");

else if (PF_LL >= 3) Serial.println (" Leading ");

// if (LeadLag <= 5) Serial.println(" Lagging ");

// else if (LeadLag > 5) Serial.println (" Leading ");

displayinfo(A_power,R_power);

if (relay_count == 0) F_PF = PF;

Serial.print(" PF_LL = "); Serial.println(PF_LL);

Serial.print(" Current in amps = "); Serial.println(Amps_RMS);

Serial.print(" Voltages = "); Serial.println(Volts_RMS);

Serial.print(" Active Power = "); Serial.print(A_power/1000); Serial.println("Kw");

Serial.print(" Reactive Power = "); Serial.print(R_power/1000); Serial.println("Kw");

// sei();

58
Serial.println("Loop Ended");

Serial.println("");

Serial.println("");

Serial.println("");

Serial.println("");

Serial.println("");

Serial.println("");

void read_Amps() //read_Amps function calculate the difference between the


high peak and low peak

{ //get peak to peak value

int cnt; //Counter

High_peak = 0; //We first assume that our high peak is equal to 0 and low peak is
1024, yes inverted

Low_peak = 1024;

for(cnt=0 ; cnt<300 ; cnt++) //everytime a sample (module value) is taken it


will go through test

float ACS_Value = analogRead(Cout); //We read a single value from the module

59
if(ACS_Value > High_peak) //If that value is higher than the high peak
(at first is 0)

High_peak = ACS_Value; //The high peak will change from 0 to that


value found

if(ACS_Value < Low_peak) //If that value is lower than the low peak (at
first is 1024)

Low_peak = ACS_Value; //The low peak will change from 1024 to that
value found

} //We keep looping until we take all samples and at the


end we will have the high/low peaks values

Amps_Peak_Peak = High_peak - Low_peak; //Calculate the difference

void read_Volts() //read_Amps function calculate the difference between the


high peak and low peak

{ //get peak to peak value

int cnt; //Counter

60
High_peak = 0; //We first assume that our high peak is equal to 0 and low peak is
1024, yes inverted

Low_peak = 1024;

for(cnt=0 ; cnt<300 ; cnt++) //everytime a sample (module value) is taken it


will go through test

float ACS_Value = analogRead(Vout); //We read a single value from the module

if(ACS_Value > High_peak) //If that value is higher than the high peak
(at first is 0)

High_peak = ACS_Value; //The high peak will change from 0 to that


value found

if(ACS_Value < Low_peak) //If that value is lower than the low peak (at
first is 1024)

Low_peak = ACS_Value; //The low peak will change from 1024 to that
value found

61
} //We keep looping until we take all samples and at the
end we will have the high/low peaks values

Volts_Peak_Peak = High_peak * V_res; //Calculate the difference

void displayinfo(float A_power, float R_power)

float A = A_power;

float R = R_power;

lcd.clear();

lcd.home();

lcd.print("V = "); lcd.print(Volts_RMS); lcd.print("V ");

lcd.setCursor(0, 1);

lcd.print("I = "); lcd.print(Amps_RMS); lcd.print("A");

delay(1200);

lcd.clear();

lcd.home();

lcd.print("P = "); lcd.print(A/1000); lcd.print("KW");

lcd.setCursor(0, 1);

lcd.print("Q = "); lcd.print(R/1000); lcd.print("KW");

delay(1200);

62
lcd.clear();

lcd.home();

lcd.print("PF = "); lcd.print(PF);

lcd.setCursor(0, 1);

lcd.print("FP_type= "); if (PF_LL <= 1) lcd.print("Lagging");

else if (PF_LL >= 2) lcd.print ("Leading");

delay(1200);

void simConfig()

lcd.home();

lcd.print("Configuring Sim");

lcd.setCursor(0, 1);

lcd.print("Module Wait....");

delay(1000);

sim.print("AT"); // communcation Handshake

//lcd.print("AT");

sim.println("AT+CMGF=1"); //Set to Text mode

63
sim.println("AT+CMGS=\"+923086116331\""); // Set Mobile Number to Send
SMS

sim.print("Sim Module is Configure Successfully"); // set the Txt MSG to be sent

sim.write(26); // ASCII to send msg

lcd.clear();

lcd.home();

lcd.print("configure 100%");

lcd.setCursor(0, 1);

lcd.print("Notification ");

delay(1000);

lcd.clear();

lcd.home();

lcd.print("Sent to your ");

lcd.setCursor(0, 1);

lcd.print( "Mobile number");

delay(1000);

void PFLowAlert()

/////// if Power Factor is reduced from 0.75/////////

// 1. save the faulty power factor

64
// 2. display msg on LCD power factor is below limit

// 3. call the PF correction function.

PFCorrection();

lcd.clear();

lcd.home();

lcd.print(" PF Error ");

lcd.setCursor(0, 1);

lcd.print( "Correction start");

delay(1200);

if ((PF < 0.90) && (relay_count == 0) && (PF_LL <= 1)) {

(digitalWrite (R1, HIGH));

(digitalWrite (L1, LOW));

(digitalWrite (L2, LOW));

relay_count = 1;

inductor_count = 0;

else if ((PF < 0.90) && (relay_count == 1) && (PF_LL <= 1)) {

digitalWrite (R2, HIGH);

(digitalWrite (L1, LOW));

(digitalWrite (L2, LOW));

inductor_count = 0;

relay_count = 2;

65
}

else if ((PF < 0.90) && (relay_count == 2) && (PF_LL <= 1)) {

digitalWrite (R3, HIGH);

(digitalWrite (L1, LOW));

(digitalWrite (L2, LOW));

relay_count = 3;

inductor_count = 0;

else if ((PF < 0.90)&&(inductor_count == 0) && (PF_LL >= 2))

digitalWrite (L1, HIGH);

digitalWrite (R1, LOW);

digitalWrite (R2, LOW);

digitalWrite (R3, LOW);

inductor_count = 1;

relay_count = 0;

else if ((PF < 0.90) && (inductor_count == 1) && (PF_LL >=2))

digitalWrite(L2, HIGH);

digitalWrite (R1, LOW);

digitalWrite (R2, LOW);

66
digitalWrite (R3, LOW);

inductor_count = 2;

relay_count = 0;

if (relay_count > 0 && PF > 0.95) {PFCorrectionAlert();}

if (inductor_count > 0 && PF > 0.95) {PFCorrectionAlert();}

lcd.clear();

lcd.home();

lcd.print("Faulty PF = "); lcd.print(F_PF);

lcd.setCursor(0, 1);

lcd.print("New PF = "); lcd.print(PF);

delay(1200);

void PFCorrection()

sim.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode

delay(100); // Delay of 100 milli seconds or 0.1 second

sim.println("AT+CMGS=\"+923086116331\"\r"); // Replace x with mobile number

delay(100);

sim.println("Power Factor is Below threshold, automatic correction is in process. PF


correction will be notify");// The SMS text you want to send

67
delay(100);

sim.println((char)26);// ASCII code of CTRL+Z

void PFCorrectionAlert()

//////As the PF is Corrected and new Values are shown on LCD, its time to send an
sms to mobile

sim.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode

delay(100); // Delay of 1000 milli seconds or 1 second

sim.println("AT+CMGS=\"+923086116331\"\r"); // Replace x with mobile number

delay(100);

sim.println("Power Factor is corrected");// The SMS text you want to send

delay(100);

sim.println((char)26);// ASCII code of CTRL+Z

void GetPulse()

Serial.println("GetPulse function running");

duration_sum = 0;

68
//PF_LL = 0;

for (int i = 0; i <= 5; i++)

duration = pulseIn (PulseRead, HIGH, 1000000UL);

Serial.print("itration # ="); Serial.println(i);

Serial.print("Duration ="); Serial.println(duration);

if (duration < 50) {

i--;

duration_sum = duration_sum;

else {

duration_sum = duration_sum + duration;

if (LeadLag <= 5) {if(PF_LL == 0){PF_LL = PF_LL;} else PF_LL = PF_LL - 1;}

if (LeadLag > 5) {if (PF_LL > 5){PF_LL = 5;} else PF_LL = PF_LL + 1;}

duration = duration_sum / 5;

Serial.print("Duration ="); Serial.println(duration);

Serial.print("PF_LL = "); Serial.println(PF_LL);

Serial.print("LeadLag = "); Serial.println(LeadLag);

69
ISR (INT1_vect)

LeadLag = 5;

for (int i=0; i<5; i++)

////// intrupting the Current pulse and checking voltage pulse if its already there or
not

if (PIND & B00010000) LeadLag = LeadLag - 1; //Lagging

else LeadLag = LeadLag + 1; //Leading

*********************************************************
* End of the Program *
*********************************************************

70

Вам также может понравиться