Implementation of SHE-PWM technique for single-phase inverter based on Arduino

ABSTRACT


INTRODUCTION
In recent years, single-phase inverter is widely utilized in numerous applications such as uninterruptible power supply for the residential consumers, single-phase micro-grid, with the vast fields of renewable energy grid-integration conversion, AC motor drives, and single-phase vehicle to grid system. A full bridge inverter is as shown in Figure 1 [1,2]. Harmonics appear at the output voltage of single-phase inverter. LOHs mainly contribute to the distortion effects in the system. Conversely, the higher order harmonics have less effect in the system. So LOHs content should be minimized or eliminated to improvement the load performances [3,4].
There are many techniques for minimizing or removing these LOHs from single-phase inverter output voltage. The most common and simplest technique is the sinusoidal PWM technique. However, this technique is implemented with high switching frequency which increases switching losses and reduces the system efficiency [5,6]. Therefore, the switching at the fundamental frequency is very desirable. Space vector PWM (SV-PWM) are also used to eliminate the distortion effect created by the LOHs especially with three phase inverters, it is considered better than sinusoidal-PWM according to DC bus utilization. But this method also operates at high switching frequency and its operation performance improves with increased switching frequency, in addition to it difficulty of implementation [7,8]. SHE-PWM is the best technique with a basic fundamental frequency (i.e. it works with low switching frequencies) in addition to it has higher utilization of DC input voltage than sinusoidal-PWM technique. SHE-PWM produces a fundamental wave at  [9]. Thus, SHE-PWM technique is considered in this work to obtain the double advantages of minor switching losses and the elimination of LOHs. The challenge of the SHE-PWM technique is to estimate the switching angles specially with increasing number of switching angles which requires solving (n) number of non-linear equations.Different types of digital controllers are utilised for the production of modulating signals for inverters; as PIC microcontroller [10,11], digital signal processors (DSPs) TMS320F2812 kit [12], complex programmable logic device (CPLD) [13], field-programmable gate array (FPGA) [14,15], and Arduino [16,17]. Arduino is preferred and it employed in this work as its availability, simplicity, its low cost, in addition to its easy programming and re-program.

SELECTIVE HARMONIC ELIMINATION
The fundamental output voltage and the undesirable harmonics of the single phase inverter can be controlled. Depending on the number of switching angles (N) per quarter wave symmetry (i.e. chopped N times per quarter-cycle). The low order harmonics can be eliminated and what remains is only the high order harmonics. The fundamental voltage is obtained with the simultaneous elimination of undesirable harmonics. The output voltage waveform shown in Figure 2 is produced by firing the inverter switches S1 to S4 at the predetermined (offline) angles 1 , 2 , … . . [18][19][20].
It can be written as: where Vdc is the dc input voltage of the bridge inverter, and n is the harmonic order. The switching angles constrain is: For example: The 5 unknown switching angles ( 1 , 2 , 3 , 4 , and 5 ) (N=5) necessity to be estimated from 5 non-linear equations based on (3) for elimination (N-1) odd harmonics that are the (3 rd , 5 th , 7 th , and 9 th harmonics) and as in (6)-(10): [ 9 1 − 9 2 + 9 3 − 9 4 + 9 5 ] = 9 = 0 (10) Where M is the modulation index= 1 , where 1 is the fundamental component of the output voltage, 3, 5, 7, 9 are the 3 rd , 5 th , 7 th , and 9 th harmonics components respectively [24,25]. An m-file using MATLAB platform is used to solve these nonlinear (6)-(10) based on "Newton-Raphson Method". Table 1 lists the switching angles for different cases of SHE. For ten angles ( 1 10 ), the number of eliminated harmonics (odd harmonics) equal to nine (3 rd to 19 th ). The LOH will be 21 st (21×50=1050 Hz), Figure 3 shows the relation between modulation index M and the switching angles.  Figure 3. Relation between modulation index and switching angles

ARDUINO CODE
The proposed Arduino codes for generation the required trigger signals for inverter switches based on SHE-PWM technique for elimination LOHs are realized according to switching angles in Table 1 and as follows:  The proposed Arduino codes are developed and edited using Arduino IDE software version 1.8.10 then verified and uploaded to Arduino Mega 2560 type via serial port.  Selecting the pin mode of the utilized Arduino pins as an "OUTPUT".  The firing pulses are made ON and OFF for certain intervals depending upon the switching angles presented in Table 1. These angles are normalized to time formula to deal with it as a time delay inside the void loop using "delay Microseconds" function and after each time delay a trigger signal is turned ON (HIGH) or OFF (LOW) using "digital Write" function according to Table 2, as shown in Figures 4 and 5.  Both power semiconductor switches in the same leg of the H-bridge may be ON at the same time due to the OFF times of the semiconductors greater than the ON times. This case reasons a short circuit in the H-bridge and thus high currents flow in the semiconductors. So, dead time should be inserted between each complement gate signals of the same leg. So in our work 4 micro seconds dead time is inserted after turned OFF each switch using "delayMicroseconds" function again. "

EXPERIMENTAL IMPLEMENTATION
To validate the results obtained in the theoretical and simulation analysis, a prototype of single phase inverter has been experimentally developed as shown in Figure 6. Power MOSFET IRFP460 is used as a main power switch in the H-bridge. A gate drive circuit based on TLP350 optocoupler is used as shown in Figure 7 for providing isolation between power switches and the Arduino, also it employed for normalize the switching pulses signals to be sufficient to trigger the power switches.

DEVELOPMENT OF THE WORK AND RESULTS
Practically, several codes were proposed and carried out in Arduino board for elimination different number of harmonic based on SHE technique. For instance, the first one considers a simple code for producing square wave output voltage (i.e. with 180° conduction angle) of the inverter as shown in Figure 8. This figure also shows the spectral analysis that assures the presence of the fundamental and all accompanying odd harmonics. The second code involves implementation code for quasi-square inverter; which considered as modified of square wave inverter. The quasi-square wave eliminates the 3 rd harmonics  Figure 9. The load is (R-L) load with R=3.6 ohm, and L=5 mH. The elimination four of LOH (3 rd , 5 th , 7 th and 9 th harmonics) after solving five non-linear equations as shown in Figure 10. Adopting this procedure the elimination of five harmonics (3 rd , 5 th , 7 th , 9 th and 11 th harmonics) is shown in Figure 11. The output terminal voltage and the load current of the inverter for ten switching angles are shown in Figure 12(a) and Figure 12(b) respectively, which shows that the LOH is 21 st in its spectral analysis. Its clear that the number of eliminated harmonics in the spectrum analysis of terminal voltage are nine harmonics, where the eliminated harmonics are from 3 rd up to 19th in SHE-PWM inverter while the 21 st harmonic order (at 1050 Hz) appears as the first harmonic as shown in the spectrum analysis of terminal voltage and load current. To validate the practical results a Simulink MATLAB model is built and according to Figure 3, ten switching angles is used in MATLAB simulation. The modulation index M=1, Vdc=300 V and the inverter frequency f = 50 Hz with R-L load of R=3.6 ohm, and L=5 mH. Figure 13 show the terminal O/P voltage and load current with their harmonics spectral analysis.
(a) (b) Figure 13. Output voltage and load current with their harmonics spectral analysis for SHE-PWM converter The LOH as in Figure 13 is the 21 st . A comparative study used for sinusoidal-PWM (SPWM) technique, the same spectrum can be obtained by setting the carrier frequency f c = 1300 Hz, the load voltage and current are shown in Figure 14. The simulation shows the number of pulses per half cycle Q equal ten pulses in SHE-PWM technique since ten switching angles per half cycle are used as in Figure 13. While Figure 14 shows Q equal to thirteen pulses where Q equal the ratio between carrier frequency to the fundamental frequency, Q = f c /2f = (1300/2*50) in SPWM. It is obvious that SPWM results in higher switching losses compared with SHE-PWM strategy. Also a slightly increase in utilization of dc input voltage for SHE-PWM compare with sinusoidal-PWM.

CONCLUSION
Experimental prototype for single phase inverter based on Arduino is built to verify the software analysis and the MATLAB/Simulink of the inverter based on SHE-PWM technique. As the number of the harmonics eliminated are increased as the THD value is decreased. On the other way the switching losses are increased. Comparison study using same LOH in the output waveform between SHE-PWM and SPWM shows that number of pulses in the gate signal and output waveform in SHE-PWM strategy are less than the number of pulses in the SPWM strategy. Thus the switching losses in SHE-PWM is less than SPWM, also in the practical implementation the dead time that is inserted in the gate signals is reduced due to the reduced number of pulses. Since this dead time result in distortion in the output waveform. A modified Newton Raphson m-file in MATLAB platform is used to calculate a wide range of switching angles according to variation of modulation index. In future work, real time variation of switching angles based on SHE-PWM technique can be adopted. Also, this technique can be applied for three-phase inverter and implemented practically based on Arduino microcontroller.