You are on page 1of 6

168

Hardware Implementation of Neural Network Controlled


Optimal PWM Inverter Using TMS320C30 Board

M. Mohaddes A.M. Gole P.G. McLaren


Department of Electrical and Computer Engineering
University of Manitoba
Winnipeg, Manitoba, Canada
email:mohades@ee.umanitoba.ca

Abstract
An optimal PWM scheme is used to control a
voltage source inverter. The switching angles
are controlled by a feed forward artificial neu-
ral network in a way that all non-triplen har-
monics up to the 29th are completely removed
from the output and the amplitude of the funda-
mental is set at the desired level. The neural net-
work is emulated by a TMS320C30 DSP board
along with the other parts of the control unit of
the inverter.
1 Firing Circuit

Intvoduction Fig. 1 Three phase voltage source inverter


PWM is now the most widely used scheme for
voltage source inverter.From the several methods voltage is equal to the sum of the mean squares of
available to produce a PWM waveform, the space fundamental and all harmonics, then for a given
vector method and the carrier based methods[ 11are amplitude of fundamental, the total harmonic dis-
more widely used. They are easy to implement and tortion is always the same, regardless of the
do not assume any particular shape for the voltage selected switching method. But the switching
they approximate. But, even with relatively high instants can be adjusted such that the selected
switching frequencies, there are still considerable lower harmonics disappear (or decrease substan-
lower order harmonics in their output voltages tially) at the expense of increase in other harmon-
[2].The harmonic elimination method on the other ics. Since loads are usually inductive, higher
hand is not very popular although it can completely harmonics can be filtered more easily by the load
remove the selected lower order harmonics with without need of additional filters. Also as the tri-
the minimum switching frequency. This is mainly plen current harmonics cannot flow in a three wire-
because of two problems: it is difficult to imple- three phase system, there is no need to eliminate
ment and it can only approximate a sinewave. The the triplen harmonics in the phase voltages.
latter problem has been addressed by some authors The magnitude of harmonics for a PWM waveform
[3], while this paper focuses on the first. with odd and half wave symmetries, and n switch-
ing actions per quarter cycle of fundamental, is
Selected Harmonics Elimination obtained from the following equations:
The circuit diagram of a three phase, two level
voltage source inverter is shown in fig. 1.For a two
I-2cosa
level inverter, where the output phase voltage is 1 +2cosa2
always either +E or -E, the r.m.s. value of the volt-
age is always E2. Since the mean square of this - 2 c o s a j . . .2cosan]

ISBN 0-7803-4147-3lIEEE CAT. NO. 97CH36117 Q 1997 IEEE 1 9 9 7 Conference on Communications, Power and Computing
WESCANEXP7 Proceedings; Winnipeg, MB; May 22-23,1997; pp. 168-173
169

proved to be quite sufficient in this case. D is a fast


h3 = ( 8 . & ) . [ 1 - 2cos3a + 2 cos3 a2

- 2 COS39.. .2COS3an
1

hk = (8.;). ~ 1 - 2 c o s k a1 +2coska2 Fig. 2 Snubber Circuit


-2coska3...2coskan]
recovery diode, C is a 1pF DC capacitor and R is a
la resistor.
where E is half of the DC source voltage, hi is the The triggering signals for the IGBT’s are produced
magnitude of the ith harmonic and ajis the jth by hybrid driver circuits which provide the neces-
switching angle. sary isolation between the C30 board and the
inverter. Since drivers of the three upper IGBT’s
To find the a9sneeded for elimination of specific must have separate grounds to avoid the short
harmonics, it is sufficient to set the corresponding circuiting of emitters, each driver is supplied by a
h’s in the above equations to zero and solve for the separate DC source. These sources are actually six
a’s. The value of h, could be any desired value DC-DC converters fed by a common 5Volts sup-
between zero and some value less than 1.25E. The
exact maximum of hi depends on the eliminated Ply.
harmonics. The number of chops per quarter cycle of output
waveform was decided to be 9. This way all cur-
During the operation of the inverter, the desired rent harmonics up to the 29th are removed. The
value of h i may change, so eq. (1) must be solved maximum magnitude of the fundamental for this
for new values of hl. These equations are nonlinear case is 1 15E. Eq. (1) has no solution for values of
e

and can be solved only by iterative methods. This h i greater than this.
process is time consuming, may diverge, and is
therefore not suitable for on-line implementation. The Artificial Neural Network
The conventional approach to this problem is to
solve the equations off-line and save the results in The neural network used is a feedfonvard two
a look up table. Our approach is to use a feed-for- layer network with one input and n output neurons.
ward neural network which accepts modulation The input is the desired amplitude of the funda-
index as input, and outputs the switching angles[4- mental in per unit and the outputs are the switching
51. These angles are then used by the firing system angles. Different numbers of hidden units were
along with the desired frequency to find the exact tried and it was found that usually about n/2 hidden
ON and OFF instants for every switch of the neurons are sufficient.
inverter.
The neural network is trained off-line. To produce
Structure of The Inverter the training set for the ANN, eq. 1 is solved for
more than 100 equally spaced values of hi. As
The inverter used in this project consists of three explained before, the triplen current harmonics
double IGBT modules with the ratings of 600V cannot flow out of this inverter, so the correspond-
and 50 Amps each. The DC supply is a three pulse ing equations are not considered. The amplitude of
diode rectifier with a large capacitor filter. Since all other harmonics are set to be zero.
the DC current changes rapidly, we need a snubber In the hardware prototype the neural network is
circuit to protect the IGBT’s against the over volt- emulated by a subroutine. The weights and biases
ages caused by the inductances of the DC supply of the network obtained in the training stage are
and wires. The simple snubber circuit of fig.2 has loaded to the C30 board at the initialization time.
Then every time the input to the network is
changed by the user, the subroutine i s called and
calculates the switching angles.
170

Piece wise-linear neural network


When the sigmoid transfer function is used for the
neurons, the ANN subroutine is not fast enough
because calculation of exponential function and

1
P

-5 4 -3 -2 -1 0 1 2 3 4 5

Fig. 3 Piecewise linear characteristic


division takes a lot of time for each neuron. To
solve this problem, we replaced the sigmoid trans- x) 2, Y e
..oa
65

fer function of neurons with a piecewise-linear Fo""sr A"'Iy.'.


_..">U

transfer function (Fig. 3). When we replace the sig-


moid characteristic with the picewise-linear in a
trained network, the obtaining switching angles are -2=
not far from the previous ones. But since the mag- g *
nitude of harmonics in the output voltage is very
sensitive to changes in a's, we have unacceptably
large harmonics in the output. Fig. 4 shows a typi- 0 s ,o *s 20
Ha-ni~
25
Nudsr
30 35 .O s. 60

cal output voltage waveform and spectrum for this


case. To solve this problem, we chose to train the fig. 5 Simulation Results: Voltage and current
network considering the piecewise-linear charac- waveforms and spectra for picewise-linear net-
teristic for neurons. Although in this case the work
objective function is not differentiable at all points,
it is still continuous and therefore it is possible to find a global minimum. We used the weights of the
previous network (with nonlinear neurons) as the
starting point and chose back propagation as the
optimization technique. Since for modulation
index M greater than 1 the variations of a's with M
is highly nonlinear, we limited M to 1. This way
we could reduce the number of hidden units to 3
and get quite satisfactory results. Fig. 5 illustrates
the voltage and current waveforms and spectra for
two different values of M. All harmonics up to the
29th are cancelled and the load current has very lit-
tle ripple

Implementation of the Controller on


the C30 Board
The information flow between the inverter, C30
board and the host PC is as shown in fig.3 The win-
Fig.4 Simulation results for piecewise-linear network dows-based graphical user interface program is run
with the weights of sigmoid-neuron network on the host pc. This program initializes the C30
board and loads the C30 program. The two pro-
171

After each switching action, the time interval to


the next switching in pulse number is loaded in the
timer’s period register and the timer starts running.
When the timer reaches the value specified in the
period register, it sends an interrupt signal to the
C30 processor. The processor then calls an inter-
rupt routine.
The interrupt routine first finds which phase of the
inverter should change its state, then applies the
Fig. 6 Signal flow diagram necessary changes to the serial port’s control regis-
ter. A short dead time is inserted between tuming
grams communicate by hand shaking method. At off one IGBT and tuming on the other to take into
start up the C30 program loads the neural network account the delay of the switch. By loading the
weights and biases from a disc file to the board’s time interval to the next switching to the period
memory. Then it resets the timers and defines six register the interrupt routine completes its job and
pins of the serial port as the general purpose out- control goes back to the main C30 routine.Fig.4
puts[6]. These outputs convey the ON/OFF signals shows the internal relations of the firing system’s
to the IGBT drivers. After that the program enters components.
an infinite loop.
In the infinite loop the program is waiting for new Graphical User Interface
values of voltage or frequency sent by the PC pro-
gram. Every time a new value for the inverter out- A C++ program runs on the host PC to provide a
put voltage amplitude is sent to the C30, the neural convenient way to communicate between the user
network function is called and the switching angles and the firing control program running on the C30.
for the first quarter cycle are determined. Then the This program also initializes the C30 board and
switching angles for the whole cycle of all three loads the firing control program to it. Fig. 5 shows
phases are calculated. Using the specified fre- the GUI window. As shown, voltage and frequency
quency, the program then computes the time inter-
val between every two successive switching
actions, no matter which phase they belong to.
These time intervals are translated to the number of
timer clock pulses.

The C30 Board


f 7

Switching sig-
nals to IGBT
LA drivers
S.

time to next
Intr. Fig. 8 The GUI window
Timer routine 3Serial port can be changed either by sliders or by typing the
values directly into the text child windows. By
means of radio buttons the user can choose to
change the two values independently or propor-
tionally. When the exit command is issued, the
GUI program sends the proper signal to the C30
Fig. 7 Firing control routines program to turn off all the three upper IGBTs and
turn on the lower ones. Thus the output voltages
will be zero and a freewheeling path is provided
172

for the load current. cant mechanical transients. One should also be

Results 20
I I
M
"
I

The proposed system was tested using a 5Hp,208V


induction motor as load. A DC generator was con-
nected to the induction machine shaft to provide
the mechanical load. Figures 6 and 7 show the cur-
rent waveforms for constant Volts per Herz control
at 50% and 100% of rated speed. As can be seen,
N
-

Fig. 10 Experimental Results: Current


waveform and fft for V=l .Op.u. and f=60Hz

cautious with fast change of frequency as this may


result in large transient currents. Fig. 8 shows the
Fig. 9 Experimental Results: Current wave- current for 1Hz step change in frequency.
form and its fft for v=O.5p.u. and f=30Wz

in both cases all harmonics up to the 29th are prac-


tically cancelled and the first harmonics to appear
are 29th and 3 1st. The waveform improves signifi-
cantly by increasing the voltage magnitude and fre-
quency as expected. The number of chops per
cycle can be increased for lower fundamental fre-
quencies. This will provide a constant switching
frequency and smoother current waveforms. But
changing the number of pulses can produce signifi-
I I If I ' I( " I

Fig. 8 Experimental Results: Current


transient after a 1Hz step change in fie-
173

Conclusion
The experimental results show the possibility and
usefulness of controlling the switching angles of
voltage-source inverter by means of an artificial
neural network. The TMS320C30 signal process-
ing chip proved to be adequate for emulating the
neural network and performing the necessary cal-
culations for firing control. In constant frequency
applications such as UPS and STATCOM the out-
put current can be easily filtered as almost only two
harmonics appear in the output.

References
[ 13 J.Holtz, “Pulsewidth Modulation-A Survey”
IEEE Trans. Ind. Elec. Vol. 39, NO. 5, Dec. 1992.

[2] D.G. Holmes, ‘The significance of zero space


vector placement for carrier-based PWM
schemes”, IEEE Trans. Ind. Appl. VOL. 32, NO. 5 ,
SepJOct. 1996.

[3] J.Holtz, B.Beyer, ‘The trajectory Tracking


Approach-A New Method for Minimum Distortion
PWM in Dynamic High Power Drives”, IEEE
Trans. Ind. App. Vol. 30, No. 4, july/Aug. 1994.

[4] M.Mohaddes, A.M.Gole, P.G.McLaren, “An


artificial Neural Network Controller for an Optimal
PWM Voltage Source Inverter” 3 1st Universities
Power Engineering Conference, UPEC’96, Iraklio,
Greece.

[5] M-Mohaddes, A.M.Gole, P.G.McLaren, “Har-


monic Elimination in PWM Inverter Using Neural
Network” 1994 Canadian Conference of Electrical
and Computer Engineering CSECE’94, Halifax,
Canada.

[6]Texas Instruments, “Third-Generation TMS320


User’s Guide” 1988,Texas Instruments Incorpo-
rated.

You might also like