Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The project is designed to reduce the power loss in industries by power factor
Power factor is defined as the ratio of real power to apparent power. This definition
is often mathematically represented as KW/KVA, where the numerator is the active (real)
power and the denominator is the (active + reactive) or apparent power . Reactive power is
the non working power generated by the magnetic and inductive loads, to generate magnetic
flux. The increase in reactive power increases the apparent power, so the power factor also
decreases. Having low power factor, the industry needs more energy to meet its demand, so
In this proposed system the time lag between the zero voltage pulse and zero
mode are fed to two interrupt pins of the microcontroller. Microcontroller displays the
power loss due to the inductive load on the LCD. The program takes over to actuate
appropriate number of relays at its output to bring shunt capacitors into the load circuit to
get zero power loss. The 8 bit microcontroller used in the project belongs to 8051 family.
Further the project can be enhanced by using thyristor control switches instead of
relay control to avoid contact pitting often encountered by switching of capacitors due to
BLOCK DIAGRAM
BENEFITS OF POWER FACTOR IMPROVEMENT
Most benefits provided by a power factor improvement system from the reduction of
reactive power in the system. This may result in
Maximum benefits are obtained when capacitors are located at low power-factor levels.
Although reducing the power bill is still primary reason for improving the power factor,
and it is becoming more important because of conservation of energy, the function of
releasing system capacity is sometimes the decisive factor.
2. POWER-FACTOR FUNDAMENTALS:
The normal relationship of these two components of current to each other, to the total
current, and to the system voltage is explained in Fig-1. It shows that the active current
and reactive current add vectorially to form the total current which can be determined
from the expression,
Total current = I = √(ICos Φ )2 + (ISin Φ )2
At a given voltage, V, the active, reactive and apparent power are proportional to current
and are related as follows:
DEFINITION OF POWER-FACTOR:
The power factor is defined as the ratio of active power to apparent power in a circuit. It
varies from one to zero but is generally given as below:
Power Factor = cosine of angle between active power and apparent power
= Cos Φ
Suppose a transformer load (in the power plant used in DOT) takes an active load of 80A
and a reactive load of 60A from the mains, the total or line current will be of v802 + 1002
= 100 Amps. If a capacitor is installed so that it will supply the reactive current of 60A,
then the supply needs to deliver only 80A to the exactly same load of the transformer. The
supply circuit is now carrying only active power, hence the system capacity is not wasted
in carrying reactive power.
Now, if we increase the capacity of capacitor further to increase the reactive current, the
excess reactive current tends to flow towards the mains, causing the leading power-factor,
which is also not advisable in the view of Electricity authorities.
Calculation of methods of power-factor improvement.
From the right triangle relationship shown in Fig.1, the simple and useful
mathematical expressions may be written.
Because the active power component usually remains constant and the apparent
power and reactive power components change with the power factor, the expression
involving the active power component is the most convenient one to analyse. This
expression may be written as
Example: Find the capacitor rating required to improve the power factor of a 50KW load
from 0.76 to 0.93
VOLTAGE IMPROVEMENT
Although capacitors raise a circuit voltage, it is rarely economical to apply them in
industrial plants for that reason alone. The following approximate expression shows the
importance of reducing the reactive power component of a current in order to reduce the
voltage drop.
∆V ≈ RI cos Ф ± XI sin Ф
Typically, reactive power flow produces a voltage drop. Since the power factor acts
directly to reduce reactive power flow, it is most effective in reducing voltage drop.
POWER SYSTEM LOSSES:
Although the financial return from conductor loss reduction is seldom sufficient to justify
the installation of capacitors, it is an attractive additional benefit. System conductor
losses are proportional to current squared, and since current is reduced in direct
proportion to power factor improvement, the losses are inversely porportional to the
square of the power factor.
3. KVAR required to improve the PF to 1.0 = 326.1 x 0.776 (MF) = 253 KVAR
Month Interest on the Expenditure due to Return of cost due Balance amt. to be
investment made watt loss of to incentive recovered
@ 5 % PA capacitor
0 0 0 0 237,000
1 995 284 39,466 198,813
2 835 284 39,466 160,466
3 674 284 39,466 121,958
4 512 284 39,466 83,289
5 350 284 39,466 44,456
6 187 284 39,466 5,461
Awareness of the necessity of power quality and reliable supply is increasing, and Power
Quality Monitoring, Power Management, Power Quality Solutions and Power Factor
Correction are implemented on a growing scale. Enhancing power quality, stabilization of
the power supply, cost reduction and even climatic protection – these are targets that can
be realized by PQS.
EPCOS is the world leading manufacturer of PFC-capacitors with global presence – not
only in terms of plants and sales offices. With a broad network of application experts we
are not just offering technology – we offer Power Quality Solutions. The portfolio
provides all PQS-key components that are mandatory for a successful and effective
power factor correction and harmonic filters:
7 series of PFC-Capacitors
4 types of PFC-Controllers
3 types of Harmonic Filters
2 types of Thyristor modules for Dynamic PFC
2 types of Capacitor Contactors
The combination of first class technology and products, engineering and application
know-how makes EPCOS the first choice for Power Quality Solutions!
Product range
EPCOS PFC capacitors - used with the corresponding application technology - can
handle all PFC problems even with high harmonic pollution.
EPCOS supplies all the components providing the latest tools and solutions for all kind of
PFC and harmonic filtering problems.
Three well proven technologies build the fundament for the various capacitor families:
MKK: Concentric winding, polypropylene film, impregnation inert gas
MKP/MPP: Stacked winding, polypropylene film, impregnation biodegradable
soft resin
MKV: Double sided metallised paper as electrode carrier, polypropylene film
dielectric, with impregnation oil
Out of these three technologies, you can choose the appropriate capacitors for all
branches, applications and for all purposes:
The widest range of LV PFC-capacitors in industry will perfectly match to your needs in
any specific application:
PhaseCap: Premium quality, high technology capacitor for standard
and detuned PFC applications.
PhaseCap Compact: Improved capacitor based on the successful
PhaseCap MKK design.
PhaseCap HD: Heavy duty type, higher power in a case.
MKV-capacitors: For high harmonic contents or high ambient
temperature applications.
PhiCap: Cost effective design, for all indoor applications.
PoleCap: Outdoor applications or in surroundings with high dust-
or moisture presence.
HomeCap: Capacitors for enegy savings in residential homes.
R&D expenses far above the market standards guarantee a continuous high innovation
rate. Five factories around the globe are ensuring highest production capacities and
supply guarantee. With a strong application and solution support from EPCOS experts
from allover the world, dedicated to PFC and Power Quality Solutions, we are
continuously improving our services to our customers.
PFC controllers
The PF-controller acts as the “brain” of a PFC-system. Its major task is to supervise the
pre-defined cos-phi-value: when the switching threshold (C/k-value) is exceeded, the PF-
controller will switch on or off particular capacitor steps. Generally spoken, the PF-
controller has to maintain a certain monthly average cos-phi-value. It is mandatory that
the controller protects the capacitor against an excessive number of switching operations
which would significantly influence the life expectancy of the PFC-system.
The PF-controller series BR6000 from EPCOS represent an innovative and intelligent
concept with a high number of customer benefits and user-friendly features.
Harmonics filters
The increasing use of modern power electronics (e.g. drives, uninterruptible power
supplies, etc) produces nonlinear current, influences and loads the network with
harmonics.
These resonance phenomena can be avoided by connecting capacitors in series with filter
reactors. Detuned systems are scaled so that the self resonant frequency is below the
lowest line harmonic. The detuned PFC system is purely inductive seen by harmonics
above this frequency. For the fundamental line frequency (e.g. 50 Hz), the detuned
system acts purely capacitively, thus correcting the reactive power.
Capacitor contactors by EPCOS are especially designed for damping of these hazardous
inrush currents. Their reduction also avoids transients and voltage sags – thus improving
power quality and stability. We offer a very broad contactor range from 12,5 till 100kvar.
Benefits:
Longer useful life of main contactors of capacitor contactor
Soft switching of capacitor and thus longer useful life
Enhanced mean life expectancy of PFC system
Reduced ohmic losses
Leading contacts with wiper function
Tamper-proof and protected resistors
Easy access for cable connectionDynamic PFC
Dynamic PFC
With the TSM-series, EPCOS offers an output range for capacitive loads from 10 to 200
kvar, for 400V up to 690V grid voltage.
3.3 MICROCONTROLLER
A microcontroller (also MCU or µC) is a functional computer system-
on-a-chip. It contains a processor core, memory, and programmable
input/output peripherals. Microcontrollers include an integrated CPU,
memory (a small amount of RAM, program memory, or both) and
peripherals capable of input and output. Microcontrollers are used in
automatically controlled products and devices.
BASICS:
A designer will use a Microcontroller to
Gather input from various sensors
Process this input into a set of actions
Use the output mechanisms on the Microcontroller to do
something useful.
MEMORY TYPES:
RAM:
Random access memory.
Ram is a volatile (change) memory.
It general purpose memory that can store data or programs.
Ex: hard disk, USB device.
ROM:
Read only memory.
Rom is a non volatile memory.
This is typically that is programmed at the factory to have certain
values it cannot be changed.
Ex: cd...
3.3.1 ARCHITECTURE OF AT89C51
8051 Architecture:
8051 Architecture contains the following:
CPU
ALU
I/O ports
RAM
ROM
2 Timers/Counters
General Purpose registers
Special Function registers
Crystal Oscillators
Serial ports
Interrupts
PSW
Program Counter
Stack pointer
Pin Description:
DESCRIPTION OF AT89C51:
OSCILLATOR CHARACTERISTICS:
IDLE MODE:
In idle mode, the CPU puts itself to sleep while all the on chip
peripherals remain active. The mode is invoked by software. The content of
the on-chip RAM and all the special functions registers remain unchanged
during this mode. The idle mode can be terminated by any enabled interrupt
or by a hardware reset. It should be noted that when idle is terminated by a
hard ware reset, the device normally resumes program execution, from
where it left off, up to two machine cycles before
the internal reset algorithm takes control. On-chip hardware inhibits access
to internal RAM in this event, but access to the port pins is not inhibited. To
eliminate the possibility of an unexpected write to a port pin when Idle is
terminated by
Reset, the instruction following the one that invokes Idle should not be one
that writes to a port pin or to external memory.
3.3.2 PIN DIAGRAM OF AT89C51
AT 89C51
3.3.3 PIN DESCRIPTION
VCC:
Supply voltage.
GND:
Ground.
Port 0:
Port 0 is an 8-bit open-drain bi-directional I/O port. As an output port,
each pin can sink eight TTL inputs. When 1s are written to port 0 pins, the
pins can be used as high impedance inputs. Port 0 may also be configured to
be the multiplexed low order address/data bus during accesses to external
program and data memory. In this mode P0 has internal pull-ups. Port 0 also
receives the code bytes during Flash programming, and outputs the code
bytes during program verification. External pull-ups are required during
program verification.
Port 1:
Port 1 is an 8-bit bi-directional I/O port with internal pull-ups. The
Port 1 output buffers can sink/source four TTL inputs. When 1s are written
to Port 1 pins they are pulled high by the internal pull-ups and can be used as
inputs. As inputs, Port 1 pins that are externally being pulled low will source
current (IIL) because of the internal pull-ups. Port 1 also receives the low-
order address bytes during Flash programming and verification.
Port 2:
Port 2 is an 8-bit bi-directional I/O port with internal pull-ups. The
Port 2 output buffers can sink/source four TTL inputs. When 1s are written
to Port 2 pins they are pulled high by the internal pull-ups and can be used as
inputs.
Port 2 pins that are externally being pulled low will source current (IIL)
because of the internal pull-ups.
RST:
Reset input a high on this pin for two machine cycles while the
oscillator is running resets the device.
ALE/PROG:
Address Latch Enable output pulse for latching the low byte of the
address during accesses to external memory. This pin is also the program
pulse input (PROG) during Flash programming. In normal operation ALE is
emitted at a constant rate of 1/6 the oscillator frequency, and may be used for
external timing or clocking purposes. Note, however, that one ALE pulse is
skipped during each access to external Data Memory.
PSEN:
Program Store Enable is the read strobe to external program memory.
When the AT89C51 is executing code from external program memory,
PSEN is activated twice each machine cycle, except that two PSEN
activations are skipped during
each access to external data memory.
EA/VPP:
XTAL1:
Input to the inverting oscillator amplifier and input to the internal
clock operating circuit.
XTAL2:
Output from the inverting oscillator amplifier.
BLOCK DIAGRAM:
But also remain the same dc values even if the input dc voltage
changes. This voltage Regulation is usually obtained using one of a number
of popular voltage regulation IC Units.
TRANSFORMER:
RECTIFIER:
The full wave rectifier conducts during both positive and negative half
cycles of input a.c. input; two diodes are used in this circuit. The a.c. voltage
is applied through a suitable power transformer with proper turn’s ratio. For
the proper operation of the circuit, a center-tap on the secondary winding of
the transformer is essential.
During the positive half cycle of ac input voltage, the diode D1 will be
forward biased and hence will conduct; while diode D2 will be reverse
biased and will act as open circuit and will not conduct.
In the next half cycle of ac voltage, polarity reverses and the diode D2
conducts, being forward biased, while D1 does not, being reverse biased.
Hence the load current flows in both half cycles of ac voltage and in the
same direction. The diode we are using here for the purpose of rectification
is IN4001.
FILTER:
The filter circuit used here is the capacitor filter circuit where a
capacitor is connected at the rectifier output, and a DC is obtained across
it. The filtered waveform is essentially a DC voltage with negligible
ripples, which is ultimately fed to the load.
REGULATOR:
Since all electronic circuits work only with low dc voltage it needs a
power supply unit to provide the appropriate voltage supply. This unit
consists of a transformer, rectifier, filter and regulator. AC voltage typically
230v is connected to the transformer that steps the AC voltage down to the
level to the desired AC voltage. A diode rectifier then provides a full wave
rectified voltage that is initially filtered by a simple capacitive filter to
produce a DC voltage. This resulting DC voltage usually has some ripple or
AC voltage variations.
►Introduction
The most commonly used Character based LCDs are based on Hitachi's HD44780
controller or other which are compatible with HD44580. In this tutorial, we will discuss
about character based LCDs, their interfacing with various microcontrollers, various
interfaces (8-bit/4-bit), programming, special stuff and tricks you can do with these
simple looking LCDs which can give a new look to your application.
►Pin Description
The most commonly used LCDs found in the market today are 1 Line, 2 Line or 4 Line
LCDs which have only 1 controller and support at most of 80 charachers, whereas LCDs
supporting more than 80 characters make use of 2 HD44780 controllers.
Most LCDs with 1 controller has 14 Pins and LCDs with 2 controller has 16 Pins (two
pins are extra in both for back-light LED connections). Pin description is shown in the
table below.
Usually these days you will find single controller LCD modules are used more in the
market. So in the tutorial we will discuss more about the single controller LCD, the
operation and everything else is same for the double controller too. Lets take a look at the
basic information which is there in every LCD.
Display data RAM (DDRAM) stores display data represented in 8-bit character codes. Its
extended capacity is 80 X 8 bits, or 80 characters. The area in display data RAM
(DDRAM) that is not used for display can be used as general data RAM. So whatever you
send on the DDRAM is actually displayed on the LCD. For LCDs like 1x16, only 16
characters are visible, so whatever you write after 16 chars is written in DDRAM but is
not visible to the user.
Figures below will show you the DDRAM addresses of 1 Line, 2 Line and 4 Line LCDs.
Now you might be thinking that when you send an ascii value to DDRAM, how the
character is displayed on LCD? so the answer is CGROM. The character generator ROM
generates 5 x 8 dot or 5 x 10 dot character patterns from 8-bit character codes (see Figure
5 and Figure 6 for more details). It can generate 208 5 x 8 dot character patterns and 32 5
x 10 dot character patterns. Userdefined character patterns are also available by mask-
programmed ROM.
As you can see in both the code maps, the character code from 0x00 to 0x07 is occupied
by the CGRAM characters or the user defined characters. If user want to display the
fourth custom character then the code to display it is 0x03 i.e. when user send 0x03 code
to the LCD DDRAM then the fourth user created charater or patteren will be displayed
on the LCD.
As clear from the name, CGRAM area is used to create custom characters in LCD. In the
character generator RAM, the user can rewrite character patterns by program. For 5 x 8
dots, eight character patterns can be written, and for 5 x 10 dots, four character patterns
can be written. Later in this tutorial i will explain how to use CGRAM area to make
custom character and also making animations to give nice effects to your application.
►BF - Busy Flag
Busy Flag is an status indicator flag for LCD. When we send a command or data to the
LCD for processing, this flag is set (i.e BF =1) and as soon as the instruction is executed
successfully this flag is cleared (BF = 0). This is helpful in producing and exact ammount
of delay. for the LCD processing.
To read Busy Flag, the condition RS = 0 and R/W = 1 must be met and The MSB of the
LCD data bus (D7) act as busy flag. When BF = 1 means LCD is busy and will not accept
next command or data and BF = 0 means LCD is ready for the next command or data to
process.
There are two 8-bit registers in HD44780 controller Instruction and Data register.
Instruction register corresponds to the register where you send commands to LCD e.g
LCD shift command, LCD clear, LCD address etc. and Data register is used for storing data
which is to be displayed on LCD. when send the enable signal of the LCD is asserted, the
data on the pins is latched in to the data register and data is then moved automatically to
the DDRAM and hence is displayed on the LCD.
Data Register is not only used for sending data to DDRAM but also for CGRAM, the
address where you want to send the data, is decided by the instruction you send to LCD.
We will discuss more on LCD instuction set further in this tutorial.
Only the instruction register (IR) and the data register (DR) of the LCD can be controlled
by the MCU. Before starting the internal operation of the LCD, control information is
temporarily stored into these registers to allow interfacing with various MCUs, which
operate at different speeds, or various peripheral control devices. The internal operation
of the LCD is determined by signals sent from the MCU. These signals, which include
register selection signal (RS), read/write signal (R/W), and the data bus (DB0 to DB7),
make up the LCD instructions (Table 3). There are four categories of instructions that:
Although looking at the table you can make your own commands and test them. Below is
a breif list of useful commands which are used frequently while working on the LCD.
The table above will help you while writing programs for LCD. But after you are done
testing with the table 4, i recommend you to use table 3 to get more grip on working with
LCD and trying your own commands. In the next section of the tutorial we will see the
initialization with some of the coding examples in C as well as assembly.
►LCD Initialization
Before using the LCD for display purpose, LCD has to be initialized either by the internal
reset circuit or sending set of commands to initialize the LCD. It is the user who has to
decide whether an LCD has to be initialized by instructions or by internal reset circuit. we
will dicuss both ways of initialization one by one.
An internal reset circuit automatically initializes the HD44780U when the power is
turned on. The following instructions are executed during the initialization. The busy flag
(BF) is kept in the busy state until the initialization ends (BF = 1). The busy state lasts for
10 ms after VCC rises to 4.5 V.
Display clear
Function set:
DL = 1; 8-bit interface data
N = 0; 1-line display
F = 0; 5 x 8 dot character font
Display on/off control:
D = 0; Display off
C = 0; Cursor off
B = 0; Blinking off
Entry mode set:
I/D = 1; Increment by 1
S = 0; No shift
Note: If the electrical characteristics conditions listed under the table Power Supply
Conditions Using Internal Reset Circuit are not met, the internal reset circuit will not
operate normally and will fail to initialize the HD44780U. For such a case, initial-ization
must be performed by the MCU as explained in the section, Initializing by Instruction.
As mentioned in the Note, there are certain condtions that has to be met, if user want to
use initialization by internal reset circuit. These conditions are shown in the Table 5
below.
Figure 7 shows the test condition which are to be met for internal reset circuit to be
active.
Figure 7: Internal Power Supply reset
Now the problem with the internal reset circuit is, it is highly dependent on power supply,
to meet this critical power supply conditions is not hard but are difficult to achive when
you are making a simple application. So usually the second menthod i.e. Initialization by
instruction is used and is recommended most of the time.
Initialization by instructions
Initializing LCD with instructions is really simple. Given below is a flowchart that
describles the step to follow, to initialize the LCD.
Figure 8: Flow chart for LCD initialization
As you can see from the flow chart, the LCD is initialized in the following sequence...
1) Send command 0x30 - Using 8-bit interface
2) Delay 20ms
3) Send command 0x30 - 8-bit interface
4) Delay 20ms
5) Send command 0x30 - 8-bit interface
6) Delay 20ms
7) Send Function set - see Table 4 for more information
8) Display Clear command
9) Set entry mode command - explained below
The first 3 commands are usually not required but are recomended when you are using 4-
bit interface. So you can program the LCD starting from step 7 when working with 8-bit
interface. Function set command depends on what kind of LCD you are using and what
kind of interface you are using (see Table 4 in LCD Command section).
CODE:
LCD_data equ P2 ;LCD Data port
LCD_D7 equ P2.7 ;LCD D7/Busy Flag
LCD_rs equ P1.0 ;LCD Register Select
LCD_rw equ P1.1 ;LCD Read/Write
LCD_en equ P1.2 ;LCD Enable
LCD_init:
mov LCD_data,#38H ;Function set: 2 Line, 8-bit,
5x7 dots
clr LCD_rs ;Selected command register
clr LCD_rw ;We are writing in
instruction register
setb LCD_en ;Enable H->L
clr LCD_en
acall LCD_busy ;Wait for LCD to process the
command
mov LCD_data,#0FH ;Display on, Curson blinking
command
clr LCD_rs ;Selected instruction
register
clr LCD_rw ;We are writing in
instruction register
setb LCD_en ;Enable H->L
clr LCD_en
acall LCD_busy ;Wait for LCD to process the
command
mov LCD_data,#01H ;Clear LCD
clr LCD_rs ;Selected command register
clr LCD_rw ;We are writing in
instruction register
setb LCD_en ;Enable H->L
clr LCD_en
acall LCD_busy ;Wait for LCD to process the
command
mov LCD_data,#06H ;Entry mode, auto increment
with no shift
clr LCD_rs ;Selected command register
clr LCD_rw ;We are writing in
instruction register
setb LCD_en ;Enable H->L
clr LCD_en
acall LCD_busy ;Wait for LCD to process the
command
ret ;Return from routine
Now we can do the same thing in C, I am giving example using Keil C. Similar code can
be written for SDCC.
CODE:
#include <AT89X51.H>.
#define LCD_data P2
#define LCD_D7 P2_7
#define LCD_rs P1_0
#define LCD_rw P1_1
#define LCD_en P1_2
void LCD_init()
{
LCD_data = 0x38; //Function set: 2 Line,
8-bit, 5x7 dots
LCD_rs = 0; //Selected command
register
LCD_rw = 0; //We are writing in data
register
LCD_en = 1; //Enable H->L
LCD_en = 0;
LCD_busy(); //Wait for LCD to process
the command
LCD_data = 0x0F; //Display on, Curson
blinking command
LCD_rs = 0; //Selected command
register
LCD_rw = 0; //We are writing in data
register
LCD_en = 1; //Enable H->L
LCD_en = 0;
LCD_busy(); //Wait for LCD to process
the command
LCD_data = 0x01; //Clear LCD
LCD_rs = 0; //Selected command
register
LCD_rw = 0; //We are writing in data
register
LCD_en = 1; //Enable H->L
LCD_en = 0;
LCD_busy(); //Wait for LCD to process
the command
LCD_data = 0x06; //Entry mode, auto
increment with no shift
LCD_rs = 0; //Selected command
register
LCD_rw = 0; //We are writing in data
register
LCD_en = 1; //Enable H->L
LCD_busy();
}
With the help of the above code, you are able to initialize the LCD. Now
there is a function/subroutine coming in the code i.e. LCD_busy, which is
used to put delay for LCD so that there should not be any command or data
sent to the LCD untill it finish executing the command. More on this delay
routine is explained in the next section.
References:
www.embedded.com
www.mobileforcesolutions
www.squared.com
www.newdaedalus.com
www.springerlink.com
www.facebook.com