International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 6 Design and Implementation of Three Phase PWM Inverter Control Using Microcontroller Eng. Kalyankolo Umaru 1 , Kigenyi Abdunulu 2 , Kavuma Lawrence 3 , Isabirye William 4 , Enerst Edozie 5 , Zaina Kalyankolo 6 Department of Electrical, Telecommunication and Computer Engineering, Kampala International University, Uganda umaruseku53@gmail.com 1 , abdunurual12@gmail.com 2 , kevylauran@yahoo.com 3 , williamkyne90@gmail.com 4 , enerst.edozie@kiu.ac.ug 5 , zynak208@gmail.com 6 Abstract: This paper presents an advanced three phase inverter topology the Z-Source Inverter and its control using microcontroller Atmega 328P. Z-Source Inverter employs second order filter network at front end which provides unique buck- boost feature for inverter. Z-Source inverter can be controlled by any traditional PWM method. Here the modified maximum constant boost PWM method is utilized for Z-Source inverter control. The microcontroller Atmega 328P is used to generate PWM pulses and to control operation of Z-Source inverter. The complete hardware is designed to drive the three phase induction motor. The hardware design involves the design of control circuit, driver circuit, Z-Source network, main inverter bridge, power supply etc. The Z-Source inverter is implemented and tested to verify the Z-Source inverter concept. The desired three phase PWM signals are generated by using control circuit and detailed hardware results are presented. Keywords: driver, maximum constant boost, microcontroller, PWM, voltage boost, Z-Source Inverter 1. Introduction In most of the industries traditional voltage source and current source inverters are used to drive induction motor systems. For efficient power utilization various new PWM techniques are developed and still developing. Impedance-source inverter also referred as Z-Source Inverter is an advanced PWM inverter topology. Z-Source Inverter is more advantageous over traditional inverters with high efficiency, improved power factor and THD, EMI immunity and so on. Nowadays PWM control method is mostly used in power converter applications. These PWM signals can be generated using analog circuit as well as digital circuit. PWM generation using analog circuit requires large number of discrete circuits such as triangular carrier wave generator circuit, sine wave generator circuit; comparator, adder circuits and phase shifters etc. Each of these circuits is formed by connecting many discrete components together such as transistors, resistors, capacitors, inductors, op-amps and so on. In addition analog method of three phase PWM generation requires accurately designed phase shifter circuits and other circuit. Also the response of analog circuit may get affected by environmental conditions, noise, changes in the voltages and currents in the circuit and so on. Thus analog method is critical and increases complexity and cost of the circuit. Digital method of PWM generation requires only microcontroller and its minimum configuration. With the advent in the technology now many microcontrollers has in built feature of PWM generation. While some special controller ICs are also available that are designed and fabricated for three phase PWM generation and control purpose. PWM generation digitally require only knowledge of internal architecture of controller and good programming skill. In this work microcontroller 89C52 is used for three phase PWM generation and inverter control. 2. Block Diagram and Working Block diagram of the Z-Source inverter fed induction motor drive system is shown in the fig.1. DC voltage source can be a battery, fuel-cell stack, diode rectifier, and/or capacitor. An impedance network abbreviated as Z-Source is couples the inverter main circuit and input power source. Z-Source circuit consists of two capacitors and two inductors connected in such a way as to form second order filter, smoothen dc link voltage and current. Z-source inverter circuit provides both voltage buck and boost properties, which cannot be achieved with conventional voltage source and current source inverters. Three phase inverter circuit consists of six switches connected in three legs, converts input dc link voltage in to corresponding three phase ac voltage. Microcontroller and driver circuit is used to control on/off time of switching devices in a proper sequence in a particular time used in the main inverter circuit. Microcontroller Atmega 328P is used to generate modified maximum constant boost PWM signal. These PWM signal is applied to the gate terminals of MOSFETs through gate driver circuit. The potentiometer is interfaced to microcontroller port pins to set the duty cycle of PWM signal and to interrupt microcontroller to start and stop sending PWM signal at port pins. 3.0 HARDWARE OVERVIEW The detailed hardware circuits and explanation is presented in this section. The complete hardware is designed for induction motor control. The complete hardware design involves the design of control circuit, gate driver circuit, low power dc supply, high power dc supply, Z-Source network and the inverter circuit, selection of switches etc. mailto:umaruseku53@gmail.com2 mailto:abdunurual12@gmail.com2,%20kevylauran@yahoo.com3,%20williamkyne90@gmail.com4,%20enerst.edozie@ mailto:abdunurual12@gmail.com2,%20kevylauran@yahoo.com3,%20williamkyne90@gmail.com4,%20enerst.edozie@ International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 7 Fig.1. Z–Source inverter fed induction motor drive 3.1 DC Power Supply DC power supply is designed for obtaining 5V and 12V supply. Regulator ICs 7805 and 7812 are used to regulate the DC output at 5V and 12V respectively. 5V supply is used for the operation of the microcontroller board while 12 V supply is used for the MOSFET/IGBT gate driver circuit. 3.2 MICROCONTROLLER CONTROL CIRCUIT For PWM generation microcontroller Atmega 328P is used. The control circuit diagram is shown in the following fig.2, drawn using Proteus software. This circuit includes a potentiometer for varying the duty cycle and one led interfaced to port3 pins, gate driver circuit not shown interfaced to PWM output port2 pins and microcontroller minimum circuit. Five switches are replaced with a potentiometer to interrupt microcontroller, increment, decrement shoot-through time and input voltage values and to change the mode of operation. Fig.2. Microcontroller interface diagram In traditional mode of operation traditional PWM is generated, while in boost mode of operation some part of traditional zero state is converted into shoot-through state. The six PWM signals are send at port P2 pins P2.0 through P2.5. The control circuit simulation is performed using Proteus software. 3.3 GATE DRIVE CIRCUIT Gate drive circuit for MOSFETs and IGBTs usually contains input opto-isolation, input buffer amplifier and totem pole arrangement of gate driving transistor with high current sink and source capability. There are number of gate driver ICs available in the market that are designed to drive power transistors such as MOSFETs, IGBTs. In this project the gate driver IC PC923 is selected from SHARP Company. It has following salient features such as 1. Built-in direct drive circuit for MOS-FET/IGBT drive (IO1P, IO2P:0.4A). 2. Opto-isolation, High isolation voltage VISO = 5000 Vrms between input and output. 3. High speed response ( tPLH , tPHL: max 0.5us). 4. Wide operating supply voltage range (Vcc:15 to 30V, Ta= -10 to 60˚C). 5. High noise reduction type (CM H = MIN.-1500V/ µs) (CML=MIN. 1500V/µs). International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 8 Fig.3. shows typical gate drive circuit using PC923. PC923 consists of IR led at input side between pin no.2 and 3, with cathode at pin no.3. +5V supply is connected to pin no.2 (anode) and pin no.3 (cathode) is connected to port2 pin through a current limiting resistor 1.2k. Fig. 3. Gate drive circuit using PC923 PWM input is applied to pin no.3 from microcontroller port pin. Pin no.6 of PC923 is an output pin connected to gate terminal directly through a small 33Ω/0.5W resistor. Pin no.7 is ground pin, but for upper inverter switches in Inverter Bridge pin no.7 is connected to common point. A bootstrap capacitor of 100uf is connected between pin no.7 and +Vcc supply pin no.8 to ensure that gate voltage is always higher by 12V (+Vcc) than common point voltage. 3.4 DC source and Inverter Circuit The three phase inverter circuit diagram is shown in the fig.4. The input DC supply from AC mains is obtained using single phase rectifier and dc capacitor of 1000uf. The dc voltage is then fed to the Z-Source network through reverse blocking ultra fast diode MUR460. The output dc link voltage is then applied across the three phase inverter. The three phase inverter circuit consists of six MOSFETs IRF840 with inbuilt anti- parallel diode. The three phase inverter circuit generates the three phase output ac voltage that is then applied to ac load. The output ac load is a three phase induction motor. Fig. 4. Schematic of the Z-source inverter system 3.4 PWM Generation Using Microcontroller Modified maximum constant boost PWM control method is most advantageous over the other PWM control methods. In this method shoot-through duty ratio and hence boost factor is maintained constant form cycle to cycle. It also reduces voltage stress across switching devices and improves performance. In this work maximum constant boost with third harmonic injected PWM signal is generated digitally through programming microcontroller. This section describes how the PWM signals can be generated using microcontroller Atmega 328P. 3.5 PWM switching pattern Table 1 shows all possible PWM states for Z-source inverter and respective PWM code pattern. The letters A, B, C indicates upper three switching devices and A‟, B‟, C‟ indicates lower three switching devices in three arms of the main inverter circuit. Two devices in the same arm cannot be switched on simultaneously in traditional inverters this state is called shoot-through state. Z- source inverter allows shoot-through state possible. As shown in table PWM for Z-source inverter consists of six active states s1- s6, two zero states and a shoot- through state (ST). The PWM code in hex is shown in the right side last column. Microcontroller sends this PWM code at the port2 at regular time instances provided by timer. All PWM code bit are complemented when passed through gate drive circuit. Thus bit 0 in Table1 implies that particular switch is ON and bit 1 implies OFF switch in each PWM state. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 9 3.6 PWM generation PWM generation using microcontroller requires instantaneous PWM pulse width data values. These pulse width data values for single phase cycle are sufficient. This PWM data is generated with respect to 16.6% third harmonic injected sinusoidal signal. Those values are stored in the look up table/array. Table 1: PWM switching pattern State C’ B’ A’ C B A PWM code(hex) S1 1 0 1 0 1 0 0x2a S2 1 0 0 0 1 1 0x23 S3 0 0 1 1 1 0 0x0e S4 0 1 1 1 0 0 0x1c S5 0 1 0 1 0 1 0x15 S6 1 1 0 0 0 1 0x31 Zero1 1 1 1 0 0 0 0x38 Zero2 0 0 0 1 1 1 0x07 ST 0 0 0 0 0 0 0x00 Using three different pointers PWM pulse width data values corresponding to the three phase waveform are accessed. These pointers are adjusted so as to point to pulse width values that are 1200 degree phase shift apart in time from other. The number of PWM pulses per cycle is equal to fc/fm. Where fc is carrier frequency and fm is modulating signal frequency. This number must be divisible by three in order to obtain synchronous three phase PWM waveforms. For example if fc = 3600Hz and fm = 50Hz then number of pulses per cycle is equal to 72. This number is divisible by three 72/3 = 24. So while accessing the pulse width values first pointer points to zero location, second pointer points to 24th location of array and at the same time third pointer points to 48th location of array. The following steps illustrate the algorithm to obtain the three phase PWM waveforms using microcontroller; 1) Access the three phase synchronous PWM pulse width data values from look up table using three different pointers to look up table. 2) Send the desired PWM code pattern at port pins. 3) Set the timer value with lowest pulse width value first. 4) Start the timer and wait until timer flag set. 5) Send the next desired PWM code pattern at port pins. 6) Set the timer value with next higher pulse width value. 7) Start the timer and wait until timer flag set. 8) Send the next desired PWM code pattern at port pins. 9) Set the timer value with next higher pulse width value. 10) Start the timer and wait until timer flag set. 11) Increment pointer by one and loop back step 1. The dead time can be provided through program at requisite time while sending PWM code pattern. The pulse width values are accessed during zero state time only so that active state timing would not be disturbed. For obtaining PWM pulse width data for single cycle manually requires large number of calculations and a lot of time. To avoid this calculation part completely and to obtain pulse width values directly for any given modulation index and carrier frequency a C code is written and used. Three phase PWM waveforms are shown in the fig. 6.a. and fig.6.b. This is Edge aligned three phase PWM with respect to the third harmonic injected three phase fundamental components with fc = 2400Hz and fm = 50Hz. The simulation is performed using Proteus software. 3.7 PWM SIGNAL GENERATION CODE #include #include International Journal of Engineering and Information Systems (IJE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,0 ,0 , 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , 50 ,100 ,151 ,201 ,250 ,300 ,349 ,398 ,446 ,494 , 542 ,589 ,635 ,681 ,726 ,771 ,814 ,857 ,899 ,940 , 981 ,1020 ,1058 ,1095 ,1131 ,1166 ,1200 ,1233 ,1264 ,1294 , 1323 ,1351 ,1377 ,1402 ,1426 ,1448 ,1468 ,1488 ,1505 ,1522 , 1536 ,1550 ,1561 ,1572 ,1580 ,1587 ,1593 ,1597 ,1599 ,1600 , 1599 ,1597 ,1593 ,1587 ,1580 ,1572 ,1561 ,1550 ,1536 ,1522 , International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 11 1505 ,1488 ,1468 ,1448 ,1426 ,1402 ,1377 ,1351 ,1323 ,1294 , void setup(){ // Register initilisation, see datasheet for more detail. TCCR1A = 0b10100010; /*10 clear on match, set at BOTTOM for compA. 10 clear on match, set at BOTTOM for compB. */ ICR1 = 1600; // Period for 16MHz crystal, for a switching frequency of 100KHz for 200 subdevisions per 50Hz sin wave cycle. sei(); // Enable global interrupts. DDRB = 0b00000110; // Set PB1 and PB2 as outputs. pinMode(13,OUTPUT); // change duty-cycle every period. OCR1A = lookUp1[num]; OCR1B = lookUp2[num]; if(++num >= 200){ // Pre-increment num then check it's below 200. num = 0; // Reset num. } } 4.0 HARDWARE AND RESULTS The Z-source inverter system is implemented as per design. The detailed hardware configuration and its performance is analyzed in this section. Fig. 5 The Z-source inverter board and Microcontroller board 4.1 Hardware Results for Traditional PWM Inverter The input dc supply is 375V, the modulation index is fixed at 0.8, so the output ac phase voltage given by The theoretical and experimental results are tabulated in the table 1. Input DC voltage = 375V. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 12 Table 2: Observation table Sr. No. Parameter Theoretical Practical 1 DC link Voltage (V) 375 375 2 Line to Line Voltage (V) 187 180 3 Output phase voltage (V) 106 104 The output line to line voltage is found to be about 180V practically while the theoretical value is187V for Vdc = 375V. The output line to line voltage is found to be about 104V practically, while the theoretical value is 106V for Vdc = 375V. Thus experimental results are consistent with this theoretical result for traditional inverter. 4.2 Hardware Results for Z-Source Inverter When shoot-through is applied in the traditional zero states the mode of operation is called boost mode. The test is conducted at lower input voltage. The input dc voltage is set to 100V, modulation index is same M = 0.8, switching period is 365us and shoot- through state of 97us is applied, the theoretical results are obtained as 1. The boost factor B = 2.136 2. Average dc link voltage = 156V 3. Peak dc link voltage = 213V 4. The output phase voltage Vac = 60.4Vrms 5. The output line to line voltage = 104Vrms The theoretical and practical results are tabulated in the following table 3. Input DC voltage =100V Table 3: Observation table Practically it is verified that as the shoot-through time is increased the output dc link voltage and hence output ac voltage increased gradually. Practical results are consistent with theoretical results. The dc link voltage is greater than the input dc voltage. The input dc voltage is 100V while the dc link voltage peak value is about 215V. The average dc link voltage is found to be 151V. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 13 Fig. 6. Output phase voltage waveform The phase voltage is found to be 60V practically, while theoretical value is 60.4V. The line to line voltage observed is 98V, while theoretical value is 104V. As shown line to line voltage is square waveform with PWM variations. The peak to peak value of these pulses varies between ±215V. 5 Conclusion The Z-source inverter system can produce any output voltage greater than the dc input voltage by controlling the shoot-through duty ratio, which is impossible for the traditional ASD systems. In this work, described the hardware implementation, analyzed the circuit, and demonstrated its concept and superiority practically. Maximum constant boost with third harmonic injection PWM control method increases output voltage boost while minimizing voltage stresses across switching devices. It allows over- modulation where modulation index can be varied from 0.57 to 1.154. It requires only two reference lines for creating shoot- through pulse times. So it can be easily implemented using microcontroller Atmega 328P using it’s in-built timer. Hardware results are compared with traditional PWM inverter and are consistent with theoretical results. Microcontroller Atmega 328P is a general purpose microcontroller. It does not have in built PWM generator. PWM signals can be generated only through programming using its timer feature. Microcontroller Atmega 328P can be used to generate synchronized three phase PWM signal and speed control of induction motor. Also it offers required flexibility in control circuit operation through programming. It offers low cost solution for three phase induction motor control. For closed loop control ADC can be interfaced to the microcontroller. Besides these advantages there are some limitations that must be considered:  Timing overhead due to computations, function calls, conditional execution, jumps and Interrupt latency and so on wastes much of the microcontroller time.  These time overheads puts limits on maximum PWM frequency that microcontroller can generate. Practically it is found that even with 20MHz crystal, maximum three phase PWM frequency is limited to 5Khz. These time overheads spread in all PWM pulses evenly. Thus although synchronous PWM can be obtained but extends the PWM period evenly by some amount of time. These limitations can be overcome by using PIC, DSP or advanced microcontrollers which have in built ADC and PWM generation feature. References [1] Fang Zheng Peng, “Z- Source Inverter”, IEEE Transaction on Industry Applications. 39: 2003,2. Wuhan,China. [2] S. Rajakaruna, Member, IEEE and Y. R. L. Jayawickrama, “Designing Impedance Network of Z-Source Inverters” IEEE Transactions on industry application. [3] Miaosen Shen, Jin Wang, Alan Joseph, Fang Zheng Peng, Leon M. Tolbert, and Donald J. adams, “Constant Boost Control of the Z- Source Inverter to Minimize Current Ripple and Voltage Stress”, IEEE Transactions on industry application vol. 42, no. 3, May/June 2006 [4] Omar Ellabban, Joeri Van Mierlo and Philippe Lataire, “Comparison between Different PWM Control Methods for Different ZSource Inverter Topologies” IEEE Transactions on industry application, May/June 2010. [5] K.Niraimathy, S.Krithiga, “A New Adjustable-Speed Drives (ASD) System Based On High-Performance Z-Source Inverter”, 978-1- 61284-379-7/11 2011 IEEE, 2011 1st International Conference on Electrical Energy Systems [6] G. Pandian and S. Rama Reddy, “Embedded Controlled Z Source Inverter Fed Induction Motor Drive” IEEE transaction on industrial application, vol.32, no.2, May/June 2010. [7] S. M. Wankhede, “Micro controller Based Control of Three Phase Induction Motor Using P\Vl\1 Technique”, ICEEN/2011. International Journal of Engineering and Information Systems (IJEAIS) ISSN: 2643-640X Vol. 5 Issue 2, February - 2021, Pages: 6-14 www.ijeais.org/ijeais 14 [8] Muhammad H. Rashid, “Power Electronics”, Second Edition, Pearson Education. [9] Dr. P. S. Bhimbra , “Power Electronics”, Fourth Edition, Khanna Publn.