University of Manitoba Department of Electrical &...
-
Upload
phamnguyet -
Category
Documents
-
view
213 -
download
0
Transcript of University of Manitoba Department of Electrical &...
University of Manitoba
Department of Electrical & Computer
Engineering
ECE 4600 Group Design Project
Final Project Report
Synchronous Generator Excitation System
by
Group 07
Marko Pujic
Kashif Khokhar
Mufeed Al Khater
Falaah Alshammari
Abdulelah Alangari
Academic Supervisor
Athula Rajapakse, Ph.D., P.Eng
Date of Submission
March 2, 2016
Copyright © 2016 Marko Pujic, Kashif Khokhar, Mufeed Al Khater, Falaah
Alshammari, Abdulelah Alangari
ii
Abstract
The purpose of this project was to design and implement an excitation system for 1.5 KVA,
60Hz, 208V, 3- phase synchronous generator to automatically regulate the terminal voltage. The
focus was designing a static exciter since it has a faster transient response to changes in load or
reference voltage. The excitation system was divided into specific blocks. Specifically, the AVR
(microcontroller); firing circuit; measuring elements; AC to DC variable convertor; and an initial
start-up battery and charging station. Protection was implemented to ensure the DC current
injected into the field winding did not exceed the rated value.
Excitation system was successfully implemented. Upon initial start up the generator takes
approximately 5 seconds to build voltage of the generator up to the reference voltage. Excitation
system takes about 5 seconds to reach the steady state when a step change is applied to the
reference voltage. Tests indicated that the steady state error of the generator terminal voltage was
within ±3 % of the reference voltage for a specified voltages between 50 to 190 .
iii
Contributions
Legend: Lead task Contributed
Mu
feed
Alk
hate
r
Ka
shif
Kh
ok
har
Fa
laa
h A
lsh
am
mari
Ab
du
lela
h A
lan
gari
Ma
rko
Pu
jic
Open & Short Circuit Test for Excitation
System o o o o
Measurements and controller feedback design o
Design of a digital control system
MatLab simulation of the control system
Automatic Voltage Regulator design and
testing o
Simulation Using PSCAD o o
Generator battery start-up o o
Double pole double throw relay Design o
Recharging System
Buck Converter, Rectifier o o
IGBT isolated firing circuit design and
implementation o o
Testing the Excitation System o o o o
Generator protection o
Thermal protection design
Hardware circuit design fabrication and testing o o o o
Literature review o o o
Final report o o o o o
iv
Acknowledgements
We would like to thank all the following individuals; without them this project would not have
been completed successfully:
Dr. Rajapakse Athula (Our academic supervisor) for his support and advice throughout the
project;
Erwin Dirks for his help with ordering parts and technical support;
Dr. Oliver Derek for coordinating Capstone;
Daniel Card for his advices and technical feedback;
Aidan Topping for technical communications feedback;
ECE Tech Shop for the support with parts providing;
v
Contents
Abstract ............................................................................................................................................ ii
Contributions .................................................................................................................................. iii
Acknowledgements ......................................................................................................................... iv
Nomenclature ................................................................................................................................. vii
List of Figures ................................................................................................................................. ix
List of Tables .................................................................................................................................. xi
Chapter 1 .......................................................................................................................................... 1
1.1 Synchronous Generator Excitation System............................................................................ 1
1.1.1 Synchronous Generator Operating Principle .................................................................. 1
1.1.2 Role of the Exciter .......................................................................................................... 2
1.1.3 Different types of excitation systems .............................................................................. 2
1.2 Project Objectives ................................................................................................................ 3
1.2.1 Purpose ............................................................................................................................ 3
1.2.2 Project specifications ...................................................................................................... 3
1.3 Overview of the design .......................................................................................................... 4
1.3.1 Overall structure of excitation system ............................................................................ 4
1.3.2 Automatic voltage regulator (AVR) ............................................................................... 5
1.3.3 Rectifier........................................................................................................................... 5
1.3.4 Buck converter ................................................................................................................ 5
1.3.5 Start-up Battery and Charger .......................................................................................... 5
1.3.6 Measuring Elements ........................................................................................................ 5
1.3.7 Firing Circuit ................................................................................................................... 5
1.4 Design and Analysis Tools Used ........................................................................................... 5
1.4.1 PSCAD ............................................................................................................................ 6
1.4.2 Matlab ............................................................................................................................. 6
1.4.3 Arduino UNO .................................................................................................................. 6
Chapter 2 Design of the Power Electronics System ..................................................................... 7
2.1 Obtaining Synchronous Generator Parameters ...................................................................... 7
2.2 Design of AC to Variable DC Converter ............................................................................. 10
2.2.1 Rectifier......................................................................................................................... 10
2.2.2 Buck Converter ............................................................................................................. 11
2.2.3 Inductor and Capacitor Selection .................................................................................. 11
2.2.4 Simulation Results ........................................................................................................ 15
vi
2.3 Design of Feedback Controller ...................................................................................... 17
2.3.1 Measuring Elements for feedback control .................................................................... 17
2.3.2 PI Controller for Automatic Voltage Regulator ............................................................ 19
2.3.3 Selection of controller parameters ................................................................................ 20
2.3.4 Simulation results .......................................................................................................... 22
2.4 Design of Protection and Safety Features ...................................................................... 26
2.4.1 Firing Circuit Isolation .................................................................................................. 26
2.4.2 Generator Protection ..................................................................................................... 28
2.4.3 Thermal Protection of IGBT's - Heat Sink Design ....................................................... 28
2.4 Design of Start-up Power Supply................................................................................... 31
2.4.1 Selection of Battery ....................................................................................................... 33
2.4.2 Battery Charger ............................................................................................................. 34
Chapter 3 Design of a Digital Control System ........................................................................... 40
3.1 Functions and Requirements of the Digital Controller ........................................................ 40
3.2 Factors Considered in Selection of Microcontroller ............................................................ 40
3.3 Peripheral Hardware ............................................................................................................ 41
3.4 Analog to Digital Conversion .............................................................................................. 42
3.5 Digital to Analog Conversion .............................................................................................. 43
Chapter 4 Design of Control Software Program ......................................................................... 44
4.1 System Initialization ............................................................................................................ 44
4.2 Switching ............................................................................................................................. 45
4.3 Updating Reference Voltage/LCD ....................................................................................... 46
4.4 PI Controller ........................................................................................................................ 46
Chapter 5 Fabrication and Testing .............................................................................................. 48
Chapter 6 Conclusion ................................................................................................................. 53
Bibliography .................................................................................................................................. 54
Appendix A .................................................................................................................................... 56
Appendix B .................................................................................................................................... 61
Appendix C .................................................................................................................................... 64
Appendix D .................................................................................................................................... 71
Appendix E .................................................................................................................................... 73
Appendix F .................................................................................................................................... 80
G07_FinalReoprt List of Erratum
Section# Page# Error Correction 2.1 9 Can be found in the appendix. Can be found in the appendix A. 2.3.1 18 H bridge rectifier in figure (2.2.1) H bridge rectifier in figure 2.3.1 2.3.1 18 Equation 2.3.3 Vrms = 2 ∗ Vpeak
√2 = 2 ∗ 20√2= 28.28
Vrms = 2 ∗ Vpeak√2 = 2 ∗ 23.1
√2= 32.66 2.3.2 20 The simplified simulation model is shown The simplified simulation model figure 2.3.5 is shown 2.3.2 20 code is provided in Appendix C. code is provided in Appendix D. 2.3.4 22 Simplified model shown in figure 2.3.4 Simplified model shown in figure 2.3.5 2.3.4 22 The PI controller in figure 2.3.5 The PI controller in figure 2.3.7 2.3.4 22 Figure 2.3.6 shows the PI Figure 2.3.7 shows the PI 2.4.3 29 Figure 2.4.3: Thermal Resistance Circuit [REFERENCE] Figure 2.4.3: Thermal Resistance Circuit [14] 2.4 31 TITLE: 2.4 Design of Start-up Power Supply TITLE: 2.4.4 Design of Start-up Power Supply 2.4.4 31 As seen in figures 2.4.2 and 2.4.3 As seen in figures 2.4.6 and 2.4.7 2.4.4 31 Shown in figure 2.4.1 is the Shown in figure 2.4.5 is the 2.4.5 33 TITLE: 2.4.1 Selection of Battery TITLE: 2.4.5 Selection of Battery 2.4.5 33 Referring to figure 2.4.4, two Referring to figure 2.4.8, two 2.4.6 34 TITAL: 2.4.2 Battery Charger TITLE: 2.4.6 Battery Charger 2.4.6 35 shown below in figure 2.4.6 shown below in figure 2.4.10 2.4.6 35 According to figure 2.4.5 According to figure 2.4.9 2.4.6 36 The circuit in figure 2.4.7 is the The circuit in figure 2.4.11 is the 2.4.6 36 Labeled circuit figure 2.4.8 Labeled circuit figure 2.4.12 2.4.6 38 Referring to figure 2.4.10 Referring to figure 2.4.13 2.4.6 38 Referring to figure 2.4.11 Referring to figure 2.4.14 3.2 40 Figure 3.1 Figure 3.2 3.2 41 Figure 2.2: Arduino Uno Figure 3.2: Arduino Uno 4 44 Figure 3.1: Main Flowchart. Figure 4.1: Main Flowchart. 4.4 46 Equation 2.3.6 was used Equation 4.1 was used 4.4 46 Equation 4.4 shows the implementation Figure 4.4 shows the implementation App. A 56 The line measured using figure … The line measured using figure 2.1.3
vii
Nomenclature Idc DC Current
KI Integral Gain
Kp Proportional Gain
Vac Alternating Voltage
Vdc DC Voltage
Vl-l Line-to-Line Voltage
Vref Voltage reference (AVR)
viii
VRMS Root Mean Squared (RMS) Voltage
Vt Generator terminal voltage
AC Alternating Current
A/D Analog to Digital Converter
Ah Amp-Hour
AVR Automatic Voltage Regulator
BJT Bipolar Junction Transistor
DAC Digital to Analog Converter
DC Direct Current
DPDT Double Pole Double Throw
LCD Liquid Crystal Display
IGBT Insulated Gate Bipolar Transistor
OCRA Output Compare Register A
PI Proportional Integral
PSCAD Simulation Software - Power Systems
PWM Pulse-Width Modulation
NiCD Nickel Cadmium
NiMH Nickel-Metal Hydride
SLA Sealed Lead-acid
VRLA Valve Regulated Lead-acid
ix
List of Figures 1.1 The per-phase equivalent circuit of a synchronous generator................................ 2
1.3 Block diagram of the overall design ……………………………………............. 4
1.3.1 Closed loop control diagram…………………………………………………….. 4
2.1.1 Line Voltage vs. Field DC Current, and Line Current vs. Field DC Current for the
Open and Short Circuit Tests…………………………………………………
8
2.1.2 Saturated and Unsaturated Xs with the change of Armature Current …………. 8
x
2.1.3 The step response of the DC field winding………………………………………. 9
2.2.1 A schematic of three phase bridge rectifier…………………………………………. 10
2.2.2 A snapshot of the rectifier used in our project ……………………………………. 11
2.2.3 DC-DC Buck Converter………………………………………………………….. 14
2.2.4 The DC-DC Buck Converter in our project………………………………. 14
2.2.5 Rectifier and buck converter simulated circuit…………………………………... 15
2.2.6 IGBT Firing circuit with 0.069 duty cycle………………………………………... 15
2.2.7 Simulation graph of the rectifier and the buck converter design…………………. 16
2.3 Open loop diagram……………………………………………………………. 17
2.3.1 Measuring element………………………………………………………... 19
2.3.2 Root locus of simplified simulation model........................................................... 21
2.3.3 Root locus of simplifie simulation model with Kp = 0.0002................................ 21
2.3.4 Step response of simulation model with PI controller........................................ 22
2.3.5 Simplified simulation model……………………………………………… 23
2.3.6 PWM firing Signal for the IGBT…………………………………………………. 23
2.3.7 PI Controller Circuit…………………………………………………………… 23
2.3.8 The settling time of the PI controller……………………………………………... 24
2.3.9 The response of the PI controller while running the converter…………… 25
2.4.1 Complete schematic diagram of the IGBT gate driver circuit……………………. 26
2.4.2 PWM signal from the Microcontroller and the MIC5021……………………….. 27
2.4.3 Thermal Resistance Circuit………………………………………………….. 29
2.4.4 Calculated size heat sink………………………………………………………… 31
2.4.5 Controlling circuit of the DPDT relay …………………………………………….. 32
2.4.6 Normally closed position......................................................................................... 32
2.4.7 Schematic while battery is attached................................................................... 33
2.4.8 12V SLA batteries with high voltage diode between……………………………... 34
2.4.9 Pin labelled drawing of L200C……………………………………………………. 35
2.4.10 Battery charging circuit............................................................................................. 35
xi
2.4.11 Nodal analysis at the labelled node yields shown equation. A variable resistance
would account for a variable voltage charger..........................................................
37
2.4.12 High power ceramic resistor………………………………………………………. 37
2.4.13 Completed battery recharging station…………………………………………… 39
2.4.14 Demonstrating that the output of the charger is charging the battery by showing on
the multimeter a voltage higher than that of the battery's………………………
39
3.2 Arduino UNO……………………………………………………………… 41
3.3 LCD..................................................................................................................... 42
4.1 Main flowchart.................................................................................................... 44
4.2 Switching flowchart.............................................................................................. 45
4.3 PI controller........................................................................................................ 47
5.1 Controller behavior for start-up of the machine................................................... 48
5.2 Step response of excitation system to change in reference from 100Vl-l to 190Vl-l... 49
5.3 LCD displaying Vref and Vt...................................................................................... 49
5.4 Step response of excitation system to change in reference from 190Vl-l to 100Vl-l 50
5.5 LCD displaying Vref and Vt.................................................................................... 50
5.6 Step response of excitation system to change in reference from 100Vl-l to 50Vl-l 51
5.7 LCD displaying Vref and Vt.................................................................................... 51
5.8 Response of the excitation system with addition of an inductive load.................. 52
5.9 Response of the excitation system with addition of an capacitive load.................. 52
A.2.1 Load Angle Characteristics Curve for the Synchronous Generator. 63
List of Tables
1 Design specifications............................................................................................... 3
2 Open and short circuit test results............................................................................ 61
3 Calculating saturated and unsaturated armature reactance...................................... 61
4 Load test results....................................................................................................... 62
5 Load angle calculation results................................................................................. 63
xii
6 PWM signal error.................................................................................................... 64
1
1
Chapter 1
1.1 Synchronous Generator Excitation System
The main function of the excitation system is to provide DC current to the field winding of the
synchronous generator. The excitation system regulates the generator output.
1.1.1 Synchronous Generator Operating Principle
The synchronous generator is essentially used to convert mechanical power to AC electrical
power. The synchronous generator consists of a rotating component called a rotor and a stationary
component called stator. The rotor contains the field winding that produces the magnetic field in
the machine. The stator contains an armature winding in which the electromotive force (emf) is
induced figure1.1.1.
By supplying the rotor with DC current the rotor magnetic field is energized. The prime mover
will then spin the rotor at synchronous speed producing a rotational magnetic field in the
machine, which induces emf in the stator winding [16].
Induced emf in the coil is given by:
sin (1.1.1)
and the per phase voltage (no load) is obtained from:
= 4.44 . (1.1.2)
Finally, synchronous speed of the rotor in (rpm) is given by:
(1.1.3)
Variables are defined as: is a pitch factor, is the flux per pole, is the angular frequency,
is the number poles in the machine, is the frequency of the induced emf. is the number of
turns in the coil, and effective turns per phase.
2
Figure 1.1.1: The per-phase equivalent circuit of a synchronous generator
1.1.2 Role of the Exciter
The role of the exciter was to provide DC current to the field winding.
1.1.3 Different types of excitation systems
Excitation systems can be classified into three types: DC excitation systems, AC excitation
systems, and static excitation systems.
• DC excitation system:
DC exciter uses a dc generator as a source of power and provides current to the rotor through
slip rings. The shaft of the main generator or a motor may be used to drive the exciter. This
exciter is either self-excited or separately excited.
• AC excitation system
AC exciter uses an AC machine as a source of power. The AC output is rectified to produce
DC current for the field winding. This exciter is consisting of two different types of
rectifiers; stationary and rotating. There are two types of AC excitation systems: Stationary
AC and Brushless AC excitation system.
• Static excitation system
The static exciter uses power electronic devices to rectifier the main generators voltage and
feeds it back to the field winding. Static exciter has fastest transient response compared to
other excitation system.
Stator
Rotor
3
1.2 Project Objectives
The project objective was to design and implement an excitation system for 1.5 KVA, 60Hz,
208V, 3- phase synchronous generator. The static exciter was implemented by using power
electronic devices. The supply for the excitation system was obtained by rectifying the terminal
voltage from the generator. Microcontroller was used to implement the AVR. Design and
implementation of a variable AC to DC convertor was completed. Protection was added to
ensure no damage to field winding. External battery was used for initial start-up and a charging
was designed to charge the battery.
1.2.1 Purpose
The implementation of a static exciter in the excitation system allows for faster transient response
to system changes. The automatic voltage regulator ensures that the terminal voltage being
supplied to a load was equal to the reference voltage specified by a user. Regulating the voltage at
specified value prevents damage to the attached load and may reduce reactive power losses.
1.2.2 Project specifications
Excitation system design specifications are listed in Table 1. The static exciter provided DC
voltage to the field winding. AVR regulated the terminal voltage of the synchronous generator to
within the accepted 5% tolerance of the reference voltage. IGBT was used as an electronic switch
for the buck converter with a switching frequency of 15 KHz. The buck converter was capable of
operating between 24-volt DC to 80-volt DC. The measuring element was designed to convert
the full range of terminal voltage to a RMS value between 0 to 4.1 V DC that was sent to the
microcontroller.
Feature Value or Range
IGBT switching frequency 15KHz
Microcontroller sampling rate 9600Hz
AVR 50 to 190 volt
Output DC voltage to field winding 24 to 80 volt
Output DC current 0 to 0.9 A
Settling time 5 sec
Steady state error ±5%
Table 1: Design specifications.
4
1.3 Overview of the design
Figure 1.3 shows the overall design of the synchronous excitation system. The batteries were
used to provide initial DC current to the field winding. The static exciter was connected to the
field winding after initial excitation and DC current was supplied to the field winding. The
amount of DC current being supplied was controlled by the AVR.
Figure 1.3: Block diagram of the overall design
1.3.1 Overall structure of excitation system
The design of the excitation system consisted of an automatic voltage regulator (AVR),
measuring element and a static exciter. The AVR was implemented using a microcontroller. The
measuring element was designed using a rectifier transformer, rectifier and a voltage divider. The
static exciter was designed using power electronic devices such as a rectifier and buck converter.
Figure 1.3.1 shows the control diagram of the excitation system.
Error
Desired
Input
Respons
e _
Automatic
Voltage
Regulator
Exciter
Generator
Measuring Element
Actual
Output
Figure 1.3.1: Closed loop control diagram.
5
1.3.2 Automatic voltage regulator (AVR)
Automatic voltage regulator compared the RMS (root mean square) output voltage of the
generator with a reference voltage. The difference between the measurements was corrected
using a PI (proportional gain plus integral) controller which adjusted the duty cycle of the PWM
(pulse width modulation).
1.3.3 Rectifier
A 3 Phase uncontrolled full wave bridge rectifier was used to convert the output of the generator
from AC to a DC voltage.
1.3.4 Buck converter
The buck converter controlled the output DC voltage from the rectifier and filtered out high order
harmonics. The desired output voltage was based on Equation 1.3.4, D in the equation represents
the duty cycle [1].
(1.3.4)
1.3.5 Start-up Battery and Charger
The purpose of rechargeable battery was to provide a DC voltage to the field winding. The
battery was connected to a charging station to recharge the battery.
1.3.6 Measuring Elements
Measured the terminal voltage from the generator and converted the voltage to RMS and
provided this measurement to the microcontroller.
1.3.7 Firing Circuit
The function of the firing circuit was to provide the IGBT with the PWM signal and isolation for
the microcontroller from the rest of the system.
1.4 Design and Analysis Tools Used
Analysis tools consisted of using PSCAD supplied in the lab for simulation. Matlab to find PI
parameters, and the Arduino UNO as the AVR and monitor for several components which is
described in subsequent chapters.
6
1.4.1 PSCAD
PSCAD is the main software that was used in our project to simulate several components to test
the design prior building the real circuits and improve the design efficiency. Before building our
project on hardware we simulated the buck converter and the rectifier and we obtained the desired
values that are ready to be applied practically. A PI controller was also tested and tuned on
PSCAD through the adjustment through Matlab values for the proportional gain and proportional
integral were found.
1.4.2 Matlab
Matlab was used to graph the root locus of the simplified simulation model. The root locus plot
was used to determine preliminary values graphically of the proportional gain and integral
parameters. These results were used initially to tune the PI controller in PSCAD.
1.4.3 Arduino UNO
The serial monitor was used to track and verify input and output of the microcontroller through
the serial USB connection. The PWM output and the terminal voltage were monitored. An open
loop test was performed on the controller and values are displayed on the serial monitor. The
serial commands were removed from the program so they did not affect the performance of the
system.
7
Chapter 2 Design of the Power Electronics System
2.1 Obtaining Synchronous Generator Parameters
To calculate the synchronous generator parameters the following three tests were performed: DC
step response, open circuit test and short-circuit test. The inductance and the resistance of the
field winding for the synchronous generator were calculated from the DC step response test. The
open circuit test was performed in order to find the internal generated voltage of the generator for
any given field current. The short-circuit test provided information about the current capabilities
of a synchronous generator. The capability curve was constructed from the values obtained from
the open and short circuit test.
Open Circuit Test
We initially performed this test by disconnecting the terminals of the synchronous generators
from all loads and then setting the field current to zero and the rated speed at 1800 rpm. Then by
increasing the field current the terminal voltage was measured at each step along the way. Thus
we obtained the relationship between the field current and the terminal voltage.
Short-Circuit Test
We initially performed this test by short-circuit the terminals of the synchronous generators and
then adjust the field current to zero and the rated speed at 1800 rpm. We recorded the armature
current Ia as the field current is increased. Thus we obtained the relationship between the field
current and the armature current Ia.
DC Test for the armature winding:
The main reason of the DC test of the armature winding is to determine the armature resistance
Ra. A variable DC voltage was applied between the two stator terminals.
VDC = 37 V and IDC = 3 A:
(2.1.1)
Hence, the per phase stator resistance if the stator connected as:
Y-connected => Ra =
(2.1.2)
Δ-connected =>
(2.1.3)
8
Figure 2.1.1: Line Voltage vs. Field DC Current, and Line Current vs. Field DC Current for the Open and Short Circuit
Tests
Figure 2.1.2: Saturated and unsaturated Xs with the change of armature current
-0.5
0.5
1.5
2.5
3.5
4.5
5.5
-50
50
150
250
350
450
550
0 0.2 0.4 0.6 0.8 1 1.2
V_L
L [v
olt
]
If [Amp]
OCC vs. SCC
air gap line
Open Circuit Test
Short Circuit Test
Ideal Short Circuit Test
I a [
Am
p]
0
2
4
6
8
10
12
14
16
18
20
22
24
26
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6
Xs
[Oh
m]
Ia [Amp]
Saturated and Unsaturated Xs Vs. Is
Saturated Armature Reactance (Xs)
Unsaturated Armature Reactance (Xs)
9
DC Test for the field winding:
This test was performed to find the inductance and resistance of the field winding. These
parameters were needed to model the exciter. A 20-volt DC step was applied to the field
winding and the response was measured using an oscilloscope. The step response of the field
winding is shown in figure 2.1.3. The current reached steady state at 360.352 ms with a value
of 0.25 A and the measured voltage was 20.58V. Equation 2.1.4 shows the resistance of the
field winding.
(2.1.4)
The value of the inductance calculated was 6.18 H. The complete calculation can be found in the
appendix.
(2.1.5)
Figure 2.1.3: Step response of DC field winding.
10
2.2 Design of AC to Variable DC Converter
The AC to variable DC converter was designed using a three-phase uncontrolled rectifier,
100μF capacitor and a buck convertor. The capacitor reduced voltage ripple from the rectified
signal and the buck convertor was used to control DC voltage.
2.2.1 Rectifier
A rectifier is a power electronic device which convert AC voltage to DC voltage. There are
two types of three phase rectifiers controlled and uncontrolled rectifiers. Originally, the
proposed design required a controlled rectifier which contained 6 IGBTs. The design was
changed to an uncontrolled diode rectifier. Equation 2.1.1 shows the rectified voltage assuming
that the terminal voltage is 208 . Figure 2.2.1 shows the three phase bridge rectifier
(36MT120) which was rated for 35A.
(2.2.1)
Figure 2.2.1: Schematic of a three phase bridge rectifier[1].
11
Figure 2.2.2: A snapshot of the rectifier used in our project.
2.2.2 Buck Converter
A buck converter is a step-down DC -DC converter. The buck converter consisted of a
diode, inductor, capacitor and an electronic switch. The IGBT is a semiconductor device
which was used as an electronic switch. In our design we used the IXGH6N170A-IGBT
model which had high current handling capability (6 A). Free-wheeling diode was used to
provide protection for the IGBT from being damaged by reverse current from the
inductive load. The diode used was the TO-220 FULL-PAK model cause of the short
reverse recovery time and low forward voltage drop.
2.2.3 Inductor and Capacitor Selection
The calculated values of three different scenarios were considered in the selection of the
components for the buck convertor. The first case considered was the outcome of supplying the
buck convertor with DC value of the rated voltage of 208V line to line and a field current of
0.9A. The second scenario considered was supplying a DC voltage based on 85V line to line.
12
The duty cycle needed to increase the DC field voltage in order to restore the terminal voltage
to rated value was calculated. The final outcome considered was feeding the buck convertor
with the equivalent DC voltage of 260V line to line. The reduction of the duty cycle that was
need in order to reduce the terminal voltage to rated value was calculated. Scenario #3 shown
below was a sample of the calculation and the remaining calculations can be found in Appendix
A.
Scenario Case #3:
Output voltage of the synchronous generator: 260 V
Vphase =
= 150 V (2.3.1)
Voltage after the Diode rectifier:
We need to reduce the field current to about 0.3 A at the output of the buck regulator so
the voltage at the field winding will be
=
=
= 0.069 (2.3.2)
Inductor Selection:
Lmin =
=
= 37.70mH, is switching frequency. (2.3.3)
IL = IR =
=
= 0.3A (2.3.4)
Imax = IL +
, = 5% A (2.3.5)
Imax = 0.3 A +
= 0.3075A (2.3.6)
Imin = IL -
= 0.2925A (2.3.7)
L =(
) = (
) = 1.49H (2.3.8)
The inductor must be rated for rms current,
13
IL, rms =
=
= 0.3A (2.3.9)
The inductor voltage when the switch is closed is = 350 – = 325.7V
The inductor voltage when the switch is open is = V
Capacitor Selection:
Voltage ripples is
, Let’s choose it to be 10 %
C =
=
= 0.781 (2.3.10)
The initial selection of the inductor was based on a switching frequency of approximately 1
kHz. The size of the inductor at this frequency was 1.49 H. The cost of this inductor did not
fall within the project budget it was decided to increase the frequency to 15 kHz to reduce the
size of the inductor. Equation 2.3.11 and 2.3.12 respectively show the calculated values of the
Inductor and Capacitor at 15 kHz frequency. The capacitor was selected to be at least 20%
greater than the calculated value to reduce any voltage ripple. The value of the inductor
selected was 100mH and the capacitor was 0.051 Figure 2.2.3 shows a schematic of the
DC-DC buck converter circuit and figure 2.2.4 the actual implementation in the excitation
system.
L =(
) = (
) = 99.88mH 100mH (2.3.11)
C =
=
= 0.051 (2.3.12)
14
Figure 2.2.3: DC-DC buck converter. [2]
Figure 2.2.4: DC-DC converter used in our project.
15
2.2.4 Simulation Results
The rectifier and buck converter shown in figure 2.2.5 was simulated in PSCAD. A firing
circuit design was included as the control of the IGBT. PWM had a duty cycle of 0.069
as shown in figure 2.2.6. Figure 2.2.7 shows that the rectified voltage was 350V DC
when the input was 208 and the output from the buck convertor was 25V.
Figure 2.2.5: Rectifier and buck converter simulated circuit.
Figure 2.2.6: IGBT firing circuit with 0.069 duty cycle.
16
Figure 2.2.7: Simulated graph of rectifier and buck converter design.
17
2.3 Design of Feedback Controller
Control system is a combination of individually distinct components working together to maintain
a desired system response [2]. There are two types of control systems: open loop and closed
loop. Open loop control system is shown in figure 2.3. The control system used in this project
was a closed loop system and is shown in figure 1.3.1. The closed loop system used negative
feedback to compare actual results with the desired results. The error was sent to the controller so
proper adjustments were made to produce the desired response [2].
Figure 2.3: Open Loop Gain
2.3.1 Measuring Elements for feedback control
Maximum voltage that could be injected into the microcontroller analog input pin was
5 . The maximum output of synchronous generator was 208 . In order to meet
microcontroller specification AC voltage needed to be converted to DC and stepped
down before being fed to the microcontroller. The following hardware was used to
accomplish this task:
Rectifier Transformer
Rectifier
Voltage Divider
Terminal voltage from the synchronous generator was fed into the primary side of the
rectifier transformer. Terminal voltage fed was from a single phase of the generator since
the load was balanced all phase had the same voltage. This voltage was stepped down
based on the transformer ratio. Equation 2.3.1 shows the relationship between the
primary voltage and the secondary voltage. Equation 2.3.2 shows the step down voltage
calculated assuming a transformer ratio of 20. A rectifier transformer was not found that
could achieve the calculated value. It was decided to purchase a rectifier transformer with
the highest transformer ratio. The output voltage of the rectifier was not purely
sinusoidal. The amount of clipping was acceptable error. Figure 2.3.1 shows the rectifier
Process Input Output
18
transformer that was chosen based on the data sheet it would step down the maximum
terminal voltage to 20 . The transformer turns ratio was approximately 10.
(2.3.1)
(2.3.2)
Secondary side of the transformer was connected to a rectifier so the ac voltage could be
converted into dc voltage. Another advantage of having the transformer was it provided
isolation from the synchronous generator.
H bridge rectifier in figure (2.2.1) was used to convert ac voltage to dc. Output voltage of
the rectifier was initially calculated based on the assumption that the input voltage would
be 20 . Equation 2.3.1 shows initial calculation along with the revised calculation
below based on the measured value of the secondary side of the transformer [1].
(2.3.3)
To ensure minimal fluctuation in dc signal being sent to the microcontroller the rectified
signal was passed through a 2μF capacitor. The measured output was higher than the
required specifications so voltage divider was implemented. The voltage divider in
figure 2.3.1 had a value of , 3.3 and .
Voltage divider was the last component of the hardware before the result was fed into the
microcontroller. The measured value from the voltage divider was 4.1 when the
voltage on the primary side of the measurement transformer was 208
19
Figure 2.3.1: Measuring Element.
2.3.2 PI Controller for Automatic Voltage Regulator
The main task of the PI controller is to reduce steady state error between the desired
response and the actual output [2]. The PI controller is a proportional plus integral
controller in Laplace form is shown in Equation 2.3.4. The proportional gain parameter
scales the initial error and the proportional integral keeps track of prior error so the
controller can send the appropriate output and the desired response can be met. In the
continuous time domain, the PI controller is represented using Equation 2.3.5. The
output of the PI controller is represented by the variable . The input is the
difference between the desired response and actual output.
(2.3.4)
(2.3.5)
In order to implement the PI controller in the microcontroller the continuous time domain
equation had to be changed into discrete form using difference equations. Equation 2.3.6
is the discrete form of the PI controller.
Measurement
Transformer
Rectifier
R1 R2
R4
R3
20
(2.3.6)
2.3.3 Selection of controller parameters
Root locus was mathematical model that was used to assist in determining PI controller
parameters. In order to plot the root locus each component of the control system required
appropriate transfer functions. The root locus of the simplified simulation model is shown
in figure 2.3.2. The initial response of the system is first order for a period of time before
becoming second order marginally stable. Figure 2.3.3 shows the root locus after
selecting the Kp = 0.0002 (proportional gain). The step response in figure 2.3.4 shows
that the system at steady state was stable with a settling time of 206 seconds with Ki =
0.019. The Kp and Ki determined in Matlab were starting values the PI controller in
PSCAD. Matlab code is provided in Appendix C
21
Figure 2.3.2: Root Locus of Simplified Simulation Model
Figure 2.3.3: Root Locus of Simplified Simulation Model with Kp= 0.0002
22
Figure 2.3.4: Step Response of Simulation Model with PI controller
2.3.4 Simulation results
Simplified model shown in figure 2.3.4 was simulated using PSCAD. The input to the model was
AC voltage which was rectified and fed to buck convertor the attached load was the same value
as field winding. The difference between the reference voltage and the load voltage was sent to
the PI controller in figure 2.3.5. The PI controller determined the amount of DC voltage that was
fed to the field winding. The initial values calculted in Matlab for the PI controller were used.
These values needed to be adjusted to correctly tune the PI controller. The final parameters of Kp
was 0.001 and Ki was 0.3 sec in PSCAD. Figure 2.3.6 shows the PI controller implemented in
PSCAD. The PI controller was tested by changing the reference voltage and ac input voltage.
Figure 2.3.8 shows the repsponse of the PI controller to the change in reference voltage. The
controller increases the amount of voltage being fed to the buck convertor until there error was
zero in steady state. Figure 2.3.9 shows the response of the PI controller to change in the ac input
voltage. The response was similar to change in the reference voltage.
23
Figure 2.3.5: Simplified Simulation Model
Figure 2.3.6: PWM firing Signal for IGBT in PSCAD
Figure 2.3.7: PI Controller Circuit
Buck converter 3-Φ Rectifier
Excitation Field winding (Load)
Feed to PI
controller
24
Figure 2.3.8: Settling time of PI controller
3 sec Settling
time
25
Figure 2.3.9: Response of PI controller while running converter.
Change in the
input AC
voltage
Change in the
reference
voltage needed
26
2.4 Design of Protection and Safety Features
2.4.1 Firing Circuit Isolation
The IGBT used was a voltage control device that required a gate voltage to set the
collector emitter conduction voltage. IGBT gate driver circuit was used which consisted
of a 5 V to 15 V DC to DC converter that was powered by the microcontroller. Opto-
coupler was used to isolate the microcontroller ground from the IGBT ground. BJT was
used to invert the signal and feed it to the gate driver mic5021 chip. This driver chip was
used to drive the IGBT. Figure 2.4.1 shows the complete schematic of the firing circuit
that was used.
Figure 2.4.1: Schematic diagram of the IGBT gate driver circuit
DC to DC converter:
DC to DC converter was used to provide power to the driver chip and also the opto-
coupler. This converter was powered from the microcontroller. The converter has an
internal isolation which isolated the controller ground from the power ground.
5 V 15 V
Optocouplers PWM signal
220 Ω 15
0
KΩ
1
KΩ
Microcontroller power
27
Opto-coupler chip:
Opto-coupler also called an Opto-isolator is an electronic device that conducted electrical
signals between two isolated circuits by using Infra-red light emitting diode. Opto-
coupler was used for high speed logic ground isolation. Opto-coupler prevented high
voltages from affecting the microcontroller.
MIC5021 chip:
The MIC5021 was used since it is a high speed high side MOSFET and IGBT driver
chip. This driver chip was designed to operate at high frequencies up to 100kHz. It is an
ideal choice for high speed switching application. Buck converter frequency was 15kHz
the MIC5021 was ideal for the convertor. Figure 2.4.1 shows the connection of the
MIC5021 which will turn the IGBT on and off. Figure 2.4.2 shows the behavior of the
firing circuit when PWM signal was provided by the microcontroller.
Figure 2.4.2-PWM signal from the Microcontroller and MIC5021
PWM signal
sent from the
Microcontroller
PWM signal
sent from the
MIC5021 to
IGBT
28
2.4.2 Generator Protection
Generator protection was needed to prevent excessive current to the field winding.
Circuit breakers were going to be used but the cost of circuit breakers was not within the
budget. Fuses were used, these are electric devices that have a low resistance value that
act as a line of defence to provide overcurrent protection. These devices consist of a
metal wire or strip that break or melts whenever high current flows through it. The fuse is
rated for 1A.
2.4.3 Thermal Protection of IGBT's - Heat Sink Design
Switching devices such as IGBTs and MOSFETs dissipate heat during operation due to
switching power loss. The increase in power dissipation from such microelectronic
devices increase the heat dissipation and may cause internal damage. Thermal
management becomes an important part of electronic product design. Controlling the heat
dissipation of the IGBT improves the performance reliability and life expectancy of the
device.
Heat sinks are used with high power components to enhance heat dissipation to a lower
ambient temperature (air). Heat sinks maintain device temperature by increasing surface
area for better management of generated heat.
Different types of heat sinks are available such as stampings, extrusions, bonded or
fabricated, castings, and folded fins heat sinks. Each type is used for a specific power
level and the needed heat dissipation. In our design we chose the stampings heat sinks
which is usually made from a copper or aluminum sheet as a coolant agent. This type is
suitable for high volume production and advanced devices with high frequency operation.
Heat Sink Selection:
To correctly select the heat sink consider the thermal circuit in figure 2.4.3.
29
Figure 2.4.3: Thermal Resistance Circuit [REFERENCE]
The heat sink thermal resistance was calculated. The datasheet of the IGBT was used to
find the maximum junction temperature Tj and the thermal junction to case resistance RΦj-
c and thermal junction to ambient resistance RΦj-A [14].
(2.4.1)
(2.4.2)
(2.4.3)
Where: Tj is the maximum junction temperature.
Tc is the temperature of the case.
TH is the heat sink temperature.
TA is the coolant temperature or the ambient temperature which is between 23 to
25 C room temperature.
RΦc-H is the thermal case to heat sink resistance which is ignored as it is
insignificant and it will not affect the calculation.
RΦH-A is the thermal heat sink to ambient resistance.
Pd is the maximum power dissipation of the device.
RΦH-A
RΦC-H
RΦj-c
30
Equation 2.4.4 was used to calculate the total junction to ambient resistance:
(2.4.4)
From the equation 2.2.4 the thermal heat sink to ambient resistance RΦH-A was found.
(2.4.5)
From the IGBT datasheet: Tj = 150 C, Pd = 179 w, RΦj-c = 0.7 C/w, and RΦj-A = 40 C/w.
We will choose TA to be 23 C.
Hence,
C/w.
Therefore, the maximum thermal heat sink to ambient resistance needed is 0.0095 C/w.
To find the size of the aluminum we have to use [15]
(2.4.6)
The thermal conductivity of Al is 205 w/ m K that is (2.05 w/cm C). RΦH-A is equal to
0.0095C/w. The thickness of the aluminum plate used is 0.125 in (0.3175 cm) and the
height is 2.5 in (6.35 cm).
(2.4.7)
Therefore, the minimum size of heat sink needed was:
t = 0.125 inch, L = 1.0079 inch, and h = 2.5 inch see figure 2.2.4.
31
Figure 2.4.4: Heat sink
In the actual design we used a heat sink with a bigger size to ensure that the heat sink
does not overheat with dimension (t = 0.125 inch, L = 3 inch, and h = 2.5 inch).
The thermal resistance of this heat sink was:
(2.4.8)
2.4 Design of Start-up Power Supply
Batteries are needed in our design to initially supply the field winding with current. During start-
up two 12V batteries in series supply the field winding current momentarily until a double pole
double throw relay switches the battery path from supplying the windings to being supplied by
the charger as seen in figures 2.4.2 and 2.4.3. In addition to the battery supplying the rotor field
winding, the battery must also supply the relay coil with 24V. Relay power must always be
supplied however, supply to the field winding and battery charger must be interchanged as the
battery can't supply the needed current while being charged. The battery is only supplying the
relay with power, whereas the relay is controlled by a darlington circuit and an Arduino
microcomputer. Shown in figure 2.4.1 is the control circuit of the DPDT relay. The darlington
chip contains seven channels allowing low power output devices such as the microcontroller to
drive high current devices such as the relay switch. The optocoupler connected to the 5V-5V DC-
1.0079 inch
2.5 inch
0.125 inch
32
DC converter is used to provide isolation between the controller ground and the power switch
ground.
It was determined two 12V batteries in series, 24V, would be a sufficient amount to achieve the
aforementioned tasks. At 24V from the batteries, the field winding current is about 0.3A and line
to line voltage is about 100V. The batteries combined voltage was 25.1V. The batteries we used
were VRLA gel encapsulated with nominal cell voltages of approximately 2.1V on average,
resulting in the 12 cells we used actually having voltages of approximately 2.1V obtained by
dividing 25.1V by 12 [8]. These values were measured using LabVolt software and are acceptable
as both field current and line-to-line voltage requirements are satisfied with Vl-l > 80V, and field
current < 0.9A. Therefore, to get the needed field current and to power the relays two batteries
were needed in the design.
1. Generator DC field
2. Output of buck
converter
3. Battery
1 KΩ
Microcontroller
signal
1 2
3
+ -
24 V
Field Winding
Battery Charger
Batteries
Open circuit
Generator
Figure 2.4.6: Normally closed position of relay
Figure 2.4.5: Controlling circuit of DPDT relay.
33
Having two 12V batteries running constantly requires them to be coupled to a battery charger as
well to ensure the batteries stay at operating capacity. After the initial start up, the battery no
longer feeds current to the field winding. At this point the generator terminal voltage begins to
power the field winding and the battery is no longer needed for supply. The battery is then
toggled to be charged by the charging circuit which is initially disconnected. The charging circuit
charges the battery as the battery supplies the relay coils until next use of the machine. The
charging circuit is supplied by rectifying and stepping down the ac mains to feed to the input side.
Theory concerning batteries and the charging circuit, how hardware components were chosen and
mounted, and basic knowledge of how the circuit works and was tested will be discussed.
2.4.1 Selection of Battery
As little was known about batteries prior to their use in this project, research concerning many
types was facilitated. A comparison regarding battery capacity, memory, and general use was
needed to be done to choose what type of battery to use, contrasting between NiCd, NiMH, Li-
ion, and lead acid/SLA/VRLA batteries. NiCd and NiMH batteries exhibit the memory effect
resulting in less charge held over time unless periodically recharged and used. NiCd batteries also
have high discharge rates and are made of more toxic materials and are expensive. NiMH
batteries are less environmentally damaging than NiCd and even less prone to memory effects,
although they still have are higher maintenance regarding charging, have high discharge rates, are
more expensive than NiCd, and generally used for laptops and mobile devices. Lithium ion
batteries weren't considered as they are very expensive and require a protection circuit.
Consequently, we chose SLA batteries instead of other batteries for various reasons [9]. They are
low maintenance, have no memory effect, capable of high current pulses (>1C, where C is the
battery Amp-hour rating), high voltage per cell, low cost, and safer than lead acid as the liquid
inside is in a gel form. Referring to figure 2.4.4, two 12V, 7.2Ah, SLA batteries were purchased
and placed in series with a diode soldered to leads between them for protection against accidental
reverse connection. The batteries were measured with readings of 12.6V, and 12.5V, combining
to 25.1V.
Open circuit
Field Winding
Battery Charger
Batteries
Generator
Figure 2.4.7: Relay position during start-up transience of generator.
34
2.4.2 Battery Charger
A charging circuit to accommodate for the two batteries was designed and tested with all
calculated values. The design is centered around the IC L200CV adjustable voltage and current
regulator [10]. The entire charger design is adapted from a general circuit provided in the L200
Figure 2.4.8: 2 12V SLA batteries with a high voltage diode between them.
35
datasheet application note figure shown below in figure 2.4.6.
Figure 2.4.9: Pin labelled drawing of L200C voltage/current regulator.
The L200 is an adjustable voltage and current regulator, with a 2A max output current. According
to figure 2.4.5 it has 5 pins. Pin 1 is input and pin 5 is output. Pin 2 has the function of detecting
the potential between pins 5 and 2, Vlim, and ultimately limits the output current I0. Vlim=0.45V,
and if it is >0.45V then too much current has outputted and could damage the IC. Pin 4 is the IC
voltage Vref,l200 which is basically voltage between pin 4 and pin 3, and is equal to 2.77V. As long
as output current is less than the maximum 2A the L200 sets pin 4 to 2.77V. However, if output
current is greater than the maximum rated current then pin 5 (V0) is dropped to keep I0 in bounds.
In this way the L200 serves as the heart of the battery charger.
Figure 2.4.10: Battery charger circuit.
36
The circuit in figure 2.4.7 is the battery charger circuit that is designed and mounted on the
perforated board along with the rest of our circuits. The 5 pin L200CV chip is the heart of the
operation. The circuit consists of: two smoothing capacitors; the L200 IC with input on pin 1 and
output on pin 5; three resistors with various functions that will be mentioned, two diodes (for
protection); and ultimately an 32V AC/DC adapter on the input and wires connecting to battery
leads on the output. Referring to component labeled circuit figure 2.4.8 below, the two capacitors
on the input and output that are in a low-pass configuration (Tf=(jωRC+1)-1
) were chosen with
general values serving only the purpose of cleaning up higher frequency components such as
spikes and ripples that could damage the battery or circuit. Since the operating frequency is 60Hz
(coming from the wall), and the capacitors are very small at C1=220nF and C2=100nF, a high
reactance (Xc=(ωC)-1
) is achieved at high frequencies blocking out harmonics and resulting in a
clean DC output. Rp serves the purpose of protecting the IC in-case the battery is connected in
reverse. A maximum 100mA of reverse current is allowed and Rp=270Ω is designed to allow a
maximum of approximately 90mA. Rsc serves as the charging current control. Trickle or slow
charge battery charging rates are generally around C/10 where C is the battery's Amp-hour rating.
Rsc=0.5Ω is set for trickle charge at I0=900mA [11]. R1 and R2 are derived from the output
voltage, which in our case is comprised of 12 cells at approximately 2.1V each, totalling to
roughly 25.1V. However, anything less than 2.15V per cell will not charge the lead acid cells at
all. 2.3V per cell charging voltage was chosen to charge to a float voltage allowing for long
battery life and less water loss [12]. R1 is chosen as 1kΩ to limit the current across pin 4 and
ground. R2 is generally a potentiometer as this way a variable output voltage is attained and
charging of different battery capacities is possible however, this is not needed in our case.
R2=10kΩ is found considering an output voltage of approximately 27.5V and by applying nodal
analysis at pin 4 (Vref,l200). Finally, the diodes were selected as high powered diodes to allow for
high amounts of current to protect against battery back discharge. The SBYV-28-200 diode was
selected [13]. The equations and methods of finding these values is discussed next.
37
Figure 2.4.11: Nodal analysis at the labelled node yields shown equation. A variable resistance would account for a
variable voltage charger.
Referring to the above labeled circuit figure, capacitors C1 and C2 were chosen such that gain at
60Hz is unity and at high frequencies is small. Taking the 100nF capacitor and ignoring the R
term for estimation purposes:
(2.4.1)
Rp is a pull-down resistor serving to protect the IC from reverse battery connection. The IC can
have a maximum of 100mA entering ground pin 3, and thus is designed around this limitation.
Pin 3 to ground shares the voltage drop of the battery and thus we design for a current of 90mA
and obtain the required resistance:
(2.4.2)
Since Rp had current around 90mA a 0.25W resistor will burn. We chose to use 10W ceramic
resistors to overcome this problem as Rp takes up I2R=(0.09A)
2(270Ω)=1.7W of power on paper.
When measured V2/R=(25.1V)
2/270Ω=2.3W. Therefore a higher power resistor must be used.
R1 was chosen so that the current in the pin 4 IC branch was
low. Since the voltage Vref on pin 4 (to gnd.) is 2.77Ω,
R1=1kΩ was a sufficient choice to limit current. R2 is chosen
Figure 2.4.12: High power resistor.
38
such that 2.3V can appear across each of the 12 cells in charging which corresponds to about
27.5V total.
Referring to pin 4 of the labelled schematic, nodal analysis yields:
(2.4.3)
(2.4.4)
Rsc determines the initial charging current which flows from the output (pin 5). L200C has a max
current capability of 2A. Generally for trickle charge this is set to about 0.1C, where C=7.2Ahr.
We chose this to be about 0.125C for a little more than slow charging current but still nowhere
near quick charging. At 0.125C we need 0.9A, and since voltage drop Vlim between pins 5 and 2
is 0.45V we have:
(2.4.5)
Finally, taking into account the power lost in the IC:
(2.4.6)
A heat sink is definitely needed with that amount of power.
Referring to figure 2.4.10, the components that had been picked out consisted of ceramic
capacitors, a larger wire type resistor for 0.5Ω, two 10W ceramic resistors to equal 270Ω, two
diodes and the L200 IC. The IC received a heat sink and was to be screwed in place. The circuit
was assembled on a perforated board and each component soldered in place. The AC/DC adapter
was attached finally and the circuit was ready to be tested. Referring to figure 2.4.11, it is seen
that the output voltage of the charging circuit is above the battery voltage and therefore charging
is being done.
39
Figure 2.4.13: Completed battery recharging station.
Figure 2.4.14: Demonstrating that the output of the charger is charging the battery by showing on the multimeter a
voltage higher than that of the battery's.
40
Chapter 3 Design of a Digital Control System
A Microcontroller was needed to implement a digital PI controller and control switching
from battery to the static exciter. Analog PI controller would have needed hardware to be
changed and an amplifier to amplify the error. Manually switching from battery to static
exciter would have produced inconsistent results due to different switching time. The use
of a microcontroller allowed for a self-regulating system. The AVR was implemented in
the microcontroller. Upon initial start-up of the system the microcontroller was
responsible for switching from the battery to the static exciter. The error between the
reference voltage and RMS were sent to the PI controller. The controller adjusted the duty
cycle of the PWM.
3.1 Functions and Requirements of the Digital Controller
The following key attributes considered in selection of the microcontroller:
Pulse Width Modulation implemented in hardware
Minimum of Five Analog to Digital Convertor Channels
Readily available libraries and coding examples
Minimum 10 digital input/output Channels
The speed of the microcontroller was considered, but since the system frequency is 60 Hz
this was not a key requirement. The microcontroller needed to be fast enough to perform
all required tasks.
3.2 Factors Considered in Selection of Microcontroller
Based on these key attributes the Arduino Uno was chosen. Arduino Uno uses the
ATmega328P processor [3]. The Arduino Uno has a 32KB flash memory, 14 digital
input/output pins, 6 pulse width modulation pins and six analog pins. The resolution of
the analog to digital convertor was 10 bits. Arduino clock speed was 16 MHz which was
fast enough to perform all required tasks. There are large numbers of libraries available
on the internet including libraries for LCD display, A/D conversion, and PWM. Arduino
uses the programming language Processing which is based on C. Figure 3.1 shows a
picture of the microcontroller selected.
41
Figure 2.2: Arduino Uno
3.3 Peripheral Hardware
An important input into the microcontroller is the reference voltage. This voltage was
compared with terminal voltage to produce the correct PWM signal. Initially reference
voltage was set at 100 . Potentiometer was implemented so a user could change the
voltage to a value between 50 to 190 . Turning the potentiometer clockwise will
increase the reference voltage by increments of 10 and counterclockwise will equally
decrement the voltage.
An LCD was attached to the Arduino that displayed reference voltage, terminal voltage
and generator current [4]. The LCD required 7 digital I/O pins, it has two-line display
with 16 characters per line. Reference voltage was displayed on the first line and
terminal voltage along with generator current on the second line.
42
Figure 3.3: LCD
3.4 Analog to Digital Conversion
The terminal voltage from the generator was a continuous signal. The microcontroller
can only read discrete signals. The 10-bit resolution in Arduino quantized the continuous
signal into discrete to be read. To ensure the continuous signal was properly
reconstructed into a discrete signal the appropriate sampling frequency ( was chosen.
Recommended theoretical sampling frequency should be greater than the Nyquist rate
calculated in Equation 3.4.1 [5]. For practical purposes the recommended sampling
frequency should be at least thirty times the Nyquist frequency. Equation 3.4.2 shows that
the calculated sampling frequency should be at least . The Arduino was set to
sample at , which met the minimum requirement.
(3.4.1)
(3.4.2)
The performance of A/D converter can be measured by mean square error also known as average
distortion [6]. Equation 3.4.3 shows the average distortion of the A/D convertor.
(3.4.3)
43
3.5 Digital to Analog Conversion
The DAC converts a discrete signal into analog signal. The DAC in Arduino has an 8-
bit resolution which produces a PWM signal that was outputted to the system [7]. The
square wave is constructed by sending high and low signals for a distinct period of time.
The timer counts up to 255 until the duty cycle is reached. For example, if a 50% PWM is
needed it keeps the signal high till it reaches 128 and then low for the remaining count.
The frequency of the DAC needed to be set according the switching frequency of buck
convertor. The switching frequency of the buck convertor was . In order to
achieve this clock select bit was set to 010 so the pre-scalar was 8. Waveform generation
bits are set to 111 for fast PWM with OCRA controlling the top limit of 128. Equation
3.5.1 shows how the 15 frequency was calculated. The calculation of the mean
square error due to changing the timer count can be found in appendix C.
(3.5.1)
44
Chapter 4 Design of Control Software Program
Figure 4.1 shows a flowchart of the program implemented in Arduino. The five components are:
System Initialization, Switching, Updating Reference Voltage, PI Controller and Updating LCD.
Full Arduino UNO code is available in Appendix E.
Figure 3.1: Main Flowchart.
4.1 System Initialization
In this section the pins were assigned for hardware and variables used in coding were
defined. PWM signal is being outputted from Pin 5 of the Arduino. Digital pins
2,3,4,10,11 and 12 are being uses for the LCD [4]. The Relay_Pin was defined as pin 7.
System Initialization
Updating LCD
PI Controller
Updating Reference
Voltage
Switching
45
Analog pin A0 was used to read the measurement of the terminal voltage and pin A3 to
change the reference voltage.
4.2 Switching
The switching flowchart in Figure 4.2 shows the code for this part of the program.
Before the start of the loop, Battery was initialized to true. Setting Pin 7 the Relay_Pin
high (5V) and true sent a signal to the relay to connect the battery to the field winding
and a low (0V) signal to the relay connects the static exciter to field winding. The
microcontroller is writing the high signal as long as the battery is equal to true. After 5
seconds the Battery is equal to false and the Relay_Pin is a low signal.
Figure 4.2: Switching Flowchart
Battery ==
true?
Relay_Pin = 1
t >= Battery
Time?
Battery = False
Relay_Pin = 0
End
Yes
No
No
Yes
Start
46
4.3 Updating Reference Voltage/LCD
After the battery is disconnected from the system, a change in reference voltage is read from
the analog pin A3. Turning potentiometer changes the reference voltage. The program
will check the analog pin every 10 samples to update the reference voltage. LCD is
updated every 1000 samples to display the current terminal line to line voltage and the
line to line reference voltage.
4.4 PI Controller
The input into the PI controller was the error between the terminal voltage and the
reference voltage. The user has the option of choosing the desired reference voltage in
terms of line to line voltage. The line to line voltage was divided by a factor of 46 so it
can be compared with the terminal RMS (root mean square) voltage and was defined as
Vref. Analog pin A0 reads the terminal RMS voltage from the final component of the
measuring element. The microcontroller quantizes this values and assigns a number
between 0 – 1023. In order to compare this value with the desired reference voltage the
quantized value was scaled by dividing by 1023 and multiplying by 5V. This value was
defined as Vin, and the error sent to the PI controller was the difference between Vref
and Vin. Equation 2.3.6 was used and the following changes were made to the variables:
current output of the controller was defined as y, prior output as y1, current input as x and
prior input as x1. Equation 4.4 shows the implementation of the PI controller in
software. Initially all values were set to zero. The minimum value of y was set to 0 and
the maximum value of y was set to 4.1. The maximum and minimum values were set as
safeguards to ensure that the output would never become negative or exceed the
maximum RMS value. The output of y is divided by 4.1 and then multiplied by the
PWM_MAX_COUNT, which represents the PWM counter limit stored in OCRA. This
calculation gives the correct duty cycle to be sent to the system. The PI controller
flowchart is shown in figure 4.4
(4.1)
47
Figure 4.4: PI Controller
Start
val = analogRead(A0)
= val*5/1023
x1 = x
y1 = y
y<0?
y>Max_Voltage?
y = 0
y = Max_Voltage
pwm_val = y*(PWM_MAX_COUNT/MAX_VOLTAGE
analogWrite(PWM_PIN,pwm_val)
End
Yes
es
Yes
No
No
48
Chapter 5 Fabrication and Testing
The PI controller was tested using the Kp and Ki values that were determined in PSCAD.
With these values the system went unstable. Rated load was attached to the generator
terminal and the PI controller was tuned manually by changing the values of Kp and Ki in
software. The strategy used was to have a small values for both Kp and Ki and observe
the response. The values initially found were 0.3 for Kp = 0.3 and 0.1 for Ki. The
response of the system to change in reference voltage was measured to be approximately
45 seconds with an absolute error of less than 5% in the range of 50 to 190 . As
settling time was longer than what was desired, the Ki parameter was increased to 0.8 and
the settling time decreased.
Initially when the generator was turned on the field winding was excited from two 12V
batteries. After 5 seconds the batteries were disconnected from the field winding and the
static exciter was connected to provide DC power to the field winding. When reference
voltage was set at 100 it took the excitation system approximately 5 seconds to build
up the voltage to 100 . Figure 5.1 shows the response of the excitation system during
initial start-up of the generator. In the far right corner the change in time being measured
between the two cursors was shown, and it can be seen steady was reached in 5 seconds.
The response being measured was the change in RMS value from the measuring element.
Figure 3.3 shows the value of the reference voltage and terminal voltage it can be seen
that the error was within the 5%.
Figure 5.1: Controller behavior for start-up of generator.
49
The second test performed was measuring the step response of the excitation system as
the reference voltage was changed from 100 to 190 . Figure 5.2 shows that the
excitation system takes 4.2 seconds to reach steady state. The oscilloscope measured the
change in the RMS. Figure 5.3 displays the actual reference voltage and terminal voltage
outputted from the microcontroller. The error between the terminal voltage and reference
voltage was within the 5% proposed.
Figure 5.2: Step Response of excitation system to change in reference from 100 to 190 .
Figure 5.3: LCD displaying Vref and Vt.
The third test performed was reducing the reference voltage from 190 to 100 .
Settling time of the excitation system increase to 10.70 seconds. Figure 5.4 shows that
50
the RMS value initially overshoots the steady state value before becoming steady. Figure
5.5 shows that the error between the reference voltage and terminal voltage fell within the
5% range.
Figure 5.4: Step Response of excitation system to change in reference from 190 to 100 .
Figure 5.5: LCD displaying Vref and Vt.
The last change in reference test was performed by changing the reference voltage from 100
to 50 . Excitation response was similar to the response when the voltage was changed
from 190 to 100 . Figure 5.6 shows the response with a settling time of 10.70
seconds and figure 5.7 shows that the error between the two voltages was within the 5%
margin.
51
Figure 5.6: Step Response of excitation system to change in reference from 100 to 50
Figure 5.7: LCD displaying Vref and Vt.
Response of the excitation system was measured when a three phase Y-connected 10mH
inductive load in series with 60Ω resistive load was attached. Figure 5.8 shows that there
was sudden drop in the RMS voltage when the load is connected. The excitation system
reached steady state in 2.8 seconds. Though a picture of the LCD showing the reference
voltage and terminal voltage is not available, the error fell within the 5% range.
52
Figure 5.8: Response of the excitation system with addition of an inductive load.
Figure 5.9 shows the response of a three phase Y-connected 10 µF capacitive load.
Similar to the inductive load there was a sudden increase in line voltage when the load
was connected. The excitation system was able to get steady state in 4.4 seconds. Though
a picture of the LCD showing the reference voltage and terminal voltage is not available,
the error fell within the 5% range.
Figure 5.9: Response of the excitation system with addition of a capacitive load.
53
Chapter 6 Conclusion
An excitation system was successfully designed, built and implemented to feed the field winding
DC current and regulate the terminal voltage of the 1.5 KVA, 60Hz, 208V, 3- phase synchronous
generator. Automatic voltage regulator maintained the steady state error of the generator terminal
voltage within ±3 % of the reference voltage for a specified voltages between 50 to 190 .
The error range achieved was better than the proposed value of ±5%. The excitation system had
the ability to provide 1.25A DC to the field winding but this value exceeded the recommended
field current. The battery charger successfully recharged the two 12V batteries used for initial
excitation. Upon initial start up the generator takes approximately 5 seconds to build voltage of
the generator up to the reference voltage. The excitation system took 4.2 seconds to reach
steady state when the reference voltage was increased from 100 to 190 . It took
10.70 seconds to reach steady state when the reference voltage was decreased from
100 to 190 .
54
Bibliography
[1] D.W.Hart, Power Electronics, New York: McGraw-Hill, 2011.
[2] R. D. a. R. H. Bishop, Modern Control Systems, New Jersey: Pearson Hall, 2011.
[3] Atmel, "www.sparkfun.com," Atmel Corporation, 01 Febuary 2009. [Online]. Available:
https://www.sparkfun.com/datasheets/Components/SMD/ATMega328.pdf. [Accessed 10
10 2015].
[4] Arduino, "www.arduino.cc," arduino.cc, 17 August 2015. [Online]. Available:
https://www.arduino.cc/en/Tutorial/LiquidCrystalDisplay. [Accessed 15 January 2016].
[5] B. Lathi, Linear Systems and Signals, New York: Oxford University Press, 2005.
[6] J. D. Powell, G. F. Franklin and M. L. Workman, Digital Control of Dynamic Systems, Half
Moon Bay: Ellis-Kagle Press, 1998.
[7] K. Shirriff, "www.arduino.cc," arduino, 1 July 2009. [Online]. Available:
htttps://www.arduino.cc/en/Tutorial/SecrectsOfArduinoPWM. [Accessed 1 July 2015].
[8] I. Cowie, "All Abot Batteries Part 3: Lead-acid Batteries," 13 January 2014. [Online].
Available: http://www.eetimes.com/author.asp?section_id=36&doc_id=1320644.
[Accessed 6 January 2016].
[9] "Whats the Best Battery?," Battery University, 11 January 2011. [Online]. Available:
http://www.batterycharger.com/learn/article/whats_the_best_battery. [Accessed 8
January 2016].
[10] STMicroelectronics, "L200," January 2000. [Online]. Available:
http://www.zen22142.zen.co.uk/Circuits/Power/l200.pdf. [Accessed 2 January 2016].
[11] W. C. Ltd., "Battery Chargers and Charging Methods," 2005. [Online]. Available:
http://www.mpoweruk.com/chargers.htm. [Accessed 11 January 2016].
[12] P. Technology, "Lead Acid Battery Charging Basics and Chargers," 23 November 2015.
55
[Online]. Available: http://www.powerstream.com/SLA.htm. [Accessed 6 January 2016].
[13] Vishay, "Soft Recovery Ultrafast Plastic Rectifier," 10 February 2015. [Online]. Available:
http://www.vishay.com/docs/88737/sbyv28.pdf. [Accessed 3 February 2016].
[14] S. Lee, "AAVID THERMALLOY," [Online]. Available:
http://www.aavid.com/sites/default/files/technical/papers/how-to-select-heatsink.pdf.
[Accessed 18 February 2016].
[15] A. A. Ali, "Heat Transfer Lectures - Conduction," [Online]. Available:
http://www.scribd.com/doc/22016082/Heat-transfer-lectures-1-conduction#scribd..
[Accessed 19 February 2016].
[16] Guru,Hiziroglu, Electric Machinery and Transformers 3rd ed., New York: Oxford University
Press, Inc., 2001
56
Appendix A
DC field winding calculation to find its parameters:
Input step DC voltage is 20 volts.
Output measured current steady state is 0.25 A.
The slope of the line measured using figure … is 359.4
For first order response:
V(t) at t = 0 sec;
Inductor voltage is
Buck Converter Inductor and Capacitor Selection:
57
1- Best Scenario Case:
Output voltage of the synchronous generator: 208 V
Vphase =
= 120 V
Voltage after the Diode rectifier:
The best case is when we have 0.9 A at the output of the buck regulator so the voltage
will be
=
=
= 0.259
Inductor Selection:
Lmin =
=
= 30.01 mH , where is the switching frequency.
IL = IR =
=
= 0.9 A
Imax = IL +
, = 5% A
Imax = 0.9 A +
= 0.9225 A
Imin = IL -
= 0.8775 A
L =(
) = (
) = 1.196 H
The inductor must be rated for rms current,
IL, rms =
=
= 0.9 A
The inductor voltage when the switch is closed is = 280.8 – 72.9 = 207.9 V
The inductor voltage when the switch is open is = 72.9 V
Capacitor Selection:
Voltage ripples is
, Let’s choose it to be 10 %
58
C =
=
= 0.7744
The capacitor must be rated for the 72.9 V output.
Worst scenario Case-1:
Let’s choose the output of the buck regulator to be 25 V
Output voltage of the synchronous generator: 85 V
Vphase =
= 49.07 V
Voltage after the Diode rectifier:
=
=
= 0.635
Inductor Selection:
Lmin =
=
= 14.78 mH , where is the switching frequency.
IL = IR =
=
= 0.9 A
Imax = IL +
, = 5% A
Imax = 0.9 A +
= 0.9225 A
Imin = IL -
= 0.8775 A
L =(
) = (
) = 0.591 H
The inductor must be rated for rms current,
IL, rms =
=
= 0.9 A
The inductor voltage when the switch is closed is = – = 41.9 V
The inductor voltage when the switch is open is = V
Capacitor Selection:
59
Voltage ripples is
, Let’s choose it to be 10 %
C =
=
= 0.772
The capacitor must be rated for the V output.
3- scenario Case:
Output voltage of the synchronous generator: 260 V
Vphase =
= 150 V
Voltage after the Diode rectifier:
The best case is when we have 0.9 A at the output of the buck regulator so the voltage
will be
=
=
= 0.069
Inductor Selection:
Lmin =
=
= 37.70 mH , where is the switching frequency.
IL = IR =
=
= 0.3 A
Imax = IL +
, = 5% A
Imax = 0.3 A +
= 0.3075 A
Imin = IL -
= 0.2925 A
L =(
) = (
) = 1.49 H
The inductor must be rated for rms current,
IL, rms =
=
= 0.3 A
60
The inductor voltage when the switch is closed is = 350 – = 325.7 V
The inductor voltage when the switch is open is = V
Capacitor Selection:
Voltage ripples is
, Let’s choose it to be 10 %
C =
=
= 0.781
The capacitor must be rated for the 24.3 V output.
With :
L =(
) = (
) = 149.8 mH 150 mH
C =
=
= 0.0776
_____________________________________________________________________________
With :
L =(
) = (
) = 119.8 mH 120 mH
C =
=
= 0.062
_____________________________________________________________________________
With :
L =(
) = (
) = 99.88 mH 100 mH
C =
=
= 0.051
61
Appendix B
Open Circuit Test Short Circuit Test
If V_LL If Ia
0.009 4.5 0.006 0.143
0.1 27.8 0.024 0.25
0.2 55.8 0.032 0.295
0.3 84 0.1 0.769
0.4 111.3 0.154 1.071
0.5 135.6 0.211 1.476
0.6 158.4 0.255 1.723
0.7 179.6 0.311 2.083
0.8 198.3 0.358 2.386
0.855 206.5 0.401 2.671
0.456 3.024
0.496 3.198
0.53 3.308
Table 2: Open and short circuit test results.
Calculating the Saturated and Unsaturated Xs
If
[Amp]
Saturated
Line
voltage
Saturated
Phase
voltage
Unsa-
turated
Line
Voltage
Unsaturated
phase
Voltage
Line
current
Ia
[Amp]
Saturated
Armature
Reactance
(Xs)
pu Unsaturated
Armature
Reactance
(Xs)
0 4.5 2.59807 4.5 2.59807 0.1253 20.7256 0.71864 20.72567401
0.075 19 10.9696 19 10.9696 0.59249 18.5042 0.64161 18.50422575
0.15 41 23.6713 41 23.6713 1.05968 22.3297 0.77426 22.32970285
0.225 62 35.7957 62 35.7957 1.52687 23.4357 0.81261 23.43574177
0.3 84 48.4974 84 48.4974 1.99406 24.3131 0.84303 24.31312535
0.375 102 58.8897 102 58.8897 2.46125 23.9188 0.82936 23.91880767
0.45 123 71.0140 123 71.0140 2.92844 24.2419 0.8405 24.24195748
0.525 141 81.4063 145.95 84.2642 3.39563 23.9659 0.83099 24.80784129
0.6 158.4 91.4522 166.8 96.302 3.86282 23.6669 0.8206 24.92286972
0.675 175 101.036 187.65 108.33 4.33001 23.3258 0.8088 25.01307574
0.75 190 109.696 208.5 120.377 4.7972 22.8584 0.79259 25.08571165
62
0.825 202 116.624 229.35 132.415 5.26439 22.1449 0.76785 25.14545526
Table 3: Calculating saturated and unsaturated armature reactance.
Load Test
Load
R
V_LL
[volt]
I_L
[Amp]
If
[Amp]
20 149.7 3.55 0.843
24 161.3 3.43 0.843
30 173 3.215 0.843
34 179.4 3.01 0.84
40 184.2 3.658 0.84
48 188.8 2.274 0.838
60 192.8 1.86 0.838
80 196 1.419 0.835
120 198.2 0.958 0.83
240 200.4 0.486 0.829
255 205.1 0.465 0.858
375 205 0.317 0.854
Table 4: Load test results.
63
Load Angle characteristics
Line
Voltages
[Volt]
Line
currents
[Amp]
Power [W] Angle δ
[rad]
Angle δ
[deg]
149.7 3.55 920.47242 0.7380850 42.310606
161.3 3.43 958.27269 0.6842022 39.221786
173 3.215 963.35799 0.6192688 35.499486
179.4 3.01 935.29704 0.571825 32.779809
188.8 2.274 743.62345 0.4327731 24.808650
192.8 1.86 621.1272 0.3544102 20.316512
196 1.419 481.72489 0.2708667 15.527395
198.2 0.958 328.87418 0.1833137 10.508430
200.4 0.486 168.69204 0.092752 5.3170383
205.1 0.465 165.18828 0.08674 4.9725057
205 0.317 112.55732 0.0592424 3.3960656
Table 5: Load angle calculations.
Figure A.2.1: Load Angle Characteristics Curve for the Synchronous Generator.
0
200
400
600
800
1000
1200
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
Rea
l Po
wer
P [
W]
Load angle δ [rad]
Load angle characteristics curve
Angle δ [rad]
64
Appendix C
Table 6: Error in PWM signal.
PWM
MAX
COUNT
DUTY
DESIRE
D
PWM
DESI-
RED
PWM
ACHIEVA-
BLE
DUTY
ACTUA
L
ERR
OR
MEAN
SQUARE
ERROR
128 0.01 1.28 1 0.007812
5
0.047
85156
0.001886708
0.02 2.56 2 0.015625 0.047
85156
0.03 3.84 3 0.023437
5
0.047
85156
0.04 5.12 5 0.039062
5
0.000
54932
0.05 6.4 6 0.046875 0.003
90625
0.06 7.68 7 0.054687
5
0.007
83963
0.07 8.96 8 0.0625 0.011
47959
0.08 10.24 10 0.078125 0.000
54932
0.09 11.52 11 0.085937
5
0.002
03752
0.1 12.8 12 0.09375 0.003
90625
0.11 14.08 14 0.109375 3.228
3E-05
0.12 15.36 15 0.117187
5
0.000
54932
65
0.13 16.64 16 0.125 0.001
47929
0.14 17.92 17 0.132812
5
0.002
63572
0.15 19.2 19 0.148437
5
0.000
10851
0.16 20.48 20 0.15625 0.000
54932
0.17 21.76 21 0.164062
5
0.001
21986
0.18 23.04 23 0.179687
5
3.014
1E-06
0.19 24.32 24 0.1875 0.000
17313
0.2 25.6 25 0.195312
5
0.000
54932
0.21 26.88 26 0.203125 0.001
07178
0.22 28.16 28 0.21875 3.228
3E-05
0.23 29.44 29 0.226562
5
0.000
22337
0.24 30.72 30 0.234375 0.000
54932
0.25 32 32 0.25 4.930
4E-32
0.26 33.28 33 0.257812
5
7.078
6E-05
0.27 34.56 34 0.265625 0.000
26256
0.28 35.84 35 0.273437
5
0.000
54932
66
0.29 37.12 37 0.289062
5
1.045
1E-05
0.3 38.4 38 0.296875 0.000
10851
0.31 39.68 39 0.304687
5
0.000
29368
0.32 40.96 40 0.3125 0.000
54932
0.33 42.24 42 0.328125 3.228
3E-05
0.34 43.52 43 0.335937
5
0.000
14277
0.35 44.8 44 0.34375 0.000
31888
0.36 46.08 46 0.359375 3.014
1E-06
0.37 47.36 47 0.367187
5
5.778
1E-05
0.38 48.64 48 0.375 0.000
17313
0.39 49.92 49 0.382812
5
0.000
33965
0.4 51.2 51 0.398437
5
1.525
9E-05
0.41 52.48 52 0.40625 8.365
6E-05
0.42 53.76 53 0.414062
5
0.000
19985
0.43 55.04 55 0.429687
5
5.281
6E-07
0.44 56.32 56 0.4375 3.228
3E-05
67
0.45 57.6 57 0.445312
5
0.000
10851
0.46 58.88 58 0.453125 0.000
22337
0.47 60.16 60 0.46875 7.073
3E-06
0.48 61.44 61 0.476562
5
5.128
6E-05
0.49 62.72 62 0.484375 0.000
13178
0.5 64 64 0.5 1.972
2E-31
0.51 65.28 65 0.507812
5
1.839
7E-05
0.52 66.56 66 0.515625 7.078
6E-05
0.53 67.84 67 0.523437
5
0.000
15332
0.54 69.12 69 0.539062
5
3.014
1E-06
0.55 70.4 70 0.546875 3.228
3E-05
0.56 71.68 71 0.554687
5
8.999
6E-05
0.57 72.96 72 0.5625 0.000
17313
0.58 74.24 74 0.578125 1.045
1E-05
0.59 75.52 75 0.585937
5
4.741
1E-05
0.6 76.8 76 0.59375 0.000
10851
68
0.61 78.08 78 0.609375 1.049
8E-06
0.62 79.36 79 0.617187
5
2.057
8E-05
0.63 80.64 80 0.625 6.298
8E-05
0.64 81.92 81 0.632812
5
0.000
12612
0.65 83.2 83 0.648437
5
5.778
5E-06
0.66 84.48 84 0.65625 3.228
3E-05
0.67 85.76 85 0.664062
5
7.853
4E-05
0.68 87.04 87 0.679687
5
2.111
9E-07
0.69 88.32 88 0.6875 1.312
7E-05
0.7 89.6 89 0.695312
5
4.484
2E-05
0.71 90.88 90 0.703125 9.376
2E-05
0.72 92.16 92 0.71875 3.014
1E-06
0.73 93.44 93 0.726562
5
2.217
4E-05
0.74 94.72 94 0.734375 5.778
1E-05
0.75 96 96 0.75 3.506
E-31
0.76 97.28 97 0.757812
5
8.284
6E-06
69
0.77 98.56 98 0.765625 3.228
3E-05
0.78 99.84 99 0.773437
5
7.078
6E-05
0.79 101.12 101 0.789062
5
1.408
3E-06
0.8 102.4 102 0.796875 1.525
9E-05
0.81 103.68 103 0.804687
5
4.301
6E-05
0.82 104.96 104 0.8125 8.365
6E-05
0.83 106.24 106 0.828125 5.103
2E-06
0.84 107.52 107 0.835937
5
2.339
E-05
0.85 108.8 108 0.84375 5.406
6E-05
0.86 110.08 110 0.859375 5.281
6E-07
0.87 111.36 111 0.867187
5
1.045
1E-05
0.88 112.64 112 0.875 3.228
3E-05
0.89 113.92 113 0.882812
5
6.521
9E-05
0.9 115.2 115 0.898437
5
3.014
1E-06
0.91 116.48 116 0.90625 1.698
2E-05
0.92 117.76 117 0.914062
5
4.165
2E-05
70
0.93 119.04 119 0.929687
5
1.129
1E-07
0.94 120.32 120 0.9375 7.073
3E-06
0.95 121.6 121 0.945312
5
2.434
6E-05
0.96 122.88 122 0.953125 5.128
6E-05
0.97 124.16 124 0.96875 1.660
6E-06
0.98 125.44 125 0.976562
5
1.230
4E-05
0.99 126.72 126 0.984375 3.228
3E-05
1 128 128 1 4.437
3E-31
71
Appendix D
G =
6 s + 81
-------------------------------------------
8.16e-06 s^3 + 0.0001102 s^2 + 6.017 s + 81
Continuous-time transfer function.
r =
1.0e+02 *
-0.0002 + 8.5871i
-0.0002 - 8.5871i
-0.1346 + 0.0000i
n =
-13.5000
Kp =
2.0000e-04
Kp =
2.0000e-04
ans =
RiseTime: 115.6276
SettlingTime: 205.8826
72
SettlingMin: 0.9001
SettlingMax: 1.0000
Overshoot: 0
Undershoot: 0
Peak: 1.0000
PeakTime: 552.7287
% the original root locus of the PSCAD simulation
close all;
clear all;
clc;
num = [6, 81];
den = [8.16*10^(-6) 1.1016*10^(-4) 6.017 81];
G = tf(num, den)
figure;
rlocus(G)
r = roots(den)
n = roots(num)
Kp = .0002
Ki = 0.019;
num1 = [6, 81];
den1 = [8.16*10^(-6) 1.1016*10^(-4) 6.017 81+Kp 0];
G2 = tf(num1,den1);
figure;
rlocus(G2);
%step response with the PI controller
Kp = .0002
73
Ki = 0.019;
GC = tf([Kp, Ki], [1,0]);
GP = tf ([6 81],[8.16*10^(-6), 1.1016*10^(-4) 6.017 81]);
G1 = feedback(GC * GP , 1);
stepinfo(G1)
figure;
stepplot(G1);
Appendix E
Arduino code:
// include the library
#include <LiquidCrystal.h>
// all of our LCD pins
int lcdRSPin = 12;
int lcdEPin = 11;
int lcdD4Pin = 10;
int lcdD5Pin = 4;
int lcdD6Pin = 3;
int lcdD7Pin = 2;
74
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(lcdRSPin, lcdEPin,
lcdD4Pin, lcdD5Pin, lcdD6Pin, lcdD7Pin);
#define PWM_PIN 5
#define PWM_MAX_COUNT 128
// the pin we use to control the relay
#define RELAY_PIN 7
#define MAX_VOLTAGE 4.1
#define MIN_VOLTAGE 0.0
// the time to leave the battery on in microseconds
#define BATTERY_TIME 50000000
long t0, t;
void setup()
{
Serial.begin(9600);
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
pinMode(A0, INPUT);
75
pinMode(A1, INPUT);
pinMode(A3, INPUT);
pinMode(PWM_PIN, OUTPUT);
pinMode(RELAY_PIN, OUTPUT);
TCCR0A = _BV(COM0A0) | _BV(WGM00) | _BV(WGM01);
TCCR0B = _BV(WGM02) | _BV(CS01);
OCR0A = PWM_MAX_COUNT;
t0 = micros(); // record the starting time in microseconds
}
double Vreference = 100.0;
double Vref = Vreference / 46.0;
double kp = .3;
double ki = 0.8;
double T = 1.0/9600.0; // the peroid is 1/sampling frequency
double x = 0;
double x1 = 0; // recorded input x(k - 1)
double y = 0;
double y1 = 0; // recorded output y(k - 1)
76
bool battery = true;
unsigned int k = 0; // keeps track of the sample.
int val;
int pwm_val;
double vin;
double current = 0.0;
void vref_lcd()
{
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Vref=");
lcd.print((int)(Vreference));
lcd.setCursor(0, 1);
lcd.print("Vt= 10");
lcd.print((int)(vin*46.0));
}
void vref_update()
{
77
Vreference = (int)(analogRead(A3) * 15.0 / 1023.0) *10.0 +
50.0;
Vref = Vreference / 46.0;
}
void loop()
{
k++;
t = micros()-t0; // calculate elapsed time
if (battery == true)
{
digitalWrite(RELAY_PIN, HIGH);
if (t >= BATTERY_TIME)
{
battery = false;
digitalWrite(RELAY_PIN, LOW);
}
}
78
if (k % 10 == 0)
{
vref_update();
}
val = analogRead(A0); // uncomment this line to read from A/D
converter
vin = (double)val / 204.6; //(double)val / 1023.0 * 5.0;
x1 = x;
x = (Vref - vin);
y1 = y;
y = y1 + kp*x + (ki*T - kp)*x1;
if (y < 0) y = 0;
if (y > MAX_VOLTAGE) y = MAX_VOLTAGE;
pwm_val = (int)(y * (double)PWM_MAX_COUNT / MAX_VOLTAGE);
analogWrite(PWM_PIN, pwm_val); // uncomment this to use the
difference equations
79
if (k % 1000 == 0)
{
lcd.clear();
vref_lcd();
}
}
80
Appendix F Budget given was $500 from the Electrical and Computer Engineering Department. Actual
spending was $687.59.