Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

5

Modeling & Simulation of Hysteresis


Current Controlled Inverters Using MATLAB
Ahmad Albanna
Mississippi State University
General Motors Corporation
United States of America
1. Introduction
Hysteresis inverters are used in many low and medium voltage utility applications when
the inverter line current is required to track a sinusoidal reference within a specified error
margin. Line harmonic generation from those inverters depends principally on the
particular switching pattern applied to the valves. The switching pattern of hysteresis
inverters is produced through line current feedback and it is not pre-determined unlike the
case, for instance, of Sinusoidal Pulse-Width Modulation (SPWM) where the inverter
switching function is independent of the instantaneous line current and the inverter
harmonics can be obtained from the switching function harmonics.
This chapter derives closed-form analytical approximations of the harmonic output of
single-phase half-bridge inverter employing fixed or variable band hysteresis current
control. The chapter is organized as follows: the harmonic output of the fixed-band
hysteresis current control is derived in Section 2, followed by similar derivations of the
harmonic output of the variable-band hysteresis controller in Section 3. The developed
models are validated in Section 4 through performing different simulations studies and
comparing results obtained from the models to those computed from MATLAB/Simulink.
The chapter is summarized and concluded in section 5.
2. Fixed-band hysteresis control
2.1 System description
Fig.1 shows a single-phase neutral-point inverter. For simplicity, we assume that the dc
voltage supplied by the DG source is divided into two constant and balanced dc sources, as in
the figure, each of value
c
V . The RL element on the ac side represents the combined line and
transformer inductance and losses. The ac source
sa
v represents the system voltage seen at the
inverter terminals. The inverter line current
a
i , in Fig.1, tracks a sinusoidal reference
( )
* *
1
2 sin
a a
i I t e | = + through the action of the relay band and the error current
*
( )
a a a
e t i i = .
In Fig.2, the fundamental frequency voltage at the inverter ac terminals when the line
current equals the reference current is the reference voltage, ( )
* *
1
2 sin
a a
v V t e u = + . Fig.2
compares the reference voltage to the instantaneous inverter voltage resulting from the
action of the hysteresis loop.

Applications of MATLAB in Science and Engineering

98
Q
Q
'
c
V
1 d
i
sa
v
+
+

*
a
i
a
i
Q
a
e
c
o
c
V
+
+
L R
ao
v
Q'
E
( )
*
a a a a
d
R e L e v v
dt
+ =
a
i
2 d
i

Fig. 1. Single-phase half-bridge inverter with fixed-band hysteresis control.
Referring to Fig.2, when valve Q is turned on, the inverter voltage is
*
a c a
v V v = > ; this
forces the line current
a
i to slope upward until the lower limit of the relay band is reached
at ( )
a
e t c = . At that moment, the relay switches on Q' and the inverter voltage becomes
*
a c a
v V v = < , forcing the line current to reverse downward until the upper limit of the relay
band is reached at ( )
a
e t c = .


Fig. 2. Reference voltage calculation and the instantaneous outputs.
The bang-bang action delivered by the hysteresis-controlled inverter, therefore, drives the
instantaneous line current to track the reference within the relay band ( ) , c c . With reference to
Fig.3 and Fig.4, the action of the hysteresis inverter described above produces an error current
waveform ( )
a
e t close to a triangular pulse-train with modulating duty cycle and frequency.

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

99
2.2 Error current mathematical description
The approach described in this section closely approximates the error current produced by
the fixed-band hysteresis action, by a frequency-modulated triangular signal whose time-
varying characteristics are computed from the system and controller parameters.
Subsequently, the harmonic spectrum of the error current is derived by calculating the
Fourier transform of the complex envelope of frequency modulated signal.
Results in the literature derived the instantaneous frequency of the triangular error current
( )
ia
f t in terms of the system parameters ( 0 R = ). Using these results and referring to
Fig.3 (Albanna & Hatziadoniu, 2009, 2010):

( )
1
1
2
1 sin
c
L
t
V M t
c
e u
=
+ + (

,
( )
2
1
2
1 sin
c
L
t
V M t
c
e u
=
+ (

, (1)
and therefore:
( ) ( )
2
1
1
cos 2 2
8
c
ia c
V M
f t f t
T L
e u
c
= = + + (2)
where the average switching (carrier) frequency
c
f is given by

2
1
4 2
c
c
V M
f
L c
(
=
(

, (3)
and M is the amplitude modulation index of the inverter expressed in terms of the peak
reference voltage and the dc voltage as:

*
2
a
c
V
M
V
=
. (4)


Fig. 3. Detail of ( )
a
e t .

Applications of MATLAB in Science and Engineering

100

Fig. 4. Effect of
*
a
v on the error current duty cycle.
Examining (2), the instantaneous frequency ( )
ia
f t of the error current ( )
a
e t consists of the
carrier frequency
c
f and a modulating part that explicitly determines the bandwidth of the
error current spectrum, as it will be shown later in this chapter. Notice that the modulating
frequency is twice the fundamental frequency, that is,
1
2 f
.
Now, with the help of Fig.3, we define the instantaneous duty cycle of the error current
( ) D t as the ratio of the rising edge time
1
t to the instantaneous period T . Noting that
( ) ( )
1 ia
D t t f t = , we obtain after using (1), (2) and manipulating,
( ) ( )
1
0.5 0.5 sin D t M t e u = + . (5)
Implicit into (3) is the reference voltage
*
a
v . The relation between the instantaneous duty
cycle and the reference voltage can be demonstrated in Fig.4: the duty cycle reaches its
maximum value at the minimum of
*
a
v ; it becomes 0.5 (symmetric form) at the zero of
*
a
v ;
and it reaches its minimum value (tilt in the opposite direction) at the crest of
*
a
v . Next, we
will express ( )
a
e t by the Fourier series of a triangular pulse-train having an instantaneous
duty cycle ( ) D t and an instantaneous frequency ( )
ia
f t :
( )
( ) ( )
| |
2 2
1
0
sin 1 ( ) 1
2
sin 2 ( )
( ) 1 ( )
n
t
a ia
n
n D t
e t n f d
D t D t
n
t
c
t t t
t

=
| | (


= |
|

\ .

}
. (6)
As the Fourier series of the triangular signal converges rapidly, the error current spectrum is
approximated using the first term of the series in (6). Therefore truncating (6) to 1 n = and
using (2) yields

| |
| |
( ) ( )
1
2
sin ( )
2
( ) sin sin 2 2
( ) 1 ( )
a c
D t
e t t t
D t D t
t
c
e | e u
t
~ + +

, (7)
where ( ) sin 2 | u = . The frequency modulation index

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

101

2
1
1
8 2
c
V M
L f
|
c
= (8)
determines the frequency bandwidth
( )
1
4 1 BW f | = + (9)
that contains 98% of the spectral energy of the modulated sinusoid in (7). To simplify (7)
further, we use the following convenient approximation (see Appendix-A for the
derivation): Given that, 0 ( ) 1 D t s s , then

| |
| |
| |
sin ( )
(4 ) sin ( )
( ) 1 ( )
D t
D t
D t D t
t
t t t ~ +

. (10)
Therefore (7) becomes,
( ) ( ) ( )
1
2
2
( ) (4 ) sin ( ) sin sin 2 2
a c
e t D t t t
c
t t t e | e u
t
~ + + + (

. (11)
Substituting ( ) D t from (5) into (11) and manipulating, we obtain
( ) ( ) ( )
1 1
2
2
(4 ) cos sin( ) sin sin 2 2
2
a c
M
e t t t t
c t
t t e u e | e u
t
| | | |
~ + + + +
| |
\ . \ .
(12)
Next, the cosine term in (12) is simplified by using the infinite product identity and
truncating to the first term. That is,

2 2
2 2 2
1
4
cos( ) 1 1
( 0.5)
n
x x
x
n t t

=
| |
= ~ |
|

\ .
[
, (13)
Substituting (13) into (12) and manipulating, the error current approximation becomes:
( ) ( ) ( ) ( )
1
2
1 1
2
( )
( )
( ) 8 cos 2 2 sin sin 2 2
a c
e t
e t
e t k k t t t
c
e u e | e u
t
(
~ + + + + (
(

, (14)
where
2
(4 ) k M t = . The harmonic spectrum ( )
a
E f of the error current is the convolution
of the spectra of the product terms ( )
1
e t and ( )
2
e t in (14). Therefore,

2 2
1 1 2
( ) (8 ) ( ) ( 2 ) ( 2 ) ( )
2 2
j j
a
k k
E f k f e f f e f f E f
u u (
= o + o + o +
(

, (15)
where denotes convolution. In order to calculate ( )
2
E f , we rewrite ( )
2
e t as

( ) ( )
( )
1 1
sin 2 2 sin 2 2
2
2
( )
2
c c
j t j t j t j j t j
e t e e e e e e
j
| e u | e u e e
c
t
+ +
= . (16)

Applications of MATLAB in Science and Engineering

102
The positive frequency half of the spectrum ( )
2
E f is therefore given by
( ) ( )
( )
( )
1
2
2 2
2
2
c
j n
n f nf
n
E f J e
j
u
c
|
t

+
=
= o

, (17)
where ( )
x
f x = is the Dirac function, and
n
J is the Bessel function of the first kind and
order n . Substituting (17) into (15), and convoluting, we obtain:
| |
( )
( )
1
2
1 1 2
2
( ) ( ) ( ) (8 ) ( )
2
2
c
j n
a n n n f nf
n
k
E f J J k J e
j
u
c
| | |
t

+ +
=
| |
= + + o
|
\ .

. (18)
Using the recurrence relation of the Bessel functions,

1 1
2
( ) ( ) ( ),
n n n
n
J J J | | |
|
+
+ = (19)
the positive half of the error current spectrum takes the final form:

( )
( )
1
2
2
( )
c
n
j n
a n f nf
n
E f E e
u
=

=
= o

, (20)
where,
( )
2
8
2
n n
kn
E k J
j
c
|
|
t
| |
= +
|
\ .
. (21)

c
f
c
f
'
| | ' >
( )
1
4 1 f | +
( )
1
4 1 f |' +

Fig. 5. Effect of changing | on the harmonic spectrum.
The calculation of the non-characteristic harmonic currents using (20) is easily executed
numerically as it only manipulates a single array of Bessel functions. The spectral energy is
distributed symmetrically around the carrier frequency
c
f

with spectrum bands stepped
apart by
1
2 f . Fig.5 shows the harmonic spectrum of the error current as a function of the
frequency modulation index | . If the operating conditions of the inverter forces | to
increase to | ' , then the spectral energy shifts to higher carrier frequency
c
f
'
. Additionally,
as the average spectral energy is independent of | and depends on the error bandwidth c ,

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

103
the spectral energy spreads over wider range of frequencies, ( )
1
4 1 f | ' + , with an overall
decrease in the band magnitudes to attain the average spectral energy at a constant level as
shown in Fig.5. The Total Harmonic Distortion (THD) of the line current is independent of
| and is directly proportional to the relay bandwidthc .
2.3 Model approximation
The harmonic model derived in the previous section describes the exact spectral
characteristics of the error current by including the duty cycle ( ) D t to facilitate the effect of
the reference voltage
*
a
v on the error current amplitude and tilting. Moreover, the
consideration of ( ) D t in (6) predicts the amplitude of the error current precisely, which in
turn, would result in accurate computation of the spectrum bands magnitudes according to
(20). The model can be further simplified to serve the same functionality in without
significant loss of numerical accuracy. As the instantaneous frequency of the error current,
given by (2), is independent of ( ) D t , the spectral characteristics such as
c
f and BW are
also independent of D and therefore, setting ( ) D t to its average value 0.5 will slightly
affect the magnitude of the spectrum bands according to (7). Subsequently, the error current
harmonic spectrum simplifies to
( )
( )
( )
1
2
2
2
4
( )
c
n
j n
a n f nf
n
E f J e
j
u
c
|
t
=

=
= o

, (22)
where the carrier (average) frequency
c
f is given by (3), the frequency modulation index |
is given by (8). The 3 dB frequency bandwidth BW that contains 98% of the spectral energy
is given by (9).

A
C

S
p
e
c
t
r
u
m
D
C

S
p
e
c
t
r
u
m
f 1
2
c
f f +
1
2
c
f f
1 c
f f
1 c
f f +
c
f
f
--- ---
---
---

Fig. 6. AC harmonics transfer to the inverter dc side.
2.4 Dc current harmonics
The hysteresis switching action transfers the ac harmonic currents into the inverter dc side
through the demodulation process of the inverter. As the switching function is not defined

Applications of MATLAB in Science and Engineering

104
for hysteresis inverters, the harmonic currents transfer can be modeled through balancing
the instantaneous input dc and output ac power equations.
With reference to Fig.1, and assuming a small relay bandwidth (i.e.
*
a a
i i ~ ), the application
of Kirchhoff Current Law (KCL) at node a gives:

*
1 2 d a d
i i i = + . (23)
The power balance equation over the switching period when Q' is on is given by:
( ) ( )
2
1
d a a
c
i v t i t
V
= . (24)
Using the instantaneous output voltage

*
a a a
d
v v L e
dt
| |
=
|
\ .
(25)
in (24), the dc current
1 d
i will have the form:
( )
* *
* *
1
a a
d a a a
c c
v i L d
i t i i e
V V dt

| |
= +
|
\ .
, (26)
where x is the derivative of x with respect to time. Using the product-to-sum
trigonometric identity and simplifying yields:
( ) ( ) ( )
* *
* *
1 1
2 2
cos cos 2
2 2
a a
d a a a
c
MI MI L
i t i t e i
V
u | e u | = + + + . (27)
The positive half of the dc current spectrum is thus computed from the application of the
Fourier transform and convolution properties on (27), resulting in
( ) ( ) ( ) ( )
1 1
1 0 0 1 2 2 1 1

d f f h a a
I f I I I f I E f f E f f = + + + + , (28)
where ( )
a
E f is the error current spectrum given by (22). The average, fundamental, and
harmonic components of the dc current spectrum are respectively given by

( )
( )
*
0
* *
1 2
*
2
cos ,
2
2 2
, , and
2 4
2
.
a
j j
a a
h a
c
I M I
I I e I M I e
j
I L I
V
u | |
u |
t

=
= =
=
(29)
Each spectrum band of the ac harmonic current creates two spectrum bands in the dc side
due to the convolution process implicitly applied in (28). For instance, the magnitude of the
ac spectrum band at
c
f is first scaled by
c
f according to (28) then it is shifted by
1
f to

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

105
create the two dc bands pinned at
1 c
f f as shown in Fig.6. Consequently, every two
successive bands in the ac spectrum create one corresponding dc spectrum band that is
located half the frequency distance between the two ac bands.
2.5 Harmonic generation under distorted system voltages
The harmonic performance of the hysteresis inverter in Fig.7 under distorted dc and ac
system voltages is analyzed. The presence of background harmonics in the ac and dc
voltages will affect the instantaneous frequency of the inverter according to (30) as

( )
2
*
1
4
c a h k
ia
c c c
V v v v
f t
L V V V c
(
| |
(
' = + |
|
(
\ .

. (30)
where the dc distortion
k
v , and the distortion of the ac system voltage,
h
v , are given as:

( )
( )
1
1
2 sin
2 sin
k k k
h h h
v V k t
v V h t
e
e
= +
= +
. (31)

Q
Q
'
c k
V v +
a
i
sa h
v v +
+
o
c k
V v
+
+
L R
a

Fig. 7. Hysteresis inverter operating with distorted system voltages.
Notice that in (31), k and h need not be integers. Substituting (31) in (30) and assuming
small distortion magnitudes, the instantaneous frequency of the error current
a
e simplifies
to:
( ) ( ) ( ) ( )
ia ia ac dc
f t f t f t f t ' = A + A
, (32)
where ( )
ia
f t is given by (2) and

( ) | | ( ) | | ( )
( ) | | ( ) | | ( )
1 1
1 1
cos 1 cos 1 ,
4
cos 1 cos 1 ,
4
c
ac h h h
c
dc k k k
V
f t M M h t h t
L
V
f t M M k t k t
L
e u e u
c
e u e u
c
( A = + + + +

( A = + + + +

(33)
are the frequency noise terms due to the system background distortions. The amplitude
modulation indices of the ac and dc harmonic distortions are given by :

Applications of MATLAB in Science and Engineering

106

2 2
, and
h k
h k
c c
V V
M M
V V
= =
. (34)
Integrating (32), the error current ( )
a
e t is thus approximated by the frequency-modulated
sinusoid:
( ) ( )
1
2
8
sin sin 2 2
a c ac dc
e t t t
c
e | e u
t
' = + + + + (

. (35)
In (35): the carrier frequency
c
f is given by (3); the frequency modulation index | is given
by (3); ( ) sin 2 | u = ; and

| | ( ) | | ( )
| | ( ) | | ( )
1 1
1 1
sin 1 sin 1 ,
sin 1 sin 1 .
ac h h h h ac
dc k k k k dc
h t h t
k t k t
| e u | e u
| e u | e u
+
+
= + + + + +
= + + + + +
(36)
where ( ) ( ) sin sin
ac h h h h
| u | u
+
= + ,and ( ) ( ) sin sin
dc k k h k
| u | u
+
= + . The
corresponding ac and dc frequency modulation indices are given by

( ) ( )
( ) ( )
1 1
1 1
1 1
; ;
4 1 4 1
1 1
; .
4 1 4 1
c c
h h h h
c c
k k k k
V V
M M M M
L h f L h f
V V
M M M M
L k f L k f
| |
c c
| |
c c
+
+
= =
+
= =
+
(37)
Applying the Fourier transform and convolution properties on (35), the positive half of the
frequency spectrum ( )
a
E f ' simplifies to:
( ) ( ) ( ) ( )
a a ach dck
E f E f f f ' = , (38)
Where ( )
a
E f is given by (22) and

( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
1 1
1 1
1 1
1 1
,
,
h h ac
k k ac
jn jn j
ach n h n h h nf h nf
n n
jn jn j
dck n k n k k nf k nf
n n
e J e J e
e J e J e
u u
u u
| |
| |

+ +
+
= =

+ +
+
= =
| | | |
=
| |
\ . \ .
| | | |
=
| |
\ . \ .


(39)
are the ac and dc modulating spectra. Generally, for any H number of ac voltage
distortions and K number of dc distortions, (40) is applied first to calculate the total ac and
dc modulating spectra, then (38) is used to compute the error current harmonic spectrum.

( )
( )
,
.
acH ach
H
dcK dck
K
f
f
=
=

(40)

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

107
3. Variable-band hysteresis control
3.1 Error current mathematical description
The harmonic line generation of the half-bridge inverter of Fig.1 under the variable-band
hysteresis current control is derived. The constant switching frequency of the error current
in (2), i.e. ( )
ia o
f t f = , is achieved by limiting the amplitude of the error current to stay
within the variable band [54, 55]:
( )
2 2
1
( ) 1 0.5 0.5 cos 2 2
a o
t M M t c c e u
(
= + +

, (41)
where the maximum value of the modulating relay bandwidth is

4
c
o
o
V
Lf
c =
, (42)
and
o
f is the target switching frequency. Subsequently, the error current is approximated
by the amplitude-modulated sinusoid of frequency
o
f as:

( ) ( ) ( )
2
8
sin 2
a a o
e t t f t c t
t
=
(43)
Substituting (41) in (43) and then applying the Fourier transform, the positive half of the
frequency spectrum of ( )
a
E f is:

( )
( ) ( )
( )
1 1
2 2
2 2
2 2
2
4
1
2 4
o o o
j j o
a f f f f f
M M
E f e e
j
u u
c
t

+
( | |
= + +
( |
|
( \ .
. (44)
The error current spectrum in (44) consists of a center band at the switching frequency
o
f
and two side bands located at
1
2
o
f f . The frequency bandwidth that contains the spectral
energy of (44) is simply
1
4 f .
3.2 Dc current harmonics
The approach developed in 2.2.4 also applies to compute the dc current harmonic spectrum
when the variable-band hysteresis control. The positive half of the dc current harmonic
spectrum is computed by substituting (44) in (28).
3.3 Harmonic generation under distorted system voltages
The presence of background harmonics in the ac and dc voltages, given in (31) will affect the
instantaneous frequency of the inverter according to (30). Subsequently, to achieve the
constant switching frequency
o
f , the modulating error band in (41) will also contain the
corresponding distortions terms as

( ) ( ) ( ) ( )
o ac dc
a a a a
t t t t c c c c = +
, (45)
where ( )
o
a
t c is the error under zero background distortion given by (41), and

Applications of MATLAB in Science and Engineering

108

( ) ( )
( ) ( )
1 1
1 1
( ) 2 sin sin ,
( ) 2 sin sin ,
ac
a o h h
dc
a o k k
t MM h t t
t MM k t t
c c e e u
c c e e u
= + +
= + +
(46)
where and
h k
M M define the modulation index of the ac and dc background distortion
terms respectively as (34).
The new terms introduced by the background distortion appear as amplitude modulations
in (45). The error current ( )
a
e t ' is then expressed as:

( ) ( )
2
8
( ) ( ) ( ) sin 2
o ac dc
a a a a o
e t t t t f t c c c t
t
( ' = +

. (47)
The harmonic spectrum of the error current ( )
a
E f ' simplifies to
( ) ( ) ( ) ( )
ac dc
a a a a
E t E f E f E f ' = + , (48)
where ( )
a
E f is the zero-background-distortion error as in (44), and the new terms due to
background distortion:

( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
( )
1 1
1 1
1 1
1 1
1 1
2
1 1
1 1
2
1 1
2

,
2

.
h h
o o
h h
o o
k k
o o
k k
o o
j j ac h o
a f h f f h f
j j
f h f f h f
j j dc k o
a f k f f k f
j j
f k f f k f
MM
E e e
j
e e
MM
E e e
j
e e
u u
u u
u u
u u
c
t
c
t

+
+ +
+ + +

+
+ +
+ + +

= +

= +

(


(49)
Examining (49), the presence of the harmonic distortions in the system tends to scatter the
spectrum over lower frequencies, more specifically, to ( )
1
1
o
f h f + , for h k > or to
( )
1
1
o
f k f + for k h > .
4. Simulation
The harmonic performance of the half-bridge inverter under the fixed- and variable-band
hysteresis control is analyzed. Results computed from the developed models are compared
to those obtained from time-domain simulations using MATLAB/Simulink. Multiple
simulation studies are conducted to study the harmonic response of the inverter under line
and control parameter variations. The grid-connected inverter of Fig.1 is simulated in
Simulink using: 400
c
V V = , 120
sa rms
V V = ,
1
60 f Hz = , 1.88 R = O , and 20 L mH = . In order
to limit the THD of the line current to 10%, the line current tracks the sinusoidal reference
( )
*
1
2 15 sin
a
i t A e = within the maximum relay bandwidth of 2.82
o
A c c = = .
4.1 Fixed-band hysteresis current control
The ac outputs of the half-bridge inverter under the fixed-band hysteresis current control
are shown in Fig.8. the fundamental component
*
a
v of the bipolar output voltage
a
v has a

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

109
peak value of 263.7 V. the inverter line current
a
i tracks the sinusoidal reference within an
absolute error margin c . The error current resulting from the fixed-band hysteresis action
resembles a frequency-modulate triangular signal of constant amplitude. The implicit
relation between the error current duty cycle and the reference voltage
*
a
v is clearly seen in
Fig.8. The symmetric duty cycle, i.e. 0.5 D = , happens whenever the reference voltage
approaches a zero crossing.

0.2333 0.2375 0.2417 0.2458 0.25
-400
0
400

V
v
a
and v
*
a
, M = 0.659
0.2333 0.2375 0.2417 0.2458 0.25
-21.2
0
21.2

A
i
a
(t)
0.2333 0.2375 0.2417 0.2458 0.25
-2.82
0
2.82

A
e
a
(t)
Time(sec)

Fig. 8. Inverter ac outputs under fixed-band hysteresis control.


Fig. 9. Simulation results obtained from the developed model and Simulink.

Applications of MATLAB in Science and Engineering

110
The harmonic parameters of the model are computed the system and controller parameters
as follows: substituting the reference voltage in (4) results in an amplitude modulation index
of 0.659 M = ; from (3), the carrier frequency is
1
23.05 1383
c
f f Hz = = ; and from (8), the
frequency modulation index is 3.2 | = 3.2. Fig.9 compares the harmonic spectrum of the
error current ( )
a
E f computed from (20) to that obtained from the Fourier analysis of the
time-domain simulation results using Simulink. The figure shows a good agreement
between the two spectra in terms of frequency order, magnitude and angle.
The spectrum bands are concentrated around the order of the carrier frequency and are
stepped apart by two fundamental frequency orders
1
2 f as shown in Fig.9. With reference
to (9) and Fig.9, it is shown that 98% of the spectrum power is laying in the bandwidth
1 1
4( 1) 16 BW f f | = + ~ . Therefore, the spectrum bands outside this range contribute
insignificantly to the total spectrum power and thus can be truncated from the spectrum for
easier numerical applications.
To study the effect of line parameter variations on the harmonic performance of the inverter,
the DG source voltage is decreased to have the dc voltage 350
c
V V = , then the harmonic
spectrum is recomputed using the model and compared to the results obtained from
Simulink. Decreasing
c
V will increase M and | according to (4) and (8) respectively, but
will decrease
c
f according to (3).


Fig. 10. E
a
(f)| when V
c
is decreased to 350V.
With reference to the results shown in Fig.10, the harmonic spectrum ( )
a
E f will shift to the
lower frequency order of, approximately, 18, and will span a wider range, as | is greater.
The frequency bandwidth has slightly increased to
1
18 f from the previous value of
1
16 f
due to the slight increase in 3.2 | = to 3.66 | = .
The total spectral energy of the error current depends on the relay bandwidth c and it is
independent of | . As | increases the spectrum energy redistributes such that the bands

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

111
closer to
c
f decrease in magnitude and those that are farther from
c
f increase as shown in
Fig.10. The Total Harmonic Distortion (THD) of the line current thus will not be affected by
changing
c
V .


Fig. 11. |E
a
(f)| when the system inductance is decreased by 25%.


Fig. 12. Results from reducing c by 50%.
Next, the system and control parameters are set to their original values and the inductance
is decreased by 25% to 15 L mH = . The results are shown in Fig.11. Lower inductance results

Applications of MATLAB in Science and Engineering

112
in higher switching frequency according to (3) and higher | according to (8). The harmonic
spectrum ( )
a
E f shifts to higher frequencies as
c
f is increasing, and the spectrum spans a
wider range as | is increasing. The amplitude modulation index M and D are affected by
the system inductance variation since the inverter reference voltage
*
a
v depends on system
inductance L .
The width of the relay band is reduced by half while maintaining the rest of the parameters
at their base values. As (4) indicates, M is independent of c and thus it remains unchanged
from its value of 0.659. Referring to Fig.12, as the error band is reduced by half, the carrier
frequency doubles and the harmonic spectrum ( )
a
E f will be concentrated around,
approximately, the order of 46. The frequency modulation index | doubles and thus the
spectrum spreads over a wider frequency range overall decreasing in magnitude, as seen in
Fig.12. Under these conditions, the THD of the line current will decrease to approximately
5% as the spectral energy of the spectrum is proportional to the relay bandwidth c .
To study the harmonic performance of the inverter under distorted system voltages, the
system and control parameters are set to the original values and the 11
th
order voltage
oscillator ( ) ( )
11 1
15 sin 11 v t t V e = is included in the source voltage
s
v to simulate a
distorted ac network voltage. The simulation is run for 30 fundamental periods to ensure
solution transients are vanishing, and the last fundamental period of the inverter ac outputs
are shown in Fig.13.

0.4833 0.4875 0.4917 0.4958 0.5
-400
0
400


V

V
*
a
= 186.5 V
rms
; V
11
= 10.8 V
rms
; M
11
= 0.04
0.4833 0.4875 0.4917 0.4958 0.5
-21
0
21
i
a
(t)


A

0.4833 0.4875 0.4917 0.4958 0.5
-2.82
0
2.82

A
e
a
(t)
Time(sec)

Fig. 13. Effect of injecting the 11
th
ac harmonic voltage on the inverter ac outputs.
Comparing Fig.8 and Fig.13, the reference voltage is distorted due to the presence of the 11
th

voltage oscillator in the source. The output voltage of the inverter is still bipolar, i.e.
400
a
v V = . Fig. 14 compares the instantaneous frequency of the error current under
sinusoidal ac voltage
ia
f to that under the distorted ac system voltage
ia
f ' .

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

113
0.4833 0.4875 0.4917 0.4958 0.5
15
19
23
27
Time (sec)

f

/
f
1
ia
f '
ia
f

Fig. 14. Instantaneous frequency of e
a
(t) when v
s
is distorted.
According to (32), the carrier frequency
1
23.05
c
f f = is constant and independent of the
distortion terms. The amplitude modulation index
11
0.038 M = is computed from (34),
subsequently, the harmonic parameters
11
0.062 |
+
= and
11
0.074 |

= are computed from (37).




Fig. 15. Error spectrum when v
sa
contains the 11
th
oscillator voltage.
Fig.15 compares the harmonic spectrum ( )
a
E f ' obtained from (38) to that computed from
the Fourier analysis of Simulink outputs with very good agreement in terms of frequency
order and magnitude. The spectral energy is centered on the carrier frequency
1
23.05
c
f f =
with spectrum bands are stepped apart by
1
2 f . The frequency bandwidth increases due to
the distortion terms, and as Fig.15 shows, the spectrum bands leaks to as low of a frequency
order as 5. Notice that the THD of the line current did not change as the controller
bandwidth did not change.

Applications of MATLAB in Science and Engineering

114
Similar analysis is performed to study the harmonic performance of the inverter when the
dc voltage contains the distortion ( ) ( )
8 1
28.2 sin 8 v t t V e = . The inverter instantaneous
outputs obtained from Simulink are shown in Fig.16. Notice that the voltage
a
v is still
bipolar but distorted.

0.4833 0.4875 0.4917 0.4958 0.5
-400
0
400


V

V
*
a
= 186.5 V
rms
; V
8
= 20 V; M
8
= 0.05
0.4833 0.4875 0.4917 0.4958 0.5
-21
0
21
i
a
(t)


A

0.4833 0.4875 0.4917 0.4958 0.5
-2.82
0
2.82

A
e
a
(t)
Time(sec)

Fig. 16. Effect of injecting the 8
th
dc harmonic voltage on the inverter ac outputs.
The dc distortions impose additional noise component on the instantaneous frequency, see
Fig.17, and subsequently, according to (38) the harmonic spectrum is drifting to lower order
harmonics as shown in Fig.18.

0.4833 0.4875 0.4917 0.4958 0.5
15
19
23
27
Time (sec)
ia
f '
ia
f
1
/
f
f

Fig. 17. Frequency of e
a
(t) when the input dc is distorted.

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

115

Fig. 18. Error spectrum when the 8
th
dc background distortion exists.
4.2 Variable-band hysteresis control
The harmonic performance of the same half-bridge inverter used in section 2.4.1 is analyzed
when the variable-band hysteresis current control is employed. Similar harmonic studies to
those in the previous section are performed to compute the spectral characteristics of the
inverter harmonic outputs using the developed models in section 2.3 and compare them
with results obtained from time-domain simulations using Simulink.

0.235 0.24 0.245 0.25
-400
0
400
v
a
(t) and v
*
a
(t)

V
0.235 0.24 0.245 0.25
-50
0
50
i
a
(t)

A
0.235 0.24 0.245 0.25
-2.8
0
2.8
e
a
(t)

A
Time (sec)
Fig. 19. Instantaneous outputs of the variable-band hysteresis control.

Applications of MATLAB in Science and Engineering

116
The instantaneous line outputs of the single-phase inverter operating under variable
hysteresis control are shown in Fig.19. With the maximum relay band
o
c is set to 2.82, the
error current ( )
a
e t resulting from the variable-band control is an amplitude-modulated
triangular signal of carrier frequency
o
f . Regardless of the adopted switching pattern, the
reference voltage is
( )
*
1
263.7 sin 37
a
v t V e

= + and hence, 0.659 M = . From (42), the
average frequency is
1
29.4
o
f f = . Fig.20 compares the spectrum ( )
a
E f computed from (44)
to that computed from the harmonic analysis of time-domain simulation of the inverter
using Simulink. The figure shows a good agreement between the two spectra in terms of
frequency order and magnitude. The center band is located at
1
29.4
o
f f = and the side
bands are stepped by
1
2 f as shown in Fig.20. The spectral energy of ( )
a
E f is distributed
over the frequency range
1
27.4 f to
1
31.4 f (i.e.
1
4 BW f = ).


27.4 29.4 31.4
0
0.25
0.5
0.75
1
|E
a
(f)|
f / f
1



A



Model
Simulink

Fig. 20. Comparing model results to Simulink.
The dc voltage
c
V was decreased to 350V while all other parameters remain unchanged
from Study 1. Decreasing
c
V will decrease
o
f according to (42).
The new values are shown in Fig.21. Consequently, the spectrum ( )
a
E f will shift to the
lower frequency order of, approximately, 25.7, while spanning over the constant bandwidth
of
1
4 f . The spectral magnitudes of ( )
a
E f depend on the relay bandwidth
o
c and M;
therefore, with fixing
o
c and decreasing
c
V , according to (44), the center band magnitude
decreases as M is increasing. While the magnitudes of the side bands are directly
proportional to M, their magnitudes will increase. This is clear from comparing the
harmonic in Fig.21 to that of Fig.20. Similar to the fixed-band control, the Total Harmonic
Distortion (THD) of the line current is independent of
c
V .

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

117
23.7 25.7 27.7
0
0.25
0.5
0.75
1
|E
a
(f)|
f / f
1



A



Model
Simulink

Fig. 21. Error spectra when 350 .
c
V V =

57 59 61
0
0.1
0.2
0.3
0.4
0.5
|E
a
(f)|
f / f
1



A


Model
Simulink

Fig. 22. Error spectra when relay bandwidth is halved.
when
o
c is halved, the carrier frequency
o
f doubles and the harmonic spectrum ( )
a
E f will
be concentrated around, approximately, the order of 59. The THD of the line current will

Applications of MATLAB in Science and Engineering

118
decrease to as low as 5% since
o
c decreases. This is demonstrated when comparing the
harmonic spectra of Fig.22 and Fig.20.
The value of the inductance is decreased to 15 L mH = . The results are shown in Fig.23.

37.2 39.2 41.2
0
0.25
0.5
0.75
1
|E
a
(f)|
f / f
1



A



Model
Simulink

Fig. 23. Inverter harmonic response to 25% reduction in L.

26.4 28.4 30.4 32.4
0
0.5
1
1.5
2
2.5
|I
d1
(f)|
f/f
1

A


Model
Simulink

Fig. 24. DC current harmonics under variable-band control.

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

119
Lower inductance results in higher switching frequency. The harmonic spectrum ( )
a
E f
shifts to higher frequencies as
o
f is increasing to
1
39.2 f . As M is directly proportional to
the system inductance, M decreases and therefore, the magnitude of the center band
slightly increases while the side bands decrease in magnitude as shown in Fig.23. The dc
current harmonics are computed from substituting (44) in (28). The resulting spectra are
shown in Fig.24 with good agreement in terms of frequency orders and magnitudes.


Fig. 25. Error current under distorted dc and ac system voltages.
The harmonic performance of the inverter under distorted system voltages is studied
by simulating the system with the distorted 8
th
order dc voltage ( ) ( )
8 1
28.2 sin 8 v t t V e =
and the 11
th
order ac voltage ( ) ( )
11 1
15 sin 11 v t t V e = . Results obtained from model using
(48) and (49) are compared to those computed from Simulink in Fig.25, the model predicts
the frequency distribution of the dc current harmonics and accurately predicts their
magnitudes.
4.3 Comparison and discussion
The spectral characteristics of the line current under the fixed- and variable-band hysteresis
control are compared in this section. For identical system configurations and controller
settings, i.e.
o
c c = , the analytical relation between
c
f and
o
f is stated in terms of the
amplitude modulation index M as:
( )
2
1 0.5
c o
f M f = . The inverter operates at higher
switching frequency when it employs the variable-band hysteresis control. In addition, from
a harmonic perspective, the frequency bandwidth of ( )
a
E f in the variable-band control
mode is constant (
1
4 f ) and independent of the system and controller parameters; unlike the
fixed-band controller where the bandwidth BW depends implicitly on the system and
controller parameters through the frequency modulation index | .

Applications of MATLAB in Science and Engineering

120
The THD of the line current is directly proportional to relay bandwidth. For similar controllers
setting
o
c c = , the THD is constant as the average spectral energy of the line current is
constant. In fixed- and variable-band modes, the variation of system parameters shifts the
spectral energy of ( )
a
E f to higher or lower frequency orders (depending on the carrier
frequency), while simultaneously redistributing the spectral energy over the frequency
bandwidth BW . The spectral energy of the error current is independent of system parameters;
and hence, the THD of the line current is constant for different system settings.
5. Conclusion
A closed-form numerically efficient approximation for the error current harmonic spectrum
of single-phase two-level inverters employing either fixed- or variable-band hysteresis
current control is derived. The models are based on the amplitude and frequency
modulation theorems.
The instantaneous frequency of the inverter is first derived. Then it is used to closely
approximate the error current by a modulated sinusoid. The error current harmonic
spectrum is basically the Fourier transform of error current complex envelop. In the case of
the fixed-band control, the spectrum reduces to a series of Bessel functions of the first kind
whose argument is implicitly expressed in terms of the system and controller parameters,
where as in the variable-band mode, the spectrum reduces to a 3-element array.
The spectral characteristics such as the carrier frequency and frequency bandwidth are
derived analytically and related to line parameters; it is a development useful in inverter-
network harmonic interactions. Unlike time-domain simulators, the developed models
provide fast numerical solution of the harmonic spectrum as they only involve numerical
computation of single arrays. Simulation results agree closely with the developed
frequency-domain models in terms of frequency order, magnitude and angle.
In addition to the single-phase two-level inverter, the proposed approximations apply also
to the harmonic output of certain three-phase two-level inverters where independent phase
control is applicable, such as the neutral point inverter, and the full-bridge inverter in
bipolar operation.
6. Future directions of research
The models detailed in this chapter can be extended in a number of ways, both in terms of
improving the proposed models as well as in the application of the models in other PWM
applications.
The developed models neglected the dynamics of the Phase-Locked Loop (PLL) and
assumed that the inverter line current tracks a pure sinusoidal reference current. Possible
extensions of the models include the effect of the harmonic current propagation through the
ac network and the deterioration of the terminal voltage at the interface level and its effect
on the reference current generation. As the PLL synchronizes the reference current with the
terminal voltage, the propagation of harmonic currents might affect the detection of the
zeros-crossings of the terminal voltage resulting in generating a distorted reference current.
The hysteresis controller consequently will force the line current to track a non-sinusoidal
reference which, in turn, modifies the harmonic output of the inverter.
The implementation of an LC filter at the inverter ac terminals could trigger a parallel-
resonance which tends to amplify the harmonic voltages and currents in the ac network

Modeling & Simulation of Hysteresis Current Controlled Inverters Using MATLAB

121
leading, in some cases, to potential harmonic instabilities. The improvement of the
developed models to include the effect the filter capacitance on the harmonic performance
of the inverter is an interesting improvement.
Reviews of the developed models show that hysteresis current controlled inverters can have
a switching function notation similar to those inherit with the Sinusoidal PWM inverters.
The switching function is based on the error current characteristics which implicitly depend
on the system and controller parameters. Such development will enable the various time-
and frequency-domain algorithms developed for the harmonic assessment of linear PWM
inverters to be applied to hysteresis controlled inverters.
Harmonic load flow studies of systems incorporating inverters with hysteresis current
control can be formulated based on the developed models. The iterative solution of the
harmonic load flow shall incorporate the harmonic magnitudes and angles obtained from
the developed models for a faster convergence to the steady state solution.
7. Appendix - A
Function
sin( )
( )
(1 )
x
f x
x x
t
=

, | | 0, 1 x e satisfies
0 1
lim ( ) lim ( )
x x
f x f x t

= = , is continuous, convex
and has even symmetry in | | 0, 1 . The approximation of ( ) f x in | | 0, 1 , ( ) sin( ) f x A x t t = + ,


Fig. A1. Approximation of
sin( )
( )
(1 )
x
f x
x x
t
=

by ( ) (4 ) sin( ) . f x x t t t = +
satisfies the same properties in | | 0, 1 . Subsequently, constant A is calculated such that the
square error over the interval | | 0, 1 ( ) ( ) ( )
1
2
2
0
f f x f x dx A =
}
is minimized. Substituting
the expressions of ( ) f x and ( ) f x into the mean-squared-error
2
f A and evaluating the
integrals numerically yields a function of the parameter A , as
( )
2 2
0.5 0.858 0.3833 f A A A A = + . Therefore, the value of A that minimizes
2
f A is
0.858 A = or 4 A t = . Functions ( ) f x and ( ) f x are shown in Fig. A1.

Applications of MATLAB in Science and Engineering

122
8. References
Albanna, A. & Hatziadoniu, C. J. (2009). Harmonic Analysis of Hysteresis Controlled Grid-
Connected Inverters, proceedings of the Power Systems Conference and Exposition,
Seattle, WA, March, 2009.
Albanna, A. & Hatziadoniu, C. J. (2009). Harmonic Modeling of Single-Phase Three-Level
Hysteresis Inverters, proceedings of the North American Power Symposium, Starkville,
Mississippi, October, 2009
Albanna, A. & Hatziadoniu, C. J. (2009). Harmonic Modeling of Three-Phase Neutral-Point
Inverters, proceedings of the North American Power Symposium, Starkville, Mississippi,
October, 2009
Albanna, A. & Hatziadoniu, C. J. (2010). Harmonic Modeling and Analysis of Multiple
Residential Photo-Voltaic Generators, proceedings of the Power and Energy Conference
at Illinois, Urbana-Champaign, Illinois, February 2010
Albanna, A. & Hatziadoniu, C. J. (2010). Harmonic Modeling of Hysteresis Inverters in
Frequency Domain, IEEE Transactions on Power Electronics, May 2010

You might also like