Professional Documents
Culture Documents
By
F17/2161/2004
This project is dedicated to my parents Mr. and Mrs. Koech who have been my source of
inspiration all my life. Your love, care and support throughout my life means the world to me.
ii
ACKNOWLEDGEMENT
First and foremost I would like to thank God for bringing me this far.
Most gratitude goes to my project supervisor, Dr.-Ing. W. Mwema for his unrelenting advice and
guidance in the design and implementation of the project.
I would also like to thanks my cousins Samson and Gilbert for moral and financial support.
Lastly I would like to take this opportunity to give special thanks to all my classmates. Your continual
support and trust in my abilities has not gone unnoticed
iii
ABSTRACT
Use of photovoltaic systems to generate electricity in homes and businesses is becoming
increasingly popular, as the cost of conventional electric energy increases while the cost-
effectiveness of solar power systems improves. While much attention is paid to gradual
improvements in the efficiency of solar cells, steps must be taken to improve the efficiency of
the power conversion electronics of the system. Solar electric systems incorporate inverters or
power control units that transform the DC electricity generated by the solar cells into AC to run
appliances or sell to a utility grid.
Inverters convert DC battery power to standard AC power. The AC power produced can run
regular AC appliances, including TVs, computers, microwaves and power tools.
This project presents a design that will attempt to convert 12 V DC power to a three phase 120 V
AC power at 50 Hz. The design is based on CMOS logic inverters made up of power MOSFETS
and a microcontroller. Simulation is carried out and actual implementation done.
From the laboratory measurement, the inverter is seen to generate a three phase 118 V AC at 47
Hz. The discrepancy in frequency of oscillation from the design value can be attributed to the
execution time and propagation delays of the microcontroller and other components.
iv
Table of contents
Dedication ............................................................................................................................................... ii
ACKNOWLEDGEMENT ............................................................................................................................ iii
ABSTRACT........................................................................................................................................... iv
1.0 INTRODUCTION ................................................................................................................................. 1
1.1 Objective ....................................................................................................................................... 1
1.2 The need for inverter circuit........................................................................................................... 1
1.3 Recognition of previous work......................................................................................................... 1
2.0 LITERATURE REVIEW .......................................................................................................................... 3
2.1 Amplifier type sine-wave inverter .................................................................................................. 3
2.2 The saturated switch...................................................................................................................... 3
2.2.1 The Voltage driven inverter ..................................................................................................... 4
Preloading the inverter .................................................................................................................... 7
Using feedback diodes ..................................................................................................................... 7
2.2.3 The current driven inverter ...................................................................................................... 9
2.3 THREE PHASE INVERTER ............................................................................................................... 11
2.3.1 180 conduction .................................................................................................................... 12
2.3.2 120 conduction .................................................................................................................... 13
2.4 Control of inverter output voltage ............................................................................................... 14
2.5 Reducing of harmonics of the inverter output .............................................................................. 15
2.6 PERFORMANCE PARAMETERS ...................................................................................................... 15
(1) Harmonic factor of nth harmonic (HFn) ..................................................................................... 15
(2)Total harmonic distortion, THD .................................................................................................. 16
(3)Distortion factor, DF .................................................................................................................. 16
(4)Lower-order harmonic, LOH ...................................................................................................... 16
CHAPTER 3: INVERTER DESIGN .............................................................................................................. 16
3.1 The power MOSFET switching circuit ........................................................................................... 16
3.2 Gate drive signals......................................................................................................................... 18
3.3 Switching circuit........................................................................................................................... 22
CHAPTER 4: IMPLEMENTATION ............................................................................................................. 24
v
4.1 Gate drive circuit ......................................................................................................................... 24
CHAPTER 5: RESULTS OBTAINED AND ANALYSIS .................................................................................... 25
CHAPTER 6: CONCLUSION AND FUTURE WORK ..................................................................................... 29
6.1Conclusion .................................................................................................................................... 29
6.2 Recommendation for future work ................................................................................................ 29
APPENDIX .............................................................................................................................................. 30
APPENDIX A. CIRCUIT DIAGRAM FOR THE IMPLEMENTATION OF THE PROJECT.................................. 30
APPENDIX B. 1 MICROCONTROLLER ASSEMBLY CODE ........................................................................ 31
APPENDIX B 2. AVR microcontroller hex file for the code developed. ................................................ 33
APPENDIX C: Three phase inverter conduction modes ....................................................................... 34
180 conduction............................................................................................................................. 34
120 conduction mode of operation............................................................................................... 37
APPENDIX D: DATASHEETS ................................................................................................................. 39
ATMEL 8-BIT MICROCONTROLLER DATASHEET. .............................................................................. 39
IRF9540 P-CHANNEL MOSFET ELECRICAL PROPERTIES.................................................................... 45
IRF830 N-CHANNEL POWER MOSFET ELECTRICAL PROPERTIES ...................................................... 46
Electrical Characteristics of the voltage regulator used to power the microcontroller. ................... 47
REFERENCE ............................................................................................................................................ 48
vi
1.0 INTRODUCTION
1.1 Objective
The project aimed to come up with specification, design and implementation of a microcontroller
based three phase inverter that can work with a solar power panel. In the design proposed, 12 V
DC from the power supply is used as the input.
THREE PHASE
DC BUS THREE PHASE
CMOS LOGIC
VOLTAGE LOAD
INVERTER
GATE DRIVE
SWITCHING
SIGNAL
1
machines, there is need for the design of three phase inverters. This project tries to solve this
problem by converting DC voltage to three phase AC.
This project is organized in six chapters. Chapter one gives a general introduction, project
objective and the need for power inverter.
Chapter two gives the theory and background information concerning power inverter. The
principles of operation of both single phase and three phase inverters are outlined here. The
performance parameters are also described.
Chapter three describes the system design. Operation of CMOS logic inverter and how it is used
to realize a power inverter is described in this chapter. A single phase simulation of an inverter is
described and the results explained.
Chapter four explains the actual implementation of the three phase inverter using CMOS logic
inverters. The gate drive circuit used in implementation is described in this chapter.
Chapter five gives the results and analysis of various waveforms obtained at different stages in
the implementation of the project. The waveforms were edited using picture editing software for
clarity.
Chapter six gives the conclusion and recommendation for future work on this project.
2
2.0 LITERATURE REVIEW
An inverter circuit is used to convert DC power to AC power. This conversion is achieved either
by transistors or by SCRs. For low power and medium power output, common MOSFETs and
BJTs transistors are suitable but for high power outputs SCRs and high power transistors such as
IGFET are used. For low power self oscillating, transistorized inverters are suitable but for high
power output, driven inverter are more common than self oscillating ones [1]. Moreover for
multiphase ac output, driven inverters must be used.
The driven inverters have better frequency stability because a separate master oscillator is used
for the purpose. For inverter applications, transistors have the following advantages over SCRs:
Higher switching speed
Simplicity in control circuit
Higher efficiency and greater reliability
This is mainly due to the fact that SCR inverters require extra circuit to turn SCRs off, moreover
additional complex logic circuits may be required to prevent false triggering and provide proper
commutation timing. SCRs can handle much higher load current than BJTs and MOSFETs thus,
for high power output, SCRs become more desirable than the transistors.
Inverter circuits may be divided broadly into two classes namely: [1]
1. Amplifier type sine-wave inverter
2. Saturated switch type square wave inverters
3
losses in the semiconductor device are thereby reduced considerably consequently improving the
efficiency and power output as compared to an amplifier type circuit using transistors with same
rating. These inverters can be classified into two groups namely:
Voltage driven inverter
Current driven inverter
V1 T1
is1 Y
Driving S1 LOAD
circuit
S2 is2 Z
4
Types of load
Resistive load
The resistive load poses no major problem to the inverter. The voltage waveform is a square-
wave and since current and voltage are in phase the current waveform is also square-wave. This
is as illustrated in the Figure 2.3
(v)
(v)
(A)
An AC source when operating on a power factor load delivers power to the load in one half-
cycle and receives power from the load in the next half-cycle. In static inverter the actual power
source is DC and if it has to operate on a power factor load, it must be capable of delivering
power in one half-cycle of the inverter and receiving power in the next half-cycle. In voltage
driven inverter, the transformer voltage is always a square-wave since it works in sequence with
the driving circuit and consequently the current must shift in phase. Therefore in some part of the
voltage waveform, power is delivered to the load and the inverter must be capable of receiving
power and delivering it to the source during the other part of the voltage-wave, or this power
5
must be dissipated on the load side of the inverter. The voltage and current waveforms for a
purely inductive load are shown in Figure 2.4.
(v)
(v)
(A)
Figure 2.4 Voltage and current waveforms for a purely inductive load
When the load voltage and current are both either positive or negative, power is absorbed by the
load. But when the load voltage and current are in anti-phase, power is delivered by the load.
In a voltage-driven inverter, the semiconductor devices should pass current as soon as they are
switched on, that is S1 should begin to conduct in the normal direction as the voltage crosses
zero, but due to the inductive load, the current does not change direction instantaneously and
continues to flow in the negative direction. This means that the inductive nature of the load
attempts to force a reverse current through the devices. However, the semiconductor devices are
unidirectional and block the required reverse current. Again the interruption takes place when the
load current is at its peak. This sudden stoppage of current causes a very large reverse voltage
spike to develop on the transformer primary. This reverse voltage is theoretically of infinite
value which can destroy the devices. Switch S2 would also face the same consequence when it
tries to conduct at . This problem can be overcome by providing a path for the load current to
flow during the device switching period. There are two ways to make it effective namely:
6
1. Preloading the inverter
2. Using feedback diodes.
Figure 2.5 Circuit in a voltage driven inverter with purely inductive load and feedback diodes
The diodes are referred to as feedback or free-wheeling diodes. When seen from the direction of
the load the feedback diodes operate as rectifiers permitting reverse energy to flow from the load
to the source.
Consider the situation when switch S2 is closed and S1 is open, as S2 is opened and S1 is closed,
the current through S2 becomes zero abruptly but the energy in the inductive load tries to force
current in the same direction. This creates a high surge voltage due to L if no path is available
for the current to flow. To avoid this situation, diodes D1 and D2 are connected across the
switches S1 and S2 respectively as shown in figure 2.5, the transformer acts as a source and
excess voltage greater than the supply source forces current through the voltage source V1 and
through the diodes D1. This continues till the transformer voltage becomes equal to or less than
7
the supply voltage. So long as D1 is conducting S1 is reverse biased by the voltage drop of D1 and
cannot conduct. As soon as current flowing through D1 becomes zero, S1 begins to conduct if it
is still closed. The same phenomenon occurs in the reverse cycle when S1 is opened and S2 is
closed.
The average current through the supply source is zero since no active power is consumed by the
purely inductive load.
Capacitive load
A capacitive load creates a similar problem to an inductive load for the voltage driven inverters.
The voltage becomes a square wave while the current waveform changes considerably due to
capacitive loading. The voltage and current waveforms of the transformer primary for purely
capacitive load are shown in figure 2.6
e
0 0 0 t
I
t
Figure 2.6 Voltage and current wave form for capacitive load
Each time the semiconductor switch begins to conduct, large current spikes appear in the
transformer primary because the square wave voltage of the transformer secondary supplies
power to reverse-charge the capacitor through the very low impedance presented by the
transformer winding and the reflected saturation resistance of the semiconductor switches. This
current continues to flow till the charge across the capacitor builds up sufficiently. Due to these
large current peaks, the losses in the inverter suddenly rise to a large value lowering the
efficiency. Moreover the high value of exceeds the safe limiting value of the semiconductor
8
devices and permanently damages them. This problem is overcome by incorporating some
resistance in the circuit to limit the peak current but this increases the size of the inverter.
Motor load
The voltage driven inverter does not operate satisfactorily on motor loads. At the time of startup,
power requirements of a motor may be several times more than required in the normal operation.
This extreme transient condition may continue for several seconds depending on the angular
acceleration of the motors rotor. Moreover, the power factor of the motor at this condition
becomes extremely low and may be of the order 0.2 lagging. Even with a power factor
improvement capacitor connected across the motor, the low transient power factor during start-
up cannot be compensated. To cater for transient power, the rating of the semiconductor devices
and the transformer should be adequately increased and properly protected. Alternatively the
motor inrush current could be restricted to a minimum value by inserting a current-limiting
resistor in series with the motor.
The loop response should be compatible with the motor, otherwise there will be hunting. That is
sudden application or removal of motor load may generate oscillations which may continue
indefinitely if a proper damping arrangement is not provided.
T1
Driving S1 LOAD
circuit
- S2
C1
L1 C L2
+ L1 L2
9
Figure 2.7 Schematic diagram of a current driven inverter
The circuit of a current driven inverter is quite similar to that of the voltage driven inverter
except that the supply source is a constant-current rather than a constant-voltage source. The
constant voltage source can be converted to a constant current source by inserting a large choke
L (theoretically of infinite inductance) in series with it. This choke, usually referred to as a
feedback choke and must be sufficiently large to maintain a constant current flowing through the
circuit under all conditions. The current waveform is a square wave irrespective if the type of
load and power factor. Usually, the DC supply is a battery which should have sufficiently low
impedance so that power can be drawn and fed back by the inverter whenever required. In
practice however, all the reactive power cannot be dumped properly into the power source
particularly when there are other equipments operating on the same DC bus. This would cause a
large ripple current to appear on the same bus bar and cause interference with the operating of
other equipment. To overcome this difficulty, an LC filter is always provided across the battery
source as shown in Figure 2.7, L1 attenuates the ripple current while C1 serves to reduce the
impedance of the dc source and is capable of delivering and receiving power during operation on
a power-factor load.
The LC filter in conjunction with a battery may be used either in a constant voltage or constant
current inverter. The operation of a current driven inverter with various loads is shown with
various loads is shown with the help of the waveforms in figure 2.8
I (A) a
0 0 0 t
b
VL
t
VL c
t
VL d
t
10
Figure 2.8(a) Current waveform, (b) Load voltage waveform at a purely resistive load, (c) Load
voltage waveform at a purely inductive load, (d) Load voltage waveform at a purely capacitive
load.
For a square-wave current, the voltage across a resistive load is a square wave in phase with the
current waveform. For a purely inductive load the voltage is spiked and for a purely capacitive
load, the voltage is triangular. The spiky nature of load voltage on a purely inductive load is
unsuitable for practical purposes. A triangular waveform on a purely capacitive load means that
voltage changes from positive to negative alternately in each half-cycle duration. In the same
half cycle, power is delivered and received from the load without being transferred through the
inverter. This shows that the current-driven inverter has the capability to handle power factor
load without interrupting the semiconductor devices.
A T1
a
Inverter 1
D
B T2
b
Inverter 2
E
C T3
c
Inverter 3
F
n
11
A three-phase output can be obtained from a configuration of six transistors as shown in Figure
2.10.
Q1 Q3 Q5
V1
D1 D3 D5
g1 g3 g5
a b c
Q6 Q2
Q4
D6 D2
v2 D4
g6 g2
V2 g4
12
For a Y-connected load, the line-to-neutral voltages must be determined to find the line currents.
g1
0
3 t
2
g2
0
t
g3
0
t
g4
0
t
g5
0
t
g6
t
Vab
0
2 3 t
Vbc
0
2 t
Vca
0
2 t
13
g1
0
3 t
2
g2
0
t
g3
0
t
g4
0
t
g5
0
t
g6
t
Van
0
2 3 t
Vbn
0
2 t
Vcn
0
2 t
14
The common methods of output control are:
Controlling DC input voltage
Controlling AC output voltage
Pulse width modulation
If inverter is supplied from an AC source through a rectifier, the input to the inverter can be
regulated by means of an induction regulator, variac or a controlled rectifier.
If the supply is DC, it can be regulated by shunt or series regulator or chopper using time-ratio
control method. The pulse width modulation can be applied for both types of inputs.
HFn =
15
Where V1 is the RMS value of the fundamental component and Vn is the RMS value of the nth
harmonic component.
TDH =
(3)Distortion factor, DF
It is a measure of effectiveness in reducing unwanted harmonics without having to specify the
values of a second order filter. DF indicates the amount of harmonic distortion that remains in a
particular waveform after the harmonics of that waveform have been subjected to a second order
attenuation.
DF =
DFn =
16
CMOS switch was implemented using power MOSFETs. Two sets of CMOS MOSFET circuits
are used and are controlled by the anti-phase signals generated by the microcontroller.
Q1
Q3
N-MOS OFF
A T1
+12 V
Q2
P-MOS OFF
Q4
In the case when the gate inputs of transistors Q1 and Q3 are L level signifying 0 volts, and the
inputs of transistors Q2 and Q4 are H level signifying 5 volts, transistors Q1 and Q4 are turned
ON while transistors Q2 and Q3 are OFF. Therefore, the electric current flows through the
direction of A to B on the primary coil of the transformer as shown in figure 3.1(a).
17
Q5
P-MOS OFF
Q6
A T2
+12 V
Q7
Q8
N-MOS OFF
Considering when the input of transistor Q5 and Q6 are H level and the input of transistors Q7
and Q8 are L level. Transistors Q6 and Q7 are ON while transistors Q5 and Q8 are OFF.
Therefore, the electric current flows through the direction of B to A on the primary coil of the
transformer as shown in Figure 3.1(b). This is contrary to the case in Figure 3.1(a).
To produce an ac signal, current is made to flow in one direction for half a period then reversed
in the next half period. The duration of the period determines the output frequency.
18
The ATtiny26L AVR microcontroller was chosen as the most appropriate source of gating signal
because it has the following characteristics:
It has an internal oscillator with frequencies ranging from 1 MHz to 8 MHz
Most of its instructions are single clock cycle execution therefore executes faster.
It has an on chip RAM of 128 bytes.
It is programmed by connecting some of its pins directly to some pins of the computer
parallel port.
It is readily available and cheaper than most microcontrollers.
The desired output frequency is 50Hz hence a period of 0.02 seconds equivalent to 20,000
microseconds. To obtain the three phase square wave AC signal, the three phases must be 120
out of phase as shown in the figure 3.2.
From the three phase waveforms drawn in Figure 3.2, it can be observed that for every one sixth
of the period, one of the three waveforms will either be changing from high to low or from low
to high. To achieve this, a delay of one sixth of the period corresponding to 3333 microseconds
was created so that after 3333 microseconds one pin of the microcontroller would be cleared then
another pin set and the delay subroutine executed.
The default frequency of the microcontroller used is 1 MHz according to the Manufacturers
datasheet. This implies that one machine cycle is 1 microsecond. In creating a delay of 3333
19
microseconds, two 8-bit registers were used to create software loops. This was done by loading
the registers with a value 3333 and decrementing the value while monitoring the content of the
register. When the value is zero, then the microcontroller clears one pin and sets another pin and
the value loaded to the registers and decremented again [4].
R1, Y1 and B1 in figure 3.2 are taken as the pin from the microcontroller that switches the
waveform from zero to a positive value while R2, Y2 and B2 switches the waveforms from zero
to a negative value. The pins are connected to the coinciding gates R1, R2, Y1, Y2, B1 and B2 of
Figure 3.4.
The sequence of switching ON and OFF various pins is of the microcontroller to achieve a three
phase square-wave waveform is as shown in the flow chart of Figure 3.3
The loop will continue indefinitely as long as power is connected to the device.
20
START
NO
IS THE VALUE ZERO?
YES
CLEAR B1 AND SET B2 THEN LOAD
VALUE 3333 TO THE REGISTER
NO
IS THE VALUE ZERO?
YES
NO
IS THE VALUE ZERO?
YES
NO
IS THE VALUE ZERO?
YES
CLEAR B2 AND SET B1 THEN LOAD
VALUE 3333 TO THE REGISTER
NO
IS THE VALUE ZERO?
YES
NO
IS THE VALUE ZERO?
YES
Figure 3.3 Flow chart showing implementation of three phase wave forms by the
microcontroller
21
3.3 Switching circuit
The switching circuit for each phase consists of two CMOS logic inverters with their gates
driven by two anti-phase signals from the microcontroller. Figure 3.3 shows three phase design
of the inverter where the gate drive signals are generated by a microcontroller. The design is
based on the saturated switch approach where high efficiency is achieved because transistors
dissipate very little power.
12 V 9
0
Q1 Q5 Q9
R1 1 Y1 18 B1 20
Q3 Q6 Q10
0 0 0
Q2 Q7 Q11
5 7
2
R2 Y2 B2 10
19 8
3 Q4 Q8 Q12
6
0 0 0
4
T1 T2 T3
22
V1
XFG1 12 V
0
Q1
2
U2B IRF9540
5
V(p-p): 14.1 uV
4010BF_10V Q3 V(rms): 11.4 V XSC1
V(dc): 11.4 V
I: 4.83 A
I(p-p): 384 uA
Probe1,Probe1 Ext T rig
IRF830 I(rms): 4.83 A +
0 I(dc): 4.83 A _
Freq.: 50.0 kHz A B
_ _
1 T1 8 + +
0
7
V2 Q2 IRON_CORE_XFORMER
12 V
0
4 IRF9540
U1C 3
4009BCP_10V Q4
IRF830
0
+2.45
0
t
-2.45V
Figure 3.6 Results of simulating the single phase inverter of Figure 3.5
From Figure 3.6, it can be seen that the output of the inverter is a square wave of output voltage
4.9V peak-to-peak centered at zero volts. The output voltage depends entirely on the transformer
ratio. A step down transformer was used for the simulation.
23
CHAPTER 4: IMPLEMENTATION
A microcontroller based three phase inverter was implemented using CMOS logic inverter.
IRF9540 PMOS and IRF830 NMOS power MOSFETs were used in the actual implementation
of the CMOS logic inverter. These set of power MOSFETs were chosen because of the following
reasons;
They have freewheeling diodes internally connected between their drain and source
They are also affordable
They are locally available
An LM7805 voltage regulator was used to power the microcontroller. Its input voltage was 12V
from the laboratory power supply and the output was a stable 5.1V.
R1
1k connetion to the
connection from the MOSFET gate
microcontroller output
pins Q1
R2
10k
BC107BP
Figure 4.1 Buffer circuit used to drive the CMOS logic inverters
The circuit in the Appendix A.1 was connected and the outputs at different points observed in the
oscilloscope and recorded.
24
CHAPTER 5: RESULTS OBTAINED AND ANALYSIS
Different waveforms were obtained at different stages in the implementation of the project.
These are shown in Figures 5.1 to 5.6
Figure 5.1 shows a square wave obtained from all the pins of the microcontroller that were to be
used. The voltage is 2.2 V at a frequency of 47 Hz. The desired output frequency was 50 Hz.
Figure 5.2 shows the anti-phase square waveforms generated by the microcontroller pins to be
connected to the three transformer primary coils. The waveforms have been coloured and one
waveform shifted downwards in position on the oscilloscope for clarity. It can be seen that both
waveforms have the same frequency and duty cycle of 50%. Similar waveforms could be
obtained for the other two phases.
25
Figure 5.2 Anti-phase signals that drives the CMOS logic inverter gates
phase difference between the red and the yellow phase.
Figure 5.3 shows the 120 The
waveforms were obtained after connecting one channel of the oscilloscope to the output of the
buffer connecting pin R1 from the microcontroller and the second channel was connected to the
output of the buffer connecting pin Y1 from the microcontroller. The two waveforms can be seen
to have a phase difference of 120, same frequency and duty cycle of 50%.
Figure 5.3 Waveforms showing the 120 phase difference between red and yellow phase
26
Figure 5.4 Waveforms showing the 240 phase difference between red and blue phase
Figure 5.4 shows the 240 phase difference between the red and the blue phase. The waveforms
were obtained after connecting one channel of the oscilloscope to the output of the buffer
connecting pin R1 from the microcontroller and the second channel was connected to the output
of the buffer connecting pin B1 from the microcontroller. The two waveforms can be seen to
have a phase difference of 240, same frequency and duty cycle of 50%.
Figure 5.5 Waveforms showing the 120 phase difference between yellow and blue phase
27
Figure 5.5 shows the 120 phase difference between the yellow and the blue phase. The
waveforms were obtained after connecting one channel of the oscilloscope to the output of the
buffer connecting pin Y1 from the microcontroller and the second channel was connected to the
output of the buffer connecting pin B1 from the microcontroller. The two waveforms can be seen
to have a phase difference of 120, same frequency and duty cycle of 50%.
The output voltages obtained at the output of each transformer was 118 V AC at a frequency of
47 Hz. From the design the desired output voltage was 120 V AC at 50 Hz. The difference
between the two values of frequency can be attributed to the use of different components with
unequal propagation delay.
The three phases of the inverter implemented gave same values in terms of voltage and
frequency. The current that the inverter can draw from the source will depend on the load to be
driven.
28
CHAPTER 6: CONCLUSION AND FUTURE WORK
6.1Conclusion
In this project an attempt has been made to come up with a three phase inverter that is suitable
for low power applications.
The design was simulated and actual implementation carried out from which 118 V three phase
AC was generated from a laboratory 12 V DC power source. The frequency of the output
voltages was 47 Hz. The desired output frequency was 50 Hz the difference can be attributed to
execution time and propagation delay of the various components used. An attempt was however
made to take care of these factors by manipulating the value loaded to the registers that created
the software loops in the microcontroller. After several attempts a frequency of 47 Hz was
achieved.
1. To obtain a proper sinusoidal ac power output, advanced means of harmonic reduction should
be employed. These includes: staircase modulation, stepped modulation, harmonic injection
modulation and trapezoidal modulation [3].
2. To ensure high switching speed of order of 100 nanoseconds, a proper charging and
discharging circuit should be provided to every CMOS logic inverter gate.
3. The output frequency can still be improved by loading the registers in the microcontroller
responsible for creating delay with different values until the desired output frequency is
achieved.
29
APPENDIX
27
U1
V1 LM7805KC
12 V
LINE VREG
VOLTAGE
C1 COMMON C2 Q1 Q5 Q9
330nF 100nF
0 16 13
C3
100uF R4 R6
1k IRF9540 1k IRF9540 R10 IRF9540
2 6 1k 10
5
1
Q14 Q3 Q15 Q6 Q17 9 Q10
R3 17 R5 19 R9 23
18
10k 10k 10k
AT BC107BP IRF830 BC107BP IRF830 BC107BP IRF830
tiny26l 0 0 0
22
24
Q2 Q7 Q11
20
R2 R8 R12
1k 1k 1k
IRF9540 IRF9540 IRF9540
4 8 11 12
0 3
Q16 Q18
Q13 Q4 R7 7 Q8 R11 25 Q12
R1 21
15
10k 10k
10k BC107BP BC107BP
BC107BP IRF830 IRF830 IRF830
0 0 0
T1 T2
T3
IRON_CORE_XFORMER IRON_CORE_XFORMER
IRON_CORE_XFORMER
28
26
30
APPENDIX B. 1 MICROCONTROLLER ASSEMBLY CODE
The code below was loaded on the ATtiny26l AVR microcontroller for creating the gate signals.
Six pins on port A of the microcontroller were used. Pins 0 and 1 generated gate anti-phase drive
signals for the red phase, similarly pins 2 and 3 generated anti-phase signals for yellow phase
and pins 5 and 6 generated anti-phase signals for blue phase. To achieve three phase waveforms,
a value equals to a sixth of the period should be used to create the delay. For an output frequency
of 50 Hz a delay of 3,333 microseconds should be created. However, this value could not be
loaded directly on the registers of the microcontroller because there are many components that
the signal passes through introducing their delay. After several trials a frequency of 47 Hz was
obtained after loading the register with value equal to 3674.
31
SBI PORTA,4 ;set pin 4 of port A
RCALL DELAY ;call delay subroutine
CBI PORTA,2 ;clear pin 2 of port A
SBI PORTA,3 ;set pin 3 of port A
RCALL DELAY ;call delay subroutine
CBI PORTA,1 ;clear pin 1 of port A
SBI PORTA,0 ;set pin 0 of port A
RCALL DELAY ;call delay subroutine
CBI PORTA,4 ;clear pin 4 of port A
SBI PORTA,5 ;set pin 5 of port A
RCALL DELAY ;call delay subroutine
CBI PORTA,3 ;clear pin 3 of port A
SBI PORTA,2 ;set pin 2 of port A
RCALL DELAY ;call delay subroutine
RJMP AGAIN ; jump to label AGAIN to repeat the sequence.
; delay loop generator
DELAY:
LDI R21, $0B ;load register 21 with value decimal 11
LOOP0: LDI R22, $DD ;load register 22 with value decimal 221
LOOP1: DEC R22 ;decrement value in register 22 by 1
BRNE LOOP1 ;branch to loop1 if value in register 22 is not equal to zero else
;proceed to the next instruction
DEC R21 ;decrement the value in register 21 by 1
BRNE LOOP0 ;branch to loop0 if value in register 21 is not equal to zero else
;proceed to the next instruction
; =============================
RET ;return to the main program.
32
APPENDIX B 2. AVR microcontroller hex file for the code developed.
The hex file for the microcontroller program used in the implementation of the project is given
below. This is the obtained after conversion of the assembly code in Appendix B1 and is the
value loaded in the microcontroller.The software used to load the hex code to the microcontroller
was WINAVR-20080512 developed by ATMEL .
:020000020000FC
:1000000000C00FED0DBF0FEF0BBB0FEF0ABB00E 001
:100010000BBBD898D99A10D0DD98DC9A0DD0DA981D
:10002000DB9A0AD0D998D89A07D0DC98DD9A04D008
:10003000DB98DA9A01D0EDCF55E06DED6A95F1F7D6
:0C0040005A95D9F751E05A95F1F7089550
:00000001FF
33
APPENDIX C: Three phase inverter conduction modes
180 conduction
There are three modes of operation in a half cycle and the equivalent circuits are shown in Figure
C.1. The output waveforms for the line voltages are shown in Figure C.2
R R R
c c b
V1 V2 V3
R R R
b a c
Figure C.1
Van
2Vs/3
Vs/3
2 3
Vbn
Vbn
2Vs/3
Vs/3 2 3
Vcn
Vcn
2Vs/3
Vs/3
2 3
34
Figure C.2 Phase voltage for 180 conduction
Req = R + R=
i1= =
Van = Vcn = =
Vbn = =
Req = R+
i2 = =
Van = i2R =
Vbn = Vcn= =
Req = R +
i3 = =
Van = Vbn = =
35
Van = =
The instantaneous line-to-line current voltage, Vab, in Figure C.2 can be expressed in a Fourier
series, recognizing that Vab is shifted by 30 and the even harmonics are zero.
Vab = (a)
Vbc and Vca can be found by phase shifting Vab by 120 and 240 respectively.
Vbc = (b)
Vca = (c)
From equations (a), (b) and (c) it can be noticed that the triple harmonics n=3, 6, 9, would be
zero in the line to line voltages.
VL= (e)
= 0.8165
From equation (a) the RMS nth component of the line voltage is
VLN = (f)
VL1=
The RMS value of the line-to-neutral voltages can be found from the line voltage
Vp = = =
36
With resistive load, the diodes across the transistors have no function. If the load is inductive, the
current in each arm of the inverter would be delayed to its voltage.
The transistors must be continuously gated since the conduction time of transistors and diodes
depends on the load power factor.
For a Y connected load, the phase voltage is Van = with a delay of 30.
ia =
1
Where n = tan -
Van =
Vbn =
37
Vcn =
The line voltage between line a and b is Vab = Van with a phase advance of 30 . There is a
delay of 30 between turning off transistor Q1 and turning on transistor Q4. Thus there should be
no short circuit of the dc supply.
At any time there, two load terminals are connected to the dc supply and the third one remains
open. Since the transistor conducts for 120 the transistors are less utilized as compared to that of
the 180 conduction for the same load.
38
APPENDIX D: DATASHEETS
39
40
41
42
43
44
IRF9540 P-CHANNEL MOSFET ELECRICAL PROPERTIES
45
IRF830 N-CHANNEL POWER MOSFET ELECTRICAL PROPERTIES
46
Electrical Characteristics of the voltage regulator used to power the microcontroller.
47
REFERENCE
[1] P C SEN, POWER ELECTRONICS, 1987, TATA McGRAW-HILL PUBLISHING
COMPANY LIMITED, printed by Rajkamal Electric Press, B 35/9 G T Karnal
[4] Dhananjay V. Gadre, Programming and customizing the AVR microcontroller, 2001, by
the McGraw-Hill companies, Inc. New York
[5] www.wikipedia/inverter.html
[6] www.smps.us/power-inverter.html
48