Predictive current control offers the potential for achieving more precise current control with a minimum of distortion and harmonic noise. However, the predictive method is difficult to implement and has a greater computational burden. This paper introduces a theoretical analysis and experimental verification for an improved predictive current control technique applied to single phase grid connected voltage source inverters (VSI). The proposed technique has simple calculations. An ATmega1280 microcontroller board is used to implement the proposed technique for a simpler and cheaper control system. To enhance the current performance and to obtain a minimum of current THD, an improved trilevel PWM switching strategy is proposed. The proposed switching strategy uses six operation modes instead of four as in the traditional strategy. Simulation results are presented to demonstrate the system performance with the improved switching strategy and its effect on current performance. The presented experimental results verify that the proposed technique can be implemented using fixed point 8bit microcontroller to obtain excellent results.
I. INTRODUCTION
In recent years, due to growing concerns over energy shortages and network stability, the concepts of distributed generation (DG), and hybrid power systems have become progressively more popular
[1]
. With the decreasing costs of various clean renewable energy sources, such as wind, solar, and fuelcells, they are becoming more attractive for feeding the utility grid from renewable sources. For an inverterbased distributed generator, the power quality largely depends on performance of the inverter controller
[2]
,
[3]
. Pulse width modulation (PWM) is the most popular control technique for gridconnected inverters. When compared with open loop voltage PWM converters, currentcontrolled PWM has several advantages such as fast dynamic response, inherent overcurrent protection, good dc link utilization, peak current protection, …etc.
[4]
.
In the case of singlephase fullbridge voltagesource inverters, two PWM switching strategies for voltage control can be employed
[5]

[7]
. The first strategy is the bilevel switching strategy, where the inverter output voltage switches between the positive and negative inverter input dc source. The second strategy is the trilevel switching strategy, where the inverter output voltage switches between the positive (or negative) inverter input dc source and zero.
Simulation of bilevel and trilevel current controlled systems indicates that many advantages can be gained by using trilevel switching such as a reduced current ripple and a halved switching frequency. The main disadvantage of the trilevel switching strategy is controlling the power switches at the voltage crossover. Care must be taken to ensure that adequate control over the current is maintained. This tends to make the controllers more complicated than the bilevel equivalent
[5]
. This problem is clearly found in the theoretical and experimental results of
[8]

[13]
. This paper introduces a solution for this problem which is one of its contributions, where six modes of operations (instead of four) are used to develop the proposed trilevel switching strategy.
The authors of
[12]
proposed an algorithm for direct implementation of a predictive current controller in a microprocessor for load situation where the load voltage is known. This method compensates the errors caused by digital sampling and computing delays. The algorithm uses the results of previous switching cycles to estimate both the next grid voltage and load current. In
[11]
, a predictive current controller with better robustness to parameters mismatch is proposed. The sampling point is set just ahead of the controlling point by the period of the computation delays. With this assumption, the measured values of the current and grid voltage are available up to the instant before the calculation proceeds to predict the demanded output voltage of the inverter. Many efforts have been done in
[11]
and
[12]
to predict an average value of the grid voltage (Va) during each sampling period to obtain a robust predictive current controller. In this work, Va is sampled at the beginning of the sampling period and it is kept constant during the sampling period as well as the reference and actual currents. This assumption greatly decreases the computation times, especially in the experimental work, with negligible side effects on the system performance.
II. SINGLEPHASE FULLBRIDGE GRIDCONNECTED VSI
The singlephase full bridge voltage source inverter topology is shown in
Fig. 1
. It is composed of a dc voltage source; four power switches T1, T2, T3, and T4 and four diodes D1, D2, D3, and D4. The inverter output is connected to the grid through a filter inductor L and a step up transformer.
Single phase gridconnected VSI.
 A. Bilevel and Trilevel Operation of VSI
Bilevel operation can be obtained by switching T1 and T4 at the same time to get +Vdc on the inverter output, whilst switching T3 and T2 together to get Vdc on the inverter output. In trilevel operation, the fullbridge inverter’s operation can be divided into four modes
[9]
: two modes in the positive half cycle and two modes in the negative half cycle as shown in
Table I
.
SINGLE PHASE GRIDCONNECTED INVERTER’S TRADATIONAL OPERATIONAL MODE
SINGLE PHASE GRIDCONNECTED INVERTER’S TRADATIONAL OPERATIONAL MODE
Trilevel operation is more complicated than bilevel operation. Trilevel gridconnected inverters exhibit superior performance over bilevel equivalents due to their decreased current ripple, decreased switch stresses and tighter switching bandwidth. The main disadvantage of trilevel over bilevel is the added complexity of maintaining control of the current near the voltage zero crossing
[5]
. In the present study, to find a simple solution without the addition of any control complexity, another two modes of operation are added to the four previous modes as will be shown in section IV. We named this mode as “six mode of operations” against the old trilevel “four mode of operations”.
III. PROPOSED PREDICTIVE CURRENT CONTROL TECHNIQUE FOR SINGLE PHASE VSI
Predictive controllers calculate the inverter voltages required to force the measured currents (
i
) to follow the reference current (
i_{ref}
). The deference between
i_{ref}
and
i
is the current error (
i_{err}
). In trilevel operation, the inverter output can be regarded as a vector which has three states, v1, v2 and v0. Where
v
1 =
V_{dc}
during the positive half cycle,
v
2 = 
V_{dc}
during the negative half cycle, and
v
0 = 0 .
 A. Switching Time Calculations
During the application of the nonzero voltage vectors (v1 and v2) the inverter’s equation is:
Where
s
= 1 for the positive half cycle,
s
= 1 during the negative half cycle and
di
_{1}
/
dt
is the rate of change for the inverter output current during the application of the nonzero vector. Then from (1):
and during the application of the zero vector:
Where
di
_{2}
/
dt
is the rate of change of the inverter output current during the application of the zero vector.
To compensate the current error during the switching time period T, the following equation can be used:
where T
_{on}
is the time period required for applying the nonzero vector and T
_{off}
is the time period required for applying zero vector.
di
_{1}
/
dt
and
di
_{2}
/
dt
are the rates of change in the inductor current (
i
) during T
_{on}
and T
_{off}
, respectively, and
v_{a}
is the grid voltage.
For a constant switching frequency the switching time period T can be obtained as follows:
From equations (2), (3), (5), and (6) the required time periods can be obtained as follows:
According to (7) and (8) based on
Table I
, PWM control signals with a duty ratio of
T_{on}
/
T
can be used to drive T1 (in the positive half cycle) and T3 (in the negative half cycle) to compensate the current error.
IV. SIMULATION RESULTS
The proposed predictive current controller is verified by simulation using MATLAB/SIMULINK. For all of the simulations, the dc voltage and grid voltage are 200V and 110V, respectively, and the filter inductor is 18 mH. The sampling period is set to 100 μsec.
Fig.2
shows the advantages of using the trilevel PWM switching strategy in terms of a reduced current ripple and a halved “effective” switching frequency. The THD in this case is about 2.6%. The main disadvantage of trilevel switching is controlling the power switches at the voltage crossover as shown in
Fig.2
. In
Fig. 2
, it is clear that the inverter output voltage, around the zero crossing points, is zero for a time period depending mainly on the inductor value L. As L increases, the current distortion at zero crossing increases. This paper introduces a simple and effective solution for this problem as will be shown in the next section.
inverter output current (THD=2.6%), inverter output voltage, T1, T4, T3, and T2 control signals (four modes of operation)
 A. Proposed Trilevel Switching Strategy
Around the voltage crossover (zerocrossing points), the first term of (7) is the only effective term (because
v_{a}
≅ 0 ). With a negative error current, Ton will be negative. In practical operation the Ton time cannot be negative. Therefore, the controller will make it equal to zero. In this case and during the positive half cycle, T1 is turned off and the controller is unable to decrease the actual current to follow the reference current. As a result, dips in the current plot are found around the zero crossing in
Fig. 2
. The inverter output voltage around the zero crossing is zero as shown from the second plot of
Fig. 2
. To solve this problem in the positive half cycle, the inverter output voltage should be negative to rapidly decrease the actual current. This can be done simply by turning off T4 (T1 is off) resulting (mode 1N) in
Fig. 3
. The turning off time of T4 in this case, is equal to the absolute value of the calculated negative value of Ton according to (7).
Modes of operation of the proposed predictive current controller.
The same procedure can be done at the end of the negative half cycle when a positive error current occurs. Then Ton will be negative. In this case the inverter output voltage should be positive to rapidly increase the actual current. This can be done simply by turning off T2 (T3 is off) resulting (mode 3N) in
Fig. 3
. The turning off time of T2 in this case, is equal to the absolute value of the calculated negative value of Ton according to (7).
Fig. 4
shows a flowchart of the procedure for six modes of operation and the generation of PWM signals to the four switches. Applying this solution, two modes of operations (mode 1N and mode 3N in
Fig.3
) are added to the previous four modes of operation resulting in six modes of operations as shown in
Fig. 3
.
Fig. 5
shows that the discontinuity of the inverter output voltage disappears and that the problem is solved. The current THD decreased from 2.6% to 1.8% which is another contribution of this study.
Flowchart of the interrupt service subroutine for sixmodes of operation to generate PWM.
Inverter output current (THD=1.8%), inverter output voltage, T1, T4, T3, and T2 control signals (six modes of operation)
Transient response for step change in reference current.
It should be mentioned that a great deal of effort has been exerted in
[11]
and
[12]
to predict the average value of Va during each sampling time to obtain a robust predictive current controller. In this study, Va is sampled at the beginning of the sampled period and is kept constant during the sampling period. From (7), it is found that the difference in Ton between the two cases has a maximum value of 1.5 μsec with a current error of about 20mA in the modeled system. Bode, et al.
[14]
have proposed a new predictive current regulation algorithm for single and threephase grid connected inverters. In their paper, they proposed that, instead of zero, the targeted current error at the end of the period is made equal to half the difference of the previous two current errors. In this paper,
i_{ref}
and
i
are sampled at the beginning of the sampling period and are kept constant during the sampling period. This assumption greatly decreases the computation time, especially in the experimental work, with negligible effects on the system performance.
V. EXPERIMENTAL SETUP
Fig. 7
illustrates the configuration of the implemented system. The prototype system includes an IGBT inverter circuit module, 4channel isolation amplifier module, a microcontrollerbased control and driver module, signal conditioning circuits, and a filter inductor. The input of the inverter is connected to a singlephase controlled rectifier with a variable dc link voltage up to 355 V. The inverter output voltage is 127V, 8A max current, up to 20kHz switching frequency. The output of the inverter is connected to the grid through a step up transformer 110/220V. The nominal grid voltage is 220 V, the grid frequency is 60 Hz and the inductor inductance is 18mH. The inverter is equipped with hardware protections.
Experimental gridconnected VSI setup circuit.
 A. Microcontroller Board
The control of the system is done using Arduino Mega microcontroller board based on AVR, 8bit ATmega1280 microcontroller device. The microcontroller board is shown in
Fig. 8
where its specifications are listed in
Table II
.
Arduino ATmega1280 based microcontroller board.
MICRCOCONTROLLER BOARD SPECIFICATIONS
MICRCOCONTROLLER BOARD SPECIFICATIONS
The microcontroller adds simplicity to the control system. Instead of the complex and more expensive digital signal processors (DSP)  as many literatures work  a simple and cheap microcontroller board which can do the same control work with the same switching frequency without loss of control functionality is used.
Two 16bit timers/counters are used to generate 4 PWM signals (S1 to S4) for driving the transistors (T1 to T4). Each counter has 4 isolated channels, and each of them can be programmed individually. Timer/counter 3 (channels A and B), and Timer/counter 4 (channels A and B) are used to generate the required PWM signals. The counters are programmed to run in Phase and Frequency Correct PWM Mode. If the counter is loaded with a count, it counts up from zero till the loaded count then counts down again to zero then an over flow interrupt occurs. In this experimental work, the whole interrupt period is set to 100μs for the selected sample time T. As a result, the switching frequency will be 10 kHz. An output compare register is loaded with a compare number, on compare match a set or reset of the output pin (OC3A, OC3B, OC4A or OC4B) occurs as programmed. Counter 3 is programmed to set on compare match, and counter 4 is programmed to clear on compare match. The compare registers of the four channels are updated with a compare number that corresponds to Ton in each sample. At the beginning of the sampling period, the grid voltage and actual current are sampled through two A/D channels. Eq. (7) is used to calculate the pulse width of the controlling signal that loaded to the counter compare registers. In the same sampling period, as soon as the calculations are finished, the four counter channels are updated. In the suggested switching strategy, there is no need for any dead time between T1 and T2 or between T3 and T4.
 B. Signal Conditioning Circuits
In operation, the signal from grid voltage is noisy and needs filtering. Instead of using a PLL with complex computations, two successive analog integrators with an adjustable dc offset are used to provide a smooth signal representing the grid voltage Va. After scaling, this signal can be used as a current reference for unity power factor operations. The grid voltage and the actual current signals are bipolar signals (±5V) but the A/D of the microcontroller accepts only unipolar signals (0:+5V). As a result, a dc offset and scaling are added for proper operation as shown in
Fig. 9
.
Experimental signal conditioning circuits.
VI. EXPERIMENTAL RESULTS
The proposed predictive current control strategy is tested on a prototype gridconnected singlephase IGBT inverter. The experimental results are collected using an USB digital storage scope (USBDSO).
Fig. 10
illustrates signal conditioning circuit input and output waveforms. The input is the grid voltage signal and the output is the filtered signal. The effectiveness of the suggested conditioning circuit in terms of providing a pure signal representing the grid voltage is shown in
Fig.10
. The upper trace for the grid voltage signal has some distortion, whereas the lower one is a pure sine wave filtered signal that is used for the current signal reference with some scale.
Experimental input and output of the signal conditioning circuit.
Fig. 11
shows the reference and actual current injected to the grid using the proposed technique where four modes of operations are used. The current ripple content in
Fig. 11
shows the superiority of the proposed technique.
Experimental reference and actual current of the predictive current controller (four modes of operation), scale: 1A/div, 5ms/div.
Fig. 11
demonstrates that the proposed predictive current controller technique can be implemented using a fixedpoint microcontroller to obtain excellent results. As a result of using four modes of operations, dips in the actual current (
Fig. 11
) exist near the zero crossing points as shown in
Fig. 2
. of the simulation results.
Fig. 12
shows the grid voltage and the inverter output current, where a unity power factor operation is obtained.
Experimental grid voltage and inverter output current (four modes of operation), scale: 50V/div, 1A/div, 5ms/div.
Fig. 13
shows the inverter output current and the inverter output voltage. The time scale is 100 μs/div. The inverter output voltage switches between zero and –Vdc. The rate of changes of the inverter output current during Ton and Toff times are clear in this figure.
Fig. 13
also shows that the sampling time is 100μsec (10 kHz switching frequency).
Experimental inverter output current and voltage, scale: 1A/div, 100V/div, 100μs/div.
Fig. 14
shows the control signals for transistor T1 and transistor T4 while using four modes of operations. This figure shows the discontinuity of the PWM signals for T1 near the zero crossover point. T4 is in the ON state during the entire positive half cycle. It should be mentioned that there is no need for any dead time in the suggested switching strategy.
Experimental gate pulses for T1 & T4 of the predictive current controller (four modes of operation).
Figs. 15
,
16
and
17
show the results of the proposed predictive current control scheme while using six modes of operations.
Fig. 15
shows the reference and actual current,
Fig. 16
shows the grid voltage and the inverter output current, and
Fig. 17
shows the gate pulses for T1 and T4. It is shown in
Fig. 17
that there are pulses for T4 (T4 in the OFF state for multiple times) near the zero crossover point as suggested in the proposed switching strategy.
Experimental reference and actual current of the proposed predictive current controller (six modes of operation), scale: 1A/div, 5ms/div.
Experimental grid voltage and inverter output current (six modes of operation), scale: 50V/div, 1A/div, and 5ms/div.
Experimental gate pulses for T1 & T4 of the proposed predictive current controller (six modes of operation).
VII. CONCLUSIONS
An improved predictive current control technique applied to a single phase grid connected voltage source inverter is proposed in this paper. The proposed technique is suitable for practical implementations using a fixed point microcontroller to achieve excellent current performance with minimal harmonic distortion. The proposed technique modifies the traditional trilevel switching strategy with four modes of operation by adding another two modes to be “six modes of operation” to enhance the current performance. The two supplementary modes of operation are added without increasing control complexity. The suggested switching strategy is free of dead time. Simulation and experimental results have been presented to confirm the excellent operation of the proposed control technique and the suggested switching strategy.
BIO
Yousry Atia was born in Egypt, in 1964. He received his B.Sc from the Faculty of Engineering, Minoufiya University, Shebin El Kom, Egypt, in 1987. He received his M.Sc and Ph.D. from the Department of Electrical Power and Machines, Faculty of Engineering, Cairo University, Cairo, Egypt, in 1995 and 2000, respectively. He is currently working as an Associate Professor Researcher in the Department of Photovoltaic Cells, Electronics Research Institute, Cairo, Egypt. His current research interests include renewable energy, power electronics, drives, electrical machines, system design and distributed gridconnected systems.
Mahmoud Salem received his B.Sc. in Electrical Engineering from the Faculty of Engineering, Minoufiya University, Shebin El Kom, Egypt, in 1988. He received his M.Sc. and Ph.D. in Electrical Engineering from Cairo University, Cairo, Egypt, in 1994 and 2000, respectively. He is currently working as an Associate Professor Researcher in the Department of Power Electronics, Electronics Research Institute, Cairo, Egypt. His current research interests include artificial intelligence, neural networks, control systems, electrical drives, digital controller hardware, and distributed gridconnected systems.
Dong D.
,
Thacker T.
,
Cvetkovic I.
,
Burgos R.
,
Boroyevich D.
,
Wang F.
,
Skutt G.
2012
“Modes of operation and systemlevel control of singlephase bidirectional pwm converter for microgrid systems,”
IEEE Trans. Smart Grid
3
(1)
93 
104
DOI : 10.1109/TSG.2011.2167352
Kim H.
2009
“Filter design for gridconnected singlephase inverters,”
Journal of Power Electronics
9
(4)
623 
630
Blaabjerg F.
,
Teodorescu R.
,
Liserre M.
,
Timbus A. V.
2006
“Overview of control and grid synchronization for distributed power generation systems,”
IEEE Trans. Ind. Electron.
53
(5)
1398 
1409
DOI : 10.1109/TIE.2006.881997
Jena S.
,
Babu B. C.
,
Naik A. K.
,
Mishra G.
2011
“Performance improvement of singlephase gridConnected PWM inverter using PI with hysteresis current controller,”
Energy, Automation, and Signal (ICEAS), 2011 International Conference on Digital Object Identifier
Baker D. M.
,
Agelidis V. G.
,
Nayar C. V.
1997
“A comparison of trilevel and bilevel current controlled gridconnected singlephase fullbridge inverters,”
IEEE Proceedings of the International Symposium on Industrial Electronics, ISIE'97
Vol. 2
Marandi D.
,
Sowmya T. N.
,
Babu B. C.
2012
“Comparative study between unipolar and bipolar switching scheme with LCL filter for single phase grid connected inverter system,”
IEEE Students’ Conference on Electrical, Electronics and Computer Science 2012 (SCEECS)
Kim Y. C.
,
Jin L.
,
Lee J.
,
Choi J.
2010
“Direct digital control of singlephase AC/DC PWM converter system,”
Journal of Power Electronics
10
(5)
518 
527
DOI : 10.6113/JPE.2010.10.5.518
Gola A. K.
,
Agarwal V.
2009
“Implementation of an efficient algorithm for a single phase matrix converter,”
Journal of Power Electronics
9
(2)
198 
206
Kojabadi H. M.
,
Yu B.
,
Gadoura I. A.
,
Chang L.
,
Ghribi M.
2006
“A novel DSPbased currentcontrolled PWM strategy for single phase grid connected inverters,”
IEEE Trans. Power Electron.
21
(4)
985 
993
DOI : 10.1109/TPEL.2006.876851
Yu B.
,
M.Sc. thesis
2004
“Predictive Current Controlled PWM Strategy for Gridconnected SinglePhase Inverter,”
Univ. New Brunswick
Fredericton, NB, Canada
M.Sc. thesis
Yu B.
,
Chang L.
2005
“Improved predictive current controlled PWM for single phase gridconnected voltage source inverters,”
IEEE 36th Power Electronics Specialists Conference, PESC '05
Holmes D. G.
,
Martin D. A.
1996
“Implementation of a direct digital predictive current controller for single and three phase voltage source inverters,”
Industry Applications Conference, IEEE ThirtyFirst IAS Annual Meeting Conference Record of the 1996, IAS '96
Wu T.F.
,
Sun K.H.
,
Kuo C.L.
,
Chang C.H.
2010
“Predictive current controlled 5kW singlephase bidirectional inverter with wide inductance variation for DCmicrogrid applications,”
IEEE Trans. Power Electron.
25
(12)
3076 
3084
DOI : 10.1109/TPEL.2010.2087773
Bode G. H.
,
Loh P. C.
,
Newman M. J.
,
Holmes D. G.
2003
“An improved robust predictive current regulation algorithm,”
in Proc. 5th Int. Conf. Power Electron. Drive Syst. (PEDS’03)
Vol. 2
1058 
1063