You are on page 1of 6

Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology

ISSN No:-2456-2165

Modeling of a Pure Sine Wave Power Inverter using


Sinusoidal Pulse Width Modulation (SPWM)
Technique
Kelechi Inyama(1), Chinenye Eberechi Uchegbu(2), Ugonna Solomon Alamezie(3)
(1)(2)(3)
Electrical Electronic Engineering Department,
Faculty of Engineering, Abia State University, Uturu, Abia State, Nigeria

Abstract:- Over the years, renewable energy has gained II. LITERATURE REVIEW
a lot of popularity in Nigeria, and Africa as a whole.
Power electronics and converter systems play an The adoption of solar-inverter systems among
important role in the renewable energy sources analysis Nigerians has likely increased over time, making it one of
and modeling. This work provides a discrete modeling the country's most prevalent sources of alternative energy at
and design method for digitally controlled inverters the moment. Also produced locally are inverters by
using software based generation of sinusoidal pulse businesses and individuals. [3].
width modulation. We introduce the background and
foundations of power inverter digital control. For digital There are three major inverter waveform types, Square
pulse-width modulations (PWMs) with delay effects, wave, Modified Sine (MS) wave, and PureSine (PS) wave.
small-signal models are developed. The controllers can Of these, only the last two are commonly seen, as the square
be designed using a variety of models in accordance with wave is considered obsolete. Modified Sine (MS) wave and
the block diagrams based on the models. The Pure Sine (PS) wave generators are the two main power
experimental setting and simulation software for the inverter types available on the Nigerian market today. The
digitally controlled inverters are then described. outputs of these inverters vary, offering various degrees of
efficiency and distortion that might have diverse effects on
Keywords:- Inverter, Pure Sine (PS) wave, Nigeria, electrical equipment. A MS wave is similar to a square wave
Uninterruptible Power Suppliers, Proteus, c++ program, but instead has a “stepping” look to it that relates more in
Arduino. shape to a sine wave [4]. An approximation of a sine wave
may be created by outputting one or more stepped square
I. INTRODUCTION wave with the amplitudes chosen to approximate the sine
[5]. This can be seen in Fig. 1, which displays how a MS
Direct current (DC) and alternating current (AC) are wave tries to emulate the sine wave itself. Notice that as
the two basic types of electrical power. Direct current has time progresses from left to right, the two different
the advantage of being able to be stored in batteries, but waveforms rise at different rates. The MS waveform is
alternating current can have its voltage level changed by simple to create because it only requires switching between
using transformers. three values at predetermined frequencies, omitting the more
intricate circuitry required for a PS wave. The MS wave
In developing countries, shortage of power is a inverter offers a simple and affordable method for powering
problem commercially and domestically [1]. Existing AC-required devices.
electricity production sources are under a heavy pressure
from newly constructed offices. The situation, particularly in
some urban areas, worsens when the quickly rising private
and domestic demand is added. Simply put, we are
becoming more able to consume energy than we are to
produce it. Under these circumstances, failure will happen
suddenly and without notice as a result of strains on the
insufficient power sources. The necessity for an alternate
energy source that can bridge the gap and cover power
supply gaps results from this. Overcoming this obstacle led
to the application of DC/AC power inverters. Short term
solution of power disruption could be addressed through the
use of these inverters and a source of DC power.

An inverter is an electrical system that converts direct


current (d.c) power into an alternating current (a.c) [2].
Components, such as but not limited to transistors, resistors,
Fig. 1: Modified sine wave and pure sine wave
diodes, relays, rectifiers, and switches, can be used to carry
out the inverting operation. Wherever there is a requirement Source: www.altestore.com
to maintain a. c. power in a building or residence, an
inverter can be found.

IJISRT23MAY381 www.ijisrt.com 1561


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
The inverters constructed in Nigeria which is available  Quiet Operation
commercially and also those incorporated in UPS Pure sine wave inverters reduces audible and electrical
(Uninterruptible Power Suppliers) are mostly MS wave noise in fans, fluorescent lights, audio amplifiers, TV, fax
inverters which are not suitable for sophisticated electrical and answering machines.
devices and equipments in daily use due to their output
waveform which constitute of undesirable harmonics [6],  Compatibility with a Wide Range of Devices
[7]. Inductive loads like microwave ovens and variable-
speed motors operate properly, quieter and cooler. Some
The modified sine wave is made up of several sine appliances will not produce full output if they do not use
waves with odd harmonics (multiples) of the modified sine Sine-Wave power.
wave's basic frequency. A modified sine wave at 60 Hz, for
instance, will include sine waves with odd harmonic
frequencies like the third (180 Hz), fifth (300 Hz), seventh
(420 Hz), and so on. A modified sine wave's high frequency
harmonic content increases radio interference, increases the
heating effect on motors and microwaves, and causes
overloading by lowering the impedance of low frequency
filter capacitors and power factor improvement capacitors
[8].

A. Need for the Research


A sine-wave inverter's output voltage has a sine
waveform similar to the sine waveform of the mains/utility Fig. 2: Blocks Diagram of Pure Sine Wave Inverter
voltage. In a sine wave inverter, the voltage rises and falls
gradually, the phase angle changes gradually, and the III. MODELING A PURE SINE WAVE INVERTER
polarity changes instantaneously when the voltage reaches 0 USING SOFTWARE GENERATED SMALL
volts. In a modified sine wave, the voltage rises and falls SIGNAL SINUSOIDAL PULSE WIDTH
sharply, the phase angle also shifts sharply, and it remains at MODULATION
0 Volts for some time before switching polarities. Therefore,
any device that uses a control circuitry that senses the phase As power inverters are usually implemented by using
(for voltage/speed control) or instantaneous zero voltage H bridges, describing the output voltage of H bridges as a
crossing (for timing control), will not work properly from a function of the modulation signal is required. The transfer
voltage that has a modified sine wave-form [6]. function of Pulse Width Modulation (PWM) model varies
when different carriers and modulation techniques are used
Having observed the need for producing inverters that [9]. The typical circuit diagram of an H bridge is shown in
can be used to operate sensitive electronic devices that Fig. 3. The output of the H bridge is the filter input voltage
require high quality waveform with little harmonic vin. The switching output is defined as y = vin/Vdc. The
distortion, there is need to establish a proper study on switching output varies significantly when different
modeling and production of a pure sine wave inverter using modulation strategies are used.
simple methods and readily available materials. This can
serve as a tool or guide to Nigerian engineers in the future.

B. Significance of the Research

 Same Current as Power Grids


A pure sine wave inverter produces a wave that is very
similar to the smooth wave form generated by mains
electricity. That is, there is no discernible difference between
plugging your devices into these inverters and plugging them
into a wall outlet with power supply from the public power
supply. Fig. 3: A typical H bridge circuit

 Minimal Risk to Devices If there are two voltage levels produced on the switch
The smooth wave form produced by a pure sine wave voltage Vin, i.e., Vdc and −Vdc, the H bridge is bipolar
inverter also protects your high-end electronics from damage switched. In order to provide the model for a single-update-
during power outages. Using modified sine wave inverters mode bipolar switched H bridge, we assume that the duty-
with AC-powered devices such as microwaves and ratio is updated at each sampling instant. Therefore, the
refrigerators can generate excessive waste heat, putting your Digital Signal Processor (DSP) delay is one sampling cycle.
devices at risk. Pure sine wave inverters, on the other hand, When the sampling frequency is equal to the switching
pose no threat to any of your devices. frequency, the key waveforms of bipolar switched H-bridge
are shown in figure 4.

IJISRT23MAY381 www.ijisrt.com 1562


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
IV. SIMULATION

Fig. 4: Key waveforms of single-update-mode uniformly- Fig. 5: Proteus simulation diagram


sampled bipolar switched H-bridge. (a) End-of-on-time
The simulation work of this research is implemented in
modulator. (b) Symmetric-on-time modulator.
Proteus. The digital controllers can be built up by commonly
It can be seen from Fig. 4 that the filter input voltage used classic Proteus models. Then, a c++ program is loaded
frequency of the bipolar switched H-bridge is equivalent to into the controller to model both the switching and carrier
the switching frequency. The duty ratio can be updated only frequency. This frequency is fed into the H-bridge to be
once when using saw-tooth carriers. However, for triangle stepped up to 230V AC.
carriers, the duty-ratio can be updated twice a switching
 INPUT STAGE: The input unit consists of sinusoidal
cycle. As the DSP delay from 𝑥∗ to 𝑢∗ is Ts, the small-
pulse width modulation generation from the arduino nano
signal transfer function describing 𝑦𝑏 as a function of xb ∗
microcontroller using a c/c++ program. When simulated it
for end-of-on-time modulator is written as:
could be seen that the two SPWM signal are
𝐺 ∗𝑝𝑤𝑚(𝑠)=𝑇𝑆𝑒 −𝑠(1+𝐷)𝑇𝑠 (3.1) complementary, which connotes that they are 180 degrees
half phase.
On the other hand, for symmetric-on-time modulator,
the small-signal transfer function 𝐺 ∗𝑝𝑤𝑚(𝑠) can be
expressed as

𝐺∗ 𝑇𝑠 −𝑠
(3−𝐷)𝑇𝑠
−𝑠
(3+𝐷)𝑇𝑠 (3.2)
𝑝𝑤𝑚(𝑠)= (𝑒 2 +𝑒 2 )
2

For bipolar switched H bridges, each switching cycle


contains two updated samples with two relevant switching
actions. If the sample is updated at the upper peak of the
(1−𝐷)𝑇𝑠
carrier, the delay from ∗ 𝑡𝑜 𝑦 𝑖𝑠 . On the other hand,
2
if the sample is updated at the lower peak of the carrier, the
𝐷𝑇𝑠
delay from 𝑢∗ to 𝑦𝑏 become . During each switching
2
cycle, the possibilities of the two situations are equal. As the
exact analytical expression of the double-update-mode
PWM model is not easy to obtain, the approximation can be
applied by averaging the two delay effects. With half
switching cycle DSP delay from 𝑥∗ to 𝑦∗, the double
update-mode PWM model of the bipolar switched H-bridge
is given by Fig. 6: Simulated digital small signal of sinusoidal PWM
voltage
𝐺 ∗𝑝𝑤𝑚(𝑠)=𝑇𝑠(𝑒 −𝑠(2−𝐷)𝑇𝑠+𝑒 −𝑠(1+𝐷)𝑇𝑠) (3.3)
4

IJISRT23MAY381 www.ijisrt.com 1563


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
 OUTPUT STAGE: It consists of the final pure sine wave V. APPLICATION
inverter signal. During the test, it can be seen that there
were less harmonics on the sine wave because of the The microcontroller used is ATmega328 in Arduino
inclusion of the LOW pass filter. nano board. This is shown figure 10 below.

Fig. 10: Arduino nano

VI. TESTING THE MODELED PURE SINE WAVE


INVERTER IN PROTEUS
Fig. 7: Simulated output voltage
The Arduino software can be used to program an
Arduino nano. Select the nano board by clicking the Tools
option. The boot loader for the ATmega328 microcontroller
on the Nano board is preprogrammed. With the help of this
boot loader, fresh code can be uploaded without a third-
party hardware programmer. This can be communicated
with via the STK500 protocol. Here, the boot loader can
also be disregarded, and the microcontroller software can be
executed using an Arduino ISP and the in-circuit serial
programming (ICSP) header.

The program is written in C/C++ programming


language. The program is written to generate a small signal
SPWM at its output which is interfaced to H bridge stage of
the inverter. The program is compiled using Arduino
integrated development environment (IDE) and exported as
Hex file. This hex file is imported into the proteus software
Fig. 8: Simulated digital small signal SPWM at MOSFET on the microcontroller model we used. The simulation will
driver and the output voltage not run if there is no code on the microcontroller. Hence,
with the code imported, simulation can commence.

Fig. 9: The simulation environment in Proteus software Fig. 11: Arduino IDE

IJISRT23MAY381 www.ijisrt.com 1564


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
The simulation diagram in figure 5 is replicated in real A = 0;
life with the H bridge (four MOSFET connected in H Timer1.initialize(t_pwm);
topology) and the step up transformation stage. Of course, Timer1.attachInterrupt(generate_sinus);
the filter stage removes the harmonics on the sinusoidal //samples=(total_sample*2/3);
waves. The complete program for the simulation is shown in Timer1.pwm(outA,(sinus[sample]* A));
appendix A. Timer1.pwm(outB,(sinus[sample]* A));
}
VII. CONCLUSION void loop() {
potinputval = analogRead(potinput);
Although there has been a lot of progress in the field feedbackinputval = analogRead(feedbackinput);
of pure sine wave inverters, the difficulty of producing a while (feedbackinputval < potinputval ) {
waveform with low harmonic content and good efficiency if (A >= max_power) {
remains. There are methods for doing this, but it is potinputval = analogRead(potinput);
necessary to adopt one that is also simple to produce and feedbackinputval = analogRead(feedbackinput);
use, especially for low power applications. This study }
analyzed existing methodologies and attempted to develop a else {
low power application solution that is simple to deploy, A = A + 1;
affordable, and reliable from the consumers' point of view potinputval = analogRead(potinput);
once implemented. We have made an effort to develop an feedbackinputval = analogRead(feedbackinput);
inexpensive design for low power applications. }
This research draws the conclusion that this method is }
an affordable, adaptable, and effective way to design pure while (feedbackinputval>potinputval ) {
sine wave inverters. if (A == 0) {
potinputval = analogRead(potinput);
VIII. APPENDIX A feedbackinputval = analogRead(feedbackinput);

#include <TimerOne.h> }
#define potinput A0 else {
#define feedbackinput A1 A = A - 1;
#define outA 9 potinputval = analogRead(potinput);
#define outB 10 feedbackinputval = analogRead(feedbackinput);
}
int f_pwm =20000;//max 20000 }
int f_sine =50; }
float sinus[200];
float phi=3.14; void generate_sinus(){
generate();
int flag = 0; }
int sample=0,samples=0;
int potinputval; void generate(){
int feedbackinputval;
int A; if(sample>=total_sample && flag==1 ){
int max_power=800;//max 1023 flag=0;
float invert=0.0; sample=1;
int total_sample; //TCCR1A=0b10100000;
int phase =0,x=0;
}
void setup() {
total_sample if(sample>=total_sample && flag==0){
=round((((1000000./f_sine)/(1000000./f_pwm))/2.)); flag=1;
for (int sudut=0;sudut<total_sample;sudut++) sample=1;
{ //TCCR1A=0b10100000;;
float rad= sudut*(180./total_sample)*phi/180; }
sinus[sudut]=sin(rad); sample++;
} if(flag==0){
Timer1.pwm(outA,(sinus[sample]* A));
float t_pwm=(1000000./f_pwm); //PORTB=(0<<PORTB3);
delay(1000); Timer1.pwm(outB,0);
pinMode(potinput, INPUT); }
pinMode(feedbackinput, INPUT); if(flag==1){
pinMode(LED_BUILTIN,OUTPUT); Timer1.pwm(outA,0);

IJISRT23MAY381 www.ijisrt.com 1565


Volume 8, Issue 5, May 2023 International Journal of Innovative Science and Research Technology
ISSN No:-2456-2165
//PORTB=(1<<PORTB3);
Timer1.pwm(outB,(sinus[sample]* A));

}
}

REFERENCES

[1.] Oladimeji T.T. and Okereke C.O. Performance


Analysis of a Branded and Locally Constructed
Modified 1KVA Sine Wave Solar Power Inverter for
Domestic Electric Power Supply. Journal of
Electrical & Electronic Systems 7: 254. 2018. doi:
10.4172/2332-0796.1000254
[2.] A. E. Abioye, M. O. Ogbuatu, M. O. Oluwe, B. O.
Egonwa and K. Ekiokeme. Design and Construction
of 1 KVA Power Inverter System. Journal of
Engineering Research and Reports 2(1): pp.1-14,
2018; Article no.JERR.42644
[3.] “Why Inverters are taking the Lead in Nigeria’s
Search for Alternative Energy Sources”. Crosstech
Nigeria. Retrieved from
https://crosstech.com.ng/why-inverters-are-taking-
the-lead-in-nigerias/
[4.] Jamal A. Mohammed. Performance Study of a
Modified Sine Wave Inverter. Eng. & Tech. Journal,
Vol. 28, No. 2, 2010
[5.] Emira, A.A. & Mohieldin, Ahmed & Sanchez-
Sinencio, E.. A 100MHz, 8mW ROM–less quadrature
direct digital frequency synthesizer. IEEE Journal of
Solid-state Circuits - IEEE J SOLID-STATE
CIRCUITS. 37. 427 - 430. 10.1109/JSSC .2002.
803008.
[6.] Meraj Hasan, Junaid Maqsood, Mirza Qutab Baig,
Syed Murtaza Ali Shah Bukhari, Salman Ahmed.
Design & Implementation of Single Phase Pure Sine
Wave Inverter Using Multivibrator IC. 2015 17th
UKSIM-AMSS International Conference on
Modelling and Simulation
[7.] Ifeagwu N. E., Alor M.,Ugwu C.I., 2016.
Performance Analysis of better Designed Pure Sine
Wave Inverter in Mitigating Frequent Power Outages
in Nigerian Homes. International Journal of Trend in
Research and Development, Volume 3(4), ISSN:
2394-9333
[8.] Sudeep K. Pyakuryal. Control of Harmonics In 6-
Pulse Rectifiers. A Dissertation Presented to the
Faculty of the Daniel Felix Ritchie School of
Engineering and Computer Science, University of
Denver, 2013.
[9.] Praven Palanivel and Subhransu Sekhar Dash.
Multicarrier pulse width modulation methods based
three phase cascaded multilevel inverter including
over modulation and low modulation indices.
Conference: TENCON 2009 - 2009 IEEE Region 10
Conference, February 2009.

IJISRT23MAY381 www.ijisrt.com 1566

You might also like