You are on page 1of 51

CHAPTER 1

INTRODUCTION
1.1 Background
After long debates in the past, it is proven that AC transmission and distribution is more
economical and reliable than DC. Hence, AC transmission and distribution is used widely
which has resulted in growing popularity of AC based appliances. AC can also be divided as
single phase or three phases. Three phase AC is more popular in high power application
while single phase is used in home appliances and low power systems.
Even though constant AC sources are readily available, in many cases we need to control the
frequency and magnitude of output voltage of the available AC source. Speed Control of
induction motors, used in various appliances and machines like conveyer belt, air
conditioner, pumps, electric traction, etc is one of the examples where it is necessary to
control the frequency for controlling the speed of the motor to match the variable torque,
power and speed requirement. Due to robust and rugged structure, induction motors are more
popular than DC motors. But speed control of AC motor is not as simple as that of DC
motors due to complex torque-speed Characteristics of AC induction motor. So, it requires
special control system like constant volt/Hz Inverter.
Constant volt/hertz inverter is the inverter which maintains the ratio of magnitude of output
AC voltage to frequency constant. This inverter finds its application for control of AC motor
drive which implements constant V/f speed control method. One of the most popular control
strategies used for variable AC output from inverter is Pulse Width Modulation (PWM)
technique which controls the duty cycle of the controller switches at high switching
frequency to achieve controlled AC output from inverter. In this project, sinusoidal PWM
technique is used to control the magnitude of output AC voltage from the inverter
maintaining constant V/f ratio.

1.2 Objective
To design and fabricate constant volt/hertz inverter
The major objective of this project is to develop a control strategy to change voltage when
frequency is varied externally so as to maintain a constant volt/hertz inverter.

1.3 Scope of the project


In this project, there is provision of changing voltage by varying frequency externally so as
to maintain a constant ratio of voltage to frequency ratio. This project is microcontroller
based and is easily controllable. It has wide range of applications when employed for
controlling speed of a three phase induction motor in industrial sectors.

1.4 Methodology
In order to carry out the mentioned objectives, the following methodology will be adopted:
1.
2.
3.
4.

Preliminary study of inverter, particularly constant volt/hertz inverter


Simulations of constant volt/hertz inverter on MATLAB/Simulink
Programming MPLAB software for dsPIC microcontroller
Simulation of constant volt/hertz inverter in Proteus software to determine required

parameters of the hardware using the microcontroller


5. Design and fabrication of hardware of the proposed scheme
6. Testing of fabricated hardware
7. Final report of the project illustrating activities and results obtained

CHAPTER 2
INVERTER SYSTEM

2.1 Voltage Source Inverter (VSI)


Inverter is an electrical converter system which is able to convert DC supply to AC output at
desired magnitude and frequency level. Voltage source inverter is the inverter topology
where independently controlled AC output is voltage signal. The AC output voltage from
inverter may be either fixed or variable. The input DC source may be fixed DC source or it
may be rectified from fixed AC source. This DC voltage is converted to AC by using
network of switches to alternate between positive and negative DC buses. Depending upon
the number of output phases, inverter may be single phase or three phase system.

2.2 Pulse Width Modulation (PWM)


Pulse width modulation is the process of modifying the width of the pulse in pulse train in
direct proportion to small control signal. Greater the control voltage wider the pulse width
becomes and vice versa. BY using PWM techniques, the frequency spectra of input
waveforms can be changed such that the major non-fundamental components are at
relatively high frequency and also to reduce the switching stress imposed upon the power
switching devices. The high frequency components can be filtered by using low pass filters
so as to reduce the harmonic distortion at output.
Pulse Width Modulation (PWM) refers to a form of signal modulation where data is
represented by the ratio of the ON time to the total time (known as the duty cycle). PWM has
the property where the instantaneous DC component
is directly proportional to the duty cycle.
Figure 2.1 shows the duty cycle and frequency of
PWM. The relationship between the time average
voltage, Vavg, the high and low voltage of the square
wave (Vhi and Vlo) and the duty cycle (D) in percent
is as follows:

Figure 2.1 Duty Cycle and Frequency of

Vavg = (Vhi Vlo) * D + Voffset


3

PWM

Where,
D=

And

t ON
tW
f PWM =

1
tw

2.3 Generation of SPWM using Analog System


Basically there are two types of PWM techniques- Analog System and Digital PWM
technique. Figure 2.2 shows the single phase half bridge topology of inverter. In Analog
PWM technique, which is also a conventional system, a carrier signal and modulating signal
are compared using a comparator and output of the comparator is desired PWM signal. For
sinusoidal PWM technique, the reference waveform is a sinusoidal wave and the carrier
waveform is triangular and hence the width of output PWM signal varies sinusoidally as
shown in figure 2. Sine wave and Triangular waves are generated using analog techniques
and compared using a comparator. The output of the comparator is high when amplitude of
modulating sine wave is greater than carrier signal and vice versa as shown in fig 2.6.Output
voltage amplitude can be controlled by controlling the Modulation Index of the system. The
frequency of the system can be varied by changing the frequency modulation index.

Figure 2.2 Single phase half bridge topology

Figure 2.3 SPWM Generation principle

2.4 Generation of three phase VSI SPWM using Digital System


The proposed alternative approach is to replace the conventional method of generation of
SPWM by the use of microcontroller. Digital PWM techniques are applied using
quantization method. Most of the digital techniques employ counter and comparator based
system. Digital systems are more flexible, less sensitive to environmental noise and simpler
in construction in comparison to the analog techniques. Digital PWM technique can be
easily applied by using digital technologies like microcontroller.

V dc
2

Figure 1.4 Three phase VSI topology


Figure 2.4 shows the three phase topology of full bridge inverter. SPWM can be generated
using digital logic equipments like microcontroller by using sine table. Complementary
PWM outputs are generated from a microcontroller using its PWM module. Altogether, there
are six PWM channels with three PWM pairs configured in complementary mode for the
5

three arms of the inverter. In complementary mode, if one of the PWM is high, the other is
low and vice-versa as shown in figure below. A certain programmable dead time is inserted
so that upper and lower switches of the H-bridge are not simultaneously ON to prevent
short circuiting of the DC bus. Complementary PWM signals (10 kHz) generated by
microcontroller with 2s dead time between the two signals is shown in figure 2.5

PWMH
PWML

Figure 2.5 Complementary PWM signals (10 kHz) generated by microcontroller

Consider a single phase half bridge as shown with load connected at point a as shown in
figure 2.2. If the complementary outputs have a 50 % duty cycle, then for half of the time,
the upper switch is ON and the voltage across the load is +V DC/2 with respect to point N
and for the next half of the period, the lower switch is ON (with upper switch now in OFF
state) and so the voltage across the load is

V DC/2. Therefore, 50 % duty cycle corresponds

to average voltage of zero volts averaged over a PWM period in complementary mode.

2.4.1 Using look-up table to generate sine wave


Sinusoidal waveform can be generated by using a look-up table. A look-up table contains,
sine values for a complete electrical cycle (0 to 360 degrees), normalized in the range -1 to 1.
The number of data points to be used depends upon the PWM frequency and the modulation
frequency i.e. frequency of sine wave to be generated. Also, too little points will cause a
staircase effect in the motor current waveform. The staircase effect will cause excessive
motor current distortion, which causes higher heat dissipation. Too many points will use
more memory of the microcontroller. A good rule of thumb is to divide maximum desired
modulation frequency by the PWM frequency.
In this project, 256 points have been used in sine table for a 10 kHz PWM frequency and
maximum modulating frequency of 77.97 Hz.
6

The sine values for the 256 different points can be evaluated by the expression;
y [i]=sin

2
i )
( 256

where, i = 0 to 255
The sine values are read from the table at periodic interval, scaled to match the allowable
ranges of duty cycle, and then written to the duty cycle register. If any numerical value is put
in the duty cycle register then the microcontroller produces output PWM waveform of that
particular duty cycle.
At first, the data from table is first multiplied by 50 percent duty cycle value. The resulting
value is then multiplied by the value of modulation index (M.I) to change the average
voltage of through the variation of pulse widths. Finally, 50 percent duty cycle value is then
added to ensure that resulting duty cycle value is positive.
Sine table[i] = y[i] * 50 percent duty cycle * M.I + 50 percent duty cycle

Figure 2.6: Diagram showing the scaling operation to generate the required duty cycle from
the sine table
Figure 2.6 shows the scaling process carried so that duty cycle values are obtained
sinusoidally. Figure 2.7 shows the PWM signals for the upper and lower switch and shows
the variation of duty cycle over a completer electrical cycle for modulation index value of
one. It can be seen that at zero electrical degree of sine wave, the duty cycle of the high side
PWM is 50%, therefore the average voltage is zero for a PWM period as the lower switch is
also ON for remaining 50% of the PWM period. At around 90 electrical degree, the upper
7

switch is ON for all PWM period (i.e 100% duty cycle), so the output is high during this
period and voltage across the load is +VDC/2 with respect to point N. But, at around 270
electrical degrees, the upper switch is OFF for whole PWM period (i.e. 0% duty cycle)
while the lower switch is ON for full PWM period. So, the output voltage is negative and
voltage across the load is VDC/2. Similarly, at other electrical degrees, the duty cycle varies
sinusoidally so as to encode the sinusoidal signal in the PWM waveform.

50%
duty

0% duty

50% duty

100% duty

50% duty

Figure 2.7 Gate signal pattern for upper switch and corresponding complementary gate
signal for lower switch

Figure 2.8 given shows the effect of changing the modulation index on the variation of pulse
width, thereby changing the amplitude of the fundamental voltage component.

Figure 2.8 Changing Vmod through PWM pattern where, M.I (a) > M.I (b) > M.I(c)

2.4.2 Changing the frequency of the sine wave


A variable called Phase is used as a 16-bit pointer to the sine table with 0x0000
representing 0 and 0xFFFF representing 360 . Let us assume the sine table pointer is
adjusted every PWM period. In other words, at each PWM interrupt, Frequency variable is
added to the Phase. The value of Delta_Phase determines how fast the code moves
through the sinusoidal data table, and, as a result, sets the modulation frequency.
The Frequency variable is calculated as follows:
Delta phase =216

Desired modulation frequency ( Hz)


F PWM

For example, to get a 76 Hz modulation frequency using 10 KHz PWM frequency


9

16

Delta_phase = 2

76
=498.07=498
10000

After the Phase variable has been adjusted by Delta_Phase, two additional table pointers are
calculated for the 2nd and 3rd motor phases by adding a constant offset to Phase. For a 16-bit
pointer, a value of 0x5555 provides 120

offset and a value of 0xAAAA gives a 240

offset.

2.5 Mathematical Analysis


The Sine PWM is implemented using a VSI (Voltage Source Inverter) as shown in figure
2.4. At any instant, either the top or the bottom switch of a half bridge is on. Hence, the
resultant fundamental component of phase-to-neutral point O voltage (V AO, VBO and VCO)
can be represented as:
V io=

V dc
V if
2

Where i = A,B,C
Vif represents the 3-phase waveforms shifted at an angle of 120
phase waveform can be represented as shown below:
V Af = m sin

V Bf = m sin (+120)
V Cf = m sin (+240)

V AO =

V dc
m sin
2

V BO =

V dc
m sin (+120)
2

V CO =

V dc
m (+240)
2

The resultant line-to-line output voltage is given by:


10

with one another. Each

V AB = V AO -V BO =

(3)V dc
m sin (+30)
2

V BC = V BO -V CO =

(3)V dc
m sin (+150)
2

V CA = V CO -V AO =

(3)V dc
m sin (+270)
2

From the above equations, it is clear that the maximum line-to line voltage is achieved when
m=1
i. e . Maximum line-to-line voltage =

2V LL ( rms ) = 3

3 V dc
2

V dc
2

V LL ( rms ) = 0.612 Vdc


V ph ( rms ) =

V LL ( rms ) 0.612
=
V dc = 0.354V dc
3
3

These equations are valid for modulation index, M.I. = m = 1. For any value of m, the
following equations will be valid.
V LL ( rms ) = 0.612 m
V ph ( rms ) =

Vdc

V LL ( rms ) m 0.612
=
V dc = 0.354 m V dc
3
3

Let us assume that

V req
=k
f req

Where k = constant
Dividing both sides of equation (a) by Vph(rms) with m=1, we get
V req
k
=
V ph ( rms ) f V ph ( rms )
or, m=

V req
k
=
f
V ph ( rms ) V ph ( rms )

11

12

CHAPTER 3
SIMULATION STUDIES

Before carrying out activities in hardware, simulations were carried out in softwares such as
MATLAB/Simulink and Proteus. This chapter is mainly concerned with the simulations in
these softwares.

3.1 MATLAB Simulation


MATLAB simulation was performed to test and confirm its implementation in a real
hardware. The major components of the simulink model as shown in figure 3.1 are given
below:
1. Clock
2. Programming block
3. PWM generator block
1. Clock: This block is used to provide current simulation real time for the program.
2. Programming block: It is a block where program can be written. This block is used
in this model for specifying modulation index and frequency input to the PWM
generator block.
3. PWM generator block: This block generates sinusoidal PWM signals for MOSFETs
used in the three phase H-bridge.
Constant V/f PWM generator block simulates the working of microcontroller, which
generates constant V/f PWM outputs. With the help of programming block, required V/f
ratio and output as per the real time could be obtained and modulation index and frequency
are fed to PWM generator, which generates sine PWM signals to provide it to the gates of
the inverter.

13

Programming
block

Figure 3.1: Constant V/f PWM generator block

Figure 3.2: Inverter bridge


Figure 3.2 shows the inverter bridge which comprises of six MOSFETS. The gating signals
generated from the PWM generator are fed to the gates of the MOSFET blocks. The three
phase outputs are fed to the three phase load. Here three phase load is taken as resistive.

14

Figure 3.3: Output waveforms

15

3.2 Software realization


Fmin = minimum frequency to be generated
MImin =minimum modulation index
Fbase = arbitrarily set frequency
Flowchart of the process used in constant Volt-hertz inverter
Start

Initialization of constant V/f ratio (K)

Frequency (f) input from


potentiometer knob
Is f<fmin ?

Yes

and f =fmin

No
Is f>fbase?

Set Modulation Index =


MImin

Yes
Set Modulation Index =
1

No
Calculation of Modulation Index
M.I = K/Vph(max) *f;

Computation of duty cycles for the six


PWM waveforms from the Sine lookup
table based on f and M.I

Generation of the required PWM


waveforms based on the calculated
duty cycles

16

3.3 Proteus Simulation


After performing simulations on MATLAB, further simulations were carried out on Proteus.
Before this, programming was done in MPLAB and the hex code, thus generated after
compilation of the source code, was loaded in the microcontroller. The layout of Proteus
simulation is shown in figure 3.4. The load used in this simulation is three-phase resistive
load. The PWM waveforms generated from the microcontroller are shown in the figures 3.5.

Figure 3.4: Layout for Proteus Simulation

Figure 3.5: PWM signal generation from microcontroller with PWM frequency of 10 kHz
17

In figure 3.5, PWMH1 and PWML1 are complementary PWM outputs from the
microcontroller for producing gate signals for the first arm of the three-phase H-bridge.
Similarly, PWMH2 and PWML2 are complementary PWM outputs from the microcontroller
for producing gate signals for the second arm of the bridge. Figure 3.6 and 3.7 show the
output waveforms.

Figure 3.6: Line-to-line voltage waveform

18

Figure 3.7: Line-to-neutral voltage waveform

19

CHAPTER 4
HARDWARE DESIGN AND FABRICATION
4.1 Description of the proposed scheme
This scheme is design of the three phase inverter to drive or supply any load which required
constant V/F such as induction motor. This drive generates the output voltage in proportion
to the output frequency to provide a relatively constant ratio of voltage to frequency (V/Hz).

Sinusoidal pulse width modulation (SPWM) is widely used in power electronics to digitize
the power so that a sequence of voltage pulses can be generated by ON and OFF of the
power switches. The pulse width modulation inverter is simple and provides better control
scheme. SPWM techniques are characterized by constant amplitude pulses with different
duty cycle for each period. The width of this pulses are modulated to obtain inverter output
voltage control and to reduce its harmonic content. To generate this signal, triangular wave is
used as a carrier signal and is compared with sinusoidal wave, whose frequency is the
desired frequency. The proposed alternative approach is to replace the conventional method
with the use of microcontroller. The use of microcontroller brings the flexibility to change
the real-time control algorithms without further changes in hardware. It is also low cost and
has a small size of control circuit for the three phase full bridge inverter. The microcontroller
has the built in dead time control circuit and various other features to control pwm signals.
AC POWER SUPPLY
DC VOLTAGE LINK SUPPLY
RECTIFIER

MICROCONTROLLER

AC VOLTAGE

MOSFET INVERTER BRIDGE

ISOLATION CIRCUIT

20

THREE PHASE LOAD

Figure 4.1: Block diagram of the proposed scheme

a. Rectifier: The first step in this process is to convert the AC supply voltage into DC by the
use of a rectifier. DC power contains voltage ripples which are smoothed using filter
capacitors. This section of the VFD is often referred to as the DC link. In our project,
rectifier is not used. Instead, dc supply is directly taken from the available dc bank.

b. MOSFET Inverter Bridge: This DC voltage is then converted back into AC. This
conversion is typically achieved through the use of power electronic devices such as IGBT
power transistors or MOSFETs using a technique called Pulse width Modulation (PWM).
The output voltage is turned on and off at a high frequency, with the duration of on-time, or
width of the pulse, controlled to approximate a sinusoidal waveform. The MOSFET inverter
bridge has 6 switches that are controlled in order to generate 3-phase AC output from the DC
bus. PWM signals, generated from the microcontroller, control these 6 switches. Switches
H1 through H3 are upper switches. Switches L1 through L3 are lower switches. The
amplitude of phase voltage is determined by the duty cycle of the PWM signals. In this
configuration, three out of six switches will be on at any given time; either one upper and
two lower switches or one lower and two upper switches. The switching produces a
rectangular shaped output waveform that is rich in harmonics. When switches are turned off,
the inductive nature of the load oppose any sudden change in direction of flow of the current
until all of the energy stored in the load is dissipated. To facilitate this, fast recovery diodes
are provided across each switch. These diodes are known as freewheeling diodes.

H1

L1

H2

L2

H3

L3

21

THREE
PHASE
LOAD

Figure 4.2: MOSFET Inverter Bridge

c. Microcontroller: The microcontroller used is dsPIC33FJ32MC202. It consists of 6 PWM


channels, one channel for each of the semiconductor switches.
d. Isolation Circuit: The isolation circuit is used to isolate low voltage signals from high
voltage signals for protection and safety. This can be done by using optoisolator.

4.2 Components used in inverter

4.2.1 Adjustable Voltage Regulator


The LM317 is an adjustable 3-terminal
positive voltage regulator capable of supplying
in excess of 1.5A over an output voltage range
of 1.2 V to 37 V. This voltage regulator is
exceptionally easy to use and requires only two
external resistors to set the output voltage.
Further, it employs internal current limiting; thermal shutdown and safe area compensation,
making it essentially blow-out proof.

Figure 4.3: LM317 Typical


Connection

Here, as shown in the adjacent figure, Cin is required if


regulator is located at an appreciable distance from power supply filter. C o is not needed for
stability; however, it does improve transient response.

4.2.2 Optocoupler
Certain isolation system between high voltage level and low
voltage level is required in Constant V/Hz Inverter system.
The microcontroller which is operating at low voltage level
(3.3V) has to control load which is at much higher voltage level. So, the microcontroller
22

needs to be isolated to protect from overvoltage damage. Optocoupler can provide such
isolation. It is also known as optoisolators.

Optocouplers are basically small electronics device which

Figure 4.4: Optocoupler


Schematic
Figure
4.5: Optocoupler
IC package

facilitates the transmission of electrical signal between two


parts of a system while keeping them electrically isolated. They use
beam of light to transmit the signal while maintaining excellent
isolation. Basically, there are two parts of optocoupler: an optical
transmitter (LED) and an opto-receiver (phototransistor) separated by transparent barrier
which allows light to pass through it but does not allow any electrical transmission. The
main purpose of an opto-isolator is to prevent high voltages or rapidly changing voltages on
one side of the circuit from damaging components or distorting transmissions on the other
side. Commercially available opto-isolators can withstand input-to-output voltages up to 10
kV.

They are best for transmitting PWM signals with frequent switching. In this project, high
speed 6N137 logic gate optocoupler is selected.

4.2.3 MOSFET as switch


The MOSFET (Metal Oxide Semiconductor Field Effect Transistor) is a transistor used for
amplifying or switching electronic signals. MOSFETs are commonly used as switching
devices in inverter. MOSFET have three terminals namely gate, drain and source. When used
as switching device, MOSFET is voltage controlled switch.
The threshold voltage between gate and drain determines the switching level of the
MOSFET switch. By applying suitable drive voltage to the gate of MOSFET, the resistance
of drain source channel can be varied from very high value (OFF state), effectively an open
circuit, to very low value (ON state), effectively short circuit. MOSFETs can be effectively
turned on and off at very high switching frequency to pass current through it. MOSFETs are
more efficient and faster in comparison to same rating of bipolar transistor switches and
IGBTs. Features like fast switching speed, high peak current, ease of drive, dv/dt capability
has boosted the popularity of MOSFETs as logic switches.
23

Enhancement mode MOSFET has been used in our project for switching electronic signals.
Enhancement mode MOSFET can be taken as a switch as these transistors require a positive
gate voltage to turn 0N and a zero voltage to turn 0FF making them easily understood as
switches and also easy to interface with logic gates.

The operation of the enhancement mode MOSFET can best be described using its I-V
characteristics curves shown below. When the Input voltage, (Vin) to the gate of the transistor
is zero, the MOSFET conducts virtually no current and the output voltage (V out) is equal to
the supply voltage (VDD). So the MOSFET is fully-OFF and in its cut-off region.

Figure 4.7: Power MOSFET


Schematic

Figure 4.6: I-V characteristics of MOSFET

The minimum ON-state gate voltage


required to ensure that the MOSFET
remains fully-ON when carrying the selected drain current can be determined from the V-I
transfer curves above. When VIN is high or equal to VDD the MOSFET Q-point moves to
point A along the load line. The drain current (I D) increases to its maximum value due to
reduction in the channel resistance. ID becomes a constant value independent of VDD, and is
dependent only on gate source voltage(V GS). Therefore, the transistor behaves like a closed
switch but the channel on-resistance does not reduce fully to zero due to its R DS(on) value,
but gets very small.
Likewise, when Vin is low or reduced to zero the MOSFET Q-point moves from point A to
point B along the load line. The channel resistance is very high so the transistor acts like an
open circuit and no current flows through the channel. So if the gate voltage of the MOSFET
24

toggles between two values, high and low the MOSFET well behave as a single-pole singlethrow (SPST) solid state switch.
Cut off region
Here the operating conditions of the transistor are zero input gate voltage (V IN), zero drain
current ID and output voltage VDS = VDD .Therefore the MOSFET is switched Fully-OFF.
Saturation region
In the saturation or linear region, the transistor will be biased so that the maximum amount
of gate voltage is applied to the device which results in the channel resistance R DS (on) being
as small as possible with maximum drain current flowing through the MOSFET switch.
Therefore the MOSFET is switched fully 0N.

4.2.4 MOSFET Driver


To turn a power MOSFET on, the gate terminal must be set to a voltage at least 10 V greater
than the source terminal. This is comfortably above the VGS

(Th)

(Gate Threshold Voltage)

parameter which is defined as the minimum voltage required between the gate and source
terminals to turn the MOSFET on. It will need more than this to turn it fully ON.

One feature of power MOSFETs is that they have a large stray capacitance between the gate
and the other terminal. The effect of this is that when the pulse to the gate terminal arrives, it
must first charge this capacitance up before the gate voltage can reach the 10 V required. The
gate terminal then effectively takes current. Therefore the circuit that drives the gate terminal
should be capable of supplying a reasonable current so the stray capacitance can be charged
up as quickly as possible. The best way to do this is to use a dedicated MOSFET driver chip.

25

After successful implementation of the proposed scheme in softwares, design and fabrication
of hardware was carried out. Some of the pictures of the hardware are shown below:
LM317
VOLTAGE
REGULATOR
DSPIC
MICRONCONTROLLER

FREQUENCY VARYING
KNOB

PWM OUTPUTS FROM


MICROCONTROLLER

Figure 4.8: Fabrication of Hardware (Microcontroller Part)


Figure 4.9 shows microcontroller part. The microcontroller part is a low voltage part of the
project. In order to vary frequency, a potentiometer was used as shown in the above figure.
The voltage developed in potentiometer is fed to the microcontroller which by means of its
ADC (analog-to digital converter) converts the analog signal (i.e. voltage) into digital signal
to be used internally for calculating frequency. The PWM signals generated from the
microcontroller is fed to the three phase part as shown in the figure 4.2 via PWM channels of
26

the microcontroller. LM317 voltage regulator was used so as to convert dc voltage from dc
bank to dc voltage of about 3.3 V as required by the microcontroller.
Figure 4.10 depicts the three phase part of the inverter. Optocoupler 6N137 was used so as to
isolate low voltage level from the high voltage level. The PWM signals are received from the
microcontroller via optocoupler which is applied to MOSFETs. Before applying these gate
signals to MOSFETs, they are firstly fed to MOSFET drivers. There is no problem in turning
ON the lower semiconductor switches but there is problem in turning ON the higher
semiconductor switches. In order to turn ON the higher semiconductor switches, MOSFET
drivers are used which builds up the required gate-to-source voltage by means of bootstrap
capacitor.

Snubber circuit
Three Phase outputs

MOSFET

Optocoupler

MOSFET Driver

Figure 4.9: Fabrication in Hardware (Three Phase part)

4.3 Hardware results


After proper design and fabrication in hardware, the output waveforms were observed by
means of digital oscilloscope. The following pictures depict waveforms associated with this

27

project. The output waveforms were similar to those observed in softwares such as
MATLAB and Proteus.

Figure 4.10: Complementary PWM outputs

Figure 4.11: Complete train of pulses for a complete cycle with complementary outputs

28

Figure 4.12: Line to neutral voltage waveform

Figure 4.13: Line-to-line voltage waveform

4.3.1 Experiment results


Power analyzer was used to check if constant volt/hertz ratio was being maintained at output
of the inverter. The ratio of fundamental rms phase voltage to frequency (V/f) was set at
29

0.106 in the code of the microcontroller. The observations of the experiment are tabulated
below in Table 4.1:
DC bus voltage, (Vdc ) = 15 V
For Modulation Index (M.I.) =1
Maximum fundamental line-to-line voltage (V LL )= 0.612 V dc = 9.18 V
Maximum fundamental Phase Voltage (Vph1) =5.3 V

Table 4.1
S.No.

Frequency

Fundamental

Fundamental

(Hz)

RMS line-

RMS Phase

line Voltage

Voltage (Vph)

Modulation Index ( M . I )
=

V ph
V ph1

(VLL)

(volt/Hz)

[
1
2
3

12.38
14.71
31.85

V ph
ratio
f

V ph =

1.9
2.3
5.0

1.09
1.33
2.88

V LL
3

]
0.205
0.251
0.543

0.088
0.090
0.090

From the above observations, it can be noticed that constant volt/hertz ratio is maintained
approximately equal to that previously set.
Simulations in MATLAB was also carried out with the paramaters set the same as in
experiment. And, the results obtained are shown in the pictures below and the results
tabulated below;

30

S.No
.

Frequency
(Hz)

Fundamental
RMS lineline Voltage
(VLL)

Fundamental
RMS Phase
Voltage (Vph)

[
1
2

14.71
31.75

2.724
5.826

V ph =

V LL
3

Modulation Index ( M . I ) V ph ratio


f
V ph
=
V ph1
(volt/Hz)

1.573
3.364
Table 4.2

0.297
0.635

0.111
0.106

CHAPTER 5
CONCLUSION AND RECOMMENDATION
5.1 Conclusion
The major objective of this project is to design and fabricate constant volt/hertz inverter
using sinusoidal pulse width modulation (PWM) technique. In order to achieve this
objective, a series of steps were taken. Firstly, the project was designed and evaluated using
softwares such as Proteus and MATLAB. After achieving satisfactory results, the project was
implemented in hardware. This implementation was found to be successful. It was verified
by observing whether the ratio of voltage to frequency ratio was constant or not when the
frequency was varied externally by means of potentiometer knob. The V/f ratio was noticed
to be nearly constant which implied success of the project.

5.2 Recommendation

31

Constant volt/hertz Inverter system was successfully designed as per the aim of project. But
still we can improve the performance of this system by further study and enhancement. This
system can also be used to drive three phase induction motor with few enhancements and
proper protection system. The following are suggestions for future enhancement for better
performance and reliability of the system:

By employing extra protection system (a better snubber circuits) for MOSFET

switching circuit, the reliability of the system can be increased.


This system can be used for speed control mechanism of AC induction drive after

considering the maximum voltage and current level which the system can handle.
MOSFETs with better static and dynamic characteristics can be used to increase

switching efficiency and hence the overall efficiency of the system.


Isolation circuit with optocoupler of better rise and fall time can be used to prevent

losses of pulse during PWM signal transfer.


By adding proper filter circuits, the quality of output can be increased for driving
both resistive and inductive loads.

32

BIBLIOGRAPHY

Muhammad H. Rashid (2001), Power Electronics Handbook, Academic Press


Prof. Dr. Indra Man Tamrakar, A Course Manual on Power Electronics
Application notes of various PIC provided in Official Microchip website

www.microchip.com
Datasheets of MOSFETs and MOSFET drivers provided in Official International

Rectifier website www.irf.com


www.alldatasheets.com

33

APPENDIX A
SOURCE CODE
The following source code is program for microcontroller.
// Source code compiled in MPLAB using C30 compiler and simulated in
Proteus software
//programming reference can be taken from microchip site and dspic pdf
#define FCY 40000000
#include <p33fj32MC202.h>
#include<libpic30.h>
// derived using PLL, first FRC at first
_FOSCSEL(FNOSC_PRI)
_FOSC(FCKSM_CSECMD & POSCMD_HS & OSCIOFNC_OFF& IOL1WAY_ON)
_FWDT(FWDTEN_OFF)
_FPOR(FPWRT_PWR128 & HPOL_ON & LPOL_ON & PWMPIN_OFF) // LPOL_ON
//
PWM module low side output pins have active-high output
polarity
;;
//
HPOL_ON: PWM module high side output pins have active-high output
polarity
_FICD(ICS_PGD1 & JTAGEN_OFF)
//
Communicate
on
PGC1/EMUC1
and
PGD1/EMUD1
unsigned
volatile
volatile
volatile
void
void
void
void
void

int FREQ_SCALING=1999;
// P1TPER value
unsigned int Modulation_Index=0,Modulation=0;
unsigned int PhaseA=0,PhaseB=0,PhaseC=0,Frequency=0,f=0;
signed int ASinevalue,BSinevalue,CSinevalue;

__attribute__((__interrupt__,no_auto_psv)) _MPWM1Interrupt(void);
__attribute__((interrupt, no_auto_psv)) _ADC1Interrupt(void);
init_PWM(void);
initInterrupts(void);
initAdc1(void);

const signed int Sinetable[ ]={0,


3212,6393,9512,12540,15446,18205,20787,23170,25330,27245,28898,30273,31357
,32138,32610
,
32768,32610,32138,31357,30273,28898,27245,25330,23170,20787,18205,15446,12
540,9512,6393,
3212,0,-3212,-6393,-9512,-12540,-15446,-18205,-20787,-23170,-25330,27245,-28898,-30273,
-31357,-32138,-32610,-32768,-32610,-32138,-31357,-30273,-28898,-27245,25330,-23170,
-20787,-18205,-15446,-12540,-9512,-6393,-3212,};
void initInterrupts(void)
{
INTCON1bits.NSTDIS = 0; // Interrupt nesting enabled here
IPC14bits.PWM1IP = 6;
// Set PWM interrupt priority to 6 (level 7
is highest)
_PWM1IF=0;
// reset
_PWM1IE=1;
// enable interrupt
T3CONbits.TON = 0;
// Disable Timer
T3CONbits.TCS = 0;
// Select external clock
T3CONbits.TGATE=0;
//disable gated timer mode
T3CONbits.TCKPS = 0b00; // Select 1:1 Prescaler
TMR3 = 0x00;
// Clear timer register
PR3 = 20000;
// Load the period value= 20000*1/(40)=500us

34

IPC2bits.T3IP
IFS0bits.T3IF
IEC0bits.T3IE
T3CONbits.TON

=
=
=
=

3;
0;
0;
1;

//
//
//
// Start

Set Timer3 Interrupt Priority Level


Clear Timer3 Interrupt Flag
Enable Timer3 interrupt
Timer3

/
*=========================================================================
====
ADC INITIALIZATION FOR CHANNEL SCAN
==========================================================================
===*/
void initAdc1(void)
{
AD1CON1bits.FORM
= 0b00;
// Data Output Format: integer
AD1CON1bits.SSRC
= 0b010;
// Sample Clock Source: GP Timer
starts conversion
AD1CON1bits.ASAM
= 1;
// ADC Sample Control: Sampling begins
immediately after conversion
AD1CON1bits.AD12B = 0;
// 10-bit ADC operation
AD1CON2bits.VCFG = 0b000; //AVDD,AVSS
AD1CON2bits.CSCNA = 1;
// Scan Input Selections for CH0+
during Sample A bit
AD1CON2bits.CHPS = 0;
// Converts CH0
AD1CON2bits.ALTS = 0;
//always use channel i/p select
for sample A
AD1CON3bits.ADRC = 0; // ADC Clock is derived from Systems Clock
AD1CON3bits.ADCS = 15;
//
ADC
Conversion
Clock
Tad=Tcy*(ADCS+1)= (1/10M)*16 = 1.6us (625Khz)
// ADC Conversion Time for 10-bit Tc=12*Tab = 19.2us
AD1CON2bits.SMPI = (NUM_CHS2SCAN-1);// 1 ADC Channel is scanned..
for input scanning SMPI is one less the
//channels
being scanned
//AD1CSSH/AD1CSSL: A/D Input Scan Selection Register
AD1CSSLbits.CSS0=1;
// Enable AN0 for
channel scan
AD1CSSLbits.CSS1=1;
// Enable AN1 for channel scan
//AD1PCFGH/AD1PCFGL: Port Configuration Register
AD1PCFGL=0xFFFF;
AD1PCFGLbits.PCFG0 = 0;
// AN4 as Analog Input
AD1PCFGLbits.PCFG1 = 0;
// AN5 as Analog Input
IPC3bits.AD1IP=2;
//2nd last priority
IFS0bits.AD1IF = 0;
// Clear the A/D interrupt flag
bit
IEC0bits.AD1IE = 1;
// Enable A/D interrupt
AD1CON1bits.ADON = 1;
// Turn on the A/D converter
}
/
*=========================================================================
====
ADC INTERRUPT SERVICE ROUTINE
==========================================================================
===*/
// this will be called after timer3 register matches the period after
200us (special trigger event)
void __attribute__((interrupt, no_auto_psv)) _ADC1Interrupt(void)
{
float freq;

35

asm("mov _ADC1BUF0,W3"); //Read the ADC results into W3 ::suppose the pot
is set at 100%, then ADC1BUF0 reads //1023d decimal
asm("asr W3,#1,W4");// Right shift by 1 bits to get the frequency(named
in placed of PhaseReq) :: this statement
//divides it by 2..ie1023/2=
511 decimal and this number is the frequency (511*10000)/65536= 77.972 Hz
so the //highesh freq by this method is 77.972 Hz.. So, if we use 10Khz
freq, we can achieve 77.97 Hz maximum freq using this //algorithm
asm("mov W4,_Frequency");
/*
this register w4(adc pin) can be used externally to control the
modulation by slight //modification
asm("mov _ADC1BUF1,W4");//
Read the ADC results into W4
::suppose
the
pot
is
set
at
100%,
then
ADC1BUF1
reads
//1023 decimal
asm("sl
W4,#5,W4");//
Left shift By 5 to get Q15 value in
the
range
::multiply
by
2^5
or
by
32
to
transform
the
//frequency to the range 0 to 32767 (in fractional format to be used
below for MPY instruction)
asm("mov W4,_Modulation");
*/
if(Frequency<66)
Frequency=66;
freq=Frequency;
f=(freq*10000)/65535;
Modulation_Index=f*655;
//if
vdc=15v,vprms=5.3V
and
f=50hz
then and MI=655*freq;
if(Modulation_Index > 32500)
Modulation_Index = 32500;
IFS0bits.AD1IF= 0;
// Clear the ADC1
Interrupt Flag
}

void init_PWM()
{
P1TCONbits.PTMOD = 0b10;// PWM time base input clock period is
TCY (1:1 prescale)
P1TCONbits.PTCKPS = 0b00;
// PWM time base output post
scale is 1:1
P1TCONbits.PTOPS = 0b00;
// Choose PWM time period based on input clock selected
// Refer to Equation 14-1
// PWM switching frequency is 20 kHz
// FCY is 40 MHz
// P1TPER = (FCY/(Fpwm*1*2))-1 =1000=999
P1TPER = 1999;
// PWM I/O pairs 1 to 3 are in complementary mode
// PWM pins are enabled for PWM output
PWM1CON1bits.PMOD1 = 0;
PWM1CON1bits.PMOD2 = 0;
PWM1CON1bits.PMOD3 = 0;
PWM1CON1bits.PEN1H = 1;
PWM1CON1bits.PEN2H = 1;
PWM1CON1bits.PEN3H = 1;
PWM1CON1bits.PEN1L = 1;
PWM1CON1bits.PEN2L = 1;
PWM1CON1bits.PEN3L = 1;
PWM2CON1bits.PEN1H = 0; //PWM module 2 used as general i/o
PWM2CON1bits.PEN1L = 0;
// synchronized update of PWM enabled
PWM1CON2bits.IUE = 0;
//1 means immediate update

36

signals

// Clock period for Dead Time Unit B is TcY


P1DTCON1bits.DTAPS = 0b01;
P1DTCON1bits.DTBPS = 0b01;
// Dead time value for Dead Time Unit B and Unit A
P1DTCON1bits.DTA = 45;
P1DTCON1bits.DTB = 45;// Tcy * 2 * 45= 2.25 usec
// Dead Time Unit selection for PWM signals
// Dead Time Unit A selected for PWM active transitions
// Dead Time Unit B selected for PWM inactive transitions
P1DTCON2bits.DTS3A = 0;
P1DTCON2bits.DTS2A = 0;
P1DTCON2bits.DTS1A = 0;
P1DTCON2bits.DTS3I = 1;
P1DTCON2bits.DTS2I = 1;
P1DTCON2bits.DTS1I = 1;
// PWM I/O pin controlled by PWM Generator
P1OVDCONbits.POVD3H = 1;
P1OVDCONbits.POVD2H = 1;
P1OVDCONbits.POVD1H = 1;
P1OVDCONbits.POVD3L = 1;
P1OVDCONbits.POVD2L = 1;
P1OVDCONbits.POVD1L = 1;
// Initialize duty cycle values for PWM1, PWM2 and PWM3
P1DC1 =1999;
// 50% duty cycle
P1DC2 =1999;
// 50% duty cycle
P1DC3 =1999;
// 50%
PhaseA=0;
// pointers for 3 sine waves generation
PhaseB=0;
PhaseC=0;
//Enabling PWM Pulse Generation
P1TCONbits.PTEN = 1;
return;

}
void delay10ms(int n){
int i;
for(i=0;i<n;i++){
__delay_ms(10);
}
}

// MAIN function
int main(void)
{
_TRISB6=0;
_LATB6=1;
/* Configure PLL prescaler, PLL postscaler, PLL divisor */
PLLFBD=30;
/* M = PLLFBD + 2=32 */
CLKDIVbits.PLLPOST=0b00;
/* N2 = 2 */
CLKDIVbits.PLLPRE=0b10;
/* N1 = 4 */
// Fosc=20 * 32 /(2*4)=79.2275 Mhz ; Fcy=39.61375Mhz used in this
case
// coding in assembly language(asm) to switch the clock from 20MHz
to 80MHz using PLL mode and //Fcy=Fosc/2
//Place the New Oscillator Selection (NOSC=0b11) in W0
asm("MOV #0x03,w0");
//OSCCONH (high byte) Unlock Sequence
asm("MOV #OSCCONH, w1");
asm("MOV #0x78, w2");
asm("MOV #0x9A, w3");
asm("MOV.B w2, [w1]"); // Write 0x78");

37

asm("MOV.B w3, [w1]"); // Write 0x9A");


//;Set New Oscillator Selection
asm("MOV.B w0, [w1]");
//; Place 0x01 in W0 for setting clock switch enabled bit
asm("MOV #0x01, w0");
//;OSCCONL (low byte) Unlock Sequence
asm("MOV #OSCCONL, w1");
asm("MOV #0x46, w2");
asm("MOV #0x57, w3");
asm("MOV.B w2, [w1]"); //; Write 0x46
asm("MOV.B w3, [w1]"); //; Write 0x57
//; Enable Clock Switch
asm("MOV.B w0, [w1]");// ; Request Clock Switching by Setting OSWEN

bit
while(OSCCONbits.COSC != 0b011);
// Wait for new Oscillator to
become POSC w/ PLL
while(OSCCONbits.LOCK != 1);
// Wait for Pll to Lock
while (OSCCONbits.OSWEN == 1) { }
// wait till finish: if OSWEN
=0 then oscillator switch is complete;
PMD3bits.PWM2MD=1;
//there is simulation problem in proteus during Pll,ie in lock and oswen
but works in hardware
//which means proteus can't simulate PLL mode using external oscillator ,
but it simulates if clock is set in FRCPLL
init_PWM();
initAdc1();
initInterrupts();
while(1)
{
delay10ms(5);
_LATB6=~_LATB6;
// to check if PIC is in working
}
}

void _ISR _MPWM1Interrupt(void)


{
PhaseA+=Frequency;
// Accumulate Delta_Phase
in Phase variable
PhaseB =PhaseA + OFFSET_120;
// Add proper value to phase
offset
PhaseC =PhaseA + OFFSET_240;
ASinevalue = Sinetable[PhaseA>>8];
// Take sine info
BSinevalue = Sinetable[PhaseB>>8];
CSinevalue = Sinetable[PhaseC>>8];
//Save off working registers ;might be used by other interrupts in nested
form
//multiplication is done in asm code and decimal has been converted into
integer (Q15 format) ie 32767
//beacause normal method of multiplying a floating point number takes a
lot of pic memory and takes long time for //calculation
asm("push.d
W4");
asm("push.d W6");
asm("push.d W8");
asm("mov _FREQ_SCALING,W7");
asm("mov _Modulation_Index,W6");
asm("mov _ASinevalue,W5");
asm("mpy W5*W6,A");
//Multiply
by
the
amplitude scaling
asm("sac A,W5");
//Store the scaled result

38

asm("mpy W5*W7,A");
//Multiply
by
the
PWM scaling factor
asm("sac A,W8");
//Store the scaled result
asm("add W7,W8,W8");
//Add
the
PWM
scaling
factor to produce 50% offset
asm("mov W8,_P1DC1");
//Write the PWM duty cycle
asm("mov _BSinevalue,W5");
asm("mpy W5*W6,A");
//Multiply
by
the
amplitude scaling
asm("sac A,W5");
//Store the scaled result
asm("mpy W5*W7,A");
//Multiply
by
the
PWM scaling factor
asm("sac A,W8");
//Store the scaled result
asm("add W7,W8,W8");
//Add
the
PWM
scaling
factor to produce 50% offset
asm("mov W8,_P1DC2");
//Write the PWM duty cycle
asm("mov _CSinevalue,W5");
asm("mpy W5*W6,A");
//Multiply
by
the
amplitude scaling
asm("sac A,W5");
//Store the scaled result
asm("mpy W5*W7,A");
//Multiply
by
the
PWM scaling factor
asm("sac A,W8");
//Store the scaled result
asm("add W7,W8,W8");
//Add
the
PWM
scaling
factor to produce 50% offset
asm("mov W8,_P1DC3");
//Write the PWM duty cycle
asm("pop.d W8");
//Save
off
working
registers
;might be used by other interrupts in nested form
asm("pop.d W6");
asm("pop.d W4");
_PWM1IF=0;
}

39

APPENDIX B
DATASHEETS OF SOME OF THE COMPONENTS USED

40

dsPIC33FJ32MC202/204

41

42

43

44

45

Optocoupler/ Optoisolators (6N137)

46

47

Power MOSFET (IRF840A)

48

MOSFET driver (IRS2110)

49

Figure: Pin Configuration of MOSFET driver

50

You might also like