Sunteți pe pagina 1din 75

ANALYSIS OF SINE WAVE INVERTER

HARMONICS CONTENTS BY SIMULATION

A Thesis
Submitted to the department of Electrical Power Engineering
Of
COMSATS Institute Of Information Technology Abbottabad
By
Ashfaq Muhammad Khan

Reg # Sp08-EPE-081

Noor Ahmad Shah

Reg # Sp08-EPE-070

Khizar Jahngir

Reg # Sp08-BEE-030

In the partial fulfillment of the requirement for the degree of Bachelor Of


Science in Electrical Power Engineering, Jan 2012

COMSATS University,
Abbottabad

DECLARATION
I hereby declare that this thesis is based on the result I found in my thesis
work. Contents of work found by other researcher are mentioned by
references. This thesis has never been previously submitted for any degree
neither in a whole nor in a part.

Signature of

Signature Of

Supervisor

Author

ACKNOWLEDGEMENT

Firstly I would like to thank my supervisor Engr. Mohsin Shahzad for giving us the
opportunity to work on this project under his supervision and also for his invaluable
support and guidance throughout the period of Project.
Through his supervision I have learned a lot.

APPROVAL CERTIFICATE
We have developed this hardware and accompanied report entirely on the basis of our
own effort, under the sincere guidance of our supervisor and seniors. If any part of this
system is proved to be copied out from any source or found to be reproduction of
someone else, we will stand by consequences.

Signature of Head of the Department

Signature of Supervisor
.

Signature of DOO
.

ABSTRACT
Energy crises are special attention in todays world. The unending usage of nonrenewable energy sources will bring an end to the limited resources in near future. In
order to preserve the resources, several alternative renewable sources have been use
in these days. The power generated from the renewable sources like solar energy,
produces is a DC power which can be stored in batteries. This DC power needs to be
converted to AC power as most of the appliances used in our daily life are dependent
on AC power. To overcome this obstacle DC-AC inverter took birth.

Inverter can be categorized into three groups i-e square wave, modified sine wave
and pure sine wave. Considering power wattage, efficiency and harmonics contents,
pure sine wave inverter has proved to have the best quality among the three types.
The control circuit for pure sine wave inverter produces sinusoidal pulse width
modulation.

In this thesis project, Performance of microcontroller based control circuit used in


invertr has been analyzed and DC-AC pure sine wave inverter used the analog control
circuit has been implemented.

TABLE OF CONTENTS
CHAPTER-1
INTRODUCTION
1.1
1.2
1.3
1.4

Motivation
Introduction
Types of Inverter
Topology of pure sine wave inverter
Topology 1. Analog control circuit
Topology 2. Microcontroller based control circuit

(10)
(11)
(11)
(13)

CHAPTER-2
DESIGNING OF SINE WAVE INVERTER
2.1

Design Method of Pure sine wave inverter (Topology-1

(15)

2.2

Block Diagram

(15)

2.3

Software Simulation

(16)

2.4

Simulink model of Inverter

(17)

2.5

Simulink model of SPWM

(18)

2.6

Scope Window

(18)

2.7

Relational operator

(18)

2.8

Simulation Result using Different loads

(19)

2.8.1

Using resistive load

(19)

2.8.2

Using inductive load

(20)

CHAPTER-3
HARMONICS
3.1

Harmonics

(21)

3.2

What are Harmonics?

(21)

3.3

What cause Harmonics?

(22)

3.4

A little about AC Drives

(24)

3.5

Effects

(24)

3.6

Technique for the reduction of harmonics

(25)

3.7

Electronic filter use for the reduction of harmonics

(26)

CHAPTER-4
FILTERS
4.1

Passive filter

(26)

4.2

Low pass RL filter

(27)

4.3

RC band pass filter

(29)

4.4

RC band stop filter

(31)

4.5

Series resonant band pass filter

(34)

4.6

Low pass RC filter

(36)

CHAPTER-5
HARDWARE
5.1

Introduction

(39)

5.2

System Overview

(39)

5.3

Conclusion

(41)

5.4

Output wave form of microcontroller based inverter

(41)

5.5

Active filter

(42)

5.6

Analogue filter

(43)

5.7

Digital filter

(44)

CHAPTER-6
Indexes

6.1
6.2

Data Sheet of inverter


Coding

(45)
(50)

List of Figures
Fig(1.1)

Pure sine wave inverter.13

Fig(1.2)

PWM.14

Fig(2.1)

Block diagram of the system16

Fig(2.2)

Simulink model of inverter.17

Fig(2.3)

Simulink model of SPWM18

Fig(2.4)

Simulation result using resistive load.19

Fig(2.5)

Simulation result using inductive load20

Fig(3.1)

Resultant wave form of sine wave with the presence of 3 rdand5thharmonic22

Fig(4.1)

Passive filter..26

Fig(4.2)

Implementation of low pass RL filter27

Fig(4.3)

Simulation result.28

Fig(4.4)

FFT Analysis28

Fig(4.5)

RC band pass filter.29

Fig(4.6)

Implementation of RC band pass filter.30

Fig(4.7)

Simulation result of RC band pass filter30

Fig(4.8)

FFT analysis of RC band pass filter31

Fig(4.9)

Implementation of RC Band stop filter..32

Fig(4.10) FFT analysis of RC band stop filter33


Fig(4.11) Simulation result of RC band stop 33
Fig(4.12) Series resonant band pass filter.34

Fig(4.13) Implementation of series resonant band pass filter35


Fig(4.14) Simulation result of Series Resonant band pass filter35
Fig(4.15) FFT Analysis of series resonant band pass filter .36
Fig(4.16) implementation of low pass RC filter..37
Fig(4.17) Simulation result of low pass RC filter. 37
Fig(4.18) FFT analysis of low pass RC filter38
Fig(5.1)

Schematic diagram of the photovoltaic inverter.39

Fig(5.2)

Single phase full bridge inverter.40

Fig(5.3)

PIC18F4437 for the generation of SPWM single phase inverter.40

Fig(5.4)

Output wave form in Oscilloscope.41

Fig(5.5)

Sine wave inverter with output wave form. 42

Chapter-1
INTRODUCTION
1.1

Motivation:-

Pakistan is suffering from shortage of electricity and to overcome the crises


alternative source of energy is expanding, especially in rural areas of Pakistan. The
solar home system is one of the alternative sources that can mitigate the demand of
electricity especially in rural areas where electricity has not reached yet.
Solar energy is a renewable energy without causing pollution to the environment. The
maximum electricity that a solar panel can produce is 130 watt by this panel. 11 CFL
(compact florescent lamp) of 6 watt power and 17-20 inches back and white TV can
run. Fan conducted on DC current can also be run by this solar energy.
After some research, we found that most of the companies, including SIEMENS System
a dependent on DC appliances. Due to lack of proper inverter, companies provide
usages of DC appliances only and not AC appliances. That is because, the existing
inverters produces modified sine wave (square waves) which causes a power loss and
harms the AC appliances. It is learned that the amount of investment in this energy
sector in rural areas per year is more than 2500 corer. 60% of this invested in solar
panel total of which requires being imported from outside. 25% is invested in battery
and the rest 15% in small mechanical parts. The companies are interested to extend
the service to the city dwellers.
In near future, the demand of pure sin wave inverter will be sky-rocketing, since most
of the appliances around us are dependent on AC power. Thus, this has motivated us
to create a pure sine wave inverter which can be implemented in solar homes systems,
at in affordable cost so the rural people can be benefited besides others. Our goal is to
produces pure sine wave, and not modified. If we can successfully implement the
analog circuit, then we can digitize our pure sine wave inverter circuitry using
microcontroller appliances.

10

1.2

Introduction:-

The output of battery source is a 12 volt DC and the required for volt for AC appliances
is a 220V AC (50 Hz). The function of inverter is to convert 12 DC to 220V AC which
should have pure sine wave oscillation at 50 hertz like the ordinary household
electrical outlet. The method that we are applying in our experiment is, converting the
low voltage DC power to AC, and then using a transformer to boost the voltage to
220V AC.
In today's market, there are two different types of inverters, modified sine wave and
pure sine wave inverter. The modified sine wave is similar to a square wave which is
less efficient in power consumption. It produces high number of harmonics which
affects the devices, hence, reducing its life time. Whereas, a pure sin wave inverter
reduces the harmonics to minimum, thus increasing the efficiency of power
consumption and life time of AC appliances. It also reduces the audible and electrical
noise in audible equipment, TV's, Fluorescent lights and allows inductive load, l ike fan
to run faster and quieter. The basic differences between the three waves are shown
in the figure: 1, below. It can be noted that the square wave has the minimum
amplitude, that is, maximum distortion. The modified sin wave is quite similar to
square, but it rests at zero for moment then rises or falls, it's less distorted then the
square. Whereas, the pure sin wave shown, have zero distortion (maximum
amplitude) compared to the rest two with pure oscillation of sine wave.

1.3

Types Of Inverter:There are three types of Inverter


1. Square wave inverter
2. Modified Sine wave inverter
3. Pure Sine wave inverter

11

1.

Square wave inverter:-

Square wave inverters were the first invented inverter. Square wave inverter has had
odd number of harmonics and can hardly be used to AC appliances except some lights
and fans which eventually reduce their life time. This is cheapest inverter. The green
colored line shown in figure:1 illustrates the output of the square wave inverter

2. Modified Sine wave inverter:The Modified sine wave is more like the square wave which has less harmonic
distortion compared to square wave. The harsh corners from the square wave were
eliminated to transform it to a modified sine wave. This type of inverter mostly exits in
today's market. Although it is less harmful to devises compared to square wave, it still
heats up the coil in filter due to large amount of harmonic distortion and dissipates
power. The blue color line in figure (1) shows the modified sine wave .

3. Pure Sine wave inverter:Unlike square wave and modified sine wave, pure sine wave inverters maintain the
best quality due to the least number of harmonic distortions present in it. Usually sine
wave inverter are more expensive but it allows to us use all AC appliances and reduces
the humming noise of inductive loads. The red colored line represents the sine wave
with respect to the other two, in figure (1)

12

(Fig. 1.1) pure sine wave inverter

1.4

Topologies of Pure Sine wave inverter:-

Pulse width modulation is widely used as a source of powering alternating current (AC)
devices with available direct current (DC) source. Variation of duty cycle of the PWM
signal to provide dc voltages across the load in a specific pattern will appear to the
load as ac signal. The pattern at which the duty cycle of a PWM Signal varies can be
implemented using simple analog components or a digital microcontroller.
There are two basic topologies to generate sinusoidal PWM that controls that output
of the inverter. The two topologies are,

TOPOLOGY-1:- Analog Control Circuit:In this type of control circuit, the SPWM is generated by comparing a sine wave with a
high carrier frequency (Triangular wave or saw tooth wave) with sine wave as the
reference voltage. Figure

shows how SPWM is produced by comparing sine wave with

13

triangular wave. This type of topology, analog components is used to generate the sine
wave and carrier wave and compare them with analog comparator.
Vsine

Fig 1.2. Pulse width modulation

TOPOLOGY-2:- Microcontroller based control circuit:In this type of topology, the SPWM is directly achieved using microcontroller that will
control the final sine wave at the final output. Using this type of topology reduces the
cost and the size of the control circuit. The low cost micro controller like ATmega32 or
Pic18F443 i has built in PWM modules which require some command to generate the
necessary PWM wave form.

14

Chapter-2
DESIGNING OF SINEWAVE INVERER
2.1

Design Method of Pure Sine wave inverter (Topology-1):-

The implementation of pure sine wave inverter can be complex when thought of as a
whole but when broken into smaller projects and implementing them individually, it
becomes easier. the following sections describes how the individual blocks like
Oscillator section, carrier wave generator and switching circuit was implemented and
how the blocks were joined together.

2.2 Block Diagram:Our project consists of analog circuitry (resistors, capacitor, diode, variable resistors)
as well as discrete components (Integrated circuits -LM348, TL084, MC3302), MOSFET
driver (IR-2101), MOSFETs and step up transformer. That is all required to cons truct a
sin wave to generate 220V AC sine wave across a load. The block diagram (Figure 1)
illustrates the various parts or blocks of the project. The three basic blocks to control
the circuit are the Six volt reference, sine wave generator and triangle wave generator.
When these blocks are implemented with comparator, and other small circuitry, they
control the pulse width modulated (PWM) signals that are fed into two MOSFET
drivers. The comparator circuit also produces square waves that are fed into other
MOSFET drivers which determine the polarity of the final output sin wave. The PWM
signals fed into the MOSFET Driver performs the level translation to drive four NChannel MOSFETs in an H-Bridge configuration. From here, the signals from the NChannel MOSFETs are passed through a low pass filter so that the output is a pure sin
wave of 12V P-P with 50 hertz frequency. Then the signal will be boosted up to 220 V
AC using a step-up transformer.

15

StapUp
220V ac
Transformer

Fig-2.1 Block Diagram Of the system

2.3

Software Simulation:-

In order to understand the circuit, we had to design the circuit in MATLAB software and
note the outputs at some specific nodes. A 12V DC supply is used and makes it step down
to 6V through regulator. In SPWM we compare two waves i-e sine wave and rectangular
wave and generate pulses. 4 MOSFETs switches are used for to convert theses pulses to
pure sine wave. An ammeter is used in series and voltmeter is used in parallel to measure
the voltage and current in the circuit.

16

2.4

SIMULINK Model Of Inverter:-

(Fig 2.2)

A pulses are applied on the gate of the MOSFETs. Voltage and current are measured on
the load through voltmeter and ammeter. For the safety of the circuit, we used fuses after
the switches.

17

2.5

SIMULINK Model of SPWM:-

(Fig 2.3)

2.6

Scope Window:-

If the Scope windows are closed at the start of a simulation, scope data is still written to the
connected Scopes. As a result, if you open a Scope after a simulation, the Scope window displays the
input signal or signals.

2.7 Relational Operator:By default, the Relational Operator block compares two inputs using the Relational operator
parameter that you specify. The first input corresponds to the top input port and the second
input to the bottom input port.
Here two waves are compared through comparator which can be seen on the scope.

18

2.8

SIMULATION Results Using Different Loads:-

2.8.1 Using Resistive Load:Using resistive load current and voltage are in phase. The simulation results is as follows.

(Fig 2.4) Simulation result using resistive load

We can easily see here that Switch 1 and Switch 4 are ON on the same time and Switch
2 and Switch 3 are ON on the same time. On the last two line it shows Voltage and
Current. Because of the resistive Load Voltage and Current are in phase. No angle
difference between them.

19

2.8.2

Using Inductive Load:-

(Fig 2.5) Simulation using Inductive load

Using inductive load, it is clear from the figure that voltage and current are not in
phase but voltage is leading from the current with some degree.

20

Chapter-3
HARMONICS
3.1

Harmonics:-

Definition:A harmonic of a wave is a component frequency of the signal that is an integer multiple
of the fundamental frequency i.e. if the fundamental frequency is f, the harmonics have
frequencies 2f, 3f, 4f, . . . etc. The harmonics have the property that they are all periodic
at the fundamental frequency, therefore the sum of harmonics is also periodic at that
frequency. Harmonic frequencies are equally spaced by the width of the fundamental
frequency and can be found by repeatedly adding that frequency. For example, if the
fundamental frequency is 25 Hz, the frequencies of the harmonics are: 50 Hz, 75 Hz,
100 Hz etc.

3.2

What are Harmonics:-

With more and more electronic devices being used the term harmonics comes into use.
Harmonics should be taken seriously but they are not the only cause of your electrical
problems. If you have tried everything and you are still having problems and you have a lot
of electronic devices it is something to think about. Any distortions in the voltage or current
wave causes harmonics. We can give you a lot of technical explanations on what harmonics
are but the intention of this website is to help everyone unders tand electrical terms not
cause more confusion. In fact a lot of people (including myself) in the electrical trade are
not

exactly

sure

how

harmonics

effect

electrical

circuits.

These harmonic currents create heat. This heat over a period of time, will ra ise the
temperature of the neutral conductor causing nuisance tripping of circuit breakers,
overvoltage problems, blinking of Incandescent Lights, computer malfunctions etc.

21

Among the electrical devices that seem to cause harmonics are Personal Computers,
Dimmers, Laser Printers, Electronic Ballast, Stereos, Radios, TVs, Fax Machines, and any
other equipment powered by switched-mode power supply (SMPS) equipment. This is not
to say that harmonics will cause all these problems, only that it is possible.
You can somewhat prevent these problems by using a dedicated circuit for electronic
equipment. Also on a branch circuit use an isolated ground wire for sensitive electronic and
computer equipment. A more expensive way is to rectify and filter the mains thus
effectively removing all low frequency harmonics including the fundamental. Oversized
neutrals is another possible means to prevent overheating of this wire. In power
distribution systems electricians are usually interested in measuring the current, thus a
"true-RMS" current measuring clamp-on meter is normally used.

Fig(3.1) The resultant wave form of a sine wave with the presence of 3 rd and 5 th harmonic
The Power company typically supplies a pure sine wave, But because of non linear loads
harmonics comes into in this pure sine wave. It becomes distorted.

3.3

What Cause Harmonics:-

22

Harmonics are the by-products of modern electronics. They occur frequently when there are
large numbers of personal computers (single phase loads), uninterruptible power supplies
(UPSs), variable frequency drives (AC and DC) or any electronic device using solid state
power switching supplies to convert incoming AC to DC. Non-linear loads create harmonics
by drawing current in abrupt short pulses, rather than in a smooth sinusoidal manner The
terms linear and non-linear define the waveform. A linear relationship exists between
the voltage and current, which is typical of an across-the-line load. A non-linear load has a
discontinuous current that does not correspond to the applied voltage waveform.
Common sources of harmonics are as follows
1.
Lighting Ballasts
2.
UPS System
3.
AC and DC Drives

1.

Lighting Ballasts:-

Lighting ballast is a piece of equipment required to control the starting and operating
voltages of electrical gas discharge lights. Examples of gas discharge light sources include
fluorescent and neon lights and high-intensity discharge (HID) lamps. The term lighting
ballast can refer to any component of the circuit intended to limit the flow of current through
the light, from a single resistor to more complex devices.
Lighting ballast is necessary to operate discharge lights because they have negative
resistance, meaning they are unable to regulate the amount of current that passes through
them. Lighting ballast must be used to control current flow; otherwise the light could fail.
Small light sources can use passive components, which require no additional power to
operate, as ballasts. An example would be a series resistor that limits the flow of current
across its terminals. For high-powered lights, however, a resistor would waste a large amount
of electricity, so more complex lighting ballast is required. Electromagnetic lighting ballast
uses electromagnetic induction to provide the starting and operating voltages of a gas
discharge light. Inside each is a coil of wire and an electromagnetic field that together
transform voltage. Some also include an igniter for high-power applications.

2.

UPS System:-

An uninterruptible power supply, also uninterruptible power source, UPS or


battery/flywheel backup, is an electrical apparatus that provides emergency power to a load
when the input power source, typically mains power fails. A UPS differs from an auxiliary or
emergency power system or standby generator in that it will provide instantaneous or nearinstantaneous protection from input power interruptions by means of one or more attached
batteries and associated electronic circuitry for low power users, and or by means of diesel
generators and flywheels for high power users. The on-battery runtime of most
uninterruptible power sources is relatively short515 minutes being typical for smaller
unitsbut sufficient to allow time to bring an auxiliary power source on line, or to properly

23

shut down the protected equipment. While not limited to protecting any particular type of
equipment, a UPS is typically used to protect computers, data centers, telecommunication
equipment or other electrical equipment where an unexpected power disruption could cause
injuries, fatalities, serious business disruption or data loss. UPS units range in size from units
designed to protect a single computer without a video monitor (around 200 VA rating) to
large units powering entire data centers, buildings, or even cities.

3. AC Drives:The word "drive" is used loosely in the industry. It seems that people involved primarily in
the world of gear boxes and pulleys refer to any collection of mechanical and electromechanical components, which when connected together will move a load, as a "drive".
When speaking to these people, an AC drive may be considered by them as the variable
frequency inverter and motor combination. It may even include the motor's pulley - I am not
sure. People in the electrical field and electrical suppliers usually refer to a variable frequency
inverter unit alone, or an SCR power module alone (when discussing DC drives) as the
"drive" and the motor as the "motor". Manufacturers of variable frequency drives (VFD) used
to refer to the drive as just that, a "variable frequency drive". More manufacturers are
referring to their drive as an "adjustable speed AC drive". To make matters worse when a
motor is included in the package it may be referred to as an "adjustable speed AC drive
system".
A variable frequency drive is an adjustable speed drive. Adjustable speed drives include all
types; mechanical and electrical. Now is it clear? Don't worry about it. It's not clear to
anyone. As you read on, when I refer to the "drive" I am referring to the variable frequency
inverter alone.

3.4 A little about AC drives:The main power components of an AC drive, have to be able to supply the required level of
current and voltage in a form the motor can use. The controls have to be able to provide the
user with necessary adjustments such as minimum and maximum speed settings, so that the
drive can be adapted to the user's process. Spare parts have to be available and the repair
manual has to be readable. It's nice if the drive can shut itself down when detecting either an
internal or an external problem. It's also nice if the drive components are all packaged in a
single enclosure to aid in installation but that's about it.

3.5

Effects:-

1.
Harmonics degrade the level of power quality and its efficiency particularly in a
commercial building or industry facility.
2.
Overheating of transformer and increased associated losses.

24

3.6

Technique for the reduction of Harmonics:-

Using Passive Filter:Method:- Provide a low-impedance path to ground for the


Harmonic frequencies.
Benefits:- May be tuned to a frequency between two prevalent harmonic s so as to help
attenuate both.
Concern:- Tuning the filter may be a labor intensive process. Filter are difficult to size
because they offer a path for harmonics from any source. Quite sensitive to any future
system changes.

3.7

Electronic Filters Use for the reduction of harmonics:-

Electronic filters are electronic circuits which perform signal processing functions,
specifically to remove unwanted frequency components from the signal, to enhance wanted
ones, or both. Electronic filters can be:
a.
b.
c.
d.
e.
f.

Passive or active
Analog or digital
high-pass, low-pass, bandpass, band-reject (band reject; notch), or all-pass.
discrete-time (sampled) or continuous-time
linear or non-linear
infinite impulse response (IIR type) or finite impulse response (FIR type)

The most common types of electronic filters are linear filters, regardless of other aspects of
their design. See the article on linear filters for details on their design and analysis.

25

Chapter 4
FILTERS
4.1 Passive Filter:A passive filter is a kind of electronic filter that is made only from passive elements in
contrast to an active filter, it does not require an external power source (beyond the signal).
Since most filters are linear, in most cases, passive filters are composed of just the four basic
linear elements resistors, capacitors, inductors, and transformers. More complex passive
filters may involve nonlinear elements, or more complex linear elements, such as
transmission lines.
A passive filter has several advantages over an active filter.

Guaranteed stability
Scale better to large signals (tens of amperes, hundreds of volts), where active devices are
often impractical
No power supply needed
Less expensive in discrete designs (unless large coils are required)
For linear filters, potentially greater linearity depending on components required

Fig 4.1. (Passive Filter)

They are commonly used in speaker crossover design (due to the moderately large voltages
and currents, and the lack of easy access to a power supply), filters in power distribution
networks (due to the large voltages and currents), power supply bypassing (due to low cost,
and in some cases, power requirements), as well as a variety of discrete and home brew
circuits (for low-cost and simplicity). Passive filters are uncommon in monolithic integrated
circuit design, where active devices are inexpensive compared to resistors and capacitors, and
inductors are prohibitively expensive. Passive filters are still found, however, in integrated

26

circuits. Indeed, it may be the desire to incorporate a passive filter that leads the designer to
use the hybrid format.

4.2 Low Pass RL Filter:A low-pass filter is an electronic filter that passes low-frequency signals but attenuates
(reduces the amplitude of) signals with frequencies higher than the cutoff frequency.

4.2(a) Implementation of Low Pass RL Filter in SIMULINK:-

(fig 4.2)Implementation of low pass RL filter)

4.2(b)

Simulation result of Low Pass RL Filter:-

27

(fig 4.3 Simulation result)

The Harmonics are present in the wave. We have to reduce this harmonics as much as
possible.

4.2(c) FFT Analysis Of Low Pass RL Filter:FFT Analysis shows the amount of distortion in a wave in percentage. In this case the Total
Harmonic Distortion is (THD) is 14.56%

(Fig 4.4 FFT Analysis)

28

4.3 RC Band Pass Filter:The cut-off frequency or c point in a simple RC passive filter can be accurately controlled
using just a single resistor in series with a non-polarized capacitor, and depending upon
which way around they are connected either a low pass or a high pass filter is obtained. One
simple use for these types of filters is in audio amplifier applications or circuits such as in
loudspeaker crossover filters or pre-amplifier tone controls. Sometimes it is necessary to only
pass a certain range of frequencies that do not begin at 0Hz, (DC) or end at some high
frequency point but are within a certain frequency band, either narrow or wide.
By connecting or "cascading" together a single Low Pass Filter circuit with a High Pass
Filter circuit, we can produce another type of passive RC filter that passes a selected range or
"band" of frequencies that can be either narrow or wide while attenuating all those outside of
this range. This new type of passive filter arrangement produces a frequency selective filter
known commonly as a Band Pass Filter or BPF for short.

(Fig 4.5) RC Band Pass

4.3(a) Implementation of RC Band Pass Filter In Simulink:-

29

(Fig 4.6)

4.3(b) Simulation Result of RC Band Pass Filter:The Simulation result of RC Band Pass Filter shows that we can reduce the total distortion to
some amount but can not finish it completely.

(Fig 4.7) Result of RC band pass filter

30

4.3(c) FFT Analysis Of RC Band Pass Filter:The FFT Analysis of RC Band Pass Filter shows that the distortion is present but reduce it to
some level. So the Total Harmonic Distortion is 19.25%.

(fig 4.8) FFT Analysis of RC Band Pass filter

4.4 RC Band Stop Filter:The simulation and FFT analysis of RC band stop filter is given

4.4(a) Implementation of RC Band Stop Filter In Simulink:-

31

(Fig 4.9)

4.4(b) FFT Analysis Of RC Band Stop Filter:The Fast Fourier Transform (FFT) analysis of RC Band Stop Filter shows that the Total
Harmonic Diistortion is 25.99%.

32

(Fig 4.10) FFT Analysis of RC Band Stop Filter

4.4(c) Simulation Result Of RC Band Stop Filter:-

(Fig 4.11)

33

4.5 Series Resonant Band Pass Filter:The filter designs we've concentrated on have employed either capacitors or inductors, but
never both at the same time. We should know by now that combinations of L and C will tend
to resonate, and this property can be exploited in designing band-pass and band-stop filter
circuits.
Series LC circuits give minimum impedance at resonance, while parallel LC (tank) circuits
give maximum impedance at their resonant frequency. Knowing this, we have two basic
strategies for designing either band-pass or band-stop filters. For band-pass filters, the two
basic resonant strategies are this: series LC to pass a signal or parallel LC to short a signal.
The two schemes will be contrasted and simulated here:

(Fig 4.12) Series Resonant Band Pass Filter

4.5(a) Implementation of Series Resonant Band Pass Filter in Simulink:The simulation result is as follows.

34

(Fig 4.13)

4.5(b) Simulation Result of Series Resonant Band Pass Filter:-

(Fig 4.14)

35

4.5(c)

FFT Analysis of Series Resonant Band Pass Filter:-

In this Filter the Total Harmonic Distortion is 18.19%

(Fig 4.15)
4.6

low pass RC filter:-

A low-pass filter is an electronic filter that passes low-frequency signals but attenuates
(reduces the amplitude of) signals with frequencies higher than the cutoff frequency. The
actual amount of attenuation for each frequency varies from filter to filter. It is sometimes
called a high-cut filter, or treble cut filter when used in audio applications. A low-pass filter
is the opposite of a high-pass filter. A band-pass filter is a combination of a low-pass and a
high-pass.

4.6(a) Implementation of low Pass RC Filter in Simulink:-

36

(Fig 4.16)

4.6(b) Simulation Result of low Pass RC filter:-

(Fig 4.17)

37

4.6(c) FFT Analysis of Low Pass RC filter:The FFT Analysis of RC Low Pass Filter shows that the Total Harmonic Distortion is 9.49%.

(Fig 4.18)

38

Chapter-5
MICROCONTROLLER BASED INVERTER (HARDWARE)
5.1

Introduction:-

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 the on and off of the
power switches. The pulse width modulation inverter has been the main choice in power
electronic for decades, because of its circuit simplicity and rugged control scheme. SPWM
switching technique is commonly used in industrial applications or solar electric vehicle
applications. 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. Sinusoidal pulse width modulation is the
mostly used method in motor control and inverter application. To generate this signal,
triangular wave is used as a carrier signal 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 PIC18F4431 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 single phase full bridge inverter. The microcontroller has
the built in dead time control circuit

5.2

System Overview:-

The basic schematic diagram of the photovoltaic inverter is shown in Fig. It consists of many
blocks, emphasis is given only on Sinusoidal PWM generation.

(Fig 5.1)
The single phase full bridge inverter circuit is shown in Fig.

39

(Fig 5.2)

The heart of the system is a PIC Microcontroller. This microcontroller is specially developed
for the generation of Sinusoidal PWM (SPWM) with dead time controller. The dead time
controller circuit is useful to make the design simpler, more reliable and the most important
thing is to reduce the cost and components. The Microcontroller: PIC18F4431generates four
Sinusoidal PWM signals. Fig. 3 shows the pin diagram of PIC18F4431 connected with
external oscillator. RB0 to RB3 pins are output for Sinusoidal PWM signals. RB0 and RB2
pins are independent which go to gate driver ICs. The name of the IC is IR2110. RB1 and
RB3 pins are complementary which go to another same gate driver IC. The output voltage of
the gate driver IC is 10V - 20V. The output voltage may be used for gate of the IGBT or
MOSFET. For operating the microcontroller we used 20MHz oscillator and two 15pF
capacitor. Also for operate Gate drive circuit IC needs some capacitors.

( Fig.5.3) PIC18F4431 for the generation of the S PWM single phase inverter

40

5.3 Conclusion:In this work, a single phase PWM signal has been implemented in PIC18F4431
microcontroller and gate drivers IC IR2110 was used. Several outstanding features of the
developed Sinusoidal PWM signal are highlighted as follows: By generating the Sinusoidal
single phase PWM signal have less harmonic; both PWM signal and Dead time control
circuits can be implemented in a single board microcontroller, which makes the system
reliable, compact and low cost; IR2110 IC can take two signals; one is used for independent
signal and another is used for inverting signal. That means IC can also reduce the cost,
compact and system reliable.

5.4 Out Put Wave Form Of Microcontroller Based Inverter:After completing our project the practical result of the Sine Wave Inverter is Shown in the
fig. A little bit distortion is present because of the connection. Almost sine wave comes out
from the project.

(Fig 5.4) out put wave form in Oscilloscope

41

This fig shows the output wave form with complete circuit.

(Fig 5.5) Sine Wave Inverter with Output wave form

5.5 Active Filter:An active filter is a type of analog electronic filter that uses active components such as an
amplifier. Amplifiers included in a filter design can be used to improve the performance and
predictability of a filter, while avoiding the need for inductors (which are typically expensive
compared to other components). An amplifier prevents the load impedance of the following
stage from affecting the characteristics of the filter. An active filter can have complex poles
and zeros without using a bulky or expensive inductor. The shape of the response, the Q
(quality factor), and the tuned frequency can often be set with inexpensive variable resistors.
In some active filter circuits, one parameter can be adjusted without affecting the others.
Using active elements has some limitations. Basic filter design equations neglect the finite
bandwidth of amplifiers. Available active devices have limited bandwidth, so they are often
impractical at high frequencies. Amplifiers consume power and inject noise into a system.

42

Certain circuit topologies may be impractical if no DC path is provided for bias current to the
amplifier elements. Power handling capability is limited by the amplifier stages.
Active filter circuit configurations (electronic filter topology) include:

Sallen and Key, and VCVS filters (low dependency on accuracy of the components)
State variable and biquadratic filters
Dual Amplifier Bandpass (DABP)
Wiennotch
Multiple Feedback Filter
Fliege (lowest component count for 2 opamp but with good controllability over
frequency and type)
Akerberg Mossberg(one of the topologies that offer complete and independent
control over gain, frequency, and type)

Active filters can implement the same transfer functions as passive filters. Common transfer
functions are:

High-pass filter attenuation of frequencies below their cut-off points.


Low-pass filter attenuation of frequencies above their cut-off points.
Band-pass filter attenuation of frequencies both above and below those they allow
to pass.
Notch filter attenuation of certain frequencies while allowing all others to pass.
Combinations are possible, such as notch and high-pass (in a rumble filter where
most of the offending rumble comes from a particular frequency). Another example
is an elliptic filter.

5.6 Analogue Filter:Analogue filters are a basic building block of signal processing much used in electronics.
Amongst their many applications are the separation of an audio signal before application to
bass, mid-range and tweeter loudspeakers; the combining and later separation of multiple
telephone conversations onto a single channel; the selection of a chosen radio station in a
radio receiver and rejection of others.
Passive linear electronic analogue filters are those filters which can be described with linear
differential equations (linear); they are composed of capacitors, inductors and, sometimes,
resistors (passive) and are designed to operate on continuously varying (analogue) signals.
There are many linear filters which are not analogue in implementation (digital filter), and
there are many electronic filters which may not have a passive topology both of which may
have the same transfer function of the filters described in this article. Analogue filters are

43

most often used in wave filtering applications, that is, where it is required to pass particular
frequency components and to reject others from analogue (continuous-time) signals.

5.7

Digital Filter:-

In electronics, computer science and mathematics, a digital filter is a system that performs
mathematical operations on a sampled, discrete-time signal to reduce or enhance certain
aspects of that signal. A digital filter system usually consists of an analog-to-digital converter
to sample the input signal, followed by a microprocessor and some peripheral components
such as memory to store data and filter coefficients etc. Finally a digital-to-analog converter
to complete the output stage. Program Instructions (software) running on the microprocessor
implement the digital filter by performing the necessary mathematical operations on the
numbers received from the ADC. Digital filters may be more expensive than an equivalent
analog filter due to their increased complexity, but they make practical many designs that are
impractical or impossible as analog filters.

44

Chapter-6
INDEXES
6.1 Data Sheet:-

UNISONIC TECHNOLOGIES CO., LTD


75N75 Power MOSFET
www.unisonic.com.tw 1 of 8
Copyright 2005 Unisonic Technologies Co., Ltd. QW-R502-097,A
75Amps, 75Volts
Data Sheet of N-CHANNEL POWER MOSTFET
DESCRIPTION
The UTC 75N75 is n-channel enhancement mode power field effect transistors with
stable off-state characteristics, fast switching speed, low thermal resistance, usually
used at telecom and computer application.
FEATURES
* RDS(ON) = 12.5m @VGS = 10 V
* Ultra low gate charge ( typical 90 nC )
* Fast switching capability
* Avalanche energy Specified
* Improved dv/dt capability, high ruggedness
SYMBOL
1.Gate
2.Source
3.Drain
TO-220F
*Pb-free plating product number: 75N75L
ORDERING INFORMATION
Order Number Pin Assignment Normal Lead Free Plating
Package 1 2 3 Packing
75N75-TA3-T 75N75L-TA3-T TO-220 G D S Tube
75N75-TF3-T 75N75L-TF3-T TO-220F G D S Tube
75N75-TM3-T 75N75L-TM3-T TO-251 G D S Tube
75N75-TN3-R 75N75L-TN3-R TO-252 G D S Tape Reel

45

75N75-TN3-T 75N75L-TN3-T TO-252 G D S Tube


Note: Pin Assignment: G: Gate D: Drain S: Source
75N75L-TA3-T
(1)Packing Type
(2)Package Type
(3)Lead Plating
(1) T: Tube, R: Tape Reel
(2) TA3: TO-220, TF3: TO-220F, TM3: TO-251,
TN 3: TO-252
(3) L: Lead Free Plating, Blank: Pb/Sn
75N75 Power MOSFET
UNISONIC TECHNOLOGIES CO., LTD 2 of 8
www.unisonic.com.tw QW-R502-097,A

ABSOLUTE MAXIMUM RATINGS


PARAMETER SYMBOL RATINGS UNIT
Drain to Source Voltage VDSS 75 V
TC = 25/ 75 A
Continuous Drain Current
TC = 100
ID=56 A
Drain Current Pulsed (Note 1) IDM 300 A
Gate to Source Voltage VGS 20 V
Single Pulsed(Note 2) EAS 900 mJ
Avalanche Energy
Repetitive (Note 1) EAR 300 mJ
Peak Diode Recovery dv/dt (Note 3) dv/dt 15 V/ns
TC = 25/ 220 W
Total Power Dissipation
Derating above 25
PD 1.4 W
Junction Temperature TJ +150
Storage Temperature TSTG -55 ~ +150
Note: Absolute maximum ratings are those values beyond which the device could be
permanently damaged. Absolute maximum ratings are stress ratings only and
functional device operation is not implied.
THERMAL DATA
PARAMETER SYMBOL MIN TYP MAX UNIT
Thermal Resistance Junction-Ambient JA 62.5

46

Thermal Resistance Junction-Case JC 0.8


Thermal Resistance Case-Sink CS 0.5
ELECTRICAL CHARACTERISTICS
(TC = 25, unless otherwise specified)
PARAMETER SYMBOL TEST CONDITIONS MIN TYP MAX UNIT
Off Characteristics
Drain-Source Breakdown Voltage BVDSS VGS = 0 V, ID = 250 A 75 V
ID = 1mA,
Referenced to 25
0.08 V
VDS = 75 V, VGS = 0 V 20 A
Drain-Source Leakage Current IDSS VDS = 75 V, VGS = 0 V,
TJ = 150
250 A
Gate-Source Leakage Current VGS = 20V, VDS = 0 V 100 nA
Gate-Source Leakage Reverse
IGSS
VGS = -20V, VDS = 0 V -100 nA
On Characteristics
Gate Threshold Voltage VGS(TH) VDS = VGS, ID = 250 A 2.0 4.0 V
Static Drain-Source On-State
Resistance
RDS(ON) VGS = 10 V, ID = 48 A 12.5 15 m
Dynamic Characteristics
Input Capacitance CISS 3300 pF
Output Capacitance COSS 530 pF

Reverse Transfer Capacitance CRSS


VGS = 0 V, VDS = 25 V
f = 1MHz
80 pF

47

Switching Characteristics
Turn-On Delay Time tD(ON) 12 ns
Rise Time tR 79 ns
Turn-Off Delay Time tD(OFF) 80 ns
Fall Time tF
VDD = 38V, ID =48A,
VGS=10V, (Note 4, 5)
52 ns
Total Gate Charge QG 90 140 nC
Gate-Source Charge QGS 20 35 nC
Gate-Drain Charge (Miller Charge) QGD
VDS = 60V, VGS = 10 V
ID = 48A, (Note 4, 5)
30 45 nC
75N75 Power MOSFET
UNISONIC TECHNOLOGIES CO., LTD 3 of 8
www.unisonic.com.tw QW-R502-097,A
ELECTRICAL CHARACTERISTICS(Cont.)
PARAMETER SYMBOL TEST CONDITIONS MIN TYP MAX UNIT
Source-Drain Diode Ratings and Characteristics
Continuous Source Current IS 75
Pulsed Source Current ISM
300
A
Diode Forward Voltage VSD IS = 48A, VGS = 0 V 1.4 V
Reverse Recovery Time trr 90 ns
Reverse Recovery Charge Qrr
IS = 48A, VGS = 0 V
dIF / dt = 100 A/s 300 C
Note 1. Repeativity rating: pulse width limited by junction temperature
2. L=0.24mH, IAS=48A, RG=20, Starting TJ=25
3. ISD48A, di/dt300A/s, VDDBVDSS, Starting TJ=25
4. Pulse Test: Pulse Width300s,Duty Cycle2%
5. Essentially independent of operating temperature.
75N75 Power MOSFET
UNISONIC TECHNOLOGIES CO., LTD 4 of 8
www.unisonic.com.tw QW-R502-097,A
TEST CIRCUITS AND WAVEFORMS

48

Same Type as D.U.T.L


VDD Driver
VGS
RGVDS
D.U.T. +
* dv/dt controlled by RG
* ISD controlled by pulse period
* D.U.T.-Device Under Test
P. W.
Period
VGS D=(Driver) ISD (D.U.T.) IFM, Body Diode Forward Current di/dt IRM
Body Diode Reverse Current
Body Diode Recovery dv/dt
Body Diode Forward Voltage Drop
VDD 10V
VDS
(D.U.T.)
VGS= P.W. Period

75N75 Power MOSFET


UNISONIC TECHNOLOGIES CO., LTD 8 of 8
www.unisonic.com.tw QW-R502-097,A
UTC assumes no responsibility for equipment failures that result from using products
at values that exceed, even momentarily, rated values (such as maximum ratings,
operating condition ranges, or other parameters) listed in products specifications of
any and all UTC products described or contained herein. UTC products are not
designed for use in life support appliances, devices or systems where malfunction of
these products can be reasonably expected to result in personal injury. Reproduction
in whole or in part is prohibited without the prior written consent of the copyright
owner. The information presented in this document does not form part of any
quotation or contract, is believed to be accurate and reliable and may be changed
without notice.

49

6.2 Coding:-

; ASM code generated by PIC Basic Pro for PIC - V. 2.0.1.0


; Date/Time: 12/22/2011 10:59:59 PM
;
; Address

Instruction

;------------------------------------0000 GOTO main


;--- procedure interrupt --interrupt:
0004 MOVWF

i_STACK_2

0005 SWAPF

STATUS,W

0006 CLRF

STATUS

0007 MOVWF

i_STACK_3

0008 MOVF FSR,W


0009 MOVWF

i_STACK_0

000A MOVF PCLATH,W


000B MOVWF

i_STACK_4

000C MOVLW

000D SUBWF

main_global_interval_counter,W

000E BTFSS STATUS,Z


000F GOTO L_Ups_Test_1
0010 L_Ups_Test_0:
0010 MOVF main_global_dutycycle_1,W
0011 MOVWF

main_global_workcycle_1

0012 MOVF main_global_dutycycle_2,W

50

0013 MOVWF

main_global_workcycle_20014

GOTO L_Ups_Test_2
0015 L_Ups_Test_1:
0015 L_Ups_Test_2:
0015 BSF

STATUS,C

0016 BTFSC main_global_workcycle_2,7


0017 GOTO $+9
0018 MOVLW

0019 MOVWF

i_STACK_6

001A MOVF main_global_workcycle_2,W


001B SUBWF

i_STACK_0,W

001C BTFSS STATUS,Z


001D GOTO $+3
001E MOVF main_global_workcycle_1,W
001F SUBLW

250

0020 BTFSC STATUS,C


0021 GOTO L_Ups_Test_5
0022 L_Ups_Test_4:
0022 MOVLW

250

0023 MOVWF

CCPR1L

0024 GOTO L_Ups_Test_6


0025 L_Ups_Test_5:
0025 BSF

STATUS,C

0026 BTFSC main_global_workcycle_2,7


0027 GOTO $+9
0028 MOVLW

0029 MOVWF

i_STACK_7

51

002A MOVF main_global_workcycle_2,W

002B SUBWF

i_STACK_0,W

002C BTFSS STATUS,Z


002D GOTO $+3
002E MOVF main_global_workcycle_1,W
002F SUBLW

0030 BTFSC STATUS,C


0031 GOTO L_Ups_Test_9
0032 L_Ups_Test_8:
0032 MOVF main_global_workcycle_1,W
0033 MOVWF
0034 CLRF

CCPR1L

i_STACK_8

0035 BTFSC PORTC,6


0036 INCF

i_STACK_8,F

0037 MOVLW

0038 SUBWF

i_STACK_8,W

0039 BTFSS STATUS,Z


003A GOTO L_Ups_Test_13
003B L_Ups_Test_12:
003B BCF

PORTC,7

003C GOTO L_Ups_Test_14


003D L_Ups_Test_13:
003D BCF

PORTC,6

003E BSF

PORTC,7

003F GOTO L_Ups_Test_14


0040 L_Ups_Test_14:

52

0040 GOTO L_Ups_Test_10

0041 L_Ups_Test_9:
0041 CLRF

CCPR1L

0042 GOTO L_Ups_Test_10


0043 L_Ups_Test_10:
0043 GOTO L_Ups_Test_6
0044 L_Ups_Test_6:
0044 MOVLW

250

0045 MOVWF

i_STACK_7

0046 MOVLW

0047 MOVWF

i_STACK_8

0048 MOVF i_STACK_7,W


0049 SUBWF

main_global_workcycle_1,W

004A MOVWF

i_STACK_5

004B MOVF i_STACK_8,W


004C BTFSS STATUS,C
004D INCFSZ

i_STACK_8,W

004E SUBWF

main_global_workcycle_2,W

004F MOVWF

i_STACK_6

0050 MOVF i_STACK_5,W


0051 MOVWF

main_global_workcycle_1

0052 MOVF i_STACK_6,W


0053 MOVWF
0054 INCF

main_global_workcycle_2

main_global_interval_counter,F

0055 MOVLW

10

0056 SUBWF

main_global_interval_counter,W

53

0057 BTFSS STATUS,Z

0058 GOTO L_Ups_Test_17


0059 L_Ups_Test_16:
0059 CLRF

main_global_interval_counter

005A GOTO L_Ups_Test_18


005B L_Ups_Test_17:
005B L_Ups_Test_18:
005B BCF

PIR1,1

005C MOVF i_STACK_4,W


005D MOVWF

PCLATH

005E MOVF i_STACK_0,W


005F BCF

STATUS,IRP

0060 MOVWF

FSR

0061 SWAPF

i_STACK_3,W

0062 MOVWF

STATUS

0063 SWAPF

i_STACK_2,F

0064 SWAPF

i_STACK_2,W

0065 RETFIE
;---endproc--;--- procedure delays_delay_22us --delays_delay_22us:
0066 MOVLW

0067 BCF

STATUS,RP1

0068 BCF

STATUS,RP0

0069 MOVWF

STACK_0

006A DECFSZ

STACK_0,F

54

006B GOTO $-1


006C RETURN
;---endproc--;--- function ADClib_A_A_adc_read --ADClib_A_A_adc_read:
006D BCF

STATUS,RP1

006E BCF

STATUS,RP0

006F CLRF

ADCON0

0070 MOVLW

192

0071 IORWF ADCON0,W


0072 MOVWF

ADCON0

0073 MOVF ADClib_A_A_adc_read_param_chann el,W


0074 MOVWF

STACK_1

0075 MOVLW

0076 MOVWF

STACK_2

0077 L_ADClib_A_A_0:
0077 MOVF STACK_2,W
0078 BTFSC STATUS,Z
0079 GOTO L_ADClib_A_A_1
007A RLF

STACK_1,F

007B BCF

STACK_1,0

007C DECFSZ

STACK_2,F

007D GOTO L_ADClib_A_A_0


007E L_ADClib_A_A_1:
007E MOVF STACK_1,W
007F IORWF ADCON0,W
0080 MOVWF
0081 BSF

ADCON0

adcon0,0

55

0082 CALL

delays_delay_22us

0083 BSF

adcon0,2

0084 L_ADClib_A_A_3:
0084 CLRF

STACK_0

0085 BTFSC adcon0,2


0086 INCF

STACK_0,F

0087 MOVLW

0088 SUBWF

STACK_0,W

0089 BTFSS STATUS,Z


008A GOTO L_ADClib_A_A_4
008B L_ADClib_A_A_2:
008B nop
008C GOTO L_ADClib_A_A_3
008D L_ADClib_A_A_4:
008D CLRF

ADClib_A_A_adc_read_result_2

008E MOVF ADRES,W


008F MOVWF
0090 BCF

ADClib_A_A_adc_read_result_1

adcon0,0

0091 RETURN
;---endproc--;--- procedure math_div_16x16_u --math_div_16x16_u:
0092 BCF

STATUS,RP1

0093 BCF

STATUS,RP0

56

0094 CLRF Math_main_Global_Remainder_1


0095 CLRF Math_main_Global_Remainder_2
0096 MOVLW 16
0097 MOVWF Math_main_global_LoopCount
0098 RLF

math_main_global_X_2,W

0099 RLF

Math_main_Global_Remainder_1,F

009A RLF

Math_main_Global_Remainder_2,F

009B MOVF math_main_global_Y_1,W


009C SUBWF Math_main_Global_Remainder_1,F
009D MOVF math_main_global_Y_2,W
009E BTFSS STATUS,C
009F INCFSZ math_main_global_Y_2,W
00A0 SUBWF Math_main_Global_Remainder_2,F
00A1 BTFSC STATUS,C
00A2 GOTO $+8
00A3 MOVF math_main_global_Y_1,W
00A4 ADDWF Math_main_Global_Remainder_1,F
00A5 MOVF math_main_global_Y_2,W
00A6 BTFSC STATUS,C
00A7 INCFSZ math_main_global_Y_2,W
00A8 ADDWF Math_main_Global_Remainder_2,F
00A9 BCF

STATUS,C

00AA RLF

math_main_global_X_1,F

00AB RLF

math_main_global_X_2,F

00AC DECFSZ Math_main_global_LoopCount,F


00AD GOTO $-21

57

00AE RETURN
;---endproc--;--- procedure Ups_Test_pwmint_setup --Ups_Test_pwmint_setup:
00AF BCF

STATUS,RP1

00B0 BSF

STATUS,RP0

00B1 BCF

TRISC,6

00B2 BCF

TRISC,7

00B3 MOVLW

249

00B4 MOVWF

PR2

00B5 MOVLW

00B6 BCF

STATUS,RP0

00B7 MOVWF
00B8 CLRF

T2CON

CCPR1L

00B9 MOVLW

192

00BA MOVWF

INTCON

00BB BSF

STATUS,RP0

00BC BSF

PIE1,1

00BD BCF

STATUS,RP0

00BE BCF

PIR1,1

00BF BSF

T2CON,2

00C0 MOVLW

12

00C1 MOVWF

CCP1CON

00C2 CLRF

main_global_interval_counter

00C3 CLRF

main_global_adc_value_1

00C4 CLRF

main_global_adc_value_2

58

00C5 BCF

PORTC,6

00C6 BCF

PORTC,7

00C7 RETURN
;---endproc--;--- procedure main --main:
00C8 CALL

Ups_Test_pwmint_setup

00C9 MOVLW

120

00CA BCF

STATUS,RP1

00CB BCF

STATUS,RP0

00CC MOVWF
00CD CLRF

main_global_dutycycle_1

main_global_dutycycle_2

00CE L_Ups_Test_20:
00CE MOVLW

00CF BCF

STATUS,RP1

00D0 BCF

STATUS,RP0

00D1 MOVWF
00D2 CALL

ADClib_A_A_adc_read_param_channel

ADClib_A_A_adc_read

00D3 MOVF ADClib_A_A_adc_read_result_1,W


00D4 MOVWF

main_global_adc_value_1

00D5 MOVF ADClib_A_A_adc_read_result_2,W


00D6 MOVWF

main_global_adc_value_2

00D7 MOVLW

00D8 MOVWF

Math_main_global_Y_2

00D9 MOVLW

00DA MOVWF

Math_main_global_Y_1

00DB MOVF main_global_adc_value_2,W


00DC MOVWF

Math_main_global_X_2

59

00DD MOVF main_global_adc_value_1,W


00DE MOVWF
00DF CALL

Math_main_global_X_1

Math_Div_16X16_U

00E0 MOVF Math_main_global_X_1,W


00E1 MOVWF

STACK_1

00E2 MOVF Math_main_global_X_2,W


00E3 MOVWF

STACK_2

00E4 MOVF STACK_1,W


00E5 MOVWF

main_global_adc_value_1

00E6 MOVF STACK_2,W


00E7 MOVWF

main_global_adc_value_2

00E8 MOVLW

00E9 MOVWF

STACK_3

00EA MOVLW

00EB SUBWF

main_global_adc_value_2,W

00EC BTFSS STATUS,Z


00ED GOTO $+3
00EE MOVF STACK_3,W
00EF SUBWF

main_global_adc_value_1,W

00F0 BTFSS STATUS,Z


00F1 GOTO L_Ups_Test_24
00F2 CLRF

main_global_dutycycle_1

00F3 CLRF

main_global_dutycycle_2

00F4 GOTO L_Ups_Test_22

60

00F5 L_Ups_Test_24:
00F5 MOVLW

10

00F6 MOVWF

STACK_4

00F7 MOVLW

00F8 SUBWF

main_global_adc_value_2,W

00F9 BTFSS STATUS,Z


00FA GOTO $+3
00FB MOVF STACK_4,W
00FC SUBWF

main_global_adc_value_1,W

00FD BTFSS STATUS,Z


00FE GOTO L_Ups_Test_25
00FF MOVLW

10

0100 MOVWF

main_global_dutycycle_1

0101 CLRF

main_global_dutycycle_2

0102 GOTO L_Ups_Test_22


0103 L_Ups_Test_25:
0103 MOVLW

20

0104 MOVWF

STACK_5

0105 MOVLW

0106 SUBWF

main_global_adc_value_2,W

0107 BTFSS STATUS,Z


0108 GOTO $+3
0109 MOVF STACK_5,W
010A SUBWF

main_global_adc_value_1,W

010B BTFSS STATUS,Z


010C GOTO L_Ups_Test_26
010D MOVLW

20

010E MOVWF

main_global_dutycycle_1

61

010F CLRF

main_global_dutycycle_2

0110 GOTO L_Ups_Test_22


0111 L_Ups_Test_26:
0111 MOVLW

30

0112 MOVWF

STACK_6

0113 MOVLW

0114 SUBWF

main_global_adc_value_2,W

0115 BTFSS STATUS,Z


0116 GOTO $+3
0117 MOVF STACK_6,W
0118 SUBWF

main_global_adc_value_1,W

0119 BTFSS STATUS,Z


011A GOTO L_Ups_Test_27
011B MOVLW

30

011C MOVWF

main_global_dutycycle_1

011D CLRF

main_global_dutycycle_2

011E GOTO L_Ups_Test_22


011F L_Ups_Test_27:
011F MOVLW

40

0120 MOVWF

STACK_7

0121 MOVLW

0122 SUBWF

main_global_adc_value_2,W

0123 BTFSS STATUS,Z


0124 GOTO $+3
0125 MOVF STACK_7,W
0126 SUBWF

main_global_adc_value_1,W

0127 BTFSS STATUS,Z


0128 GOTO L_Ups_Test_28

62

0129 MOVLW

40

012A MOVWF

main_global_dutycycle_1

012B CLRF

main_global_dutycycle_2

012C GOTO L_Ups_Test_22


012D L_Ups_Test_28:
012D MOVLW

50

012E MOVWF

STACK_8

012F MOVLW

0130 SUBWF

main_global_adc_value_2,W

0131 BTFSS STATUS,Z


0132 GOTO $+3
0133 MOVF STACK_8,W
0134 SUBWF

main_global_adc_value_1,W

0135 BTFSS STATUS,Z


0136 GOTO L_Ups_Test_29
0137 MOVLW

50

0138 MOVWF

main_global_dutycycle_1

0139 CLRF

main_global_dutycycle_2

013A GOTO L_Ups_Test_22


013B L_Ups_Test_29:
013B MOVLW

60

013C MOVWF

STACK_9

013D MOVLW

013E SUBWF

main_global_adc_value_2,W

013F BTFSS STATUS,Z


0140 GOTO $+3
0141 MOVF STACK_9,W
0142 SUBWF

main_global_adc_value_1,W

63

0143 BTFSS STATUS,Z


0144 GOTO L_Ups_Test_30
0145 MOVLW

60

0146 MOVWF

main_global_dutycycle_1

0147 CLRF

main_global_dutycycle_2

0148 GOTO L_Ups_Test_22


0149 L_Ups_Test_30:
0149 MOVLW

70

014A MOVWF

STACK_10

014B MOVLW

014C SUBWF

main_global_adc_value_2,W

014D BTFSS STATUS,Z


014E GOTO $+3
014F MOVF STACK_10,W
0150 SUBWF

main_global_adc_value_1,W

0151 BTFSS STATUS,Z


0152 GOTO L_Ups_Test_31
0153 MOVLW

70

0154 MOVWF

main_global_dutycycle_1

0155 CLRF

main_global_dutycycle_2

0156 GOTO L_Ups_Test_22


0157 L_Ups_Test_31:
0157 MOVLW

80

0158 MOVWF

STACK_11

0159 MOVLW

015A SUBWF

main_global_adc_value_2,W

015B BTFSS STATUS,Z


015C GOTO $+3

64

015D MOVF STACK_11,W


015E SUBWF

main_global_adc_value_1,W

015F BTFSS STATUS,Z


0160 GOTO L_Ups_Test_32
0161 MOVLW

80

0162 MOVWF

main_global_dutycycle_1

0163 CLRF

main_global_dutycycle_2

0164 GOTO L_Ups_Test_22


0165 L_Ups_Test_32:
0165 MOVLW

90

0166 MOVWF

STACK_12

0167 MOVLW

0168 SUBWF

main_global_adc_value_2,W

0169 BTFSS STATUS,Z


016A GOTO $+3
016B MOVF STACK_12,W
016C SUBWF

main_global_adc_value_1,W

016D BTFSS STATUS,Z


016E GOTO L_Ups_Test_33
016F MOVLW

90

0170 MOVWF

main_global_dutycycle_1

0171 CLRF

main_global_dutycycle_2

0172 GOTO L_Ups_Test_22


0173 L_Ups_Test_33:
0173 MOVLW

100

0174 MOVWF

STACK_13

0175 MOVLW

0176 SUBWF

main_global_adc_value_2,W

65

0177 BTFSS STATUS,Z


0178 GOTO $+3
0179 MOVF STACK_13,W
017A SUBWF

main_global_adc_value_1,W

017B BTFSS STATUS,Z


017C GOTO L_Ups_Test_34
017D MOVLW

100

017E MOVWF

main_global_dutycycle_1

017F CLRF

main_global_dutycycle_2

0180 GOTO L_Ups_Test_22


0181 L_Ups_Test_34:
0181 MOVLW

110

0182 MOVWF

STACK_14

0183 MOVLW

0184 SUBWF

main_global_adc_value_2,W

0185 BTFSS STATUS,Z


0186 GOTO $+3
0187 MOVF STACK_14,W
0188 SUBWF

main_global_adc_value_1,W

0189 BTFSS STATUS,Z


018A GOTO L_Ups_Test_35
018B MOVLW

110

018C MOVWF

main_global_dutycycle_1

018D CLRF

main_global_dutycycle_2

018E GOTO L_Ups_Test_22


018F L_Ups_Test_35:
018F MOVLW

120

0190 MOVWF

STACK_15

66

0191 MOVLW

0192 SUBWF

main_global_adc_value_2,W

0193 BTFSS STATUS,Z


0194 GOTO $+3
0195 MOVF STACK_15,W
0196 SUBWF

main_global_adc_value_1,W

0197 BTFSS STATUS,Z


0198 GOTO L_Ups_Test_36
0199 MOVLW

120

019A MOVWF

main_global_dutycycle_1

019B CLRF

main_global_dutycycle_2

019C GOTO L_Ups_Test_22


019D L_Ups_Test_36:
019D MOVLW

130

019E MOVWF

STACK_16

019F MOVLW

01A0 SUBWF

main_global_adc_value_2,W

01A1 BTFSS STATUS,Z


01A2 GOTO $+3
01A3 MOVF STACK_16,W
01A4 SUBWF

main_global_adc_value_1,W

01A5 BTFSS STATUS,Z


01A6 GOTO L_Ups_Test_37
01A7 MOVLW

130

01A8 MOVWF

main_global_dutycycle_1

01A9 CLRF

main_global_dutycycle_2

01AA GOTO L_Ups_Test_22


01AB L_Ups_Test_37:

67

01AB MOVLW

140

01AC MOVWF

STACK_17

01AD MOVLW

01AE SUBWF

main_global_adc_value_2,W

01AF BTFSS STATUS,Z


01B0 GOTO $+3
01B1 MOVF STACK_17,W
01B2 SUBWF

main_global_adc_value_1,W

01B3 BTFSS STATUS,Z


01B4 GOTO L_Ups_Test_38
01B5 MOVLW

140

01B6 MOVWF

main_global_dutycycle_1

01B7 CLRF

main_global_dutycycle_2

01B8 GOTO L_Ups_Test_22


01B9 L_Ups_Test_38:
01B9 MOVLW

150

01BA MOVWF

STACK_18

01BB MOVLW

01BC SUBWF

main_global_adc_value_2,W

01BD BTFSS STATUS,Z


01BE GOTO $+3
01BF MOVF STACK_18,W
01C0 SUBWF

main_global_adc_value_1,W

01C1 BTFSS STATUS,Z


01C2 GOTO L_Ups_Test_39
01C3 MOVLW

150

01C4 MOVWF

main_global_dutycycle_1

01C5 CLRF

main_global_dutycycle_2

68

01C6 GOTO L_Ups_Test_22


01C7 L_Ups_Test_39:
01C7 MOVLW

160

01C8 MOVWF

STACK_19

01C9 MOVLW

01CA SUBWF

main_global_adc_value_2,W

01CB BTFSS STATUS,Z


01CC GOTO $+3
01CD MOVF STACK_19,W
01CE SUBWF

main_global_adc_value_1,W

01CF BTFSS STATUS,Z


01D0 GOTO L_Ups_Test_40
01D1 MOVLW

60

01D2 MOVWF

main_global_dutycycle_1

01D3 CLRF

main_global_dutycycle_2

01D4 GOTO L_Ups_Test_22


01D5 L_Ups_Test_40:
01D5 MOVLW

170

01D6 MOVWF

STACK_20

01D7 MOVLW

01D8 SUBWF

main_global_adc_value_2,W

01D9 BTFSS STATUS,Z


01DA GOTO $+3
01DB MOVF STACK_20,W
01DC SUBWF

main_global_adc_value_1,W

01DD BTFSS STATUS,Z


01DE GOTO L_Ups_Test_41
01DF MOVLW

170

69

01E0 MOVWF
01E1 CLRF

main_global_dutycycle_1

main_global_dutycycle_2

01E2 GOTO L_Ups_Test_22


01E3 L_Ups_Test_41:
01E3 MOVLW

180

01E4 MOVWF

STACK_21

01E5 MOVLW

01E6 SUBWF

main_global_adc_value_2,W

01E7 BTFSS STATUS,Z


01E8 GOTO $+3
01E9 MOVF STACK_21,W
01EA SUBWF

main_global_adc_value_1,W

01EB BTFSS STATUS,Z


01EC GOTO L_Ups_Test_42
01ED MOVLW

180

01EE MOVWF

main_global_dutycycle_1

01EF CLRF

main_global_dutycycle_2

01F0 GOTO L_Ups_Test_22


01F1 L_Ups_Test_42:
01F1 MOVLW

190

01F2 MOVWF

STACK_22

01F3 MOVLW

01F4 SUBWF

main_global_adc_value_2,W

01F5 BTFSS STATUS,Z


01F6 GOTO $+3
01F7 MOVF STACK_22,W
01F8 SUBWF

main_global_adc_value_1,W

01F9 BTFSS STATUS,Z

70

01FA GOTO L_Ups_Test_43


01FB MOVLW

190

01FC MOVWF

main_global_dutycycle_1

01FD CLRF

main_global_dutycycle_2

01FE GOTO L_Ups_Test_22


01FF L_Ups_Test_43:
01FF MOVLW

200

0200 MOVWF

STACK_23

0201 MOVLW

0202 SUBWF

main_global_adc_value_2,W

0203 BTFSS STATUS,Z


0204 GOTO $+3
0205 MOVF STACK_23,W
0206 SUBWF

main_global_adc_value_1,W

0207 BTFSS STATUS,Z


0208 GOTO L_Ups_Test_44
0209 MOVLW

200

020A MOVWF

main_global_dutycycle_1

020B CLRF

main_global_dutycycle_2

020C GOTO L_Ups_Test_22


020D L_Ups_Test_44:
020D MOVLW

210

020E MOVWF

STACK_24

020F MOVLW

0210 SUBWF

main_global_adc_value_2,W

0211 BTFSS STATUS,Z


0212 GOTO $+3
0213 MOVF STACK_24,W

71

0214 SUBWF

main_global_adc_value_1,W

0215 BTFSS STATUS,Z


0216 GOTO L_Ups_Test_45
0217 MOVLW

210

0218 MOVWF

main_global_dutycycle_1

0219 CLRF

main_global_dutycycle_2

021A GOTO L_Ups_Test_22


021B L_Ups_Test_45:
021B MOVLW

220

021C MOVWF

STACK_25

021D MOVLW

021E SUBWF

main_global_adc_value_2,W

021F BTFSS STATUS,Z


0220 GOTO $+3
0221 MOVF STACK_25,W
0222 SUBWF

main_global_adc_value_1,W

0223 BTFSS STATUS,Z


0224 GOTO L_Ups_Test_46
0225 MOVLW

220

0226 MOVWF

main_global_dutycycle_1

0227 CLRF

main_global_dutycycle_2

0228 GOTO L_Ups_Test_22


0229 L_Ups_Test_46:
0229 MOVLW

230

022A MOVWF

STACK_26

022B MOVLW

022C SUBWF

main_global_adc_value_2,W

022D BTFSS STATUS,Z

72

022E GOTO $+3


022F MOVF STACK_26,W
0230 SUBWF

main_global_adc_value_1,W

0231 BTFSS STATUS,Z


0232 GOTO L_Ups_Test_47
0233 MOVLW

230

0234 MOVWF

main_global_dutycycle_1

0235 CLRF

main_global_dutycycle_2

0236 GOTO L_Ups_Test_22


0237 L_Ups_Test_47:
0237 MOVLW

240

0238 MOVWF

STACK_27

0239 MOVLW

023A SUBWF

main_global_adc_value_2,W

023B BTFSS STATUS,Z


023C GOTO $+3
023D MOVF STACK_27,W
023E SUBWF

main_global_adc_value_1,W

023F BTFSS STATUS,Z


0240 GOTO L_Ups_Test_48
0241 MOVLW

240

0242 MOVWF

main_global_dutycycle_1

0243 CLRF

main_global_dutycycle_2

0244 GOTO L_Ups_Test_22


0245 L_Ups_Test_48:
0245 MOVLW

250

0246 MOVWF

STACK_28

0247 MOVLW

73

0248 SUBWF

main_global_adc_value_2,W

0249 BTFSS STATUS,Z


024A GOTO $+3
024B MOVF STACK_28,W
024C SUBWF

main_global_adc_value_1,W

024D BTFSS STATUS,Z


024E GOTO L_Ups_Test_49
024F MOVLW

250

0250 MOVWF

main_global_dutycycle_1

0251 CLRF

main_global_dutycycle_2

0252 GOTO L_Ups_Test_22


0253 L_Ups_Test_49:
0253 MOVLW

120

0254 MOVWF

main_global_dutycycle_1

0255 CLRF

main_global_dutycycle_2

0256 GOTO L_Ups_Test_22


0257 L_Ups_Test_22:
0257 GOTO L_Ups_Test_20
0258 L_Ups_Test_21:
0258 GOTO $
;---endproc--References:-

1.
B. Ismail, S. T. (November 28-29, 2006). Development of a Single Phase SPWM
Microcontroller-Based Inverter. First International Power and Energy Conference PEC (p.
437). Putrajaya, Malaysia: IEEE
2.
MICROCHIP. (2003). PIC18F2331/2431/4331/4431 Data Sheet.
Michrochip Tchonology Inc.

74

Links
http://www.wisegeek.com/what-is-a-lighting-ballast.htm
http://www.drivesys.com/asdis.html
http://en.wikipedia.org/wiki/Electronic_filter
http://en.wikipedia.org/wiki/Passive_filter#Passive_filter
http://en.wikipedia.org/wiki/Active_filter
http://en.wikipedia.org/wiki/Analog_filter
http://en.wikipedia.org/wiki/Digital_filter
http://en.wikipedia.org/wiki/Low-pass_filter
http://www.electronics-tutorials.ws/filter/filter_4.html
http://www.allaboutcircuits.com/vol_2/chpt_8/6.html

75

S-ar putea să vă placă și