Sie sind auf Seite 1von 6

Design and Real-Time Implementation of SPWM

based Inverter

Sundas Hannan Sohaib Aslam, Muhammad Ghayur


Department of Electrical Engineering Department of Electrical Engineering Department of Electrical Engineering
Superior University, Superior University, Superior University,
Lahore, Pakistan Lahore, Pakistan Lahore, Pakistan
Sohaib.aslam@superior.edu.pk

Abstract— This paper presents the design and implementation of between positive and negative cycles. However, the loads are
1kW SPWM based inverter to convert the applied DC voltage becoming more sensitive to pure sine wave in last few years and
from photovoltaic array in to pure sinusoidal AC voltage thus demand of pure sine wave inverters is increasing
according to the voltage and frequency of standard grid output i- tremendously [6]. Pure Sine Wave inverter offers number of
e 220V and 50Hz. The crux of this research work is the use of an
economical and advanced 16-bit PIC microcontroller to generate
advantages over traditional inverters i-e low harmonic
the popular SPWM with very high carrier frequency (in order of distortion, clean power, reduction in electrical and audible noise
kHz) to control the inverter circuit. The high frequency pulses of in fans, cooler and quicker running of inductive loads [7]. There
SPWM results in smoothed filtration of inverter output into pure exists number of techniques in literature to generate pure sine
sine wave by using small sized capacitors and inductors as a filter. wave AC but in this research work, Sinusoidal Pulse Width
In this paper, the simulations of inverter are presented by first Modulation (SPWM) is used to control the switching of
developing code of SPWM in MPLAB and then simulating it on MOSFET full bridge and provides pure sine wave AC output
Proteus software. Finally, it is real-time implemented and tested after filtration by LC filter. Traditionally, SPWM is generated
for resistive load and the output voltage and current are displayed by comparing the sinusoidal signal of desired frequency with
on LCD
Keywords—SPWM; Pure Sine Wave; Microcontroller; Single
triangle wave of carrier frequency and this is done by using
Phase Inverter; MPLAB; Proteus number of ICs in fixed configuration and provides static
solution. The alternative approach used in this paper is to
employ a cost effective with high computational power 16-bit
I. INTRODUCTION PIC24F series microcontroller to generate SPWM at desired
In recent years, the demand in electrical energy has been frequency. The use of microcontroller provides dynamic
increased exponentially due to increase in population, economy solution for changing the frequency of SPWM and control
growth and fast depletion of non-renewable energy sources i-e algorithms without any change in hardware. In this research
fossils therefore, renewable energy sources have been getting work simulations of designed SPWM based pure sine wave
popularity word-wide and they have also no adverse effects on inverter are presented in Proteus and then it is real-time
environment [1]. Solar energy is the preferred renewable energy implemented and tested for resistive load. In section 2 SPWM
source over others due to number of reasons i-e ease of is elaborated. Section 3 presents the design and circuit
availability, less maintenance cost, reliable operation and implementation of inverter. Section 4 and 5 presents the
average person can invest in it [2]. Fortunately, Pakistan has simulation and hardware results and finally conclusion is
high potential of solar energy as sun warms the environment for summarized in section 6.
the whole year [3]. The recent development in technology to
II. SINUSOIDAL PULSE WIDTH MODULATION
efficiently harvest solar energy from sun through photovoltaic
(PV) has motivated researchers to improve electrical energy Pulse Width Modulation (PWM) is a technique used to
conversion systems and inverter as a power converter plays an control the output voltage of inverter by varying the duty cycles
important role in renewable energy integration [4]. Inverter of pulses and it has become very popular in power converters
converts the DC output of PV module to AC voltage and injects due to its simple circuit and robust control technique. In
the sinusoidal current into utility [5]. Inverters are classified on SPWM, pulses have constant amplitudes but their duty cycles
the basis of their outputs as Square wave inverter, Modified are changed in proportion to the amplitude of sine wave
Square Wave inverter and Pure Sine Wave inverter. In Pakistan, evaluated at the center of same pulse [8]. Conventionally,
Square Wave inverters are mostly used as they have simple SPWM is generated by comparing the reference sinusoidal
circuit and are cheaper but they are not suitable for most of the signal of desired frequency and carrier triangular signal of very
electrical loads and also have less efficiency due to higher high frequency through comparator. The comparator gives one
harmonics. Modified Square Wave inverter output does not get state at output when carrier signal exceeds the reference and
transition directly from positive peak to negative peak but rather gives second state when reference voltage exceeds the carrier
stay for a while at zero level and consequently gives dead spots voltage as shown in Fig. 1
/
= = 200 (5)
To complete half cycle (180 degrees) of reference signal in 200
pulses, each incremental step (Istep) of sine signal in degrees is
found by Eq. (6)
°
= = 0.9° (6)
From Eq. (6) it is very easy to generate sine look up table of 200
values and the duty cycle of PWM is set by multiplying the
value of sine look up table with total time period of PWM as
shown in Eq. (7)
= (7)
B. Hardware Design and Implementation of Inverter
In this paper the pure sine wave inverter is designed for
Fig. 1 SPWM Generation
following specifications shown in Table 1
In conventional method analog circuits are used to generate
sinusoidal and triangular signals and comparator is used to Table 1. Design Specifications
compare these generated signals and generates SPWM. Input Voltage 12V (DC)
However, the disadvantages associated with this configuration Output Voltage 220V (AC)
are lack of flexibility, more difficult closed loop control, more Max. Output Power 1 (kW)
space required and more complexity [9]. Therefore, with recent Frequency 50Hz
advancements in both digital technology and integrated circuits
The hardware of the inverter is described by the block diagram
microcontroller is getting huge attraction because of its
shown in Fig. 2
integrated peripherals i-e ADCs, Timers and PWM modules etc
[10]. In this paper, SPWM is generated by PIC24F series 16-bit
PIC microcontroller to avoid the disadvantages of analog
circuits. The designing of SPWM and algorithm development
in MPLAB are presented in next section
III. SPWM BASED INVERTER
SPWM based inverter is implemented by following a sequence
of steps given below:
1) SPWM Calculations
2) Hardware Design and Implementation of Inverter

All these steps are explained in following sections


A. SPWM Calculation
PIC 24F series microcontroller generates SPWM by varying
the duty cycles of PWM according to the sine lookup table. Sine
lookup table is developed by doing following calculations
= 50 (1)
= 20 (2)
Where fd represents the desired frequency of sinusoidal signal Fig. 2 Blok Diagram of Inverter
and Td shows it’s time period. The time period required for half
cycle is 10 ms as SPWM is only generated for one half cycle In the above figure the battery is used to operate microcontroller
and remain zero for second half cycle. For inverter at desired voltage and provide 12V DC to MOSFETs to convert
implementation two SPWMs are generated with alternate in to 220V AC. Microcontroller is used to generate two SPWMs
switching pattern. The carrier signal frequency is given by Eq. at specific frequency for switching of MOSFETs. The isolation
(3) and it has inverse relation with size of LC filter and even circuit receives low power input from microcontroller and
high value of fc results in improved pure sine wave after provides high current gate drive for MOSFET. MOSFETS
filtration. Therefore, in this research work 20kHz carrier signal develop the inverter section used to convert the applied DC
is used and time period of carrier signal is shown in Eq. (4) voltage to AC voltage. The output of inverter is applied to
= 20 (3) transformer to step up the voltage to 220V and then filtration is
= 50 (4) done to get pure sine wave output at desired frequency of 50
The number of PWM pulses of carrier signal required to Hz. Finally, sensors are used to provide feedback to
complete the half cycle time of reference signal is shown in Eq. microcontroller to display voltage and current on LCD. The
(5) details of each block are given below:
1) Battery: The 12V DC battery is used to operate 4) Bridge Inverter: Bridge circuit consists of four high
microcontroller, isolation circuit and MOSFETS at frequency switching MOSFETS to convert the applied
desired voltage levels by using voltage regulator. DC voltage in to AC voltage as shown in Fig. 4
Similarly, it provides the input 12V DC to MOSFETS
inverter section to convert in to 220V AC
2) Microcontroller: PIC24FJ128GA010 is used to
generate SPWMs. It is a 16-bit microcontroller and has
capability of generating very high frequency PWM. It
has three pins OC1, OC2 and OC3 to generate PWMs.
Output Compare Module (OCM) is used to generate
PWM. OCM has variety of operating modes but here
it is used simply to generate PWM by assigning the
first three bits of OCXCON control register (110)2.
However, PWM of particular frequency is produced
by putting the number of clocks required to produce
PWM period in the period register of selected timer Fig. 4 Bridge Inverter
used. The required number of clocks are calculated by
the Eq. (7) [11]. Two SPWMs generated by microcontroller SPWM 1 and
= [( ) + 1] ∗ (7) SPWM 2 are applied to the gates of bridge shown in above
figure. However, SPWM1 is applied to Q1 and Q2 while
Where PWM period = , Pry is the period
SPWM 2 is applied to Q3 and Q4. Positive cycle of AC voltage
register and Tcy = and Fosc is the crystal is generated by switching ON Q1, Q4 and switching OFF Q3,
Q4 and the negative cycle of AC voltage is generated by
oscillator frequency. In this research work the crystal
switching ON Q3, Q4 and switching OFF Q1, Q2. The working
oscillator frequency is 32 MHz and the desired of these switches and its expected output is shown in Fig. 5
frequency is 20khz so calculated value of Pry is 799.
The duty cycle of generated PWM is set by assigning
value from sine lookup table and then it becomes
SPWM rather than simple PWM. Microcontroller
generates two SPWMs to switch full bridge inverter
3) Isolation Circuit: The isolation circuit has two
purposes in the inverter circuit. First it provides
isolation between the low power circuit i-e
microcontroller and high power MOSFETs section.
Secondly it receives low power input from
microcontroller and provides the required high-current
gate drive for MOSFETs section. In this research
work, TLP250 gate driver is used and it is an optically (a) Q1 and Q2 ON (b) Q3 and Q4 ON
isolated driver as shown in Fig. 3 [12].

(c) Output of Full Bridge Inverter


Fig. 3 TLP250 Gate Driver Fig. 5 Bridge Inverter Operation
In this paper four IRL540 power MOSFETS are used with rated
voltage of 100V and rated current of 28A. For high current
requirement MOSFETs are used in parallel configurations
1) Transformer: A simple low frequency step-up
transformer is used to step up AC output voltage of
inverter to 220V i-e standard voltage of grid
2) LC-Filter: The periodic pulsating output of
transformer is passed through designed LC-filter to
convert it into pure sine wave AC voltage with desired
50Hz frequency. In this research work LC-filter in Pi
network configuration is used as shown in Fig. 6

Fig. 6 Low Pass LC-PI Filter

In the above figure the value of capacitor and inductor is found


by the following relation
= (8)

Where f is the cut-off frequency and in this research work cut-
off frequency is 18kH Hz. The calculated product of L and C is
0.0029. Therefore, values of L and C are 72mH and 0.04uF
respectively
Feedback: At the output the current and voltage are measured
and given back to the microcontroller to display them on LCD Fig. 7 Algorithm Flow Chart of SPWM in MPLAB

IV. SIMULATIONS
D. Simlation Results
The simulations of pure sine wave inverter are presented in
Proteus by first developing the algorithm of SPWM in MPLAB The simulations of inverter are developed by implementing the
and then implementing the inverter in Proteus. The algorithm circuit diagram shown in Fig. 8
flow chart of SPWM and simulation results are elaborated in
following sections
C. Spwm Algorithm Flowchart
The algorithm flow chart of SPWM is shown in Fig. 7. In the
Fig. 7, initially headers files required by microcontroller are
included then interrupt service routine for timer 2 is defined in
which the sine look up table is declared and at every completion
of PWM cycle a new value of duty cycle is picked from look up
table and in this way microcontroller generates SPWM. In the
following steps timer 2, OC1CON and OC2CON registers are
initialized to generate two PWMs. In main section all the
declared functions are called and finally in while loop the duty
cycle is assigned to particular registers to generate real-time
SPWM Fig. 8 Circuit Diagram of Inverter

The simulation results at the output at every stage of inverter


are shown in Fig. 9
V. HARDWARE RESULTS
The real-time implementation of SPWM pure sine wave
inverter is shown in Fig. 10

(a) SPWM1 and SPWM2

Fig. 10 Real-Time Implementation of SPWM Based Inverter

In the above figure DC supply is used to operate the circuit at


regulated voltage by using voltage regulator also supply 12V
DC voltage to Bridge inverter for conversion in to 220V AC
voltage. The full bridge inverter with heat sink is used in the
circuit. One microcontroller is used to generate SPWMs and
second is used to display the values of current, voltage and
(b) Output at Full Bridge Inverter power on 16x2 LCD. Two transformers are used to measure
current and voltage at the output of inverter and give feedback
to the microcontroller for display purposes. It is also clear in
above figure that resistive load (bulbs) is connected at the
output but still oscilloscope is showing pure sine wave
therefore, SPWM based inverter gives excellent results for
resistive load
The hardware results at resistive load are shown in Fig. 11

(c) Pure Sine Wave at Output of LC-Filter

(a) Resistive Load

(d) Pure Sine Wave at Resistive Load (100W Bulb)

Fig. 9 Simulations of SPWM Based Inverter


displayed on LCD. In future prospect, inverter can be tested for
inductive and capacitive load and some control techniques
should be used to regulate the parameters at the output.
Moreover, researchers can investigate the transformer less
design of inverter

REFERENCES

[1] M.A.Ghalib, Y.S.Abdalla, R.M.Mostafa, “Design and Implementation of


a Pure Sine Wave Single Phase Inverter for Photovoltaic Applications,”
Zone 1 Conference of the American Society for Engineering Education,
pp. 1-8, April, 2014, U.S.A.
(b) Pure Sine Wave at Resistive Load [2] R.Haider, R.Alam, N.Yousaf, K.M. Salim,”Design and Construction of
Single Phase ure Sine Wave Inverter For PhotoVoltaic Application”,
International Conference on Infonnatics, Electronics & Vision , pp. 190-
194, 2012.
[3] S.Adnan, A.H.Khan, “Solar Energy Potential in Pakistan”, Journal of
Renewable and Sustainable Energy, vol. 4, No. 3, 2012
[4] S.S.Lee, Y.E.heng, “Improved Single Phase Split-Source Inverter with
Hybrid Quasi-Sinusoidal and Constant PWM”, IEEE TRANSACTIONS
ON INDUSTRIAL ELECTRONICS, vol. 64, No. 3,2017
[5] L.Hassaine, A.Maroui “Control Strategy based on SPWM Switching
Patterns for Grid Connected Photovoltaic Inverter”, AIP Conference
Proceedings, 2017
[6] M.B.Cheema, S.A.Hasnain, “Comparative Analysis of SPWM and
Square WaveOutput Filtration based Pure Sine Wave Inverters”, IEEE
15th International Conference on Environment and Electrical
(c) Display of Values for Resistive Load Engineering, 2015
[7] Texas Instuments “800VA Pure Sine Wave Inverter’s Reference Design”,
Fig. 11 Real-Time results of Inverter for Resistive Load
Application Report, 2013
VI. CONCLUSION AND FUTURE [8] A.S.Chowdary, M.S.Shehab, “Design and Implementation of a Highly
Efficient Pure Sine-Wave Inverter for Photovoltaic Applications”,
In this research work, designing of 1kW single phase SPWM International Conference on Informatics, Electronics and Vision (ICIEV),
based pure sinewave inverter and real-time implementation is 2013
presented. SPWM is generated by 16-bit PIC24F series [9] Z.Ying, “Sinusoidal Pulse Width Modulation Design Based DDS”, 2nd
International Workshop on Intelligent Systems and Applications, 2010
microcontroller at 20kHz and the simulations are done by first
[10] S.Aslam, S.Hannan, U.Sajjad and W.Zafar, “IMPLEMENTATION OF
developing algorithm of SPWM in MPLAB and then PID ON PIC24F SERIES MICROCONTROLLER FOR SPEED
implementing inverter in Proteus. The simulation results are CONTROL OF A DC MOTOR USING MPLAB AND PROTEUS”,
presented at output of every section of inverter and output after Advances in Science and Technology Research Journal, vol. 10, No. 31,
2016
the filtration is a pure sine wave 220V AC with the desired
[11] S.Aslam, S.Hannan, A.Haider, and M.H.Tariq, “Exploring PIC 24F series
frequency of 50Hz. Finally, real-time implementation of Microcontroller using MPLAB and Proteus” , JOURNAL OF CURRENT
inverter is done and tested for resistive load and again the RESEARCH IN SCIENCE, vol. 4, No. 2, 2016
results are excellent as pure sine wave does not distort and the [12] TLP250, Toshiba datasheet, 2017
values of voltage, current and power delivered to load are

Das könnte Ihnen auch gefallen