Analysis and Simulation of Single Phase Inverter Controlled By Neural Network

This paper presents the analyses and design of Neural Network (NN) control of a single phase voltage source inverter with an L-C filter using only voltage sensor. A multiple feedback loop PI (Proportional-Integral) controller for PWM (pulse width modulation) inverter is built by root-locus method then simulated using Matlab (Simulink). The proposed NN is traind off-line using the patterns obtained from the simulated inverter with multiple loop PI (Proportional-Integral) controllers. Simulation results show that the proposed NN control can achieve low total harmonic distortion under linear loading condition, small steady state error and good dynamic response under any disturbance change in load. A hardware single phase inverter with programmed pulse width modulation control based on microcontroller is built and implemented with resistive load. حٍثصعنا حكثشنا واذخرسات هٍهع شطٍسي سىطنا يدادأ شٍغي مٍثًذو مٍهذذ الله ذثع ذًدأ سىصُي عتوص ىٌشكنا ذثع مصىًنا / حٍُقرنا حٍهكنأ صهخرسًنا ًييف حٍثييصعنا حكثييشنا واذخرييسات لييقف حييٍرنىف سييسذري ور جساذيينا مييهغي شطٍييسي م ىًٍييصذو مييٍهذذ لييذثنا ازييه حٍعاُطصلاا (ANN) (سىطنا يدادا شٍغًن (single phase inverter يىعيس ًيثد خششيو حٍرنىف سذصي ور (L-C) . جساذيينا دودضيي شطٍييسي (PI controller) واذخرييسات ًييُت حيي ثُنا ضشييع ًٍٍيي ذ شييٍغًن (لا Root locus ً ىييدو ) يايَشت واذخرسات MATLAB (SIMULINK) لايصذلاا ىيطقي ىيَ ٍي ةٌسذيذ حيدشرقًنا حٍثيصعنا حكثيشنا ديتسد , ( off line دودضيًنا شطٍيسًنا عي حي ثُنا ضشيع ًٍٍي ذ شيٍغي جا اذي ٍي اهٍهع لىصذنا ىذ ةٌسذذ خاٍُع واذخرسات ) ( جساذنا (PI controller ٍُت جا اذًنا ئارَ . ايطط حثيسَ ,اذج حهٍهق خاهىشذ ىطعأ حشرقًنا حٍثصعنا حكثشنا شطٍسي ٌأ د ىيذ حٍثيصعنا حكثيشنا ئارَ ٍي مقذرهن .مًذنا شٍغٌ باشطضا يأ دذذ جذٍج حٍكٍياٌُد حتاجرساو جشقرسًنا حناذنا ًف مٍهق (مٍقد شطٍسي ىهع ًُثي يشثًنا حيثُنا ضشع ًٍٍيذ واذخرسات اٌشثرخي شٍغي صاهج مٍثًذ microcontroller .) Received: 3 – 3 2010 Accepted: 2 – 2 2012 Al-Rafidain Engineering Vol.20 No. 6 December 2012 2 1-INTRODUCTION With the increasing demands for high-quality power sources, a pulse-width modulated PWM inverter has been used as a key element for a high performance power conversion system such as uninterruptible power supplies (UPS), medical equipment and communication systems [1]. In the UPS inverter the output voltage is required to be sinusoidal with minimum total harmonic distortion (THD). This is usually achieved by employing a combination of pulse width modulation (PWM) scheme and a second order filter at the output of the inverter .One way of achieving a “clean” sinusoidal load voltage is by using sinusoidal pulse width modulation (SPWM). In this technique the load voltage waveform is compared with a reference sinusoidal voltage waveform and the difference in amplitude is used to control the modulated signal in the control circuit of the power inverter [1]. A multiple loop feedback control scheme can be utilized to achieve good dynamic response and low total harmonic distortion (THD). Although the performance of these schemes are good, the complicated algorithms and the heavy computational demands make the implementations difficult. In recent years, artificial neural networks (ANNs) have received considerable attention and their applications are now being actively explored. ANNs are computing architectures that consist of massively parallel interconnections of simple neural processor. They have the ability to approximate an arbitrary nonlinear mapping and can achieve a higher degree of fault tolerance [2]. When an NN is used in a system control, the NN can be trained either online or off-line. The most popular training algorithm for a feed forward NN is back propagation. It is attractive because it is stable, robust, and efficient [2]. In this paper, first a multiple feedback loop PI controller with inner capacitor current loop and outer voltage loop for PWM inverter is built and simulated using Matlab (Simulink) to obtain adequate example patterns. Then a selected NN with using only voltage sensor is trained off-line with data base comprising all example patterns using matlab programme. When the training is complete this ANN is used to control the inverter on-line. Simulation results show that the proposed ANNs controlled inverter achieve low THD, small steady state error and good dynamic responses under disturbance change in load or input voltage. Finally a simple hardware inverter with programmed PWM based on microcontroller is built. 2-SINGLE PHASE DC-AC PWM INVERTER As shown in Fig. (1), the inverter consists of two legs (A, B) which supplies a singlephase AC output voltage V out to the load. A certain switching algorithm is applied to each of the four switch modules T 1 , T 2 , T 3 , and T 4 in order to control the inverter to generate the desired sinusoidal output with the desired frequency and magnitude. In this paper the unipolar SPWM technique is used to drive the inverter because it gives low THD and decreases the power switches losses. Comparing a control signal V control1 with the carrier signal results a logic signal to control the switches in leg A, and comparing of V control2 with the carrier signal results in logic signal to control the switches in leg B Fig. (2) [3] [4] . Al-Rafidain Engineering Vol.20 No. 6 December 2012 3 Fig. (1): Single phase full bridge inverter Fig. (2): Unipolar PWM scheme 3-COMPONENT SELECTION The magnitude of the ripple current and ripple voltage in the output of the inverter is determined by the size of the LC filters. Once the filter size has been chosen, the PI compensator constants are chosen.. The design specifications for the proposed inverter circuit is shown in table (1) 4-OUTPUT LC FILTER DESIGN A proper design of the LC filter results in a great reduction of the inverter output harmonics and hence provides a very clean power to the load. The inductor ripple current is depend on the size of the inductor and switching frequency. Fig.(3) shows the ripple waveform of the inductor current. The value of the inductance of the output filter inductor is given by [5]:


1-INTRODUCTION
With the increasing demands for high-quality power sources, a pulse-width modulated PWM inverter has been used as a key element for a high performance power conversion system such as uninterruptible power supplies (UPS), medical equipment and communication systems [1].In the UPS inverter the output voltage is required to be sinusoidal with minimum total harmonic distortion (THD).This is usually achieved by employing a combination of pulse width modulation (PWM) scheme and a second order filter at the output of the inverter .One way of achieving a "clean" sinusoidal load voltage is by using sinusoidal pulse width modulation (SPWM).In this technique the load voltage waveform is compared with a reference sinusoidal voltage waveform and the difference in amplitude is used to control the modulated signal in the control circuit of the power inverter [1].A multiple loop feedback control scheme can be utilized to achieve good dynamic response and low total harmonic distortion (THD).Although the performance of these schemes are good, the complicated algorithms and the heavy computational demands make the implementations difficult.In recent years, artificial neural networks (ANNs) have received considerable attention and their applications are now being actively explored.ANNs are computing architectures that consist of massively parallel interconnections of simple neural processor.They have the ability to approximate an arbitrary nonlinear mapping and can achieve a higher degree of fault tolerance [2].When an NN is used in a system control, the NN can be trained either online or off-line.The most popular training algorithm for a feed forward NN is back propagation.It is attractive because it is stable, robust, and efficient [2].
In this paper, first a multiple feedback loop PI controller with inner capacitor current loop and outer voltage loop for PWM inverter is built and simulated using Matlab (Simulink) to obtain adequate example patterns.Then a selected NN with using only voltage sensor is trained off-line with data base comprising all example patterns using matlab programme.When the training is complete this ANN is used to control the inverter on-line.Simulation results show that the proposed ANNs controlled inverter achieve low THD, small steady state error and good dynamic responses under disturbance change in load or input voltage.Finally a simple hardware inverter with programmed PWM based on microcontroller is built.

2-SINGLE PHASE DC-AC PWM INVERTER
As shown in Fig. (1), the inverter consists of two legs (A, B) which supplies a singlephase AC output voltage V out to the load.A certain switching algorithm is applied to each of the four switch modules T 1 , T 2 , T 3 , and T 4 in order to control the inverter to generate the desired sinusoidal output with the desired frequency and magnitude.In this paper the unipolar SPWM technique is used to drive the inverter because it gives low THD and decreases the power switches losses.Comparing a control signal V control1 with the carrier signal results a logic signal to control the switches in leg A, and comparing of V control2 with the carrier signal results in logic signal to control the switches in leg B Fig.

3-COMPONENT SELECTION
The magnitude of the ripple current and ripple voltage in the output of the inverter is determined by the size of the LC filters.Once the filter size has been chosen, the PI compensator constants are chosen..The design specifications for the proposed inverter circuit is shown in table (1)

4-OUTPUT LC FILTER DESIGN
A proper design of the LC filter results in a great reduction of the inverter output harmonics and hence provides a very clean power to the load.The inductor ripple current is depend on the size of the inductor and switching frequency.Fig. (3) shows the ripple waveform of the inductor current.The value of the inductance of the output filter inductor is given by [5]: Where d V is the dc bus voltage, i  is the inductor ripple current and s f is the inverter switching frequency.
The output filter capacitor size is determined by the allowable output voltage ripple ∆V o and can be calculated from [5] : If the dc input voltage is limited to 350 volt and the switching frequency is limited to 15 KHz, and if the maximum inductor ripple current is limited to 20% of the maximum peak to peak output current,  In order to obtain sinusoidal load voltage with a small amount of THD, the maximum ripple voltage is limited to 1% of the maximum peak to peak output voltage, then f C is obtained  4) shows the circuit diagram of a single-phase full bridge voltage source UPS inverter followed by a LC filter, PWM generator and gate drive circuit.R f , represents the resistance of the filter inductor.The effective series resistance of the filter capacitor is ignored since it has a small effect within the concerned frequency range [2].since the inverter switching frequency (here is 15 kHz) is several orders higher than the fundamental frequency of the AC output, the dynamics of the PWM inverter can be ignored.Thus, the UPS inverter can be modeled as a simple proportional gain block (k) as shown in Fig.( 5), [2,5,6].

6-CLOSED LOOP CONTROL FOR SINGLE PHASE PWM INVERTER
The control circuit of a PWM inverter consists of two loops [1]:the first loop is a fast internal current loop to reduce the THD of the output voltage and increases the speed of the response, the second loop is a slow external voltage loop, which provides output voltage regulation.The internal current loop may be the filter inductor current loop or the filter capacitor current loop [1,5,6,7].

7-FILTER CAPACITOR CUEERNT LOOP
If the capacitor current is controlled , dynamic stiffness can be improved substantially [5].
The key issue for the capacitor current is how the sensing is performed , i.e. either via direct measurement or via an observer .One of the drawbacks of using the capacitor current feedback is the tremendous amount of switching noise present in capacitor current [6].Also the capacitor current decreases the THD of the output voltage.Another advantage of using capacitor current is that it does not need load current feed forward control to improve the dynamic response of the inverter , because the capacitor current feedback is equivalent to feeding back the inductor current loop and load current feedforward [5], where the capacitor current is the sum of inductor current and load current.This gives another advantage when it is compared with the previous items that the capacitor current loop technique needs only one sensor to sense the current , while the inductive current loop technique needs two sensors, one to sense the inductor current and the other to sense the load current.This will complicate the circuit as well as increase the cost.
In this study the control topology used in reference [5] and shown in Fig.( 6) is used.In this respect there are two PI controllers: one for inner capacitor current loop and the other for output voltage loop.

8-PRINCIPLE OF OPERATION
The output voltage is compared to a reference voltage and the voltage error signal is passed through PI compensator as shown in Fig. (6).Then the signal forms the current reference for the inner current loop.The current in the filter capacitor i c is measured and compared with the reference which forms the current error.The error is passed through another Proportional and Integral (PI) compensator to form the modulating signal.The proportional and integral constants of the PI compensators are chosen to produce a stable system with good transient response and small steady state error.The PI compensator provides high gain at low frequencies.The modulating signal is compared with a triangular carrier signal to generate the required PWM signal.

9-SELECTION OF PI COMPENSATOR CONSTANT
The parameters of the proportional and integral controller in the current loop and voltage loop are selected by using root locus method.Based upon the analysis of the control loop given in Fig. (6), an approximate linearized control model of the inverter by ignoring the resistance of filter inductor R f is shown in Fig. (7).

10-CLOSED LOOP CONTROL ANALYSIS
The stability of the closed-loop system must be ensured by root locus plot, and the peak over shot , settling time , steady-state error from the step response plot.The most important aspect in this design is the steady state error , peak overshot and settling time.10), it is observed that the settling time is approximately equal to the required value which is 1mse, the peak over shot is 13.8% and the steady state error of the output voltage is equal to zero.

11-STRUCTURE OF THE PROPOSED ANN CONTROLLER
The network chosen should be as simple as possible (with fewer inputs and fewer hidden nodes) so as to speed up the control process and to reduce the controller cost.The structure of the proposed ANN controller has three layers NN 4-3-1 (four inputs, three nodes in the hidden layer and

12-OBTAINING EXAMPLE PATTERN AND TRAINING NEURAL NETWORK
In order to obtain good example patterns for NN off-line training, a simulation model is needed that can perform large database and contains input output relationships.In the case of UPS inverters, the database should include the input-output patterns under variable loading conditions.
In this work a large number of example patterns are obtained from the simulated PI controller with the inner capacitor current loop and output voltage loop.The example patterns are taken for variable resistive loading condition in the rang between full load and no load to ensure and obtain a good network that operates in all loading conditions and predicts any loading change.
The training of the neural network is done off-line using MATLAB with Neural Network Toolbox.The backpropagation with Levenberg-Marqnardt (LM) algorithm is used in the training which has a fast convergence rate.The ANN is trained repeatedly with randomly selected example pattern from the pattern database.After the training is completed, the weights and biases are downloaded to the ANN controller to control the inverter on-line.The network obtained is of many repeated trials.

13-SIMULATION RESULTS: 1-SIMULATION RESULTS OF MULTIPLE LOOP CONTROL PWMINVERTER
The performance of the inverter system was run using the MATLAB simulation software shown in Fig ( 12) .To evaluate the controller performance, several types of loading condition have been tested.

16-CONCLUSION
A NN controller for single phase inverter using only voltage feedback has been presented in this paper.Modules of the PWM inverter and LC filter have been developed to aid in the control design.Two control strategies for the H-bridge inverter were designed and analyzed in detail, The First, model for the inverter with multiple loops, inner capacitor current loop and outer voltage loop using classical PI controller has been built and simulated under transient and variable loading conditions and the example patterns have been taken from it.Then, the proposed ANN is trained offline with database comprising all example patterns using MATLAB program.When the training is completed, the network is connected together with the inverter instead and is simulated under variable and transient loading condition.The simulation results show that the multiple loop PI control and proposed NN controlled inverter give good results i.e. small steady state error, low THD.But the NN control have faster dynamic response than PI controller, so the proposed NN is best than PI controller because it uses only voltage sensor and this will decrease the inverter cost and complexity Finally, hardware inverter with programmed PWM using microcontroller has been built.

Fig.(
Fig.(4) shows the circuit diagram of a single-phase full bridge voltage source UPS inverter followed by a LC filter, PWM generator and gate drive circuit.R f , represents the resistance of the filter inductor.The effective series resistance of the filter capacitor is ignored since it has a small effect within the concerned frequency range[2].since the inverter switching frequency (here is 15 kHz) is several orders higher than the fundamental frequency of the AC output, the dynamics of the PWM inverter can be ignored.Thus, the UPS inverter can be modeled as a simple proportional gain block (k) as shown in Fig.(5),[2,5,6].

Fig.( 5 )
Fig.(5) shows the linear model of the inverter system (PWM inverter plus the output filter and load), in which the proportional gain K represents the PWM inverter is equal to Vc Vd / (Vd is the

Fig.( 5 )
Fig.(5): block diagram of the linear model for PWM inverter plus output filter and load (open loop)

Fig.( 7 )
Fig.(7): An approximate linearized control model of the system with capacitor current and output voltage loop Fig.(9): Root locus of the compensated closed loop control one node in the output layer).The activation functions are sigmoid in the hidden layer and linear in the output layer.The inputs of NN are load voltage lo a d V , load voltage with one sample time delay desired output of the network.Fig.(11) shows the ANN controlled inverter.

Fig.( 11
Fig.(11): Proposed NN control scheme for a UPS inverter Fig.(13) shows the steady state load voltage and current for full resistive load of the inverter under multiple loop PI controller.Fig.(14) shows the load voltage and current for 0.8PF lagging and Fig (15) shows the load voltage and current at step change of load (no-load 1000Ω to full load 100Ω) at t=25msec.from the figures its noted that the multiple loop PI controller gives good results, small steady state error (0.5V)rms, small THD, but have large peak over shoot at the step load change.