Sei sulla pagina 1di 108

MONITORING & DATA LOGGING SYSTEM FOR

SYNCHRONOUS GENERATOR

SESSION 2010-2014
Submitted By
Muhammad Dilpazir Ali
Sufian Tahir
Rashid Khurshid

1JU2209B11RZ
1JU2208H11R5
1JU2209711RV

Project Advisor
PROF. NAIB HUSSAIN

DEPARTMENT OF ELECTRICAL ENGINEERING


MIRPUR UNIVERSITY OF SCIENCE AND TECHNOLOGY
MIRPUR (AJK)

CERTIFICATE
This is to certify that the following students have completed their project on

MONITORING & DATA LOGGING SYSTEM FOR SYNCHRONOUS


GENERATOR
Muhammad Dilpazir Ali
Sufian Tahir
Rashid Khurshid

1JU2209B11RZ
1JU2208H11R5
1JU2209711RV

It is certified that following students have successfully completed their final year project as prescribed
by the Electrical Engineering Department for the degree of Electrical Engineering.

Project Advisor

________________________

External Examiner

________________________

Chairman
______________________
Department of Electrical Engineering
Project Coordinator

______________________

SESSION 2010-2014
DEPARTMENT OF ELECTRICAL ENGINEERING

MIRPUR UNIVERSITY OF SCIENCE AND TECHNOLOGY


MIRPUR (AJK)

ABSTRACT
In the past, machine control consists primarily of analog technologies that are very time
consuming to be tune and require a lot of maintenance. Changing of the require response of
those system could involve actual adding of capacitors or resistors to the controller circuits. A
recent year of technological advancement in electronic devices, such as highly integrated
circuit, has made the implementation of the digital controller possible. The digital controller
being compact has high reliability and provides the mean to easily access to the challenging
parameters of the analog system. In modern large interconnected systems, manual regulation
is not feasible and therefore automatic generation and voltage regulation equipment is
installed on each generator.
The controllers are set for a particular operating condition and they take care of small
changes in load demand without frequency and voltage exceeding the prescribed limits. With
the passage of time, as the change in load demand becomes large, the controllers must be
reset either manually or automatically. Excitation voltage control is fast acting in which the
major time constant encountered is that of the generator field; while the power frequency
control is slow acting with major time constant contributed by the turbine and generator
moment of inertia this time constant is much larger than that of the generator field. Thus,
the transients in excitation voltage control vanish much faster and do not affect the dynamics
of power frequency control. The generators capability to produce a constant frequency is
directly proportional to the RPM speed of the prime mover which is controlled by the
governor. Simply adding or removing loads, or cycling those loads on and off, creates
conditions to which the governor must respond.

ACKNOWLEDGEMENT
With the blessings of Allah Almighty and prayers of our parents, we have made this humble
attempt to achieve the goal that was set for us in the beginning of the final year. Although it
was not an easy task, but with the devotion and dedication of our project team and
cooperation of our respected teachers and loving friends, we have at last succeeded in the
completion of our project. The support and encouragement rendered by our Project advisor
Prof. Naib Hussain was very vital in the completion of this project. His guidance and
encouragement played a key role in the designing and implementation of this project. We
would like to extend our deepest gratitude to Engr. Ateeq Baig and Mr. Nadeem for their
consistent technical support and valuable suggestions.

TABLE OF CONTENTS
ABSTRACT ...........................................................................................i
ACKNOWLEDGEMENT.................................................................................ii
LIST OF FIGURES.......................................................................................... iv
LIST OF TABLES............................................................................................. v
Chapter1: Introduction.......................................................................................1
1.1 History of Electric Power System..........................................................1
1.2 Analogue to Digital control....................................................................1
1.3 Motivation and Objectives.....................................................................2
1.4 Features..................................................................................................2
1.5 Requirements.........................................................................................3
1.6 Methodology..........................................................................................5
Chapter2: Synchronous Machine.......................................................................7
2.1 Introduction............................................................................................7
2.2 Synchronous Generator construction.....................................................7
2.3 Types of Synchronous machine.............................................................9
2.4 Cylindrical rotor Synchronous Generator............................................10
2.5 Voltage Regulation...............................................................................12
2.6 Synchronous Generator connected to the Grid....................................13
2.7 Synchronizing Procedure.....................................................................14
2.8 Hunting ...............................................................................................15
2.9 Synchronous Motors............................................................................15
2.10 Effect of mechanical load..................................................................17
2.11 Starting Synchronous Motor..............................................................17
2.12 Application of Synchronous Motors .................................................17
2.13 Excitation System..............................................................................18
Chapter3: Monitoring Methodology................................................................19
3.1 Introduction..........................................................................................19
3.2 Generator Monitoring Philosophies....................................................19
3.3 Parameters to be Monitored.................................................................20
3.4 Sensors and Instrumentation................................................................23
3.5 Hardware..............................................................................................23
3.6 Microcontroller....................................................................................24
3

3.7 A 5V Regulated power Supply.............................................................36


3.8 Current Transformer.............................................................................38
3.9 Voltage Transformer.............................................................................41
3.10 LCD....................................................................................................43
3.11 LM 358 Operational Amplifiers.........................................................45
Chapter 4: Voltage control and Speed control for Generator..........................47
4.1 AVR .....................................................................................................47
4.2 The Need for AVR................................................................................48
4.3 The Cost of Voltage problems..............................................................49
4.4 AVR functions......................................................................................50
4.5 AVR: Phases and Phase Regulation.....................................................51
4.6 Coil Rotation Ac voltage Regulator..................................................53
4.7 Constant Voltage Transformer Regulator..........................................55
Chapter 5: Serial Port Interfacing....................................................................57
5.1 Basics of Serial Communication..........................................................57
5.2 RS 232 Standards.................................................................................60
5.3 RS 232 Data transmission....................................................................61
5.4 MAX 232 Interfacing with Microcontroller........................................66
5.5 HyperTerminal.....................................................................................67
5.6 Common Applications for Serial Ports................................................68
Chapter 6: Introduction to Data Logging.........................................................70
6.1 Introduction..........................................................................................70
6.2 Data Format.........................................................................................71
6.3 Future Directions about Data logging..................................................72
6.4 Data Logging and Functional Requirements.......................................73
6.5 Online Analysis....................................................................................76
6.6 Data Storage.........................................................................................77
6.7 Offline Analysis...................................................................................78
6.8 Applications of Data Logging..............................................................80
6.9 Advantages and Disadvantages of Data Logging................................81
Conclusion.......................................................................................................82
Abbreviations and Symbols.............................................................................83
References........................................................................................................86
Appendix..........................................................................................................90
4

LIST OF TABLES
Table 1.1: Hyper terminal.........................................................................................04
Table 3.1: Sensor and instrumentation......................................................................23
Table 3.2: Command recognized by LCD................................................................44
Table 5.1: IBM pc DB-9 signal.................................................................................64

LIST OF FIGS
5

Fig 2.1 Non-salient rotor...........................................................................................08


Fig 2.2 salient rotor...................................................................................................08
Fig 2.3 Construction of Cylindrical rotor.................................................................10
Fig 2.4 salient pole rotor construction......................................................................10
Fig 2.5 per phase equivalent circuit..........................................................................11
Fig 2.6 Phasor diagram of cylindrical rotor..............................................................12
Fig 2.7 voltage character tics of cylindrical rotor.....................................................12
Fig 2.8 Excitation charter tics...................................................................................13
Fig 2.9 Equivalent circuit of cylindrical rotor .........................................................16
Fig 2.10 synchronous motor V curves......................................................................17
Fig 3.1 Microcontroller fundamental components....................................................24
Fig 3.2 Basic microcontroller architecture................................................................25
Fig 3.3 Inside a microcontroller................................................................................28
Fig 3.4 PIC 16F977A................................................................................................29
Fig 3.5 pin out of PIC 16F877A...............................................................................30
Fig 3.6 Basic microcontroller connectivity...............................................................32
Fig 3.7 Re set to controller........................................................................................33
Fig 3.8 A/D input module.........................................................................................35
Fig 3.9A/D input module result justification............................................................35
Fig 3.10 A 5V regulated supply................................................................................36
Fig 3.11 waveform and circuit Connection of half wave rectifier............................37
Fig 3.12 7805 regulator IC........................................................................................38
Fig 3.13 current transformer.....................................................................................39
Fig 3.14 transformer principle..................................................................................42
Fig 3.15 step-down transformer................................................................................42
Fig 3.16 LCD display................................................................................................43
Fig 3.17 Interfacing LCD with power supply...........................................................44
Fig 3.18 pin out of LM358........................................................................................46
Fig 4.1 single phase regulator...................................................................................51
Fig 4.2 three phase regulator.....................................................................................51
Fig 4.3 Moving coil voltage regulator .....................................................................53
Fig 4.4 Electromechanical voltage regulator............................................................54
Fig 4.5 graph of voltage output on time scale...........................................................54
6

Fig 5.1 Serial communication...................................................................................57


Fig 5.2 types of transmission ...................................................................................58
Fig 5.3 Framing ASCII A......................................................................................59
Fig 5.4 RS232 Transmission.....................................................................................61
Fig 5.5 Data transmission on RS232 line..................................................................62
Fig 5.6 how receiver receive data.............................................................................63
Fig 5.7 DB-9 pin connector......................................................................................63
Fig 5.8 Schematic for RS232....................................................................................65
Fig 5.9 MAX 232 pin configuration.........................................................................65
Fig 5.10 internal hardware........................................................................................66
Fig 5.11 block diagram 232......................................................................................66
Fig 5.12 interfacing MAX 232 with serial ports.......................................................67
Fig 5.13 hyper terminal ............................................................................................68
Fig 5.14 COM ports..................................................................................................68

Chapter 1
Introduction
1.1. History of Electric power system
In the year 1878, Thomas A. Edison began his incredible work on the research of electric
light and formulated the concept of the lighting in the surrounding area, which was driven by
a centrally located power station. Realization of the research came in the year of 1879 and by
1882, September 4, he set up a historic Pearl Street Station in New York City, making him the
pioneer batch of scientist in the World of Electric Utility Industry.
In the beginning, the generator that supplied the electricity to the surrounding could only
support the initial load of 30kW for a 110V incandescent lighting. Due to the introduction of
the DC motor by Frank J. Sprague in 1884 and the development of the three wire 220V DC
system, this allowed the loads to increase. As the demand of electricity and transmission
distances started to increase, voltage problems were experienced. By the year of 1885,
William Stanley solved the problems with the development and design of the transformer,
which has the ability of transmit power at a high AC voltage and low current, minimizing the
voltage drops on the transmission lines; making AC source more attractive than DC source.
Growth of the AC systems started in the year of 1888, when Nikola Tesla discovered twophase induction and synchronous motors. This discovery added to the advantages of the poly
phase versus the single phase systems, leading to an expansion in the usage of three-phase
line in Germany and United States of America. Making the three-phase synchronous
generator the workhorse of the industry [1]
1.2. Analog to Digital Control
In a world of change, new technologies replace old ones ever more quickly. In the early
years, change was slow with the transition process from the electro-mechanical voltage
controller with motor-driven rheostats to high gain rotating exciters. In the past 30 years,
however, control circuit has progressed from magnetic technology to analog control. Shaping
of the generator response using analog excitation system was a matter of adjusting potential
meters or adding or removing of capacitors in the control loops of the regulator circuit. This
adjustment is very time consuming and it often requires the excitation system to be repeatedly
turn on and off for the modification to be make. In recent years, another major technology
change has taken place with a move away from the analog control to digital control. This has

been made possible due to the rapid developments of electronic devices and technologies
such as high performance micro-processors and high intensity integrated circuits. The
controller is now reduced to integrated assembly. This had greatly increased it reliability as
multiple components are implemented with just Microcontroller. The digital controllers are
not simply a digital version of the analog version, but can realize sophisticated control
functions that will difficult with the analog circuit thus making it possible to enhance the
stability of the power system.[1]
1.3. Motivation and Objectives
The control of synchronous machines is now moving almost completely from analogue
electronic to digital. It is therefore necessary to develop a digital circuit for the monitoring
and control system for machines. In order to modify and upgrade the control of the machines,
knowledge of the parameters of the machine is very important. Most often these machines are
linked together to produce a grid system in which all are driven at synchronous speed and
generating the same (relative) voltage. In order to ensure that the machines can bye tied
together; two types of controllers are required:
a) A speed controller (governor) to keep the speed and hence the frequency of the
machine constant.
b) A voltage controller to control the field current and hence keep the terminal voltage
constant.
c) Web interface to view the system parameters
The very first reason which motivated us toward this project is that we wanted some digital
control (Microcontroller Based) for monitoring different parameters of Synchronous
Generator. In the World of machinery, the control of the machine has moved almost
completely from analogue electronic to digital. This happened to the case for the synchronous
machine as well. Synchronous machines are used almost universally in power stations around
the World as AC generators.
1.4. Features
The digital control for synchronous generator has following features:
a)
b)
c)
d)
e)

1.4.1.
Sensing the system parameters
Load Current
Generator Voltage
Temperature of windings of generator
Frequency of system
RPM (Revolution Per Minute)
1.4.2. Controlling the parameters

a)
b)

Frequency control for synchronous generator


Voltage control
1.4.3.

Monitoring the parameters

Applying limitations and generating alarms when the restrictions are violated
1.4.4. Digital display using LCD
1.4.5.

Parameters reading

Sending to computer after specific interval of time Serial port interfacing


1.4.6.

Data logging

1.4.7.

Uploading data on web page

1.5. Requirements
Monitoring & Data Logging System is hardware as well as a software project. As this project
is based on microcontrollers, it is important to check whether codes work well as required.
So, for development of this project, it can be said that this project is both software and
hardware based. Hence the requirements of the project are of two types.
Software Requirements
Hardware Requirements
1.5.1. Software Requirements
The software needed for different purposes are as under:
1.5.1.1. ASEM 51
It is a professional development environment for the MCS-51 architecture (8051, 8032,
Dallas 80C320, Atmel, etc.) that offers all the features that 90% of us developers, hobbyists,
and students need, at an economical price.
Some features of the software are:
a)
b)
c)
d)

Supports all MCS-51 Instructions


Generates both program and library object modules, facilitating code reuse
Produces Intel-HEX or binary output files
Viewing of entire program as simulation

1.5.1.2. EZ 30
This is the software used to dump the .hex file in the micro controller. It is very useful
software that provides dumping of programs to all kinds of micro controllers. It works
through serial port of computer. Also, it is a very fast programmer.
a) Proteus ISIS

This software is used to simulate the whole project. The Proteus Design Suite is
wholly unique in offering the ability to co-simulate both high and low-level micro-controller
code in the context of a mixed-mode SPICE circuit simulation. With this Virtual System
Modeling facility, you can transform your product design cycle, reaping huge rewards in
terms of reduced time to market and lower costs of development. All sort of hardware is
present in the software to check the simulation with microcontroller.
b) Express PCB
It forms a complete platform to design, validate and layout printed circuit boards (PCB). Its
interface enables efficient layout and routing of PCB designs
Some features of the software are:
i.
ii.
iii.

Intuitive, user-friendly design environment


Integrated spreadsheet view for managing design constraints, part placement, and
copper routing
Easy-to-use design tools optimized for speed or precise control
c) Hyper Terminal

HyperTerminal is a built-in windows program that can be used to connect to other computers,
online services, and host computers and other devices using either modem or a serial DB-9
cable.
Table.no.1.1
Sr.#

Software

Purpose

ASEM-51

hex files generation

EZ up loader

Dumping .hex files to microcontroller

Proteus ISIS

Simulations

Express PCB

PCB designing

Hyper terminal

Communication with computer system

1.5.2. Hardware Requirements


a)
b)
c)
d)
e)
f)
g)
h)

Circuit Designing for motor drive, Excitation circuit and monitoring module.
Programming of PIC microcontroller.
Designing PCB for each module.
Making circuit hardware of modules.
Assembly of all parts on a single board.
Finalize checking of the working of all circuit modules.
Data logging
Uploading data on web page

Following are the hardware requirements for project:

a)
b)
c)
d)
e)
f)
g)
h)
i)
j)
k)
l)
m)
n)
o)
p)
q)

Current Transformer (split core CT)


Temperature sensor LM 35
Sine to Square wave converter 7414
LCD (16*4 character, 5*8 dots)
Step-down AC transformer (220V-12V)
Buzzer (Beep Type)
Push switches
MAX 232
Voltage Regulator 7805
Slotted opto coupler
DB-9 connectors
Breadboards
Vero Boards
Crystal Oscillators (12MHz)
Resistors
Capacitors
Power Supply

1.6 .

Methodology

Following Methodology is followed for completion of this project:


1.6.1.

Analysis

In the starting phase of our project following data was required for design of the project:
a)
b)
c)
d)
e)
f)

Functions of old control systems


Flows of powerhouse operation
Previous solution and related problems
Information of sensors and controlling parameters
Shortcomings in the old systems
Ratings of Powerhouse and its parts
1.6.2.

Designing Flow charts

After analysis of the problems, flow charts had to be designed. These flow charts were
designed and verified from the engineers working in the powerhouse
1.6.3.

Writing and developing codes and simulating the circuits

Codes were written and developed according to the flow charts. All the codes were divided
into short modules for each operation.
1.6.4.

Hardware implementation

All the Circuits from software were implemented on hardware, at first on breadboard their
PCB were designed.
1.6.5. Testing and troubleshooting

Finally, the design is tested and troubleshooting is done. The designs are altered due to results
to give accuracy in controlling.

Chapter 2
Synchronous Machine

Synchronous machines are principally used as alternating current (AC) generators. They
supply the electric power used by all sectors of modern societies: industrial, commercial,
agricultural, and domestic. Synchronous machines are sometimes used as constant speed
motors or as compensators for reactive power control in large power systems.
2.1 . Introduction
A synchronous machine is an ac rotating machine whose speed under steady state condition is
proportional to the frequency of the current in its armature. The magnetic field created by the
armature currents rotates at the same speed as that created by the field current on the rotor,
which is rotating at the synchronous speed, and a steady torque results. Synchronous machines
are commonly used as generators especially for large power systems, such as turbine
generators and hydroelectric generators in the grid power supply. Because the rotor speed is
proportional to the frequency of excitation, synchronous motors can be used in situations
where constant speed drive is required. Since the reactive power generated by a synchronous

machine can be adjusted by controlling the magnitude of the rotor field current, unloaded
synchronous machines are also often installed in power systems solely for power factor
correction or for control of reactive kVA flow. Such machines, known as synchronous
condensers, may be more economical in the large sizes than static capacitors. [2]
2.2. Synchronous Generator Construction
A DC current is applied to the rotor winding, which then produces a rotor magnetic field.
The rotor is then turned by a prime mover producing a rotating magnetic field. This rotating
magnetic field induces a 3-phase set of voltages within the stator windings of the generator.
Field windings applies to the windings that produce the main magnetic field in a machine,
and armature windings applies to the windings where the main voltage is induced. For
synchronous machines, the field windings are on the rotor, so the terms rotor windings and
field windings are used interchangeably.
Generally a synchronous generator must have at least 2 components:
a) Rotor Windings or Field Windings
i.

Salient Pole

ii.

Non Salient Pole

b) Stator Windings or Armature Windings


The rotor of a synchronous generator is a large electromagnet and the magnetic poles on the
rotor can either be salient or non salient construction. Non-salient pole rotors are normally
used for rotors with 2 or 4 poles rotor, while salient pole rotors are used for 4 or more poles
rotor.

Figure 2.1 Non-salient rotor for a synchronous machine [2]

Figure 2.2 Salient rotors [2]


A dc current must be supplied to the field circuit on the rotor. Since the rotor is rotating, a
special arrangement is required to get the dc power to its field windings. The common ways
are:
a) supply the dc power from an external dc source to the rotor by means of slip rings and
brushes.
b) Supply the dc power from a special dc power source mounted directly on the shaft of
the synchronous generator.
Slip rings are metal rings completely encircling the shaft of a machine but insulated from it.
One end of the dc rotor winding is tied to each of the 2 slip rings on the shaft of the
synchronous machine, and a stationary brush rides on each slip ring.
A brush is a block of graphite like carbon compound that conducts electricity freely but has
very low friction, hence it doesnt wear down the slip ring. If the positive end of a dc voltage
source is connected to one brush and the negative end is connected to the other, then the same
dc voltage will be applied to the field winding at all times regardless of the angular position
or speed of the rotor. [2]
Some problems with slip rings and brushes:
a) They increase the amount of maintenance required on the machine, since the brushes
must be checked for wear regularly.
b) Brush voltage drop can be the cause of significant power losses on machines with
larger field currents.
2.3. Types of Synchronous Machine
According to the arrangement of the field and armature windings, synchronous machines may
be classified as rotating-armature type or rotating-field type.[3]

2.3.1. Rotating-Armature Type


The armature winding is on the rotor and the field system is on the stator. The generated
current is brought out to the load via three (or four) slip-rings. Insulation problems, and the
difficulty involved in transmitting large currents via the brushes, limit the maximum power
output and the generated electromagnetic field (e.m.f). This type is only used in small units,
and its main application is as the main exciter in large alternators with brushless excitation
systems.
2.3.2. Rotating-Field Type
The armature winding is on the stator and the field system is on the rotor. Field current is
supplied from the exciter via two slip-rings, while the armature current is directly supplied to
the load. This type is employed universally since very high power can be delivered. Unless
otherwise stated, the subsequent discussion refers specifically to rotating-field type
synchronous machines.
According to the shape of the field, synchronous machines may be classified as cylindricalrotor (non-salient pole) machines and salient-pole machines.
The cylindrical-rotor construction is used in generators that operate at high speeds, such as
steam-turbine generators (usually two-pole machines). This type of machine usually has a
small diameter-to-length ratio, in order to avoid excessive mechanical stress on the rotor due
to the large centrifugal forces.

Figure 2.3 Construction of cylindrical-rotor synchronous machine [3]


The salient-pole construction is used in low-speed alternating current (AC) generators (such
as hydro-turbine generators), and also in synchronous motors. This type of machine usually
has a large number of poles for low-speed operation, and a large diameter-to-length ratio. The
field coils are wound on the bodies of projecting poles. A damper winding (which is a partial

squirrel-cage winding) is usually fitted in slots at the pole surface for synchronous motor
starting and for improving the stability of the machine.

Figure 2.4 Salient-pole rotor constructions [3]


2.4. Cylindrical-Rotor Synchronous Generators
2.4.1. Principle
When a synchronous generator is excited with field current and is driven at a constant speed,
a balanced voltage is generated in the armature winding. If a balanced load is now connected
to the armature winding, a balanced armature current at the same frequency as the e.m.f will
flow. Since the frequency of generated e.m.f is related to the rotor speed, while the speed of
the armature rotating m.m.f is related to the frequency of the current, it follows that the
armature m.m.f rotates synchronously with the rotor field. An increase in rotor speed results
in a rise in the frequency of e.m.f and current, while the power factor is determined by the
nature of the load. The effect of the armature m.m.f on the resultant field distribution is called
armature reaction. Since the armature m.m.f rotates at the same speed as the main field, it
produces a corresponding e.m.f in the armature winding. For steady-state performance
analysis, the per-phase equivalent circuit shown in Figure 3 is used. The effects of armature
reaction and armature winding leakage are considered to produce an equivalent internal
voltage drop across the synchronous reactance Xs, while the field excitation is accounted for
by the open-circuit armature voltage E.m.f.[2]
The impedance Zs = (R + jXs) is known as the synchronous impedance of the synchronous
generator, where R is the armature resistance.

Figure 2.5 Per-phase equivalent circuit of synchronous generator [2]


The circuit equation of the synchronous generator is:

Figure 4 shows a voltage phasor diagram of a cylindrical-rotor synchronous generator


supplying a lagging-power-factor load.

Figure 2.6 Phasor diagram of cylindrical-rotor synchronous generator supplying a lagging


power factor load load angle; power factor angle [3]
2.5. Voltage Regulation
The variation in the terminal voltage with load is called voltage regulation. Mathematically,
per-unit voltage regulation is defined as the fractional rise in the terminal voltage when a
given load is removed: in other word

Figure 5 shows the variation in terminal voltage with load current when the field excitation is
constant. When the load is resistive or inductive, the terminal voltage drops when the load

current increases; when the load is capacitive, however, the terminal voltage may exceed the
open-circuit voltage.

Figure 2.7 Voltage characteristics of cylindrical-rotor synchronous generator at constant field


excitation [4]
(a) Zero power factor leading
(b) 0.8 power factor leading
(c) 0.9 power factor leading;
(d) Unity power facto
(e) 0.9 power factors lagging
(f) Zero power factor lagging.
For practical applications, the field excitation is varied to maintain a constant terminal
voltage across the load, using a device called an automatic voltage regulator (AVR).
Figure 6 shows the variation of the field current with load current when the terminal voltage
is maintained constant, often known as the excitation characteristics.

Figure 2.8 Excitation characteristics of cylindrical-rotor synchronous generator at constant


voltage [4]
(a) Zero power factor leading;
(b) 0.8 power factor leading;
(c) 0.9 power factor leading;
(d) Unity power factor;
(e) 0.9 power factor lagging;
(f) Zero power factor lagging.
2.6. Synchronous Generator Connected to the Grid
In practice, synchronous generators seldom operate in the isolated mode. A large number of
synchronous machines are usually connected in parallel to supply the loads, forming a large
power system known as a grid. The voltage and the frequency of the grid remain substantially
constant. When a synchronous generator is connected to the grid, its rotor speed and terminal
voltage are fixed by the grid and it is said to be operating on infinite busbars. In general, a
change in field excitation will result in a change in the operating power factor, while a change
in mechanical power input will cause a corresponding change in the electrical power output.
2.7. Synchronizing Procedure
The process of paralleling a synchronous machine onto infinite bus bars is known as
synchronizing. Before a synchronous generator can be synchronized onto live bus bars, the
following conditions must be satisfied:
a) The voltage of the generator must be equal to that of the bus bars;
b) The frequency of the generator must be equal to that of the bus bars;
c) The phase sequence of the generator must be the same as that of the bus bars and at
the instant of synchronizing, the voltage phasor of the generator and the bus bars must
coincide. Synchronizing may be achieved with the help of synchronizing lamps, the
rotary lamp method being the most popular. Alternatively, a device known as the
synchroscope may conveniently be used to facilitate synchronizing.
2.7.1. Operating Conditions of Synchronous Generator
Depending upon the field excitation and the mechanical power input, a synchronous
generator may operate in one of the operating conditions shown in Figure 7. The phasor
diagrams show that when a synchronous generator operates on infinite bus bars, over
excitation will cause the machine to deliver power at a lagging power factor, while under

excitation will cause the generator to deliver power at a leading power factor. The
synchronous generator is thus a source or sink of reactive power.[3]
2.7.2. Synchronizing Power and Torque
A synchronous machine has an inherent tendency to remain in synchronism with the power
system on which it operates, due to the presence of synchronizing power. As an example,
consider a synchronous generator connected to the grid and driven by a prime mover that
provides a constant mechanical input power. If the rotor accelerates due to some disturbance
the load angle increases, resulting in an increase in electrical power output The extra output
power is derived from the stored kinetic energy of the rotor; consequently the rotor slows
down as the rotor mechanical energy is being extracted, and the generator will return to
synchronous operation.[4]
Synchronizing power Ps is defined as the power per electrical radian of rotor displacement; in
other words

The synchronization torque is given as

Where

is the synchronous angular speed of the machine.

The synchronizing power is a maximum for no load ( = 0) and decreases as the load on the
machine increases. For a load angle of 90 electrical degrees, the synchronizing power is zero,
meaning that the machine is on the verge of instability. The larger the load angle, the less
stable the synchronous machine becomes.
2.8. Hunting
Hunting is the sustained oscillation of the rotor following a disturbance in a synchronous
machine operating on infinite bus bars. The synchronizing torque Ts and the rotor moment of
inertia J of the synchronous machine are analogous to the stiffness and mass of a spring-mass
mechanical system. When subjected to an external disturbance, the load angle follows a
simple harmonic motion and the natural frequency of oscillation is given by

If the driving torque provided by the prime mover is cyclic with a frequency close to .,
hunting may develop into vigorous rotor swings, with a consequent danger of instability.
In practice, some of the rotor energy is dissipated in the stator and field resistances; hence the
oscillations will die down and the synchronous machine will settle to steady state again after
a disturbance. A damper winding may be fitted to the pole surfaces of the salient-pole
synchronous machine to prevent hunting and to improve stability.[3]
2.9 Synchronous Motors
2.9.1. Operating Principle
A synchronous motor develops a constant torque only when the field system and the armature
m.m.f rotate in synchronism. When the motor is fed from the grid, the supply frequency is
constant and the motor must run at synchronous speed. The synchronous motor is thus a
constant-speed motor. The steady-state performance characteristics of the synchronous motor
may be studied using the equivalent circuit shown in Figure 9. Comparing this with Figure 3,
it should be noted that the direction of armature current has been reversed. The circuit
equation for a synchronous motor is thus

In order to satisfy the above circuit equation, the phasor Ef (often regarded as the back e.m.f
of the motor) must lag the terminal voltage V by the load angle .

Figure 2.9 Equivalent circuit of cylindrical rotor synchronous machine [4]

2.9.2. Effect of Field Excitation: V-curves


When studying the effect of field excitation on motor performance, it is often assumed that
the motor is loaded such that it draws a constant power from the supply. Since both the power
and the voltage are constant, it follows that
I . cos =I a=constant
Where Ia is the active component of armature current, and
I a Z s=constant
Figure 10 shows the effect of change in field excitation on the operation of the synchronous
motor. As the field current is changed, the tip of armature current phasor I will follow the
locus XX (a line perpendicular to V), while the tip of the back e.m.f phasor Ef will follow the
locus YY (a line perpendicular to I2.Zs, where I2 is the in-phase component of armature
current). When the synchronous motor operates with constant power input, the variation of
armature current with field current is thus a V-shaped curve, as illustrated in Figure 11. In
general, over excitation will cause the synchronous motor to operate at a leading power
factor, while under excitation will cause the motor to operate at a lagging power factor. The
synchronous motor thus possesses a variable-power-factor characteristic

Figure 2.10 Synchronous motor V-curves [4]


2.10. Effect of Mechanical Load
When the shaft load on the motor is varied, there is an internal adjustment in phase relations
between the supply voltage and the motor back e.m.f, resulting in a change in the load angle
and a momentary acceleration or deceleration. After a transient period of rotor oscillation, the
rotor settles down again to synchronous speed, but with the load angle and armature current

changed in order to develop the required torque. In general, the load angle increases when
mechanical load is applied, with a corresponding increase in armature current. If the applied
load exceeds the stability limit, the motor may pull out of synchronism.[4]
2.11. Starting Synchronous Motors
With the rotor at standstill and a three-phase voltage applied to the armature winding, the
resultant rotating armature m.m.f moves past the rotor at synchronous velocity, producing an
alternating torque with an average value of zero. The plain synchronous motor thus has no
inherent starting torque. To start the motor, the following methods may be employed.[4]
2.12. Applications of Synchronous Motors
The synchronous motor may be used as a constant-speed drive, particularly for ratings
exceeding 15 kW: for example, motor-generator sets for a DC power system, compressors,
fans, and blowers. Large synchronous motors have higher efficiencies and can operate at
unity power factor; hence they are smaller in size and weight than induction motors of the
same rating. Synchronous motors can also be used for power-factor correction in an industrial
plant consisting of a large number of induction motors. An overexcited synchronous motor
without mechanical load behaves as a variable capacitor that can be used for reactive power
control in a large power system. For the latter application, the machine is often referred to as
a synchronous capacitor or a compensator.[5]
2.13. Excitation System
The direct current required for field excitation is furnished by the excitation system. The
source of power can be a shaft-mounted exciter, a motor-generator set, or a static rectifier.
a) DC exciter. This is the traditional method. A DC generator mounted on the main shaft
may be of either the shunt-wound or the separately-excited type. The output current is
fed to the rotor of the synchronous machine through slip-rings.
b) Static excitation. Here, DC excitation can be obtained by means of a rectifier and a
suitable AC supply. This method eliminates the commutation limits inherent in DC
exciters. The rectifier unit has no moving parts, requires very little maintenance, and
is immune to hazardous or dusty atmospheres.
c) AC exciter. The AC exciter is mounted on the main shaft. Its field is fed from a pilot
exciter, whose field in turn is obtained from a permanent-magnet generator. The AC
exciter output voltage is rectified and fed to the field of the synchronous machine via
slip-rings.

d) Brushless excitation system. An exciter of rotating-armature type is mounted on the


main shaft. The AC output is converted to DC by means of a rotating rectifier. The
direct current is fed directly to the field winding of the synchronous machine, no sliprings or brush gear being needed.[3]

Chapter 3
Monitoring Methodology
3.1 Introduction
The monitoring of large electrical generators has become a high priority in the electric utility
industry due to the pressure to extend unit life and reduce operating costs. Improving the
amount or type of generator monitoring is a possible way to help extend generator life. Better
monitoring can help avoid major failure before they happen because of earlier warning and
allow additional flexibility in operation by operators being more familiar with the
performance of the machine.
3.2 Generator monitoring philosophies
Generator on line monitoring and diagnostics cover a wide range of approaches. These start
form minimal monitoring with few sensors and simple alarms up to elaborate expert systems
with extensive diagnostic capability. The level of system sophistication for the most basic
monitoring involves the operator simply keeping track of generator operation by periodically

checking specified operating parameters on various gauges and indicators and relying on
those sensors that are connected to an alarm system to give warning when a predetermined
high limit is reached.
As hardware and software capability in data loggers and computers has progressed, the ability
to provide better monitoring has increased dramatically in past years. Computers can now
handle many more sensors at one time and can scan them for information far more often.
Faster CPUs increased memory capability, and more sophisticated data acquisition hardware
are part of the reason for the progress in monitoring. In addition to hardware, software
capability and flexibility have also grown exponentially. Improved software has provided the
industry with the ability to take simple sensor inputs and derive very detailed information
about machine performance form them. Sensor inputs can now be combined to provide
artificial indications of problems that would otherwise not be available. Computer modeling
of various generator components predicts how they will react during load changes and
operating events. The use of such techniques allows closer tracking of sensors and the ability
to diagnose problems at a much earlier stage in their development.
The information gathered form sensor reading by the monitoring systems can be stored as an
archived history about the performance of machine. This can be used for long term trending
and maintenance management of equipment. In addition the use of graphical user interfaces
has allowed much more meaningful presentation of the data collected sot that operators can
interpret the information faster more accurately. Reading now presented in both numeric and
graphical form. Short term trends are used to compare various operating parameters while
operators attempt to diagnose problems based on such things as temperature rise with load
increase and so on. Because significant advances in computers generators monitoring has
become very sophisticated. Along with this sophistication comes a high price tog to install
complex expert system. However in some cases a high level of sophistication is not always
necessary. A utility must asses its needs passed on the equipment under consideration[4]
3.3 Parameters to be monitored
Regardless of the type of monitoring system employed on a generator all system require
sensor inputs to provide the information about the various machines components and
operating parameters. This section lists the basic sensors that are installed on generators in
service today. It provides a brief description of the type of sensor or instrument, the units in
which the output is given, what each detects and how they are used.
a) Generator terminal voltage

b) Load current
c) Frequency
d) Speed
e) Temperature of Generator windings
3.3.1 Generator terminal voltage
Terminal voltage is a function of magnetic flux, rotor speed and the stator winding
configuration. Excessively high voltage on the stator winding can break down the ground
wall insulation and deteriorate the stator bar surface coatings due to the electrical breakdown
phenomenon. The stator terminal voltage is monitored for abnormal terminal voltage (either
too high or too low), and for the degree of phase voltage unbalance. Monitoring the generator
terminal voltage is critical while synchronizing the generator with the system. The terminal
voltage is critical while synchronizing the generator with the system. The terminal voltage of
the generator must be matched in magnitude, phase, and frequency to that of the system
voltage before closing the main generator breakers. This ensures smooth closure of the
breakers and connection to the system with no mal synchronization occurring. [4]

3.3.2 Frequency
Frequency measured in cycles per second or hertz (Hz) refers to the electrical frequency of
the generator. It is monitored for abnormal deviation from the system frequency, which is 50
Hz in Pakistan. Frequency is more a consideration for turbine blade, hydrogen (H2) seal, and
bearing operation. There are many sub synchronous vibration modes associated with low
frequency operation that could fail these components and must be avoided. In terms of
generator operation, over frequency and under frequency are main concerns. Over frequency
is most often the result of an instantaneous load reduction when the generator is synchronized
to the system or from excessive excitation when the generator is in the open circuit condition
at rated speed and terminal voltage. During on load operation, fast load reductions cause the
current in the stator winding to decrease rapidly and the terminal voltage to increase rapidly
due to a high level of field excitation still applied. In this case automatic actions is taken to
decrease the steam input of the turbine in order to match the load requirements and to quickly
reduce field current in order to keep the terminal voltage within limits (for example the AVR)
Under frequency is generally caused by a system event rather than by the generator itself. The
effect on the generator however, is almost always and attempt by the system to extract

excessive current from the stator and to drag the rotor speed down. This also has the effect of
depressing the stator terminal voltage. To offset this excitation system for the generator will
normally go into field forcing to try and maintain rated terminal voltage. Therefore it can be
seen that there is a possibility of sustaining overheating in both the stator and rotor windings
during this type of event. Protection against overloading in these components is usually
provided. [5]
3.3.3 Load Current
The three phase currents flowing in the stator winding are alternating currents (ac) and
produce losses in the copper that directly affect the temperature of the winding. In addition
vibration and bar bounce forces are induced in the stator winding in proportion to the
electrical current flowing. Temperature and vibration affect the electrical and mechanical
integrity of both the inter strand and ground wall insulation, and the stator bar surface
coatings. The mechanical integrity of copper strands is also affected by temperature and bar
bouncing.
The stator currents are monitored and used to provide and indication of stator current
overload and phase current unbalance, and they can be used to calculate the negative
sequence currents flowing in the rotor.
3.3.4 Core temperature
Stator core temperature is monitored by TCs or RTDs embedded between the stator core
laminates at strategic locations. In the radial directions, these locations are most often in the
tooth center, in the core yoke a few inches below the slot bottom and in the core yoke
centered between the slot bottom and the back of the core. In the axial direction they are
positioned at both core ends, generally from the first packet up to about one and a half feet
inward, and in the core center. This provides coverage to fully monitor the various core
heating modes including global overheating, core and overheating and localized overheating
from local core faults.
Global overheating of the stator core can occur from over fluxing by excessive field current
application either on line or off line. An indication that this condition is occurring is also
evident from the stator terminal voltage being above the allowable limit. It can also occur
during overload in which case the terminal voltage and field current will almost certainly be
above limits. Another cause of global core overheating can occur when the hydrogen gas
pressure drops too low. In this case, the core is not getting sufficient cooling. Hydrogen gas

purity also affects core temperature, but a drop in purity would have to be sever for
overheating to occur.
The other cause of global core overheating is high hydrogen gas temperature. This is most
likely to occur due to a problem with the hydrogen coolers, such as low flow or loss of raw
cooling water to H2 cooler. There have also been cases where the raw water supply is too
warm in the summer months in southern areas, and even at full raw water flow the cold H2
gas could not be maintained below allowable limits. Again, core heating will be higher but
overheating is unlikely. The condition should be corrected though because the stator core
inter laminar insulation life will be adversely affected in long run by extended operation at
higher than rated temperatures.
Core end overheating is a condition related to leading power factor operation. In this
overheating mode the core center is not affected. During leading power factor operation, the
interaction of the magnetic fields in the core ends is such that there is a higher degree of axial
flux impingement on the core that tends to saturate the iron at the core ends. As the power
factor or field current is reduced saturation increases, and subsequently the core end
temperature increase also. The level of temperature rise in the core ends is dependent on a
variety of generator design features, and depending on the design variations, some machines
see this effect more than others. Local core overheating is a condition that is related to a small
area of the core, usually due to a localized defect or foreign body present in the stator. It can
also be associated with a breakdown of the inter laminar insulation or shorting of the core
laminates. Inter laminar insulation breakdown can occur from voltage spike due to system or
machine related events, fretting form loose iron, poor space block welds and so on. Shorts
across laminates usually occur from either foreign objects in the bore, or damage to the core
from the rotor skid plate or from hammer strikes during re-wedging activities.
3.3.5 Shaft speed
Shaft speed refers to the shaft rotational speed. It is 3000 rpm for a 2 pole generator and 1500
rpm for 4 pole machine. The speed is generally measured by a probe mounted next to the
rotor looking at a toothed wheels or key phasor on the rotors shaft. The speed signal is
particularly useful for monitoring but frequency of the generator is usually taken from the
electrical output of the generator in Hz.
Shaft speed monitoring is particularly useful while looking at the vibration profile of the rotor
during run up and run down when the generator goes through its first and second critical
speed.[5]

3.4 Sensors and instrumentation


Table. No. 3.1
Parameter
Generator terminal voltage
Load current
Frequency
Speed
Temperature of Generator windings

Sensor
Potential transformer
Current transformer
Schmitt trigger
Slotted optocoupler
LM 35

Measuring unit
Volts
Amperes
Cycles/sec (Hz)
Rpm
centigrade

3.5 Hardware
Hardware used in the implementation of this circuit is as under.
a) Microcontroller PIC 16F977A
b) Current Transformer (split core CT)
c) LCD (16*2 character, 5*8 dots)
d) Step-down AC transformer (220V-12V)
e) Voltage Regulator 7805
f) Buzzer (Beep Type)
g) Capacitors
h) Resistors
i) LEDs
3.6 Microcontroller
Basically, a microcontroller is a device which integrates a number of the components of a
microprocessor system onto a single microchip and optimized to interact with the outside
world through on-board interfaces; i.e. it is a little gadget that houses a microprocessor, ROM
(Read Only Memory), RAM (Random Access Memory), I/O (Input Output functions), and
various other specialized circuits all in one package.[6]
On the other hand, a microprocessor is normally optimized to co-ordinate the flow of
information between separate memory and peripheral devices which are located outside it.
Connections to a microprocessor include address, control and data busses that allow it to
select one of its peripherals and send to or retrieve data from it. Because a microcontrollers
processor and peripherals are built on the same silicon, the devices are self-contained and
rarely have any bus structures extending outside their packages. So a microcontroller
incorporates onto the same microchip the following:
The CPU core
a) Memory (both ROM and RAM)

b) Some parallel digital I/O

Figure 3.1 Microcontroller's fundamental components [6]


Microcontrollers will also combine other devices such as:
a) A Timer module to allow the microcontroller to perform tasks for certain time periods.
b) A serial I/O port to allow data to flow between the microcontroller and other devices
such as a PC or another microcontroller.
c) An ADC to allow the microcontroller to accept analogue input data for processing.

Figure 3.2 Basic microcontroller architecture [7]


3.6.1 The microcontroller's building blocks
To illustrate the functions and interconnectivity of the building blocks of the microcontroller,
we shall construct the microcontroller block by block:
3.6.1.1

Memory unit

Memory is part of the microcontroller whose function is to store data. The easiest way to
explain it is to describe it as one big closet with lots of drawers. If we suppose that we
marked the drawers in such a way that they can not be confused, any of their contents will

then be easily accessible. It is enough to know the designation of the drawer and so its
contents will be known to us for sure.
Memory components are exactly like that. For a certain input we get the contents of a certain
addressed memory location and that's all. Two new concepts are brought to us: addressing
and memory location. Memory consists of all memory locations, and addressing is nothing
but selecting one of them. This means that we need to select the desired memory location on
one hand, and on the other hand we need to wait for the contents of that location. Beside
reading from a memory location, memory must also provide for writing onto it. This is done
by supplying an additional line called control line. We will designate this line as R/W
(read/write). Control line is used in the following way: if r/w=1, reading is done, and if
opposite is true then writing is done on the memory location. Memory is the first element,
and we need a few operation of our microcontroller.[7]

3.6.1.2

Central Processing Unit

The block that will have a built in capability to multiply, divide, subtract, and move its
contents from one memory location onto another are called "central processing unit" (CPU).
Registers are therefore memory locations whose role is to help with performing various
mathematical operations or any other operations with data wherever data can be found.
3.6.1.3
Bus
Physically, it represents a group of 8, 16, or more wires. 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. As far as functionality, the situation has improved, but a new problem has
also appeared: we have a unit that's capable of working by itself, but which does not have any
contact with the outside world, or with us! In order to remove this deficiency, let's add a
block which contains several memory locations whose one end is connected to the data bus,
and the other has connection with the output lines on the microcontroller which can be seen
as pins on the electronic component.
3.6.1.4
Input-output unit
Those locations we've just added are called "ports". There are several types of ports : input,
output or bidirectional ports. When working with ports, first of all it is necessary to choose

which port we need to work with, and then to send data to, or take it from the port.
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.
3.6.1.5
Serial communication
The Microcontroller can communicate with an outside world. This way of communicating
has its drawbacks. One of the basic drawbacks is the number of lines which need to be used
in order to transfer data.
3.6.1.6
Timer unit
Since we have the serial communication explained, we can receive, send and process data.
However, in order to utilize it in industry we need a few additionally blocks. One of those is
the timer block which is significant to us because it can give us information about time,
duration, protocol etc. The basic unit of the timer is a free-run counter which is in fact a
register whose numeric value increments by one in even intervals, so that by taking its value
during periods T1 and T2 and on the basis of their difference we can determine how much
time has elapsed. [7]
3.6.1.7
Watchdog
The flawless functioning of the microcontroller during its run-time is very important.
Suppose that as a result of some interference (which often does occur in industry) our
microcontroller stops executing the program, or worse, it starts working incorrectly.
Of course, when this happens with a computer, we simply reset it and it will keep working.
However, there is no reset button we can push on the microcontroller and thus solve our
problem. To overcome this obstacle, we need to introduce one more block called watchdog.
This block is in fact another free-run counter where our program needs to write a zero in
every time it executes correctly. In case that program gets "stuck", zero will not be written in,
and counter alone will reset the microcontroller upon achieving its maximum value. This will
result in executing the program again, and correctly this time around. That is an important
element of every program to be reliable without man's supervision.
3.6.1.8
Analog to Digital Converter (ADC)
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. Finally, the microcontroller is now completed, and all we need to
do now is to assemble it into an electronic component where it will access inner blocks

through the outside pins. The picture below shows what a microcontroller looks like inside.
[7]

Figure 3.3: inside a microcontroller [7]


Thin lines which lead from the center towards the sides of the microcontroller represent wires
connecting inner blocks with the pins on the housing of the microcontroller so called bonding
lines. Chart on the following page represents the center section of a microcontroller. For a
real application, a microcontroller alone is not enough. Beside a microcontroller, we need a
program that would be executed, and a few more elements which make up a interface logic
towards the elements of regulation. 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.[7]
3.6.2

Microcontroller PIC 16F977A

This series of microcontroller is important for current measurements. It has some very useful
features, which make it unique in applications. Its features and specifications are given below.

3.6.2.1 High-Performance RISC CPU:


a) Only 35 single-word instructions to learn
b) All single-cycle instructions except for program branches, which are two-cycle
c) Operating speed: DC 20 MHz clock input
d) DC 200 ns instruction cycle
e) Up to 8K x 14 words of Flash Program Memory

Fig 3.4 PIC 16F977A


a) Up to 368 x 8 bytes of Data Memory (RAM),
b) Up to 256 x 8 bytes of EEPROM Data Memory
c) Pin out compatible to other 28-pin or 40/44-pin PIC16CXXX and
PIC16FXXX microcontrollers

Figure 3.5 Pin outs of PIC 16F877A[8]


3.6.2.2 Peripheral Features:
1. Timer0: 8-bit timer/counter with 8-bit prescaler
2. Timer1: 16-bit timer/counter with prescaler, can be incremented during Sleep via
external crystal/clock
3. Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
4. Two Capture, Compare, PWM modules
5. Capture is 16-bit, max resolution is 12.5 ns
6. Compare is 16-bit, max resolution is 200 ns
7. PWM max resolution is 10-bit
8. Synchronous Serial Port (SSP) with SPI
9. (Master mode) and I2C (Master/Slave)
10. Universal Synchronous Asynchronous Receiver transmitter (USART/SCI) with 9 bit
11. Parallel Slave Port (PSP) 8 bits wide with external RD, WR and CS control 40/44-pin
12. Brown-out detection circuitry for Brown-out Reset (BOR)

3.6.2.3 Analog Features:


1. 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)
2. Brown-out Reset (BOR)
3. Analog Comparator module with:
a)

Two analog comparators

b)

Programmable on-chip voltage reference (VREF) module

c)

Programmable input multiplexing from device inputs and internal voltage


reference

d)

Comparator outputs are externally accessible


3.6.2.4 Special Microcontrollers Features:

1. 100,000 erase/write cycle Enhanced Flash program memory typical


2. 1,000,000 erase/write cycle Data EEPROM memory typical
3. Data EEPROM Retention > 40 years
4. Self-reprogram able under software control
5. In-Circuit Serial Programming (ICSP) via two pins
6. Single-supply 5V In-Circuit Serial Programming
7. Watchdog Timer (WDT) with its own on-chip RC oscillator for reliable operation
8. Programmable code protection
9. Power saving Sleep mode
10. Selectable oscillator options
11. In-Circuit Debug (ICD) via two pins
3.6.2.5 CMOS Technology:
1. Low-power, high-speed Flash/EEPROM technology
2. Fully static design
3. Wide operating voltage range (2.0V to 5.5V)
4. Commercial and Industrial temperature ranges
5. Low-power consumption
3.6.3 Basic connectivity of microcontroller
In order to enable the microcontroller to operate properly it is necessary to provide:
a) Power Supply;
b) Reset Signal and Clock Signal.

Figure 3.6: Basic Microcontroller Connectivity [9]


3.6.3.1 Power Supply
Even though the PIC16F887 can operate at different supply voltages, w, A 5V DC power
supply is the most suitable. The circuit, shown on the previous page, uses a cheap integrated
three-terminal positive regulator LM7805 and provides high-quality voltage stability and
quite enough current to enable the microcontroller and peripheral electronics to operate
normally (enough here means 1A).[9]
3.6.3.2 Reset Signal
In order that the microcontroller can operate properly, a logic one (VCC) must be applied on
the reset pin. The push button connecting the reset pin MCLR to GND is not necessary.
However, it is almost always provided because it enables the microcontroller to return safely
to normal operating conditions if something goes wrong. By pushing this button, 0V is
brought to the pin, the microcontroller is reset and the program execution starts from the
beginning. A10K resistor is used to allow 0V to be applied to the MCLR pin, via the push
button, without shorting the 5VDCrail to earth.[9]

Figure 3.7 Reset to controller[10]


3.6.3.3 Clock Signal
Even though the microcontroller has a built-in oscillator, it cannot operate without external
components which stabilize its operation and determine its frequency (operating speed of the
microcontroller).
Depending on elements in use as well as their frequencies, the oscillator can be run in four
different modes:
a) LP - Low Power Crystal;
b) XT - Crystal / Resonator;
c) HS - High speed Crystal / Resonator; and
d) RC - Resistor / Capacitor.
3.6.3.4 Special Features of The CPU
All PIC16F87XA devices have a host of features intended to maximize system reliability,
minimize cost through elimination of external components, provide power saving perating
modes and offer code protection. These are:
1. Oscillator Selection
2. Reset
3. Power-on Reset (POR)
4. Power-up Timer (PWRT)
5. Oscillator Start-up Timer (OST)
6. Brown-out Reset (BOR)
7. Interrupts
8. Watchdog Timer (WDT)

9. Sleep
10. Code Protection
11. ID Locations
12. In-Circuit Serial Programming
13. Low-Voltage In-Circuit Serial Programming
14. In-Circuit Debugger
PIC16F87XA devices have a Watchdog Timer, which can be shut-off only through
configuration bits. It runs off its own RC oscillator for added reliability. There are two timers
that offer necessary delays on power-up. One is the Oscillator Start-up Timer (OST), intended
to keep the chip in Reset until the crystal oscillator is stable. The other is the Power-up Timer
(PWRT), which provides a fixed delay of 72 ms (nominal) on power-up only. It is designed to
keep the part in Reset while the power supply stabilizes. With these two timers on-chip, most
applications need no external Reset circuitry.
Sleep mode is designed to offer a very low current power-down mode. The user can wake-up
from Sleep through external Reset, Watchdog Timer wake-up or through an interrupt. Several
oscillator options are also made available to allow the part to fit the application. The RC
oscillator option saves system cost while the LP crystal option saves power. A set of
configuration bits is used to select various options.[10]
3.6.4 Analog-To-Digital Converter (A/D) Module
a)

The Analog-to-Digital (A/D) Converter module has eight for the 40/44-pin
devices.

b)

The conversion of an analog input signal results in a corresponding 10-bit digital


number. The A/D module has high and low-voltage reference input that is software
selectable to some combination of VDD, VSS, RA2 or RA3.

c)

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/Ds
internal RC oscillator.
3.6.4.1 A/D Acquisition Requirements

For the A/D converter to meet its specified accuracy, the charge holding capacitor (CHOLD)
must be allowed to fully charge to the input channel voltage level. The analog input model is
shown in Figure 11-2. The source impedance (RS) and the internal sampling switch
impedance (RSS) directly affect the time required to charge the capacitor CHOLD. The

sampling switch (RSS) impedance varies over the device voltage (VDD); see Figure 3.4. The
maximum recommended impedance for analog sources is 2.5 k. As the impedance is
decreased, the acquisition time may be decreased. After the analog input channel is selected
(changed), this acquisition must be done before the
Conversion can be started.
To calculate the minimum acquisition time, Equation may be used. This equation assumes
that 1/2 LSb error is used (1024 steps for the A/D). The 1/2 LSb error is the maximum error
allowed for the A/D to meet its specified resolution.

Fig 3.8 A/D Input Module[12]


3.6.4.2 A/D RESULT REGISTERS
The ADRESH: ADRESL register pair is the location where the 10-bit A/D result is loaded at
the completion of the A/D conversion. This register pair is 16 bits wide.

Fig 3.9 A/D Result Justification [13]

The A/D module gives the flexibility to left or right justifies the 10-bit result in the 16-bit
result register. The A/D Format Select bit (ADFM) controls this justification.
Figure 4.6 shows the operation of the A/D result justification. The extra bits are loaded with
0s. When an A/D result will not overwrite these locations (A/D disable), these registers may
be used as two general-purpose 8-bit registers.[10]
3.7. A 5V Regulated Power Supply:

Fig.3.10 5V Regulated Power Supply


Main Components:
a) Transformer (220/12V)
b) Bridge Rectifier
c) Filter Capacitor
d) Regulator 7805
3.7.1

Transformer:

A transformer is a device that transfers electrical energy from one circuit to another through
inductively coupled conductors the transformer's coils. A varying current in the first or
primary winding creates a varying magnetic flux in the transformer's core, and thus a varying
magnetic field through the secondary winding. This varying magnetic field induces a varying
electromotive force (EMF) or "voltage" in the secondary winding. This effect is called mutual
induction. In the vast majority of transformers, the coils are wound around a ferromagnetic
core, air-core transformers being a notable exception. Transformers come in a range of sizes
from a thumbnail-sized coupling transformer hidden inside a stage microphone to huge units

weighing hundreds of tons used to interconnect portions of national power grids. All operate
with the same basic principles, although the range of designs is wide. While new technologies
have eliminated the need for transformers in some electronic circuits, transformers are still
found in nearly all electronic devices designed for household ("mains") voltage. In this circuit
the transformer can be utilized in order to step down the input voltage so that a rectifier can
be implemented to convert the ac input power into DC which can be used to drive a regulator
circuit to charge an electronic device.[13]
3.7.2

Rectifier:

A rectifier is an electrical device that converts alternating current (AC) to direct current (DC),
a process known as rectification. Rectifiers have many uses including as components of
power supplies and as detectors of radio signals. Rectifiers may be made of solid state diodes,
vacuum tube diodes, mercury arc valves, and other components.
A device which performs the opposite function (converting DC to AC) is known as an
inverter. When only one diode is used to rectify AC by blocking the negative or positive
portion of the waveform, the difference between the term diode and the term rectifier is
merely one of usage, i.e., the term rectifier describes a diode that is being used to convert AC
to DC. Almost all rectifiers comprise a number of diodes in a specific arrangement for more
efficiently converting AC to DC than is possible with only one diode. Before the
development of silicon semiconductor rectifiers, vacuum tube diodes and copper (I) oxide or
selenium rectifier stacks were used. A full-wave rectifier converts the whole of the input
waveform to one of constant polarity positive or negative at its output. Full-wave rectification
converts both polarities of the input waveform to DC direct current, and is more efficient.
However, in a circuit with a non-center tapped transformer, four diodes are required instead
of the one needed for half-wave rectification. Four rectifiers arranged this way are called a
diode bridge or bridge rectifier.

Fig.3.11 Waveforms and circuit connections for a half wave rectifier [14]

3.7.3

Filter Capacitor:

The filter Capacitors are generally connected to the output of the full wave bridge. These are
used to transform the pulsating DC into pure DC. The capacitor used in APFC is 1000 F,
16V.
3.7.4

Regulator 7805:

The LM78XX series of three terminal regulators is available with several fixed output
voltages making them useful in a wide range of applications. One of these is local on card
regulation, eliminating the distribution problems associated with single point regulation. The
voltages available allow these regulators to be used in logic systems, instrumentation, HiFi,
and other solid state electronic equipment. Although designed primarily as fixed voltage
regulators, these devices can be used with external components to obtain adjustable voltages
and currents. 7805 receives almost 8 V from the output of the filter capacitor and is connected
to the Vin Pin and the ground of the 7805 respectively and we get regulated 5 V from Vout
Pin and Ground.

Fig.3.12 7805 Regulator IC


3.8 Current Transformer
A current transformer (CT) is used for measurement of electric currents. When current in a
circuit is too high to directly apply to measuring instruments, a current transformer produces
a reduced current accurately proportional to the current in the circuit, which can be
conveniently connected to measuring and recording instruments. A current transformer also
isolates the measuring instruments from what may be very high voltage in the primary circuit.
Current transformers are commonly used in metering and protective relays in the electrical
power industry.
In OUR PROJECT split core type current transformer is used to measure the current used by
the load.

Fig 3.13 Current Transformer[15]


3.8.1 Design
Like any other transformer, a current transformer has a primary winding, a magnetic core,
and a secondary winding. The alternating current flowing in the primary produces a magnetic
field in the core, which then induces current flow in the secondary winding circuit. A primary
objective of current transformer design is to ensure that the primary and secondary circuits
are efficiently coupled, so that the secondary current bears an accurate relationship to the
primary current.
The most common design of CT consists of a length of wire wrapped many times around a
silicon steel ring passed over the circuit being measured. The CT's primary circuit therefore
consists of a single 'turn' of conductor, with a secondary of many hundreds of turns. The
primary winding may be a permanent part of the current transformer, with a heavy copper bar
to carry current through the magnetic core. Window-type current transformers are also
common, which can have circuit cables run through the middle of an opening in the core to
provide a single-turn primary winding. When conductors passing through a CT are not
centered in the circular (or oval) opening, slight inaccuracies may occur.
The primary circuit is largely unaffected by the insertion of the CT. The rated secondary
current is commonly standardized at 1 or 5 amperes. For example, a 4000:5 CT would
provide an output current of 5 amperes when the primary was passing 4000 amperes. The
secondary winding can be single ratio or multi ratio, with five taps being common for multi
ratio CTs.[15]
3.8.2 Safety precautions
Care must be taken that the secondary of a current transformer is not disconnected from its
load while current is flowing in the primary, as the transformer secondary will attempt to
continue driving current across the effectively infinite impedance. This will produce a high

voltage across the open secondary (into the range of several kilovolts in some cases), which
may cause arcing. The high voltage produced will compromise operator and equipment safety
and permanently affect the accuracy of the transformer.[15]
3.8.3Accuracy
The accuracy of a CT is directly related to a number of factors including:
1.
2.
3.
4.
5.
6.
7.
8.

Burden
Burden class/saturation class
Rating factor
Load
External electromagnetic fields
Temperature and
Physical configuration.
The selected tap, for multi-ratio CT's

For the IEC standard, accuracy classes for various types of measurement are set out in
BSEN /IEC 60044-1, class 0.1, 0.2s, 0.2, 0.5, 0.5s, 1 & 3. It will be seen that the class
designation is an approximate measure of the accuracy, e.g., class 1 current transformers have
ratio error within 1% of rated current class 0.5 within a ratio error of 0.5% etc. Phase
difference is important when power measurements are involved, i.e. when using wattmeter's,
kilowatt-hour meters, VAr meters and Power Factor meters. For the ANSI/IEEE Standard the
accuracy requirements are based upon if the CT will be used for electrical metering, or, if it
will be used for protective relaying.
3.8.4 Burden
The burden in a CT metering circuit is essentially the amount of impedance (largely resistive)
present. Typical burden ratings for IEC CTs are 1.5VA, 3VA, 5VA, 10VA, 15VA, 20VA,
30VA, 45VA & 60VA with ANSI/IEEE B-0.1, B-0.2, B-0.5, B-1.0, B-2.0 and B-4.0. This
means a CT with a burden rating of B-0.2 can tolerate up to 0.2 of impedance in the
metering circuit before its output current is no longer a fixed ratio to the primary current.
Items that contribute to the burden of a current measurement circuit are switch blocks meters
and intermediate conductors. The most common source of excess burden in a current
measurement circuit is the conductor between the meter and the CT. Often, substation meters
are located significant distances from the meter cabinets and the excessive length of small
gauge conductor creates a large resistance. This problem can be solved by using CT with 1ampere secondaries, which will produce less voltage drop between a CT and its metering
devices (used for remote measurement).

This is the voltage at which a CT becomes saturated. When a CT becomes saturated it can no
longer transform current. An example of this rating would be C200, C800 etc... This means
that the CT will saturate near 200 Volts or 800 Volts respectively.
3.8.5 Rating factor
Rating factor is a factor by which the nominal full load current of a CT can be multiplied to
determine its absolute maximum measurable primary current. Conversely, the minimum
primary current a CT can accurately measure is "light load," or 10% of the nominal current
(there are, however, special CTs designed to measure accurately currents as small as 2% of
the nominal current). The rating factor of a CT is largely dependent upon ambient
temperature. Most CTs have rating factors for 35 degrees Celsius and 55 degrees Celsius. It is
important to be mindful of ambient temperatures and resultant rating factors when CTs are
installed inside pad-mounted transformers or poorly ventilated mechanical rooms. Recently,
manufacturers have been moving towards lower nominal primary currents with greater rating
factors. This is made possible by the development of more efficient ferrites and their
corresponding hysteresis curves. This is a distinct advantage over previous CTs because it
increases their range of accuracy, since the CTs are most accurate between their rated current
and rating factor.[16]
3.8.6 Usage
Current transformers are used extensively for measuring current and monitoring the operation
of the power grid. The CT is typically described by its current ratio from primary to
secondary. Often, multiple CTs are installed as a "stack" for various uses (for example,
protection devices and revenue metering may use separate CTs). Similarly potential
transformers are used for measuring voltage and monitoring the operation of the power grid.
3.9 Voltage Transformer
A transformer that decreases the voltage from primary to secondary (less secondary winding
turns than primary winding turns) is called a step-down transformer

3.9.1 Basic Principle


The transformer is based on two principles: firstly, that an electric current can produce a
magnetic field (electromagnetism) and secondly that a changing magnetic field within a coil

of wire induces a voltage across the ends of the coil (electromagnetic induction). Changing
the current in the primary coil changes the magnitude of the applied magnetic field. The
changing magnetic flux extends to the secondary coil where a voltage is induced across its
ends.

Fig 3.14 Transformer Principle [16]


A simplified transformer design is shown. A current passing through the primary coil creates
a magnetic field. The primary and secondary coils are wrapped around a core of very high
magnetic permeability, such as iron; this ensures that most of the magnetic field lines
produced by the primary current are within the iron and pass through the secondary coil as
well as the primary coil.

Fig 3.15 Step-down Transformer [17]

3.10

LCD Liquid Crystal Display

In this project some form of display is required so as to make a user-friendly environment.


LCDs have become a cheap and easy way to get text display for an embedded system.
Common displays are set up as 16 to 20 characters by 1 Line, 2 Line or to 4 lines.
This component is specifically manufactured to be used with microcontrollers, which means
that it cannot be activated by standard IC circuits. It is used for displaying different messages
on a miniature liquid crystal display. It is based on the HD44780 microcontroller (Hitachi)
and can display messages in two lines with 16 characters each. It can display all the letters of
alphabet, Greek letters, punctuation marks, mathematical symbols etc. It is also possible to
display symbols made up by the user. Other useful features include automatic message shift
(left and right), cursor appearance, LED backlight etc.
3.10.1 LCD Screen
An LCD screen can display two lines with 16 characters each. Every character consists of
5x8 or 5x11 dot matrix. This book covers a 5x8 character display which is most commonly
used.

Fig. 3.16
Display contrast depends on the power supply voltage and whether messages are displayed in
one or two lines. For this reason, varying voltage 0-Vdd is applied to the pin marked as Vee.
A trimmer potentiometer is usually used for this purpose. Some of the LCD displays have
built-in backlight (blue or green LEDs). When used during operation, a current limiting
resistor should be serially connected to one of the pins for backlight power supply (similar to
LED diodes).

Figure 3.17: interfacing LCD with power supply [17]


If there are no characters displayed or if all of them are dimmed when the display is switched
on, the first thing that should be done is to check the potentiometer for contrast adjustment. Is
it properly adjusted? The same applies if the mode of operation has been changed (writing in
one or two lines).
3.10.2 LCD Basic Commands
All data transferred to an LCD through the outputs D0-D7 will be interpreted as a command
or a data, which depends on the RS pin logic state:
a) RS = 1 - Bits D0 - D7 are addresses of the characters to be displayed. LCD
processor addresses one character from the character map and displays it. The
DDRAM address specifies location on which the character is to be displayed. This
address is defined prior to transferring character or the address of the previously
transferred character is automatically incremented.
b) RS = 0 - Bits D0 - D7 are commands for setting the display mode.
Here is a list of commands recognized by the LCD:
Table. No. 3.2
COM

R R D D D D D D D D EX

MAN

S W 7 6 5 4 3 2 1 0 EC

UTI
ON
TIM

Clear

E
0 0 0 0 0 0 0 0 0 1 1.6

displ

4m

ay
Curs

S
0 0 0 0 0 0 0 0 1 x 1.6

or

4m

hom

e
Entry

0 0 0 0 0 0 0 1 I S 40u

mod
e set
Displ

D
0 0 0 0 0 0 1 D U B 40u

ay

on/o
f
contr
ol
Curs

0 0 0 0 0 1 D R x x 40u

or/Di

/ /

splay

C L

Shift
Funct 0 0 0 0 1 D N F x x 40u
ion
set
Set
CGR

L
0 0 0 1 CGRAM
address

S
40u
S

AM
addr
ess
Set
DDR

0 0 1 DDRAM

40u

address

ess
Read

0 1 B DDRAM

"BUS

F address

AM
addr

Y"
flag
(BF)
Write

1 0 D D D D D D D D 40u

to

7 6 5 4 3 2 1 0 S

CGR
AM
or
DDR
AM
Read
from

1 1 D D D D D D D D 40u
7 6 5 4 3 2 1 0 S

CGR
AM
or
DDR
AM
3.11 LM 358 Operational Amplifiers
The LM358 series consists of two independent, high gain, internally frequency compensated
operational amplifiers which were designed specifically to operate from a single power
supply over a wide range of voltages. Operation from split power supplies is also possible
and the low power supply current drain is independent of the magnitude of the power supply
voltage. Application areas include transducer amplifiers, dc gain blocks and all the
conventional op amp circuits which now can be more easily implemented in single power
supply systems. For example, the LM358 series can be directly operated off of the standard
+5V power supply voltage which is used in digital systems and will easily provide the
required interface electronics without requiring the additional 15V power supplies[20]

Figure 3.18: pin outs of LM 358[20]


3.11.1 Features:
1. Internally frequency compensated for unity gain
2. Large dc voltage gain: 100 dB
3. Wide bandwidth (unity gain): 1 MHz (temperature compensated)
4. Wide power supply range: Single supply: 3V to 32 or dual supplies: 1.5V to
16V
5. Very low supply current drain (500 A) essentially independent of supply voltage
3.11.2 Unique characteristics:
1. In the linear mode the input common-mode voltage range includes ground and the
output voltage can also swing to ground, even though operated from only a single
power supply voltage.
2. The unity gain cross frequency is temperature compensated.
3. The input bias current is also temperature compensated.
3.11.3 Advantages:
1. Two internally compensated op amps
2. eliminates need for dual supplies
3. allows direct sensing near gnd and vout also goes to gnd
4. compatible with all forms of logics
5. power drain suitable for battery operation

Chapter 4
Voltage control and speed control for generator

4.1 AUTOMATIC VOLTAGE REGULATOR


The AVR units maintain voltages within the allowable levels. Whenever there are variations
in voltage feeding by the substations, the AVR units shall automatically regulate the output
voltage so that the customers receive a steady voltage from their end. As the automatic
voltage regulator (AVR), which regulates generator voltage, is a device indispensable for
operation, it is required to have superior reliability in addition to easy maintenance or repair
features. And, recently there exists an ever-increasing demand for improved system stability
through the excitation control (AVR) in order to prevent decline in system stability in line
with the increase in power system and power re-routing. It may use an electromechanical
mechanism, or passive or active electronic components. Depending on the design, it may be
used to regulate one or more AC or DC voltages. With the exception of passive shunt
regulators, all modern electronic voltage regulators operate by comparing the actual output
voltage to some internal fixed reference voltage. Any difference is amplified and used to
control the regulation element in such a way as to reduce the voltage error. This forms a
negative feedback control loop; increasing the open-loop gain tends to increase regulation
accuracy but reduce stability (avoidance of oscillation, or ringing during step changes). There
will also be a trade-off between stability and the speed of the response to changes. If the
output voltage is too low (perhaps due to input voltage reducing or load current increasing),
the regulation element is commanded, up to a point, to produce a higher output voltage - by
dropping less of the input voltage (for linear series regulators and buck switching regulators),
or to draw input current for longer periods (boost-type switching regulators); if the output
voltage is too high, the regulation element will normally be commanded to produce a lower
voltage. However, many regulators have over-current protection so that they will entirely stop
sourcing current (or limit the current in some way) if the output current is too high, and some
regulators may also shut down if the input voltage is outside a given range. AVR is designed
for unstable mains and safety of load. Mains input and output are written on clemencies.
When installing the AVR it is necessary to use a connection cable of suitable diameter to use
the AVR more effective. AVR will be shut down automatically when the input voltage goes to
out of limits or one of the phases cuts off or short circuit in the output. After the temporary

conditions AVR will start again If it is requested and allowed to short term fault, AVR will
continue to operate by increasing the delay time. Over the mentioned delay time, AVR will
STOP automatically.[19]
4.2 The Need for Automatic Voltage Regulation
Many factors contribute to the need for automatic voltage regulation. However, the ultimate
reason for using voltage regulation is financial to avoid the costs associated with equipment
damage and downtime caused by poor voltage levels.
4.2.1 Utility Voltage Levels
There are many factors contributing to the amount of voltage level fluctuation observed
including:
1.
2.
3.
4.
5.

Location on the local distribution line,


Proximity to large electricity consumers,
Proximity to utility voltage regulating equipment,
Seasonal variations in overall system voltage levels,
Load factor on local transmission and distribution system, etc.
4.2.2 Voltage Drop in a Facility

It is expected and accepted that there will be a voltage drop of 3 to 5% from the point where
the electric utility delivers power to the end user (usually at the meter) to the point within a
facility where the electricity is finally consumed in an electrical device (the load). Unlike
utility voltage levels which may be high or low, the voltage drop due to wiring impedance
within a building will always drive voltage levels lower. For example, if the incoming utility
voltage is 5% low, the voltage at the point of usage might be 8 to 10% (5%+3% to 5%+5%)
below nominal due to the voltage drop within a building.
4.2.3 Sensitivity to Voltage Levels and Voltage Fluctuation
Every piece of electrical equipment will operate within a range of voltage levels, however not
necessarily with optimal performance. When the voltage level falls outside of its operational
range, a device may be unable to start or operate, it may malfunction or the device may be
damaged. The width of the voltage level range within which a device will operate is a
measure of its sensitivity to voltage level. A device that will operate fairly well within a range
of +/-10% of nominal voltage would be considered to have a relatively low sensitivity to
voltage level or voltage fluctuations. A device that operates properly only when the voltage
level is within +/-5% (or less) of nominal voltage would be considered to be sensitive to

voltage level or fluctuations. Three phase motors are very tolerant of voltage level
fluctuations while the electronic controls for the same motor might be quite sensitive.[19]
4.2.4 Voltage Too High, Too Low
Voltage that is too high can cause premature failure of electrical and electronic components
(e.g. circuit boards) due to overheating. The damage caused by overheating is cumulative and
irreversible. Frequent episodes of mild overheating can result in the same amount of
component damage as a few episodes of severe overheating. Like slicing a loaf of bread
you can have many thin slices or a few really thick slices but when you get to the end,
youre done. Motors can, on the other hand, often benefit from voltages that tend to be a little
bit high. The reason is fairly simple. As the voltage level goes up, the current is reduced and
lower current usually equates to less heat generation within the motor windings. There is a
point where the voltage level supplied can be so high as to damage a motor but this level is
far higher than that for electronics. Keeping electrical and electronic components cool tends
to insure their longevity. Slight reductions in voltage levels may permit many electronics to
perform perfectly well while minimizing their temperature. Of course, the same is not true of
motors. Just as higher voltages can help reduce motor operating temperatures, low voltage is
a major cause of motor overheating and premature failure. A low voltage forces a motor to
draw extra current to deliver the power expected of it thus overheating the motor windings.
The rule of thumb for motors is for every 10 degrees C (50 degrees F) a motor is operated
above its rated temperature, motor life will be decreased by 50%.
More than motors and circuit boards are at risk for damage when voltage levels are bad, but
chronic problems with either is often an indication of a voltage problem.
4.3 The Cost of Voltage Problems
Few homeowners can justify the cost of an automatic voltage regulator for whole-house
application. Except for those living in remote or isolated areas, the voltage supplied by the
local utility is usually entirely adequate for common household appliances and electronics.
Even if the voltage levels is off by as much as 5% or more, most household devices will
operate satisfactorily and have a reasonable service life. Those living in isolated areas will
usually find the utility willing to do all they reasonably can to deliver a proper voltage, but
the homeowner may find themselves having to make some accommodations to be able to
operate large, power-consuming equipment such as welders, woodworking equipment, etc.
There appears to be a growing number of very small automatic voltage regulators for use
with home theater and audio equipment. These devices are quite inexpensive compared to

their commercial/industrial counterparts and do provide adequate performance and capability


for home electronics. Application of these home-type AVRs in applications with commercial
and industrial types of equipment has been reported to be quite unsatisfactory with the AVR
failing very quickly. Contrary to the situation of the homeowners, many businesses cannot
afford NOT to have voltage regulation, at least for critical processes.
Downtime in medium to large industrial operations can cost tens of thousands to millions of
dollars each hour. In smaller commercial and industrial companies, the dollars amounts may
not be nearly so dramatic but the impact of voltage-related problems can be equally
devastating.
1.
2.
3.
4.
5.
6.
7.
8.

Lost production and revenue


Increased scrap and rework cost
Increased raw material cost
Increased labor or overtime
Increased quality problems and paperwork
Late or missed deliveries
Reduced customer satisfaction
Increased safety or environmental issues

4.4 Automatic Voltage Regulator Function


An AVR takes in a range of voltage levels and automatically outputs a voltage with a much
narrower range of voltage levels. For example, a typical automatic voltage regulator for
power quality application may have an input voltage range of +10% to -25% of the nominal
input voltage and convert this to a regulated voltage range of +3% to -3% of the nominal
output voltage as shown the graphic for a 480V input and output. A voltage regulator may
have a symmetrical input voltage range (e.g. +10% to -10% of nominal voltage) or an
asymmetrical input voltage range as shown in the example. The choice of symmetrical versus
asymmetrical input voltage range is dictated by purpose and design of the voltage regulator.
The output voltage regulation range is almost universally symmetrical (e.g. +3% to -3% of
nominal output voltage). A voltage regulator may also perform a voltage step up or step down
function whereby the nominal incoming voltage is transformed to a different output voltage
level (e.g. a step up from a 208V input to a 400V output). For a voltage regulator with step up
or step down capability, the input and output voltage ranges are usually applied to the input
and output voltages (e.g. the example would become 208V +10/-25% on the input voltage
range and 400V +3%/-3% for the regulated output range).[19]
4.5 AVR: Phases and Phase Regulation

Automatic

voltage

regulators

can

designed for single phase or

three

applications. It is common

for utilities to use

single

voltage

phase

automatic

ganged together to provide

phase

be
AC

regulators

voltage regulation for

three phase.

Fig. 4.1
Single phase automatic voltage regulators may also be used where a three phase source is
used to supply three single phase loads. Most three phase AVRs may also be used to feed
single phase loads.

Fig. 4.2

For three phase loads, it is usually more cost effective to use a three phase AVR.
A three phase automatic voltage regulator might regulate all three phases together or it might
regulate each phase independently, depending on the design of the AVR.
When dealing with three phase power, it is not uncommon to find that one phase
has a high voltage level while another has a low voltage level. In this situation, being
limited to regulating the voltage level of all three phases together, up or down the same
amount, may not produce satisfactory results.
Independent phase regulation is often the preferred method since it typically provides better
phase-to-phase voltage level balance. Large differences in voltage levels from phase-to-phase
can cause premature failure of electrical devices due to overheating or vibration.
4.5.1 Types of regulator depending on their working
There is tremendous diversity in the size and type of devices that could qualify to be called an
automatic voltage regulator. To get a sense of the degree of diversity among AVRs, consider
an analogy about the term spotlight which can mean pixel-sized all solid state elements
found in display devices to truck-mounted, power guzzlers to illuminate the night sky.
AVRs range in size from small ones that can be mounted on printed circuit boards to those
the size of a small house. This discussion looks at automatic voltage regulators typical for AC
applications of about 1,000 VA (roughly the requirement of a hand-held hair dryer) and larger.
The diversity of automatic voltage regulators in size and design is reflected in the tremendous
variety of names for AVRs:
Ferro resonant voltage regulator(Ferro)

Constant voltage regulator(CVR)

Mechanical tap changing regulator

Electromechanical voltage regulator

Tap changer

Electromechanical voltage stabilizer

Tap-switching voltage regulator

Motorized variable transformer

Servo voltage regulator

Magnetic induction voltage regulator

Servo voltage stabilizer

Magnetic induction voltage stabilizer

Motorized variac

Motor-driven variable autotransformer

Variable autotransformer

Line voltage regulator (LVR)

Line drop compensator (LDC)

On load tap changer (OLTC)

Step voltage regulator

Electronic tap switching voltage regulator

Auto-boost regulator

Double conversion electronic voltage regulator

Electronic voltage regulator (EVR)


4.6 Coil-rotation AC voltage regulator
This is an older type of regulator used in the 1920s that uses the principle of a fixed-position
field coil and a second field coil that can be rotated on an axis in parallel with the fixed coil.
When the movable coil is positioned perpendicular to the fixed coil, the magnetic forces
acting on the movable coil balance each other out and voltage output is unchanged. Rotating
the coil in one direction or the other away from the center position will increase or decrease
voltage in the secondary movable coil.

Fig.4.3
This type of regulator can be automated via a servo control mechanism to advance the
movable coil position in order to provide voltage increase or decrease. A braking mechanism
or high ratio gearing is used to hold the rotating coil in place against the powerful magnetic
forces acting on the moving coil.[20]
4.6.1 Electromechanical automatic voltage regulator
Electromechanical regulators, usually called voltage stabilizers, have also been used to
regulate the voltage on AC power distribution lines. These regulators operate by using a
servomechanism to select the appropriate tap on an autotransformer with multiple taps, or by
moving the wiper on a continuously variable auto transformer. If the output voltage is not in
the acceptable range, the servomechanism switches connections or moves the wiper to adjust
the voltage into the acceptable region. The controls provide a dead band wherein the
controller will not act, preventing the controller from constantly adjusting the voltage
("hunting") as it varies by an acceptably small amount.

Fig.4.4 Circuit design for a simple electromechanical automatic voltage regulator.

Fig. 4.5 Graph of voltage output on a time scale.


In older electromechanical regulators, voltage regulation is easily accomplished by coiling
the sensing wire to make an electromagnet. The magnetic field produced by the current
attracts a moving ferrous core held back under spring tension or gravitational pull. As voltage
increases, so does the current, strengthening the magnetic field produced by the coil and
pulling the core towards the field. The magnet is physically connected to a mechanical power
switch, which opens as the magnet moves into the field. As voltage decreases, so does the
current, releasing spring tension or the weight of the core and causing it to retract. This closes
the switch and allows the power to flow once more. If the mechanical regulator design is
sensitive to small voltage fluctuations, the motion of the solenoid core can be used to move a
selector switch across a range of resistances or transformer windings to gradually step the
output voltage up or down, or to rotate the position of a moving-coil AC regulator. Early
automobile generators and alternators had a mechanical voltage regulator using one, two, or
three relays and various resistors to stabilize the generator's output at slightly more than 6 or

12 V, independent of the engine's rpm or the varying load on the vehicle's electrical system.
Essentially, the relay(s) employed pulse width modulation to regulate the output of the
generator, controlling the field current reaching the generator (or alternator) and in this way
controlling the output voltage produced. The regulators used for generators (but not
alternators) also disconnect the generator when it was not producing electricity, thereby
preventing the battery from discharging back into the generator and attempting to run it as a
motor. The rectifier diodes in an alternator automatically perform this function so that a
specific relay is not required; this appreciably simplified the regulator design. More modern
designs now use solid state technology (transistors) to perform the same function that the
relays perform in electromechanical regulators. Electromechanical regulators are used for
mains voltage stabilization[19]
4.7 Constant-voltage transformer regulator
An alternative method is the use of a type of saturating transformer called a ferro resonant
transformer or constant-voltage transformer. These transformers use a tank circuit composed
of a high-voltage resonant winding and a capacitor to produce a nearly constant average
output with a varying input. The Ferro resonant approach is attractive due to its lack of active
components, relying on the square loop saturation characteristics of the tank circuit to absorb
variations in average input voltage. Older designs of Ferro resonant transformers had an
output with high harmonic content, leading to a distorted output waveform. Modern devices
are used to construct a perfect sine wave. The Ferro resonant action is a flux limiter rather
than a voltage regulator, but with a fixed supply frequency it can maintain an almost constant
average output voltage even as the input voltage varies widely. The Ferro resonant
transformers, which are also known as Constant Voltage Transformers (CVTs) or Ferros, are
also good surge suppressors, as they provide high isolation and inherent short-circuit
protection. A Ferro resonant transformer can operate with an input voltage range 40% or
more of the nominal voltage. Output power factor remains in the range of 0.96 or higher from
half to full load. Because it regenerates an output voltage waveform, output distortion, which
is typically less than 4%, is independent of any input voltage distortion, including notching.
Efficiency at full load is typically in the range of 89% to 93%. However, at low loads,
efficiency can drop below 60% and no load losses can be as high as 20%. The currentlimiting capability also becomes a handicap when a CVT is used in an application with
moderate to high inrush current like motors, transformers or magnets. In this case, the CVT

has to be sized to accommodate the peak current, thus forcing it to run at low loads and poor
efficiency.
Minimum maintenance is required. Transformers and capacitors can be very reliable. Some
units have included redundant capacitors to allow several capacitors to fail between
inspections without any noticeable effect on the device's performance.[20]
4.7.1 SCR regulators
Regulators powered from AC power circuits can use silicon controlled rectifiers (SCRs) as
the series device. Whenever the output voltage is below the desired value, the SCR is
triggered, allowing electricity to flow into the load until the AC mains voltage passes through
zero (ending the half cycle). SCR regulators have the advantages of being both very efficient
and very simple, but because they cannot terminate an on-going half cycle of conduction,
they are not capable of very accurate voltage regulation in response to rapidly-changing
loads.
4.7.2 The AC Automatic Voltage Regulator
The automatic voltage regulator or AVR, as the name implies, is a device intended to regulate
voltage automatically: that is to take a varying voltage level and turn it into a constant voltage
level. In the sections describing the different types of voltage regulators, the common names
for each type will be identified and used interchangeably along with generic names such as
AVR and automatic voltage regulator. Also note that the descriptions, operational
explanations and other commentary provided about the different types of AVRs is for
informational purposes only and is intended to provide an overview of variations among a
class of products generically called automatic voltage regulators.
The main functions of the AVR are:
Potential Divider and Rectifier take a proportion of the generator output voltage and attenuate
it. This input chain of resistors includes the range potentiometer and hand trimmer which
adjust the generator voltage. A rectifier converts the a.c. into d.c. for further processing. The
Amplifier (Amp) compares the sensing voltage to the Reference Voltage and amplifies the
difference (error) to provide a controlling signal for the power devices. The Ramp Generator
and Level Detector and Driver infinitely control the conduction period of the Power Control
Devices and hence provides the excitation system with the required power to maintain the
generator voltage within specified limits.

Chapter 5
Serial Port Interfacing
5.1 Basics of Serial Communication
When a microprocessor communicates with the outside world, it provides the data in bytesized chunks. In some cases, such as printers, the information is simply grabbed from the 8bit data bus and presented to the 8-bit data bus of the printer. This can work only if the cable
is not too long, since long cables diminish and even distort signals. Furthermore, an 8-bit data
path is expensive. For these reasons, serial communication is used for transferring data
between two systems located at distances of hundreds of feet to millions of miles apart.

Figure 5.1 Serial Communications [21]


The fact that in serial communication a single data line is used instead of the 8-bit data line of
parallel communication makes it not only much cheaper but also makes it possible for two
computers located in two different cities to communicate over the telephone. For serial data
communication to work the byte of data must be converted to serial bits using a parallel in
serial out register; then it can be transmitted over a single data line. This also means that at
the receiving end there must be a serial-in-parallel-out shift register to receive the signal data
and pack them into byte. Of course, if data is to be transferred on the telephone line, it must
be converted from 0s and 1s to audio tones, which are sinusoidal-shaped signals. A peripheral
device called a modem, which stands for modulator/demodulator, performs this conversion.
When the distance is short, the digital signal can be transferred as it is on a simple wire and
requires no modulation. This is how IBM PC keyboards transfer data to the motherboard.
However, for long-distance data transfer using communication lines such as a telephone,
serial data communication requires a modem to modulate (convert from 0s and 1s to audio
tones) and demodulate (converting from audio tones to 0s and 1s).
Serial data communication uses two methods, asynchronous and synchronous. The
synchronous method transfers a block of data (characters) at a time while the asynchronous
transfers a single byte at a time. It is possible to write soft ware to use either of these

methods, but the programs can be tedious and long. For this reason, there are special IC
chips made by many manufacturers for serial data communications. These chips are
commonly referred to as UART (universal asynchronous receiver-transmitter) and USART
(universal synchronous-asynchronous receiver-transmitter). The 80S51 chip has a built-in
UART.[21]
5.1.1 Half- and full-duplex transmission
In data transmission if the data can be transmitted and received, it is a, duplex transmission.
This is in contrast to simplex transmissions such as with printers, in which the computer only
sends data. Duplex transmissions can be half or full duplex, depending on whether or not the
data transfer can be simultaneous. If data is transmitted one way at a time, iris referred to as
half duplex. If the data can go both ways at the same time, it is full duplex. Of course, full
duplex requires two wire conductors for the data lines (in addition to the signal ground), one
for transmission and one for reception, in order to transfer and receive data simultaneously.
See Figure.

Figure 5.2 Simplex, Half-, Full-Duplex Transfer[22]


5.1.2 Asynchronous serial communication and data framing
The data coming in at the receiving end of the data line in a serial data transfer is all 0s and
1s; it is difficult to make sense of the data unless the sender and receiver agree on a set of
rules, a protocol, on how the data is packed, how many bits constitute a character, and when
the data begins and ends

5.1.3 Start and stop bits


Asynchronous serial data communication is widely used for character-oriented
transmissions, while block-oriented data transfers use the synchronous method. In the
asynchronous method, each character is placed in between start and stop bits. This is called
framing. In data framing for asynchronous communications, the data, such as ASCII
characters, are packed in between a start bit and a stop bit. The start bit is always one bit but
the stop bit can be one or two bits. The start bit is always a 0 (low) and the stop bit(s) is 1
(high). For example, look at Figure below in which the ASCII character "A" (8-bit binary
0100 0001) is framed in between the start bit and a single stop bit. Notice that the LSB is
sent out first.[22] Notice in Figure below that when there is no transfer, the signal is 1 (high),
which is referred to as mark. The 0 (low) is referred to as space. Notice that the transmission
begins with a start bit followed by D0, the LSB, then the rest of the 'bits until the MSB (07),
and finally, the one stop bit indicating the end of the character "A".

Figure 5.3 Framing ASCII A" (41H)[3]


In asynchronous serial communications, peripheral chips and modems can be programmed
for data that is 7 or 8 bits wide. This is in addition to the number of stop bits, 1 or 2. While in
older systems ASCII characters were 7-bit, in recent years due to the extended ASCII
characters, 8-bit data has become common. In some older systems, due to the slowness of the
receiving mechanical device, two stop bits were used to give the device sufficient time to
organize itself before transmission of the next byte. However, in modem PCs the use of one
stop bit is standard. Assuming that we are transferring a text file of ASCII characters using 1
stop bit, we have a total of 10 bits for each character: 8 bits for the ASCII code, and 1 bit
each for the start and stop bits. Therefore, for each 8-bit character there are extra 2 bits,
which gives 25% overhead.
In some systems in order to maintain data integrity, the parity bit of the character byte is
included in the data frame. This means that for each character (7or 8-bit, depending on the
system) we have a single parity bit in addition to start and stop bits. The parity bit is odd or
even. In the case of an odd-parity bit the number of data bits, including the parity bit, has an

odd number of Is. Similarly, in an even-parity bit system the total number of bits, including
the parity bit, is even. For' example, the ASCII character "A", binary 0100 0001, has 0 for the
even-parity bit. UART chips allow programming of the parity bit for odd-, even-, and noparity options.
5.1.4 Data transfer rate
The rate of data transfer in serial data communication is stated in bps (bits per second).
Another widely used terminology for bps is baud rate. However, the baud and bps rates are
not necessarily equal. This is due to the fact that baud rate is the modem terminology and is
defined as the number of signal changes per second. In modems, there are occasions when a
single change of signal transfers several bits of data. As far as the conductor wire is
concerned, the baud rate and bps are the same, and for this reason in this book we use the
terms bps and baud interchangeably.
The data transfer rate of a given computer system depends on communication ports
incorporated into that system. For example, the early IBM PC/XT could transfer data at the
rate of 100 to 9600 bps. However in recent years, Pentium based PCs transfer data at rates as
high as 56K bps. It must be noted that in asynchronous serial data communication, the baud
rate is generally limited to 100,000 bps. [21}
5.2 RS232 standards
To allow compatibility among data communication equipment made by various
manufacturers, an interfacing standard called RS232 was set by the Electronics Industries
Association (EIA) in 1960. In 1963 it was modified and called RS232A. RS232B and
RS232C were issued in 1965 and 1969, respectively. In this book we refer to it simply as
RS232. Today, RS232 is the most widely used serial I/O interfacing standard. This standard is
used in PCs and numerous types of equipment. However, since the standard was set long
before the advent of the TTL logic family, its input and output voltage levels are not TTL
compatible. In RS232, a 1 is represented by -3 to -25 V, while a 0 bit is +3 to +25 V, making
-3 to +3 undefined. For this reason, to connect any RS232.to a micro controller system we
must use voltage converters such as MAX232 to convert the TTL logic levels to the RS232
voltage level, and vice versa. MAX232 IC chips are commonly referred to as line drivers.
5.2.1 RS232
In RS232 there are two data lines RX and TX. TX is the wire in which data is sent out to
other device. RX is the line in which other device put the data it need to sent to the device.

Figure 5.4 - RS232 transmission.


The arrows indicate the direction of data transfer. In addition to RX/TX lines there is a
third line i.e. Ground (GND) or Common.[23]

A HIGH =+5v and LOW=0v in TTL / MCU circuits but in RS232 a HIGH=-12V and
LOW=+12V.
As there is no "clock" line so for synchronization accurate timing is required so transmissions
are carried out with certain standard speeds. The speeds are measured in bits per second.
Number of bits transmitted is also known as baud rate.
Some standard baud rates are
1.
2.
3.
4.
5.
6.
7.
8.

1200
2400
4800
9600
19200
38400
57600
115200

To transmit a single byte we need extra bits they are START BIT AND STOP BIT(more
about them latter). Thus to send a byte a total of ten bits are required so we are sending 960
bytes per second.
5.3 RS232 Data Transmission.
The data transfer is done in following ways

5.3.1 Transmission
When there is no transmission the TX line sits HIGH ( STOP CONDITION )
1. When the device needs to send data it pulls the TX line low for 104uS (This is the
start bit which is always 0)
2. then it send each bits with duration = 104uS

3. Finally it sets TX lines to HIGH for at least 104uS (This is stop bits and is always 1).
[23]

Figure 5.5- Data Transmission on RS232 line.[23]

5.3.2 Reception
a) The receiving device is waiting for the start bit i.e. the RX line to go LOW When it
gets start bit it waits for half bit time i.e. 104/2 = 51uS now it is in middle of start bit
it reads it again to make sure it is a valid start bit not a spike.
b) Then it waits for 104uS and now it is in middle of first bit it now reads the value of
RX line.
c) In same way it reads all 8 bits
d) Now the receiver has the data.[23]

Figure 5.6- How the Receiver receives the data on RS232 RX [23]
5.3.3. RS 232 pins
Table below (for DB-9) provides the pins and their labels for the RS232 cable, commonly
referred to as DB-25 connector. In labeling, DB-9P refers to the plug connector (male) and
DB-9S is for the socket connector (female).
Since not all the are used in PC cables, IBM introduced the DB-9 version of the serial I/O
standard, which uses 9 pins only, as shown in Table. The DB-9 pins are shown in Figure
below.

Fig 5.7 DB-9 Pin Connector [8]

Table 5.1 IBM PC DB-9 Signals


5.3.4 Limitations of the standard
Because the application of RS-232 has extended far beyond the original purpose of
interconnecting a terminal with a modem, successor standards have been developed to
address the limitations. Issues with the RS-232 standard include:

a) The large voltage swings and requirement for positive and negative supplies increases
power consumption of the interface and complicates power supply design. The
voltage swing requirement also limits the upper speed of a compatible interface.
b) Single-ended signaling referred to a common signal ground limits the noise immunity
and transmission distance.
c) Multi-drop connection among more than two devices is not defined. While multi-drop
"work-arounds" have been devised, they have limitations in speed and compatibility.
d) The handshaking and control lines of the interface are intended for the setup and
takedown of a dial-up communication circuit; in particular, the use of handshake lines
for flow control is not reliably implemented in many devices.
e) No method is specified for sending power to a device. While a small amount of
current can be extracted from the DTR and RTS lines, this is only suitable for low
power devices such as mice.
5.3.5 RS-232 Level Converters:
Usually all the digital ICs work on TTL or CMOS voltage levels which cannot be used to
communicate over RS-232 protocol. So a voltage or level converter is needed which can
convert TTL to RS232 and RS232 to TTL voltage level. The most commonly used RS-232
level converter is MAX232. This IC includes charge pump which can generate RS232
voltage levels (-10V and +10V) from 5V power supply. It also includes two receiver and two
transmitters and is capable of full-duplex UART/USART communication.

Figure 5.8 - Schematic for RS232 level converter.

Figure 5.9[21]

Figure 5.10 internal hardware of MAX 232[21]


5.4

MAX232 Interfacing with Microcontrollers

To communicate over UART or USART, we just need three basic signals which are namely,
RXD (receive), TXD (transmit), GND (common ground). So to interface MAX232 with any
microcontroller (AVR, ARM, 8051, PIC etc..) we just need the basic signals. A simple
schematic diagram of connections between a microcontroller and MAX232 is shown below:
Working of RS 232

Figure 5.11 Block Diagram of RS 232 level converters

Figure 5.12 interfacing MAX 232 with serial port[7]


5.5 Hyper Terminal
HyperTerminal is a program that you can use to connect to other computers, Telnet sites, and
built-in board systems (BBSs), online services, and host computers, using either your modem
or a null modem cable. HyperTerminal is a program that you can use to connect to other
computers, Telnet sites, bulletin board systems (BBSs), online services, and host computers,
using your modem, a null modem cable or Ethernet connection. Though using HyperTerminal
with a BBS to access information on remote computers is a practice that has become less
common with the availability of the World Wide Web, HyperTerminal is still a useful means
of configuring and testing your modem or examining your connection with other sites. For
more information, see Set up a new connection.
HyperTerminal records the messages passed to and from the computer or service on the other
end of your connection. Therefore, it can serve as a valuable troubleshooting tool when

setting up and using your modem. To make sure that your modem is connected properly or to
view your modem's settings, you can send commands through HyperTerminal and check the
results. HyperTerminal has scroll functionality that allows you to look at received text that
has scrolled off the screen.
Start Menu (All Programs>Accessories>Communication>Hyperterminal)

1. Enter the name of connection say "testing" and select any icon for it.

Figure 5.13- HyperTerminal Main Window

2. Select COM port in the "Connect Using Drop Down List". PC might be having more
than one COM port but commonly only one is available outside the rest are connected
internally to modems etc.

Figure 5.14- Select COM port.

5.6 Common applications for serial ports


The RS-232 standard is used by many specialized and custom-built devices. This list includes
some of the more common devices that are connected to the serial port on a PC. Some of
these such as modems and serial mice are falling into disuse while others are readily
available.
1.
2.
3.
4.
5.
6.
7.
8.
9.

Computer terminal
Dial-up modems
Printers
Networking
Serial mouse
Older Joysticks
GPS receivers
Older GSM mobile phones
Satellite phones, low-speed satellite modems and other satellite based transceiver

devices
10. Microcontroller, EPROM and other programmers
11. Bar code scanners and other point of sale devices
12. LED and LCD text displays
13. Flat-screen (LCD and Plasma) monitors to control screen functions by external
computer, other AV components or remotes
14. Homemade electronic devices such as Arduino hobby microcontrollers
15. Older digital cameras
16. Test and measuring equipment such as digital multimeters and weighing systems
17. Updating Firmware on various consumer devices.
18. Some CNC controllers

Chapter 6
Introduction to Data Logging
6.1 Introduction
Data is a collection of facts from which conclusions may be drawn. The term data means
groups of information that represent the qualitative or quantitative attributes of a variable or
set of variables. A data segment is one of the sections of a program in an object file or in
memory, which contains the global variables and static variables that are initialized by the
programmer. It has a fixed size, since all of the data in this section is set by the programmer
before the program is loaded. In computer science, data is anything in a form suitable for use
with a computer. Data is often distinguished from programs. A program is a set of instructions
that detail a task for the computer to perform. In this sense, data is thus everything that is not
program code. Data is Information that has been organized and categorized for a pre
determined purpose
6.1.1 Introduction to data logging
The process of using a computer to collect data through sensors, analyze the data and save
and output the results of the collection and analysis. Data logging also implies the control of
how the computer collects and analyzes the data. Data logging is commonly used in scientific
experiments and in monitoring systems where there is the need to collect information faster
than a human can possibly collect the information and in cases where accuracy is essential.
Examples of the types of information a data logging system can collect include temperatures,

sound frequencies, vibrations, times, light intensities, electrical currents, pressure and
changes in states of matter.
6.1.2 Data logger
A data logger (also data logger or data recorder) is an electronic device that records data over
time or in relation to location either with a built in instrument or sensor or via external
instruments and sensors.
Data logger (also data logger or data recorder) is an electronic device that records data over
time or in relation to location either with a built in instrument or sensor or via external
instruments and sensors. Increasingly, but not entirely, they are based on a digital processor
(or computer). They generally are small, battery powered, portable, and equipped with a
microprocessor, internal memory for data storage, and sensors. Some data loggers interface
with a personal computer and utilize software to activate the data logger and view and
analyze the collected data, while others have a local interface device (keypad, LCD) and can
be used as a stand-alone device. Data loggers vary between general purpose types for a range
of measurement applications to very specific devices for measuring in one environment or
application type only. It is common for general purpose types to be programmable; however,
many remain as static machines with only a limited number or no changeable parameters.
Electronic data loggers have replaced chart recorders in many applications. One of the
primary benefits of using data loggers is the ability to automatically collect data on a 24-hour
basis. Upon activation, data loggers are typically deployed and left unattended to measure
and record information for the duration of the monitoring period. This allows for a
comprehensive, accurate picture of the environmental conditions being monitored, such as air
temperature and relative humidity.
6.2 Data Format
Standardization of protocols and data formats has been a problem but is now growing in the
industry and XML is increasingly being adopted for data exchange. The development of the
Semantic Web is likely to accelerate this trend. Data must be logged in understandable
language.
6.2.1 Data logging verses data acquisition
The terms data logging and data acquisition are often used interchangeably. However, in a
historical context they are quite different. A data logger is a data acquisition system, but a
data acquisition system is not necessarily a data logger.

1. Data loggers typically have slower sample rates. A maximum sample rate of 1 Hz may
be considered to be very fast for a data logger, yet very slow for a typical data
acquisition system.
2. Data loggers are implicitly stand-alone devices, while typical data acquisition system
must remain tethered to a computer to acquire data. This stand-alone aspect of data
loggers implies on-board memory that is used to store acquired data. Sometimes this
memory is very large to accommodate many days, or even months, of unattended
recording. This memory may be battery-backed static random access memory, flash
memory or EEPROM. Earlier data loggers used magnetic tape, punched paper tape, or
directly viewable records such as "strip chart recorders".
3. Given the extended recording times of data loggers; they typically feature a time- and
date-stamping mechanism to ensure that each recorded data value is associated with a
date and time of acquisition. As such, data loggers typically employ built-in real-time
clocks whose published drift can be an important consideration when choosing
between data loggers.
4. Data loggers range from simple single-channel input to complex multi-channel
instruments. Typically, the simpler the device the less programming flexibility. Some
more sophisticated instruments allow for cross-channel computations and alarms
based on predetermined conditions. The newest of data loggers can serve web pages,
allowing numerous people to monitor a system remotely.
5. The unattended and remote nature of many data logger applications implies the need
in some applications to operate from a DC power source, such as a battery. Solar
power may be used to supplement these power sources. These constraints have
generally led to ensure that the devices they market are extremely power efficient
relative to computers. In many cases they are required to operate in harsh
environmental conditions where computers will not function reliably.
6. This unattended nature also dictates that data loggers must be extremely reliable.
Since they may operate for long periods nonstop with little or no human supervision,
and may be installed in harsh or remote locations, it is imperative that so long as they
have power, they will not fail to log data for any reason. Manufacturers go to great
length to ensure that the devices can be depended on in these applications. As such
data loggers are almost completely immune to the problems that might affect a

general-purpose computer in the same application, such as program crashes and the
instability of some operating systems.
6.3 Future Directions about data logging
Data Loggers are changing more rapidly now than ever before. The original model of a stand
alone data logger is changing to one of a device that collects data but also has access to
wireless communications for alarming of events, automatic reporting of data and remote
control. Data loggers are beginning to serve web pages for current readings e-mail their
alarms and FTP their daily results into databases or direct to the users.

6.4 Data logging and functional requirement


Every data logging application, from manually recording weather patterns in the 15th century,
to logging the experimental parameters of a fusion reactor test in the 21st century, can be
broken down into a set of five common functional requirements, illustrated in Figure
Acquiring is the process of actually measuring the physical parameters and bringing them
into your logging system. Online analysis consists of any processing done to the data while
you are acquiring. It includes alarms, data scaling, and sometimes control, among others.
Logging, or storing, the data is an obvious requirement of every data logging system. Offline
analysis is everything done with the data after it has been acquired in order to extract useful
information from it. The final functional block is made up display, reporting, and data
sharing. These are all the "miscellaneous" requirements that fill out the functionality of a data
logging system. Lets examine how each of these functional blocks is addressed with modern,
PC-based data logging systems.
6.4.1 Acquisition
The acquisition function is one of the most critical components of every data logging system.
In a PC-based system, the acquisition is accomplished by the measurement hardware, which
can be further broken down into sensors, signal connectivity, signal conditioning, and analogto-digital conversion, as shown in Figure 3. Since these topics are well covered in other
material, only a high-level overview will be given here.
6.4.2 Sensors

A wide variety of sensors is used to convert physical parameters into electrical signals.
Temperature sensors such as thermocouples, RTDs, or thermistors are some of the most
common sensors used in data logging applications. Other widespread sensors are flow meters,
pressure transducers, strain gauges, accelerometers, and microphones, to name a few. Proper
selection and installation of sensors is beyond the scope of this paper.
6.4.3 Signal Connectivity
After sensors are installed, they must be connected to the data logging system. Signal
connectivity describes the component of your measurement hardware with which you
connect your sensors to your logging system. Screw terminals, with which you can connect
bare wires from sensors directly to your logging system, are the most basic form of
connections. Screw terminals are a good choice for general-purpose use, particularly when
you need to connect a large number of signals into a small amount of space. The disadvantage
of screw terminals is that they are time-consuming to connect and difficult to reconfigure.
Figure 4 shows some other standard connectivity options that are designed to make
connecting and disconnecting sensors less labor-intensive. Mini thermocouple connectors are
a widely used option for thermocouples. BNC and SMB connectors are commonly used when
electrical shielding is required for noise immunity. Banana jacks are often used when
measuring current, resistance, or higher voltages.
6.4.4 Signal Conditioning
Signal conditioning is one of the most important, and most overlooked, components of a PCbased data logging system. Most signals require some form of preparation (conditioning)
before they can be digitized. For example, thermocouples produce very low level signals that
require amplification, filtering and linearization. Other sensors, such as RTDs, thermostats,
strain gauges and accelerometers, require power in addition to amplification and filtering,
while other signals may require isolation to protect the system from high voltages. Even pure
voltage signals can require special technologies to block large common-mode signals or to
attenuate high voltages for safe measurement. No single stand-alone datalogger can provide
the flexibility required to make all of these measurements. However, with front-end signal
conditioning, you can combine the necessary technologies to bring these various types of
signals into a single PC-based data logging system.
6.4.5 Amplification

When the voltage levels you are measuring are very small, amplification is used maximize
the effectiveness of your digitizer. By amplifying the input signal, the conditioned signal uses
more of the effective range of the analog-to-digital converter (ADC) and you achieve better
measurement accuracy. Typical sensors that require amplification are thermocouples and
strain gauges.
6.4.6 Attenuation
Attenuation is the opposite of amplification. It is necessary when the voltages to be digitized
are beyond the input range of the digitizer. This form of signal conditioning divides down the
input signal so that the conditioned signal is within the range of the ADC. Attenuation is
necessary for measuring voltages higher than 10 V.

6.4.7 Isolation
Voltage signals outside the range of the digitizer can damage the measurement system and
harm the operator. For that reason, isolation is usually required in conjunction with
attenuation to protect the system and the user from dangerous voltages or voltage spikes.
Isolation may also be required when the sensor is on a different electrical ground plane from
the measurement sensor (such as a thermocouple mounted on an engine).
6.4.8 Multiplexing
Typically, the digitizer is the most expensive part of a data acquisition system. Using
multiplexing, you can automatically route several signals into a single digitizer to provide a
cost-effective way to greatly expand the signal count of your system. Multiplexing is
necessary for any high-channel-count application.
6.4.9 Filtering
Filtering is required to remove unwanted frequency components from a signal to prevent
aliasing and reduce signal noise. Thermocouple measurements typically require a lowpass
filter to remove power line noise from the signals. Vibration measurements normally require
a higher frequency lowpass filter to remove high frequency signal components that are above
the range of the acquisition system

6.4.10 Excitation
Many sensor types, including RTDs, strain gauges, and accelerometers, require excitation
some form of power to make a measurement. Excitation signals can be voltage or current,
depending on the sensor type.
6.4.11 Linearization
Some types of sensors produce voltage signals that are not linearly related to the physical
quantity they are measuring. Linearization is the process of interpreting the signal from the
sensor as a physical measurement. This can be done either with signal conditioning or
through software. Thermocouples are the classic example of a sensor that requires
linearization.
6.4.12 Cold-Junction Compensation
Another technology that is required for thermocouple measurements is cold-junction
compensation (CJC). Any time a thermocouple is connected to a data acquisition system, the
temperature of the connection must be known in order to calculate the true temperature the
thermocouple is measuring. A built-in CJC sensor must be present at the location of the
connections.
6.4.13 Simultaneous Sampling
When it is critical to measure two or more signals at exactly the same time, simultaneous
sampling is required. Front-end signal conditioning can provide a much more cost-effective
simultaneous sampling solution than purchasing a digitizer with those capabilities. Typical
applications that might require simultaneous sampling include vibration measurements and
phase-difference measurements.
6.5 Online Analysis
The next functional component in a typical data logging system is online analysis. In PCbased systems, online analysis is accomplished through software. Many different forms of
online analysis can be needed in various data logging applications. We will discuss some of
the most common ones here.
6.5.1 Channel scaling is the conversion of the raw binary values returned by the
acquisition system into properly scaled measurements with appropriate engineering units.
One example is computing temperature (in degrees C) from a thermocouple reading. The
digitizer returns binary measurements of the thermocouple voltage and the cold-junction

sensor voltage. The software converts the binary measurements into voltages, and then uses a
thermocouple conversion formula to compute temperature. Similar channel scaling routines
are used for strain gauges, RTDs, accelerometers, and others. Fortunately, modern PC-based
measurement software handles most scaling functions automatically. Another important
online analysis function is alarming and event management, which typically means
monitoring a channel and providing some notification if limits are exceeded. This notification
can be as basic as turning on a warning light, or as complex as paging someone with
information about the problem. Alarming can also include an automated response to certain
events. For example, a data logging system could shut down a machine being monitored if
the oil temperature exceeded a certain limit. A wide range of online analysis functionality can
be required in different data logging applications. This functionality could include feedback
control systems or advanced signal analysis. Only PC-based data logging systems have the
flexibility to implement these differing requirements.

6.5.2 Logging and Storage


The logging (or storage) functional block is, by definition, required in every data logging
system. Methods of storing data vary widely across different systems. Strip chart recorders
use paper, traditional dataloggers can use internal nonvolatile memory, floppy disks, or a
variety of other media. PC-based data logging systems typically use the hard drive of the PC,
although they can also use tape drives, network drives, RAID drives, and other more exotic
options.
6.5.3 Software
Software is of critical importance in PC-based data logging systems, because well-written
logging software determines how data is stored, how quickly data can be written to disk, and
how efficiently disk space is used. Logging software also gives you data management
capabilities, such as changing data formats, archiving data, and access to databases. The data
storage format has a strong link to the performance and ease of use of your data logging
system. There are three general formats commonly used for storage in data logging systems
ASCII text files, binary files, and databases.
6.6 Data storage:

Binary files are the most efficient method of data storage. With binary files, the raw bytes that
the computer is using to store data in memory are written directly to the file. This data takes
up considerably less space than the same information written in ASCII text format, and it
requires much less processor overhead than formatting into text. Binary files cannot be
viewed in common software applications such as MS Excel. Instead, they must be translated
by a software routine into meaningful data. With PC-based data logging systems you can log
scaled data that is already processed into correct engineering units, or you can log the raw
binary values returned by the digitizer. The raw binary values representing the analog-todigital conversions of each sample returned from a 16-bit DAQ device take up 16 bits, or two
bytes, of memory. The channel scaling routines in your logging software automatically
convert this raw data into a real number that represents the physical value you measured.
Scaled data is typically handled inside your data logging software as a double precision
floating-point value, which refers to a data type taking up eight bytes of memory on most
computer systems. For performance reasons, some high-speed data logging systems might
log the raw binary values to disk, along with the necessary scaling constants to convert them
to scaled data at a later time. Figure 5 shows the relationship between logging raw binary,
scaled binary, and ASCII text. With binary files, you require less space and achieve greatly
improved stream-to-disk speed. Raw binary files can be less than one tenth the size of a text
file containing the same information. The disadvantage of binary files is that they typically
must be translated to another format before they can be shared between different applications.
Many data logging software packages log data into databases. Databases are typically binary
files that provide a structured format for inserting and retrieving data. They are optimized for
efficiently handling large amounts of data and for searching through information in the
database without loading everything into memory. Databases also are often designed for easy
backup and archiving of data and multiple-user access. They usually have software methods
to make it easy to import data into different software packages for analysis and report
generation. In many ways, databases are the ideal storage format for PC-based data logging
systems. Two disadvantages of using databases for storage are that they add increased
complexity, and they are difficult to implement if starting from scratch. High-speed data
logging applications (more than 1Msamples/second) can start to exceed the write-to-disk
speeds of normal PC hard drives. One of the advantages of PC-based logging systems is that
you can move to more high-performance storage devices and higher performance computers,
often with little or no modifications to your logging software or measurement hardware. One
type of high-performance storage device is the RAID (redundant array of independent disks)

controller. RAID controllers use multiple hard drives in concert to greatly enhance the
combined stream-to-disk speed and to provide improved data integrity. Audio-visual (AV)
drives are another type of storage device that is used for high-speed data logging. AV drives
are optimized for streaming large amounts of audio and video information to disk, and this
optimization also makes them well suited for high-performance data logging applications.
Finally, some companies make custom hardware for streaming data from DAQ devices
directly into a storage device via the PCI bus in the PC. The stream-to-disk rates of these
devices are limited by the available bandwidth of the PCI bus, which has a theoretical
maximum of 132 Mbytes/s on most computer systems.
6.7 Offline Analysis
Offline analysis is performing mathematical functions on data after it has been acquired in
order to extract important information. Types of offline analysis can include computing basic
statistics of measured parameters, as well as more advanced functions such as the frequency
content of signals and order analysis. Offline analysis can be integrated with the rest of the
data logging application, or it can occur separately through stand-alone analysis software
packages. Often, offline analysis is combined with the report generation, historical display,
and data sharing functions.
6.7.1 Display
Most data logging applications require some form of display to view the measurements that
are being recorded. The display function can be further broken down to viewing live data and
historical data. Live data display is necessary if you need to view data as it is being acquired.
Many stand-alone dataloggers have a live data display integrated into the box with them.
Historical display lets you view data that was previously acquired. Most stand-alone
dataloggers require you to move the data to a PC for historical viewing. With PC-based data
logging applications, you combine both live display and historical display into the same user
interface. Data viewing utilities should provide an intuitive user interface, scrolling and
zooming capabilities, cursors, and general customization features. Figure 6 is an example of a
typical historical data display found with commercially available software.
6.7.2 Report Generation
Report generation is a function that is often not considered part of the data logging
application. In reality, almost every data logging application requires some form of reporting
capability, for the simple reason that if youre recording the data, somebody needs to see it in

a presentable format. Report generation can be integrated into PC-based data logging
applications for increased efficiency. The logging application can be set up to periodically
generate specified reports and distribute them to the appropriate people. Powerful commercial
software is available to give you advanced capabilities for analyzing data and generating
reports from your measurements. Figure 7 shows an example of some of the report generation
capabilities possible with commercially available packages. When choosing software for
report generation, it is critical that it integrate smoothly with the rest of your data logging
software. Ideally, the logging software should be able to pass data directly to the report
generation application and trigger automatic reports.
6.7.3 Data sharing and Publishing
For data that has been logged to be useful, it must be available to the right people. With the
networking capabilities found in modern data logging software, sharing data and publishing it
to the network no longer requires a degree in computer science. Logging applications can be
set up to publish live data to the network as it is acquired, periodically e-mail both raw data
and analyzed results to key personnel, or automatically post reports to a Web page. In widely
distributed data logging applications, each logging node can publish its measurements to the
network, and a main computer can serve as the central collection facility. The central
computer retrieves the measurements from each node, combines them for further analysis,
logs the results for permanent archiving, and periodically generates reports analyzing the
data.
6.8 Applications of data logging
Data logging and recording is a very common measurement application. In its most basic
form, data logging is the measurement and recording of physical or electrical parameters over
a period of time. The data can be temperature, strain, displacement, flow, pressure, voltage,
current, resistance, power, or any of a wide range of other parameters. Real-world data
logging applications are typically more involved than just acquiring and recording signals,
typically involving some combination of online analysis, offline analysis, display, report
generation, and data sharing. Moreover, many data logging applications are beginning to
require the acquisition and storage of other types of data, such as recording sound and video
in conjunction with the other parameters measured during an automobile crash test. Data
logging is used in a broad spectrum of applications. Chemists record data such as
temperature, pH, and pressure when performing experiments in a lab. Design engineers log

performance parameters such as vibration, temperature, and battery level to evaluate product
designs. Civil engineers record strain and load on bridges over time to evaluate safety.
Geologists use data logging to determine mineral formations when drilling for oil. Breweries
log the conditions of their storage and brewing facilities to maintain qualities
1. Unattended weather station recording (such as wind

speed /direction, temperature,

relative humidity, solar radiation).


2. Recording of electrical parameters such as current, voltage, frequency, temperature of
winding and speed of motor.
3. Unattended hydrographic recording (such as water level, water depth, water flow,
water pH, water conductivity).
4. Unattended soil moisture level recording.
5. Unattended gas pressure recording.
6. Offshore buoys for recording a variety of environmental conditions.
7. Road traffic counting.
8. Measure temperatures (humidity, etc) of perishables during shipments: Cold
chain
9. Process monitoring for maintenance and troubleshooting applications.
10. Process monitoring to verify warranty conditions
11. Measure vibration and handling shock (drop height) environment of distribution
packaging.
12. Tank level monitoring.
13. Deformation monitoring of any object with geodetic or geotechnical sensors
controlled by an automatic deformation monitoring system.
14. Environmental monitoring.
15. Vehicle Testing
16. Monitoring of relay status in railway signaling.
6.9 Advantages and Disadvantages of data logging
Using computers to record data has a number of advantages over recording data manually:
1. Measurements are always taken at the right time. Unlike a human the computer will
not forget to take a reading or take a reading too late or too early.
2. Mistakes are not made in reading the results. Humans can make errors. For example it
is quite easy to misread the temperature using the scale on a thermometer.
3. Data logging devices can be sent to places that humans can not easily get to. e.g. to
the planet Mars, into the bottom of a volcano, or onto a roof of a tall building to get to
a weather station.
4. Graphs and tables of results can be produced automatically by the data logging
software.

The main disadvantage of using a data logging system is the initial cost of purchasing the
equipment. Whilst a thermometer can be purchased for less than one pound, the price of the
components of a data logging system to record the temperature will be considerable.

Conclusion
A. Learning through the project:
The following is a list of the experiences gained by us in the processes of developing
this project. This project provided us with the opportunity to learn skills related to following
fields.
B. New Technical knowledge:
1)

Communicating with the SERIAL PORT

2)

RS232 Communication and the host MCU.

3)

Development of embedded code for the host MCU.

4)

Motor And Generator trouble-shooting

5)

The mechanics of and LCD matrices

6)

The details of AC/DC signal conversion

7)

The web page hosting

8)

Development of code for a microcontroller

9)

The use of sensors, and optocoupler for control applications

10)

PCB design entry and board level designing.

C. Project Experience
1) Professional project planning, scheduling, conducting and management.
2) Personal time management required to efficiently contribute to this type of project
3) Use of outside resources when the team was not able to figure out the complicated
issues
4) Including slack time is very important in a project and is necessary to handle
unforeseen events.
5) The need for an individual to facilitate the project also exists. Someone to make sure
that tasks start on time and are being completed in a reasonable amount of time.
6) Time management

ABBREVIATIONS AND SYMBOLS


The introduction of digital technology means that the Protection Engineer must now be
familiar with a range of technical terms in this field, in addition to the terms long associated
with Protection and Control. Below is a list of terms and their meanings that are now
commonly encountered in the Protection and Control field and are extensively used in this
thesis.
ACB: Air Circuit Breaker
ADC: Analogue to Digital Converter
AGC: Automatic Gain Control
AI: Analogue Input
AIS: Air Insulated Switchgear
AO: Analogue Output
AUX: Auxiliary
AVR: Automatic Voltage Regulator
BCD: Binary Coded Decimal
BT: Booster Transformer
CAD: Computer Aided Design
CB: Circuit Breaker

CCR: Central Control Room


CHP: Combined Heat and Power
CT: Current Transformer
DAC: Digital to Analogue Converter
DAR: Delayed auto-reclose
DCS: Distributed Control System
DT: Definite time
FPI: Fault Passage Indicator
GTO: Gate Turn-off Thyristor
HSR: High Speed Reclosing
HVDC: High Voltage Direct Current
IGBT: Insulated Gate Bipolar Transistor
I/O: Input/output
ISO: International Standards Organization
L: Inductance
LAN: Local Area Network
LCD: Liquid Crystal Display
LED: Light Emitting Diode
MCB: Miniature Circuit Breaker
N/C: Normally Closed
N/O: Normally Open
NPS: Negative Phase Sequence
NS: Neutral Section (electrified railways)
OCB: Oil Circuit Breaker
OHL: Overhead line

PCB: Printed Circuit Board


PLCC: Power Line Carrier Communication
REF: Restricted Earth Fault
RMU: Ring Main Unit
RTD: Resistance Temperature Detector
SVC: Static Var Compensator
TCS: Trip Circuit Supervision
UPS: Uninterruptible Power Supply
V: Voltage
VCB: Vacuum Circuit Breaker
VT: Voltage Transformer
X: Reactance
Z: Impedance

REFERENCES:
[1] http://www.eolss.net/ebooks/Sample%20Chapters/C05/E6-39A-05-03.pdf
[2] http://www.8051projects.net/pic_tutorial/
[3] http://microcontrollershop.com/product_info.php?products_id=1078
[4] Draper A. (1971). Electrical Machines, 2nd edn., 384 pp. London: Longman. [A
classic text on electrical machines.]
[5]
[6]
[7]
[8]

http://ugpro143.blogspot.com/2010/08/lm358-dual-opamp-features.html
http://www.mikroe.com/eng/chapters/view/17/chapter-4-examples/#c4v1
http://www.mpoweruk.com/history.html
http://ugpro143.blogspot.com/2010/08/lm358-dual-opamp-features.html
[9] Fitzgerald A.E., Kingsley Jr. C., and Umans S.D. (1985). Electric Machinery, 571 pp.
New York: McGraw-Hill. [This provides basic knowledge of various types of electric
machines and transformers.]

[10]

http://www.uniregensburg.de/Fakultaeten/phil_Fak_I/Philosophie/Wissenschaftsgesch

ichte/Termine/E-Maschinen-Lexikon/Chronologie.html
[11] http://www.mpoweruk.com/timeline.html
[12] http://www.fh-zwickau.de/mbk/kfz_ee/praesentationen/Elma-Gndl-Generator%20[13]
[14]

%20Druckversion.pdf
http://www.mikroe.com/eng/chapters/view/17/chapter-4-examples/#c4v1
http://www.8051projects.net/pic_tutorial/

[15]

http://microcontrollershop.com/product_info.php?products_id=1078

[16] Matsch L.W. (1977). Electromagnetic and Electromechanical Machines, 2nd edn., 566 pp.
Thomas Y. Crowell.
[17]

The 8051 Microprocessor By M. Ali Mazidi

[18] Say M.G. (1983). Alternating Current Machines, 5th edn., 632 pp. London: Pitman.
[A comprehensive reference book on all types of electric machines.]
[19] http://www.8051projects.net/serial-communication/introduction.php
[20] http://www.beyondlogic.org/serial/serial1.htm#40
[21] http://extremeelectronics.co.in/avr-tutorials/rs232-communication-the-levelconversion/

References to figures:
2.1 www.globalspec.com
2.2 www.freeelectricalsandtools.blogspot.com
2.3 www. cnx.org
2.4 www.coilgun.info
2.5 www.electrical-riddles.com
2.6 www.active-power.net
2.7 www.arab-training.com
2.8 www.arab-training.com
2.9 www.electrical-riddles.com
2.10 www.eastcoastpowersavers.com
2.11 www.allaboutcircuits.com
3.1 www.www.solarbotics.com
3.2 www.microcontrollerboard.com
3.3 www.microcontrollerboard.com
3.4 www.shahrulnizam.com
3.5 www.cntuanjie.en.made-in-china.com
3.6 www.school-for-champions.com
3.7 www.steveshouse.org
3.8 www.datasheetdir.com
4.1 www.directindustry.com
4.2 www.train-srv.manipalu.com
4.3 www.the-crankshaft.info
4.4 www.electro-tech-online.com
4.5 www.hw-server.com
4.6 www.swharden.com
4.7 www.8051projects.net
4.8 www.zytrax.com
4.9 www.plcs.net
5.1 www.press.picotech.com
5.2 www.zone.ni.com
5.3 www.zone.ni.com
5.4 www.indiamart.com
5.5 www.zone.ni.com

APPENDIX-A
PCB Layouts

Top view

Bottom view

Composite view

APPENDIX-B
Microcontroller coding
#include <16F877.h>
#device adc=10
#use

delay (clock = 4000000)

#fuses BROWNOUT, HS, NOWDT, NOLVP, PUT


#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,stream=,bits=8)
#include <stdio.h>
#byte PORTB = 0x06
#byte PORTD = 0x08
#bit

RS

= PORTD.6

#bit

EN

= PORTD.7

#define fr

PIN_D5

#define rp

PIN_D4

#define buzzer pin_c5


int

overflow_count, pulse;

unsigned int32

start_time, end_time, pulse_ticks;

unsigned int32

frequency, rpm;

unsigned int

digit1, digit2, digit3, digit4 ;

unsigned int

v_digit1, v_digit2, v_digit3;

unsigned int

i_digit1, i_digit2, i_digit3;

unsigned int

t_digit1, t_digit2;

unsigned int

f_digit1, f_digit2, f_digit3;

unsigned int

r_digit1, r_digit2, r_digit3, r_digit4;

unsigned int16
//unsigned int16

adc_value, current ;
SR;

#int_TIMER1
TIMER1_isr()
{

++overflow_count;
if(overflow_count==5)
{
overflow_count=0;
pulse_ticks=0;
}

}
#int_CCP1
CCP1_isr()

end_time=CCP_1;
pulse_ticks=(0x10000*overflow_count)-start_time+end_time;
pulse_ticks=pulse_ticks-33;
start_time=end_time;
overflow_count=0;

}
void

lcd_ini (void);

// FUNCTION TO INITIALIZE LCD

void

lcd_data (char);

// FUNCTION TO SEND A DATA BYTE IN LCD

void

lcd_com (char);

// FUNCTION TO SEND A COMMAND BYTE IN LCD

void

adc_read(void);

// FUNCTION TO READ ADC VALUE

void

process_temp(void);

void

process_voltage(void);

// DO FOR VOLTAGE

void

process_current(void);

// DO FOR CURRENT

void

BCD (void);

void

display_temp (void);

void

display_volt (void);

void

display_current (void);

void

process_freq(void);

void

process_rpm(void);

void

settings(void);

void

display_vs(void);

void

display_is(void);

void

display_ts(void);

void

send_data(void);

// FUNCTION TO PROCESS TEMPERATURE

// FUNCTION CONVERTS BINARY VALUE TO BCD

void main()
{

set_tris_a(0xFF);

// SET PORTA AS INPUT

set_tris_e(0XFF);

// SET PORTE AS INPUT

set_tris_b(0x00);

// SET PORTB AS OUTPUT

set_tris_c(0b00000000);

// SET PORTC AS OUTPUT

set_tris_d(0x00);

// SET PRTD AS OUTPUT

output_b(0x00);

// SET ALL OUTPUTS TO LOW

output_c(0x00);

//

output_d(0x00);

//

setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_DIV_32);
setup_ccp1(CCP_CAPTURE_RE);
setup_timer_1(T1_INTERNAL|T1_DIV_BY_1);
enable_interrupts(INT_TIMER1);
enable_interrupts(INT_CCP1);

enable_interrupts(global);
frequency=0;
output_low(buzzer);
lcd_ini();

// LCD INI

delay_ms(1000);
while(1)
{ unsigned int cnt;
for(cnt=0; cnt<10; cnt++)
{
process_voltage(); // READ VOLTAGE, DISPLAY IT ON LCD
process_current(); // COMPARE IT WITH SET POINT
process_temp();

// CHANGE TAPPING IF NEEDED SHUT DOWN

process_freq();
process_rpm();
delay_ms(500);
}
send_data();
}
}
void process_voltage (void)
{ set_adc_channel(1);

//INPUT voltage

adc_read();
//adc_value = adc_value*5000/1023;
BCD();

// SCALE INPUT VOLTAGE

// CONVERT THEM IN BCD FORMAT

lcd_com(0x80);// DISPLAY INPUT VOLTAGE ON LCD


lcd_data('V');
lcd_data('O');
lcd_data('L');
lcd_data('T');
lcd_data('A');
lcd_data('G');
lcd_data('E');
lcd_data(' ');
v_digit1=digit1;
v_digit2=digit2;
v_digit3=digit3;

display_volt();
}
void process_current (void)
{ set_adc_channel(2);

//P1 voltage

adc_read();
//adc_value = adc_value*5000/1023;
//adc_value=1234;
current=adc_value;
BCD();
lcd_com(0xC0);

// set lcd cursor on line3 col1

lcd_data('C');
lcd_data('U');
lcd_data('R');
lcd_data('R');
lcd_data('E');
lcd_data('N');
lcd_data('T');
lcd_data(' ');
i_digit1=digit1;
i_digit2=digit2;
i_digit3=digit3;
display_current();
if(current > 2000)
output_high(buzzer);
else output_low(buzzer);
}
void process_temp (void)
{ set_adc_channel(0);
adc_read();
BCD();
lcd_com(0x90);
lcd_data('T');
lcd_data('E');
lcd_data('M');
lcd_data('P');
lcd_data(' ');
t_digit1=digit1;
t_digit2=digit2;
display_temp();

//set lcd cursor on line4 col1

}
void process_freq (void)
{ output_high(rp);
output_low (fr );
pulse_ticks=0;
delay_ms(250);
frequency=pulse_ticks;
frequency=10000000/frequency;
lcd_com(0xD0);

//set lcd cursor on line4 col1

lcd_data('F');
lcd_data('R');
lcd_data(':');
//lcd_data('Q');
//lcd_data(' ');
digit3 = frequency/100 ;
digit2 = (frequency/10) % 10 ;
digit1 = (frequency) % 10 ;
//digit1 = (frequency/10) % 10 ;
//lcd_data(digit4+0x30);
f_digit1=digit1;
f_digit2=digit2;
f_digit3=digit3;
lcd_data(digit3+0x30);
lcd_data(digit2+0x30);
lcd_data('.');
lcd_data(digit1+0x30);
lcd_data(' ');
//t_digit1=digit1;
//t_digit2=digit2;
//display_temp();
}
void process_rpm (void)
{
output_low (rp);
output_high(fr );
pulse_ticks=0;
delay_ms(250);
rpm=pulse_ticks;
rpm=60000000/rpm;

lcd_com(0xD8);

//set lcd cursor on line4 col1

lcd_data('R');
lcd_data('P');
lcd_data('M');
lcd_data(':');
//lcd_data(' ');
digit4 = rpm/1000 ;
digit3 = (rpm/100) % 10 ;
digit2 = (rpm/10) % 10 ;
digit1 = (rpm)

% 10 ;

//lcd_data(digit4+0x30);
r_digit1=digit1;
r_digit2=digit2;
r_digit3=digit3;
r_digit4=digit4;
lcd_data(digit4+0x30);
lcd_data(digit3+0x30);
//lcd_data('.');
lcd_data(digit2+0x30);
lcd_data(digit1+0x30);
//t_digit1=digit1;
//t_digit2=digit2;
//display_temp();
}
void send_data(void)
{
printf("\n\n\r---- SERIAL No. %d ----",1);
printf("\n\rVOLTAGE ");
putc(0x30+v_digit3);
putc(0x30+v_digit2);
putc(0x30+v_digit1);
printf("V\n\rCURRENT ");
putc(0x30+i_digit3);
putc('.');
putc(0x30+i_digit2);
putc(0x30+i_digit1);
printf("AMP\n\rTEMP ");
putc(0x30+t_digit2);
//putc('.');
putc(0x30+t_digit1);

putc('C');
printf("\n\rFREQ ");
putc(0x30+f_digit3);
putc(0x30+f_digit2);
putc('.');
putc(0x30+f_digit1);
putc('H');
putc('z');
printf("\n\rRPM ");
putc(0x30+r_digit4);
putc(0x30+r_digit3);
putc(0x30+r_digit2);
putc(0x30+r_digit1);
//putc('H');
//putc('z');
}
void display_volt (void)
{

lcd_data(digit3+0x30);
lcd_data(digit2+0x30);
lcd_data(digit1+0x30);
lcd_data('V');
lcd_data(' ');
lcd_data(' ');
lcd_data(' ');

}
void display_current()
{ lcd_data (digit3+0x30);
lcd_data('.');
lcd_data (digit2+0x30);
lcd_data (digit1+0x30);
lcd_data('A');
lcd_data('M');
lcd_data('P');
}
void display_temp()
{ lcd_data (digit2+0x30);
lcd_data (digit1+0x30);
lcd_data(' ');
lcd_data('C');

lcd_data(' ');
lcd_data(' ');
}
void BCD (void)
{

digit3 = adc_value/1000 ;
digit2 = (adc_value/100) % 10 ;
digit1 = (adc_value/10) % 10 ;

}
void adc_read(void)
{ unsigned int32 temp;
unsigned int count;
delay_ms(1);
temp = 0;
for (count=0; count < 50; count++)
{ temp = temp+read_adc(); delay_ms(1); }
adc_value = temp*100/1023;
}
void
{

lcd_ini(void)
delay_ms(300);
lcd_com(0x38);
lcd_com(0x0C);
lcd_com(0x01);
delay_ms(100);

}
void
{

lcd_com(char i)
RS = 0;
PORTB = i;
EN = 1;
delay_us(300);
EN =0;

}
void
{

lcd_data(char i)
RS = 1;
PORTB = i;
EN = 1;
delay_us(300);
EN = 0;

Potrebbero piacerti anche