- Open Access
- Authors : Moez Youssef , Chokri Boubahri , Fethi Aloui , Seiffallah Fetni
- Paper ID : IJERTV9IS080237
- Volume & Issue : Volume 09, Issue 08 (August 2020)
- Published (First Online): 29-08-2020
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License: This work is licensed under a Creative Commons Attribution 4.0 International License
Simulation and Design of A Single Phase Inverter with Digital PWM Issued by An Arduino Board
Moez Youssef 1
1 Associate Professor,
Department of Electromechanical Engineering, Military Academy, Foundouk Jedid, Nabeul, Tunisia.
Fethi Aloui 3
3 Assistant Professor,
Department of Electromechanical Engineering, Military Academy, Foundouk Jedid,
Nabeul, Tunisia.
Chokri Boubahri 2
2 Assistant Professor,
Energy and Environment Research Unit, National School of Engineering of Tunis, University of Tunis El Manar, BP 37, Belvedere 1002 Tunis-Tunisia.
Seifallah Fetni 4
4 Assistant,
Energy and Environment Research Unit, National School of Engineering of Tunis, University of Tunis El Manar, BP 37, Belvedere 1002 Tunis-Tunisia.
Abstract The current paper has as major purpose the design of a single-phase inverter for educational purposes. This project has the aim to use Arduino board to ease the Pulse Width Modulation (PWM) implementation on a single-phase inverter, substituting analogical circuitry. To achieve those aims, a first complete theoretical analysis will be made, including the study of the different conventional PWM techniques. The complete design is modeled in Proteus software and its output is verified practically.
Keywords Single-phase inverter, PWM, Arduino; Proteus simulations
-
INTRODUCTION
Inverters are circuits that transfer power from a DC source to an AC load. Inverters are used in applications such as adjustable-speed ac motor drives, uninterruptible power supplies (UPS), active filters, flexible ac transmission systems (FACTS), running ac appliances from an automobile battery…
Inverters can be classified into many types based on output, source, type of load…
– Specific Harmonic Elimination (SHE)
The main objective of this project is the design, simulation and testing of a single-phase inverter for educational purposes. In order to achieve this, the first step is a theoretical reminder about inverters. The most important task in this project is the implementation of the PWM modulation digitally. For this purpose, the way to obtain the PWM signal from the Arduino board is explained. After that, Proteus simulations are carried out in order to have a better idea about the results expected. Once the theoretical simulation is made, the circuit should be built into a protoboard for real testing.
-
THEORETICAL BACKGROUND
Inverters are circuits that convert DC to AC. The full- bridge converter of Fig.1 is the basic structure of an inverter.
S1 S2
T1 D D2
Complete classification of inverter circuits is as follows: TABLE I. classification of inverter circuits
VDC
1 Load T2
L i R
Output
Source
Type of Load
-Square Wave
-Sine Wave
-Current Source
-Voltage Source
-Single Phase
-Three Phase
Output
Source
Type of Load
-Square Wave
-Sine Wave
-Current Source
-Voltage Source
-Single Phase
-Three Phase
T4 D4 u
T3 D3
There are several control techniques for inverters. The most common one is the Pulse Width Modulation (PWM) technique. The main aim of these modulation techniques is to enhance the output of the inverters by obtaining an output voltage or current very close to sine waveform. PWM technique provides a way to push harmonics to higher frequencies, making filtering easier. There are many types of modulation techniques, the most familiar are:
-
Sinusoidal Pulse Width Modulation (SPWM)
-
Modified Pulse Width Modulation (MPWM)
-
Random Pulse Width Modulation (RPWM)
-
Space Vector Modulation (SVM)
-
Delta Modulation (DM)
S4 S3
Fig.1: the full-bridge inverter
The switches S1, S2, S3, S4 in the full-bridge inverter must be capable of carrying both positive and negative currents. Therefore, a feedback diode is placed in parallel (antiparallel) with each switch.
The semiconductor devices T1, T2, T3, T4 must be fully controllable switches which can be turned on and off (such as BJT, MOSFET, JFET, IGBT, GTO, MCT).
-
The square-wave inverter
The simplest switching scheme for the full-bridge converter produces a square wave output voltage. The
switches connect the load to VDC for first half cycle 0 < t < T/2 when S1 and S3 are closed, or to VDC for second half cycle T/2 < t < T when S2 and S4 are closed. The periodic switching of the load voltage between VDC and -VDC produces a square wave voltage across the load.
The current waveform in the load depends on the load components. For a resistive load, the current has the same shape of the output voltage. An inductive load will have a current closer to a sinusoidal form than the voltage because of the filtering property of the inductance.
In order to have the exact expression of current for a series RL load, the following two equations must be solved:
For [0, ] : S and S are closed :
corresponding impedance increases, both resulting in small currents for higher-order harmonics as shown in Fig.3:
VP2
20
15
10
5
0
I2
0.08
0.06
0.04
0.02
0
0 800 1600 2400 3200 4000
Frequency (Hz)
Fig.3: output voltage and current spectrum
2 1 3
= = +
(1)
The quality of a non-sinusoidal wave can be expressed in
terms of total harmonic distortion (THD). The closer the
For [ , ] : S2 and S4 are closed :
2
waveform to sinusoidal, the smaller is the THD.
=
It can be shown that:
= +
(2)
For square wave inverter with (VDC=12V, R=25, L=100mH, f=400Hz), the THD output voltage and the THD load current are respectively:
For [0, ]:
2
= 48.3% (8)
() =
+ (
)
(3)
= 12.2% (9)
In conclusion, for square wave inverter, the first harmonics
[ [For , ]:
are very close to the fundamental which makes filtering
2
() =
+ ( +
+ ( +
)
1
1
(/2)
(4)
difficult. On another hand, the THD level proves that the quality of the output waveforms had to be improved.
Where = and
=
/2
= ( )
-
PWM inverter
1+ /2
The square wave output voltage u(t) and the steady-state current waveform i(t) for an R-L load are shown in Fig.2:
VP2
12
6
0
-6
-12
I2
Pulse-width modulation (PWM) provides a way to decrease the total harmonic distortion of load current; the harmonics will be at much higher frequencies than for a square wave, making filtering easier.
There are many types of modulation techniques. In this project, two types of PWM will be used:
-
Sinusoidal Pulse Width Modulation (SPWM)
-
Specific Harmonic Elimination (SHE)
0.08
0.04
0
-0.04
-0.08
0.5 0.50125 0.5025 0.50375 0.505 0.50625 0.5075 0.50875 0.51
Time (s)
- <>Sinusoidal Pulse Width Modulation (SPWM)
In the sinusoidal pulse width modulation (SPWM), the gate control signals are generated by comparing a sinusoidal reference voltage signal (vsine) with a high-frequency triangular carrier voltage signal (vtri). The intersection points
Fig.2: output voltage and current for an R-L load (VDC=12V, R=25,
L=100mH, f=400Hz)
Since the objective of the inverter is to supply a load with an AC current, it is useful to describe the quality of the ac output voltage and current: a Fourier analysis is necessary. The output voltage u(t) and load current i(t) must be expressed in terms of a Fourier series.
In the case of the square wave u(t), the Fourier series contains the odd harmonics and can be represented as:
of the sinusoidal reference voltage signal and the triangular carrier voltage signal determine the turn on and turn off instants of the switching devices.
When > : 1 and 3 are closed then: = When < : 2 and 4 are closed then: = This version of PWM is bipolar because the output
alternates between + and .
Fig.4 illustrates the principle of sinusoidal bipolar pulse- width modulation.
() = 4
sin (2)
(5)
()
For the load current i(t), the Fourier series is as follows:
() = () sin (2 + )
The amplitude of each current term is given by:
(6)
4 4
= =
(7)
|| 2+(2)2
As the harmonic number n increases, the amplitude of the Fourier voltage component decreases and the magnitude of the
Fig.4: principle of bipolar SPWM
Two important parameters characterize the SPWM:
- <>Sinusoidal Pulse Width Modulation (SPWM)
-
The frequency modulation ratio mf , defined as the ratio of the frequencies of the carrier and reference signals:
+
=
=
(10)
1 2 3 4
-
The amplitude modulation ratio ma , defined as the ratio of the amplitudes of the reference and carrier signals:
2
,
=
=
,
(11)
Fig.7: output voltage for bipolar PWM
Simulation with PSIM for the following values: =
50,
= 7,
= 2 gives the following waveforms for
3
The rms value of the fundamental and the harmonics for
the ouput voltage u are given by:
output voltage and current:
= 42 [1 cos
+ cos
cos +
2 1 2 3
Fig.5: output voltage and current for SPWM (
= 50,
cos 4] (13)
With four angles (1, 2, 3 and 4), four harmonics can be eliminated. Logically, harmonics 3, 5, 7 and 9 must be eliminated. To find the adequate angles the following system of equations must be solved:
1
2 cos 31 + cos 32 cos 33 + cos 34 = 0
1
1
1
cos 51 + cos 52 cos 53 + cos 54 = 0 2
= 7,
= 2)
3
cos 71 + cos 72 cos 73 + cos 74 = 0
2
The output voltage and current spectrum are given in
1
cos 9
+ cos 9
cos 9
+ cos 9 = 0
Fig.6: {2 1
2 3 4
(14)
The angles are found by means of iterative algorithms as no analytical solutions can be derived. This task is performed by the Matlab software as following:
Fig.6: output voltage and current spectrum for SPWM
Fig.6 shows that thanks to SPWM technique, the first considerable harmonic is at 350Hz which corresponds to
× .
On another hand, the THD load current is:
= 28.3% (12)
The unfiltered PWM output current has a relatively high
THD, but the harmonics are at much higher frequencies than for a square wave, making filtering easier.
-
Specific Harmonic Elimination (SHE)
-
The specific harmonic elimination modulation consists in determining a set of switching angles in order to eliminate certain harmonics in the PWM inverter output.
The output voltage for bipolar PWM has the following form:
Fig.8: Matlab code used to find switching angles
The code gives the following result:
Fig.9: the four switching angles
These angles will be used later in the Arduino code.
-
-
ARCHITECTURE OF THE SINGLE PHASE INVERTER
The block diagram of the whole circuit is shown in Fig.10:
DC Power Source
Power circuit
Load
DC Power Source
Power circuit
Load
Driver circuit
Driver circuit
Arduino board
Computer
Arduino board
Computer
Fig.10: Block Diagram of Single Phase Inverter
The block diagram has three modules:
-
Power Circuit Module
-
Control Circuit Module
-
Driver Circuit Module
-
Power circuit module:
The power circuit consists of the full-bridge inverter shown in Fig.1. The input to the power circuit is a DC source
Generally micro controllers generate PWM signals of very low range which is not sufficient for the switches to turn on so a gate driver circuit is designed for that purpose. In this paper, IR2110 is used for this purpose.
As explained on its datasheet, it is a high voltage, high speed MOSFET and IGBT driver with independent high and low side output channels.
Fig.12: Typical connection of IR2110
The list of components used is given in the following table.
4 x MOSFET
IRF540
2 x Driver
IR2110
6 x Diode
1N4007
4 x Resistor
47
4 x Resistor
1k
2 x Capacitor
22µF/50V
2 x Capacitor
100nF
4 x MOSFET
IRF540
2 x Driver
IR2110
6 x Diode
1N4007
4 x Resistor
47
4 x Resistor
1k
2 x Capacitor
22µF/50V
2 x Capacitor
100nF
TABLE II. List of components used
(
= 12). The full-bridge contains four MOSFET
(IRF530) and four antiparallel diodes (1N4007).
The load is an R-L series circuit with = 25 and = 100.
-
Arduino board:
For this project an Arduino UNO will be selected. Widely employed in basic programming projects, it contains a 16MHz clock, 14 digital input/output pins, 6 analog inputs and 6 PWM outputs. It is based on Atmega 328P microcontroller and can be powered via USB connection or by an external power supply.
Fig.11: Arduino UNO board
The main advantages of Arduino are:
-
-
Simple and clear programming environment.
-
Inexpensive.
-
Open source and extensible software and hardware.
-
Wide range of tutorials and information available.
Thus, it seems to be the perfect choice for educational purposes, allowing students to take their first steps in programming.
The Arduino UNO board is used to produce the PWM pulse. This PWM pulse oscillates between 0 and 5 Volts. In order to have the appropriate voltage level on MOSFET gates, the pulse obtained from Arduino board must be given to the driver circuit.
-
Driver circuit module:
-
-
PROTEUS SIMULATIONS
D6
D6
C4
100nF
C4
100nF
C2
22uF
C2
22uF
U2
U2
1N4007
1N4007
3
3
Q2
IRF530
Q2
IRF530
6
6
10
10
VB>
VB
VC
VC
HIN PIN7
HIN PIN7
R2
10
R2
10
D2
1N4007
D2
1N4007
7
5
1
7
5
1
11
11
HO VS LO
HO VS LO
SD
SD
12
12
COM
COM
LIN PIN7
LIN PIN7
R4
1k
R4
1k
2
2
IR2112
IR2112
LOAD
LOAD
Q3
IRF530
Q3
IRF530
R7
10
R7
10
D3
1N4007
D3
1N4007
R9
1k
R9
1k
In this section, Proteus simulations are carried out for the square wave and the PWM inverters (SPWM+SHE).
VDC
VDC
D5
D5
C1
22uF
C1
22uF
C3
100nF
C3
100nF
1N4007
1N4007
U1
U1
3
3
Q1
IRF530
Q1
IRF530
10
10
6
6
PIN7
PIN7
HIN
HIN
VC
VC
VB
VB
R6
10
R6
10
11
11
7
5
1
7
5
1
D1
1N4007
D1
1N4007
SD
SD
HO VS LO
HO VS LO
12
12
PIN7
PIN7
LIN
LIN
COM
COM
R3
1k
R3
1k
2
2
IR2112
IR2112
Q4
IRF530
Q4
IRF530
R8
10
R8
10
D4
1N4007
D4
1N4007
R5
R5
1k
1k
Fig.13: Proteus model of the whole circuit
-
Square wave inverter:
PIN7 of the Arduino board deliver a pulse that oscillates between 0 and 5V. The following code must be written with the Arduino Software (IDE).
Fig.14: Arduino code for square-wave inverter
Simulation results for the square-wave inverter are given in Fig.15. The frequency is = 400, the load values are
= 25 and = 100.
Fig.15: Proteus simulation for square wave inverter
The red and yellow waveforms represent respectively the load current and the output voltage.
-
SPWM inverter:
As explained previously, for the SPWM inverter, the turn on and turn off instants of the switching devices are determined from the intersection points of a sinusoidal reference voltage signal and a triangular carrier voltage signal. These intersection points are determined by MATLAB.
2
2
As a first step, a MATLAB code (Fig.16, Fig.17) permits to plot both sinusoidal and triangular signals and to find the abscissas of the intersection points of the two signals. The
Fig.16: MATLAB code to determine turn on and turn off instants of the switching devices
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
Fig.17: sinusoidal and triangular signals and their intersection points
The abscissas of the intersection points of the two signals given by MATLAB are:
{0.0008 ; 0.0019 ; 0.0040 ; 0.0045; 0.0068; 0.0075; 0.0094;
0.0108; 0.0119; 0.0140; 0.0145; 0.0168; 0.0175; 0.0194}
These values are injected in the arduino code in order to generate the SPWM signal. The following code must be written with the Arduino Software (IDE).
parameters of the SPWM are:
= 50,
= 7, =
3
3
Fig.18: Arduino code for SPWM inverter
Simulation results for SPWM inverter are given in Fig.19.
Fig.19: Proteus simulation for SPWM inverter
The red and yellow waveforms represent respectively the load current and the output voltage.
Fig.20 shows output voltage (green) and current (red) spectrum.
Fig.20: output voltage and current spectrum for SPWM
Fig.20 shows that the first considerable harmonic is at 350Hz which corresponds to × .
-
Specific Harmonic Elimination modulation (SHE):
As explained previously, the specific harmonic elimination modulation consists in determining a set of switching angles in order to eliminate certain harmonics in the PWM inverter output. These angles are obtained from Matlab by resolving the system (14). The switching angles (shown in Fig.9) are injected in the arduino code in order to generate the SHE modulation signal. The following code must be written with the Arduino Software (IDE).
Fig.21: Arduino code for SHE inverter
Simulation results for SHE modulation inverter are given in Fig.22.
Fig.22: Proteus simulation for SHE inverter
The red and yellow waveforms represent respectively the load current and the output voltage.
Fig.23 shows output voltage (green) and current (red) spectrum (FFT).
Fig.23: output voltage and current spectrum for SHE PWM Fig.23 shows that the first considerable harmonic is at 550Hz which corresponds to 11 × . Harmonics 3,5,7,9 are quasi eliminated.
-
-
EXPERIMENTAL RESULTS
Fig.24 shows the practical circuit performed on a protoboard.
Fig.24: complete circuit setup
Fig.25, Fig.26 and Fig.27 show practical results respectively for square wave inverter, SPWM inverter and specific Harmonic Elimination modulation inverter. Yellow waveform represents the load current. The blue waveform represents the output voltage.
Fig.25: practical results for square wave inverter
Fig.26: practical results for SPWM inverter
Fig.27: practical results for the specific Harmonic Elimination modulation inverter
Practical measurements confirm Proteus simulation for all the studied cases.
-
CONCLUSION
In this project, a single phase inverter is designed. For this inverter, the pulses needed for switching semiconductor devices are generated using the Arduino Uno board and the IR2110 driver.
The most important task in this project is the implementation of the PWM modulation on the Arduino board. Two types of PWM modulation are studied: sinusoidal Pulse Width Modulation (SPWM) and Specific Harmonic Elimination (SHE).
Before performing experimental measurements, simulations with the Proteus software are carried out for the square wave and the PWM inverters (SPWM+SHE). The simulations results obtained are in accordance with measurements.
Through this project, the most important conclusion is that Arduino offers a simple and efficient programming environment suitable for PWM converters.
REFERENCES
-
R.Senthilkumar and M.Singaaravelu, Design of single phase inverter using dsPIC30F4013, International Journal of Engineering Science and Technology, Vol. 2 (11), 2010, pp. 6500-6506.
-
A. A. Mamun, M. F. Elahi, M. Quamruzzaman and M. U. Tomal, Design and Implementation of Single Phase Inverter, International Journal of Science and Research (IJSR), Volume 2 Issue 2, February 2013, pp. 163-167.
-
B. Ismail, S.Taib, A. R Mohd Saad, M. Isa and C. M. Hadzer, Development of a Single Phase SPWM Microcontroller-Based Inverter, First International Power and Energy Coference PECon 2006, November 28-29, 2006, Putrajaya, Malaysia, pp. 437-440.
-
S. K. Singh, H. Kumar, K. Singh and A. Patel, A survey and study of differnt types of PWM techniques used in induction motor drive, International Journal of Engineering Science & Advanced Technology (IJESAT), Volume-4, Issue-1, 018-122, Jan-Feb 2014, pp.18-22
-
Elisa Braco Sola, Design and simulation of a single phase inverter with digital PWM, Bachelor Final Thesis Industrial Technologies Engineering, University of Applied Sciences Hochschule Niederrhein, Krefeld, Germany. July 2016.
-
S. Mecheri, Réalisation dun onduleur de tension controlé par une carte arduino, Department of electrical engineering, Constantine University, Algeria Submitted for the requirements for the Degree of Master in Electrotechnics, May-2014.
- [Online]. Available: https://www.f-legrand.fr/scidoc/index.html.
-
M. H. Rashid and F. L. Luo, Power Electronics Handbook: Devices, Circuits and Applications, 2nd ed. New York: Elsevier Academic, 2006.
-
D.W Hart, Power Electronics, McGraw-Hill, 2011.