Professional Documents
Culture Documents
Agc and Avr Control of A Motor Generator Setup Using Microcontroller
Agc and Avr Control of A Motor Generator Setup Using Microcontroller
Project Supervisors:
Prof. Riaz Ahmed Rana
Engr. Syed Muhammad Furqan
Project Members:
ZawarHaseeb L1F14BSEE0002
Muhammad Danish Khan L1F14BSEE0006
Haris Ali L1F14BSEE0009
Session 2014-2018
FACULTY OF ENGINEERING
UNIVERSITY OF CENTRAL PUNJAB
LAHORE, PAKISTAN
1
AGC AND AVR CONTROL OF A MOTOR GENERATOR SETUP USING
MICROCONTROLLER
This project report is submitted to the Faculty of Engineering, University of Central Punjab,
Lahore, Pakistan, for the partial fulfillment of requirements for the degree of Bachelors of
Electrical Engineering.
Approved on
Sign:
Name:
Name:
Session 2014-2018
FACULTY OF ENGINEERING
UNIVERSITY OF CENTRAL PUNJAB
LAHORE,PAKISTAN
2
3
ACKNOWLEDGEMENT
WearegratefultoAlmightyALLAH,whogaveusstrengthandprovideduswithalltheresources,
sothatwemaketheirproperuseforthebenefitofmankind.Hekeepsprovidinguswiththeproper guidance
and all the resources to keep helping themankind.
We are thankful to our teachers for their guidance and support. Especially we would like to thank
our project supervisors Prof. RanaRiaz and Engr. Syed Muhammad Furqanand whose
encouragement, guidance and support from initial to final stage has enabled us to complete the
project. Always being available, even at very odd times, listening to our problems and solving
them even at very late night.For their confidence in our abilities, we wish to thank them from our
hearts and wish them successful and a blessed life. Ameen.
We also wish to thank our parents who stood by us throughout this project helping us in any way
possible for them. Their kindness, blessings, advice, love and support helped us through this time
alot.
4
Contents
Chapter 1 ..................................................................................................................................................... 7
Introduction ................................................................................................................................................. 7
1.1 Project Introduction: ............................................................................................................................ 7
1.1.1 Industrial Perspective of Project: ............................................................................................. 8
1.1.2 Domestic Usage of the Project: ................................................................................................. 8
1.2 Literature Survey of the Project: .............................................................................................. 8
1.2.1 Starting Point of Technology: ....................................................................................................... 8
1.2.2 Speed Droop & Control through Regulating Unit: ............................................................... 10
1.2.3 Current Status of Technology:................................................................................................ 10
1.3 Problem Statement: ...................................................................................................................... 13
1.4 Methodology of Project: ........................................................................................................... 13
1.5 Description of Block Diagram: .................................................................................................. 14
Chapter 2 ................................................................................................................................................... 16
Hardware Setup and Description ............................................................................................................ 16
2.1 DC Shunt Motor: ............................................................................................................................ 16
2.1.1 Function and Use in Project:................................................................................................... 16
2.1.2Working Principle:.................................................................................................................... 16
2.1.3: Testing of the Device: ............................................................................................................. 17
2.1.4 Symbol & Picture:.................................................................................................................... 17
2.1.5 Rating:....................................................................................................................................... 18
2.2 3-phase Synchronous Generator: .................................................................................................. 18
2.2.1 Function and use in project: ................................................................................................... 18
2.2.2 Working Principle: .................................................................................................................. 18
2.2.3 Testing of Device: ..................................................................................................................... 20
2.2.4 Rating:....................................................................................................................................... 20
2.2.5 Circuit Diagram and Symbol: ................................................................................................. 21
2.3. Micro-Controller: .......................................................................................................................... 21
2.3.1 Function and Use in Project:................................................................................................... 22
2.3.2 Working Principle (Architecture): ......................................................................................... 22
5
2.3.3 Pin Configuration: ................................................................................................................... 22
2.3.4 Testing of Device: ..................................................................................................................... 22
2.4 Variable DC supply: ....................................................................................................................... 22
2.4.1 Function and Use in Project:................................................................................................... 23
2.4.2 Components used: .................................................................................................................... 23
2.4.2 Working Principle: .................................................................................................................. 23
2.4.3 Symbol and Circuit Diagram: ................................................................................................. 24
2.5 Boost Converter Circuits: .............................................................................................................. 24
2.5.1 Function and use in project ..................................................................................................... 24
2.5.2 Electronic Circuit:.................................................................................................................... 25
2.5.3 Calculation: .............................................................................................................................. 26
2.5.4 Testing of component: ............................................................................................................. 29
2.6 Voltage Divider Circuit: ................................................................................................................. 29
2.6.1 Function and Use in Project .................................................................................................... 29
2.6.2 Calculation: .............................................................................................................................. 30
2.6.3 Electronic Circuit:.................................................................................................................... 30
2.6.3 Testing of device:...................................................................................................................... 30
Chapter3 .................................................................................................................................................... 31
Software Description ................................................................................................................................ 31
3.1 Introduction to Software: ............................................................................................................... 31
3.2 Description of Programming Flow Chart:.................................................................................... 36
Chapter 4 ................................................................................................................................................... 37
Integration of Software & Hardware Section ........................................................................................ 37
Chapter 5 ................................................................................................................................................... 40
Results & Conclusions .............................................................................................................................. 40
5.1 Results Obtained: ............................................................................................................................ 40
5.2 Conclusion: ...................................................................................................................................... 40
5.2.1 Implementation Difficulties: ................................................................................................... 40
5.2.2 Recommendations for Future Work: ..................................................................................... 41
5.2.3 Cost Analysis for AGC & AVR: ............................................................................................. 41
Appendix A:............................................................................................................................................... 42
Code for boost circuit ............................................................................................................................... 42
6
Appendix B: ............................................................................................................................................... 43
List for Tables ........................................................................................................................................... 43
Appendix C:............................................................................................................................................... 43
List of Figures............................................................................................................................................ 43
References:................................................................................................................................................. 44
Datasheets: ................................................................................................................................................. 44
Chapter 1
Introduction
1.1 Project Introduction:
Our Project is to make a motor generator setup with AVG (Automatic Voltage
Regulator) and AGC (Automatic Generation Control). In simple words, it is the type of
electricity generation in which both speed of motor and excitation of generator is
controlled automatically according to load. Controlling of both parameters is done by
using simple microcontroller known as ARDUINO.
8
Figure 1:Ward Leonard Speed Control
The speed of motor M1 is to be controlled which is powered by the generator G. The shunt field
of the motor M1 is connected across the DC supply lines. Now, generator G is driven by the
motor M2, when the output voltage of the generator is fed to the motor M1 then the motor starts
to rotate. When the output voltage of the generator varies then the speed of the motor also varies.
9
Application of Ward Leonard System:
This is used where wewant a wide and sensitive control of motor speed in both the directions. So
it is usually colliery winders, heavy cranes, electronic excavators, mining machines, steel mills,
paper machines, diesel-locomotives, etc. [1]
This technique of speed control for DC motor was first introduced by Harry Ward Leonard in
1891 known as “Ward Leonard Control”. In the starting of 19th century this technique was
adopted by U.S navy. At that time, this control system provided solution to operate travellator
properly.
The system was widely used in World War 1 for locomotives operation and in World War 2 for
anti-aircraft radars. It was widely used for elevators until thyristordrives became available in
1980’s.
Flywheel is also the modification of “Ward Leonard Control” which is most common thing used
in mechanical systems to store rotational energy.[2]
1.2.3 Current Status of Technology:
This technology is currently used in generator’s which are used in industries for the reliability
of service and in hybrid cars to maintain the speed. But most important use of this technique is in
MAPS (Multi Area Power Systems) in which more than one area is served by one power station
so we have to regulate the voltage according to the load variation and also we have to maintain
the frequency level. To implement AGC and AVR control we use “PID Controllers” and “Fuzzy
Logic Circuits”.
10
Fuzzy Logic Circuits Using PID Controllers:
Fuzzy logic controllers in simple words are the next stage of PID controllers as they are much
faster and reliable than the PID so we use PID controllers along fuzzy logic circuits to enhance
the controlling of system we cannot give an extensive overview on this but we can give an
example to illustrateit. [6]
11
Figure 4: Results Difference
Where,
PSS=Power system stabilizer model
PID=Proportional Integral Derivative Controller
AGC and AVR Integration:
Now a days AGC and AVR is used frequently where we have generation of power we have to
use them because using both techniques will give the following advantages
To meet load power requirements both reactive and active at the same time
Reliability
The main reason to implement both loops is because the generating unit will maintain both
desired frequency and output required.[7]
12
1.3Problem Statement:
The problem is to control the speed of the DC shunt motor and excitation of the
synchronous generator in such a way that we get controlled variable output with constant
frequency when load is changed.
Components include
a) Voltage Sensor
b) Frequency Sensor
c) Transistors
d) Resistors
e) Inductors
f) Capacitors
g) Battery
h) WPL Software
i) Connecting Wires
j) LED bulbs for load
k) Fast Recovery Diodes
l) Logic MOSFET’s
14
First thing we have to do is to start DC motor and to excite the generator’s field on the
rated speed and rated voltage using variable DC supplies to start the generation process.
Then speed of shunt motor rotor is measured through tachometer and the signal is given
to the controller by using signal condition circuitry.
Before transmitting the generated power to the load current, voltage and frequency is
measured through sensors and the signals generated from each sensor is given to the
controller after signal conditioning.
This whole information is then stored and displayed on the PC.
By changing the load physically rotor’s speed is changed by which both frequency and
generated voltage is changed.
To maintain the frequency and to have the desired value of voltage signals are given to
the both DC supplies through the controller. This will change the excitation level of
generator and motors rotor speed accordingly.
This whole process will maintain the frequency and will also generate the desired output
voltage according to the variation in load.
15
Chapter 2
16
It has feedback mechanism to control its speed. As the armature rotates in a magnetic field, it
induces electricity. The EMF is generated by this action is opposite in direction to, thus limiting
the armature current. So the current through the armature is decreased and speed of the motor is
self-regulated.
By going through two tests we conclude that our motor is running good and it gives the same
results on the rated speed which are given by the specification sheet of motor.
17
Figure 8: Motor Circuit Diagram
Where A1 and A2 are armature brushes and F1 and F2 are field terminals.
2.1.5 Rating:
18
Figure 9:Conductors Placed in Magnetic Field
Now here is the flux is maximum because they are perpendicular to each other. So we can
conclude that when it is parallel flux is zero and when its perpendicular it is maximum and vice
versa. If we have permanent magnet in three pairs we can have the output for three phase in each
phase the zero crossing is changed hence it is very useful.
But in the above figure we have seen that the field and conductor are in parallel to each other the
induced emf is zero and then again it will have the same rotation again and again now if we have
permanent magnets for three armature windings then we have the output as follows.[4]
19
Figure 12: Synchronous Generator Output
2.2.4 Rating:
20
2.2.5 Circuit Diagram and Symbol:
2.3. Micro-Controller:
Arduino UNO:
21
2.3.1 Function and Use in Project:
We are using Arduino as a micro-controller in our project because it is very easy to use and also
its software is very convenient. The function of Arduino is to integrate the hardware and
software part. We are using this to control the output of our system using coding.
Arduino uses Harvard architecture where we have to separate memories one is program code
memory and program data memory. Code storage is in the flash program memory and data
stored in the data memory. The simple Arduino has ability to store 32KB of flash memory
whereas 2KB of SRAM as well as 1KB of EEPROM. Clock speed of ATMEGA is 16MHz[3]
2.3.3Pin Configuration:
22
We made DC supplies using bridge rectifier IC’s to obtain desired value of DC we use a higher
value of current and voltage.
2.4.1 Function and Use in Project:
Bridge rectifiers are used for the smooth rectification of the AC. In our project we are using them
to make two DC supplies for controlling purpose.
2.4.2 Components used:
To make supplies we use the followings.
Components Model No
Bridge Rectifier IC KBPC3506
23
2.4.3 Symbol and Circuit Diagram:
The basic principle of a Boost converter consists of 2 distinct states (see figure 2.9):
In the On-state, the switch S is closed, resulting in an increase in the inductor current;
in the Off-state, the switch is open and the only path offered to inductor current is through
the fly back diode D, the capacitor C and the load R. This results in transferring the energy
accumulated during the On-state into the capacitor.
24
The input current is the same as the inductor current as can be seen in figure 2.9. So it is not
discontinuous as in the buck converter and the requirements on the input filter are relaxed
compared to a buck converter.[5]
Instead of IC we use logic MOSFET in both circuits because handling and integrating of IC is
more difficult as compared to the simple MOSFET.We are using two boost circuits with the
following ratings
Component Rating/Name
Capacitor 5.6µF (200volts)
Inductor 3.3mH (5Amp)
Diode RF150
Logic MOSFET IRFP 4310-Z
Switching MOSFET IRFP 460
Heat Sink With Fan 12V dc
25
Table 5: AVR Boost Circuit Components
Component Rating/Name
Capacitor 180µF (200volts)
Inductor 1.02mH (5Amp)
Diode RF150
Logic MOSFET IRFP 4310-Z
Switching MOSFET IRFP 460
Heat Sink With Fan 12 volts DV
2.5.3 Calculation:
𝑫=.0714
As our required current
𝐼𝑟𝑎𝑡𝑒𝑑 = 3.5A
As we know,
𝛥𝐼𝑟𝑎𝑡𝑒𝑑 = 0.2 × 𝐼𝑟𝑎𝑡𝑒𝑑
So,
26
𝛥𝐼𝑟𝑎𝑡𝑒𝑑 = 0.2 × 2.5
𝛥𝐼𝑟𝑎𝑡𝑒𝑑 =0.7A
𝑳 = 𝟏. 𝟎𝟐 𝒎𝑯
𝐼
𝑟𝑎𝑡𝑒𝑑 ×𝐷
𝐶 = 𝑓×.02×𝑉 eq 2.3
𝑜
3.5 × .714
𝐶=
20 × 103 × 70
𝑪 = 𝟏𝟕𝟖. 𝟓µ𝑭
27
For this we need
𝑉𝑜 =150V
𝑉𝑖𝑛 =50V
Finding duty cycle 𝑫
𝑉𝑜 1
= eq 2.1
𝑉𝑖𝑛 1−𝐷
150 1
=
50 1−𝐷
𝑫 =0.0667
As our required current
𝐼𝑟𝑎𝑡𝑒𝑑 = 2.5A
As we know,
𝛥𝐼𝑟𝑎𝑡𝑒𝑑 = 0.2 × 𝐼𝑟𝑎𝑡𝑒𝑑
So,
𝛥𝐼𝑟𝑎𝑡𝑒𝑑 = 0.2 × 2.5
𝛥𝐼𝑟𝑎𝑡𝑒𝑑 =0.5A
28
𝑳 = 𝟑. 𝟑 𝒎𝑯
𝐼𝑟𝑎𝑡𝑒𝑑 × 𝐷
𝐶=
𝑓 × .02 × 𝑉𝑜
2.5 × .664
𝐶=
20 × 103 × .02 × 150
𝑪 = 𝟓. 𝟓µ𝑭
29
2.6.2 Calculation:
As we have to maintain voltages under 5 volts so we are using Vo=3.6 volts
Set R1=1 kΩ
Vo=3.6 volts
Vin=120 volts
Finding R2
Using formula for VDR
𝑅2
𝑉𝑜 = 𝑉𝑖𝑛 × 𝑅 eq 2.4
2 +𝑅1
Software Description
3.1 Introduction to Software:
We are using Arduino for generating PWM signal to control our switching circuit. Here is a
slight intro about Arduino and PWM signal.
It is an open source controller hardware and software integrated. Arduino can perform many
functions by reading the input. We can use our board to make various outputs by using the
micro-controller programming language. Algorithm depends upon your approach and the wiring
you used. To use it we have to use IDE software.
Arduino is used by students, professionals and others to perform various functions for their
projects daily which includes simple and complex instructions as well.
Arduino was born at the Ivrea Interaction Design Institute as an easy tool for fast prototyping.
All Arduino boards are completely open-source, providing its user the ability to fulfill a set of
instructions according to their needs and adapt accordingly. This is open source and hence used
widely over all the world.
PWM works with progression of DC square wave with zero to one ratio. The on time of PWM can be
very somewhere in 0 to 100%.Now, the varied power is transferred to the load, if it is passed through
the filter the given voltage would be proportional to PWM.
31
Figure 21: PWM Duty Cycle
Arduino IDE is software that carries a text editor for writing code and a series of toolbars to help
refine our code. The codes written in IDE are called as sketches. The sketches are typed in text
editor. Message area gives feedback as to what is happening, it can display errors. The screen
displays text form output by Arduino IDE, including error messages and other related
information. The toolbar buttons permit us to confirm and upload programs or create and save
sketches, and open the serial monitor for further details. Arduino IDE provides software library
from wiring project which give many procedures of common input and output. [9]
32
Figure 22: Software Interface
33
half cycle. The other half cycle is generated by reversing the order of the sections constituting
the half cycle
I have used 50 Hz frequency in this project. 50 Hz means time period of sine wave will be 20ms
and the time period of half cycle will be 10 ms, which is used for both positive and negative
cycles. But the total time of all pulses should be equal to 10ms (time period of half cycle of sine
wave).
Open the Arduino software. This shows the menu bar with file, functions, open, save and setting
options.
34
Figure 23: Programming Flow Chart
35
3.2 Description of Programming Flow Chart:
1. First we initialize the variables.
2. Then set the
3. duty cycle.
4. Call the function of the duty cycle.
5. Then increment in the duty cycle.
6. If the duty cycle is less than or equal to 100 percent, then call function of the duty cycle.
Ifnot, then decrement in the duty cycle and then call the function.
7. If the duty cycle is greater than or equal to zero then decrement the duty cycle, if not then call
the function.
Resistive power control circuit is not power efficient so mostly PWM controller circuits are used.
If a PWM signal is passed through a filter, the resultant output is the dc voltage which varies
proportionally with the duty cycle of the PWM.The Arduino is working here for producing for
control signals for driver circuitry. We have two square waves and two level PWM at 180
degrees which are out of phase. For controller to give the desired output it has to be
programmed. This is a simple concept implemented with Arduino. For instance, we have 50Hz
sinusoid with unity magnitude and it is multiplied by impulse train of 5000Hz so we have
complete cycle of sinusoid contains 100 impulses 5000Hz can be produce in the same fashion. [4]
36
Chapter 4
Controller
excitation
equal to set
point ?
(Arduino)
Motor Generator
connected to
excitation excitation
gates of
MOSFETS
yes no
stant yes
yes no
Is excitation
Motor equal to set Generator
Is excitation point ?
equal to set
point ?
Voltage and
Frequency Load
37
being
monitored
38
Motor-Generator AGC Boost Frequency Meter
Setup Tachometer
39
Chapter 5
Results&Conclusions
5.2 Conclusion:
Constant and regulated power supply is a very crucial demand. If the power generated is not up
to standards in terms of frequency and voltage, then there could be disastrous results. Our project
helps control both necessary elements in an efficient and cost effective way, for which we used
basic elements like inductors, capacitors, resistors and Arduino. The only expensive thing we
used was the motor generator set.
40
Issues with Boost Converter:
Motor and generator both require currents up to 8 amperes initially and then later on decrease to
less than 1 ampere. Due to high initial current the MOSFET of boost convertor circuit gets
heated up quick and even burns at times. To solve this problem, we have used a big heat sink
along with a fan to keep the MOSFET cool enough to operate effectively.
1. Better quality filter could be used in order to get oscillation free dc excitation.
2. High tech elements may be used to reduce losses and make controlling more efficient.
3. Fuzzy controllers can also be used instead of the Arduino, as the fuzzy controllers have
adaptive behaviour so they can change the working conditions themselves.
41
Appendix A:
void setup() {
pinMode(feedback, INPUT);
pinMode(PWM, OUTPUT);
TCCR2B = TCCR2B & B11111000 | B00000001; // pin 3 and 11 PWM frequency of
31372.55 Hz
Serial.begin(9600); //BaudRate
}
void loop() {
float voltage = 440; //We read the value of the potentiometer, which is the desired value
float output = analogRead(feedback); //We read the feedback, which is the real value
//float output1=map(output,0,1023,0,255);
Serial.print (output);
Serial.print (" ");
//If the desired value is HIGHER than the real value, we increase PWM width
if ((voltage > output))
{
pwm = pwm-1;
pwm = constrain(pwm, 54, 254);
}
//If the desired value is LOWER than the real value, we decreaase PWM width
if (voltage < output)
{
pwm = pwm+1;
pwm = constrain(pwm, 54, 254);
}
analogWrite(PWM,pwm); //Finally, we create the PWM signal
Serial.print("\t PWM is = ");
Serial.println(pwm);
//Serial.print("\t Voltage of the given source = ");
//Serial.print(voltage);
//Serial.print("\t Voltage of the feedback is = ");
42
//Serial.print(output);
delay(100);
}
Appendix B:
Appendix C:
List of Figures
Figure 1: Ward Leonard Speed Control ................................................................................................... 9
Figure 2: Simple PID ................................................................................................................................ 11
Figure 3: PID with Fuzzy Controller ...................................................................................................... 11
Figure 4: Results Difference ..................................................................................................................... 12
Figure 5: AGC & AVR Integration ......................................................................................................... 12
Figure 6: Block Diagram of AGC & AVR Control................................................................................ 14
Figure 7: Motor Symbol ........................................................................................................................... 17
Figure 8: Motor Circuit Diagram ............................................................................................................ 18
Figure 9:Conductors Placed in Magnetic Field ...................................................................................... 19
Figure 10: Conductor Perpendicular to Magnetic Flux ........................................................................ 19
Figure 11: Conductor and Flux is Parallel ............................................................................................. 19
Figure 12: Synchronous Generator Output............................................................................................ 20
Figure 13: 3-Phase Equivalent Circuit of Generator ............................................................................. 21
Figure 14: Generator Symbol .................................................................................................................. 21
Figure 15: Arduino Pin Layout................................................................................................................ 22
Figure 16: Bridge Rectifier Operation .................................................................................................... 23
Figure 17: Symbol of Bridge Rectifier .................................................................................................... 24
Figure 18: Circuit Diagram of Bridge Rectifier ..................................................................................... 24
Figure 19: Circuit of Boost Converter .................................................................................................... 25
Figure 20: Voltage Divider Circuit .......................................................................................................... 30
Figure 21: PWM Duty Cycle .................................................................................................................... 32
Figure 22: Software Interface .................................................................................................................. 33
Figure 23: Programming Flow Chart ..................................................................................................... 35
43
Figure 24: Process Flow Chart ................................................................................................................ 37
Figure 25: Real Time Image of Project ................................................................................................... 39
References:
1.(https://www.electrical4u.com/ward-leonard-method-of-speed-control/)
2(.https://en.wikipedia.org/wiki/Automatic_Generation_Control#History)
3.(https://www.elprocus.com/bridge-rectifier-circuit-theory-with-working-operation/)
4(.https://www.elprocus.com/synchronous-generator-construction-and-working/)
5..(https://en.wikipedia.org/wiki/Fuzzy_electronics)
6. (https://www.researchgate.net/figure/Genetic-algorithm-flowchart-III)
7.( https://electronics.stackexchange.com/questions/281776/power-generator-droop-
characterstics)
9.(https://learn.sparkfun.com/tutorials/what-is-an-arduino)
10.(http://www.learnabout-electronics.org/PSU/psu32.php)
11. S. Hayashi, "Auto-tuning fuzzy PI controller", Proc. Int. Fuzzy Systems Association Conf.,
pp. 41-44, 1991.
12. G. K. I. Mann, B.-G.Hu, R. G. Cosine, "Analysis of direct action fuzzy PID controller
structures", IEEE Trans. Syst. Man Cybern. B, vol. 29, pp. 371-388, June 1999.
.13.M. Mizumoto, "Realization of PID controls by fuzzy control methods", Fuzzy Sets Syst., vol.
70, pp. 171-182, 1995.
Datasheets:
44