Implementation of SPWM Technique For 3 - VSI Using STM32F4 Discovery Board Interfaced With MATLAB
Implementation of SPWM Technique For 3 - VSI Using STM32F4 Discovery Board Interfaced With MATLAB
Implementation of SPWM Technique For 3 - VSI Using STM32F4 Discovery Board Interfaced With MATLAB
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)
Abstract-In this paperj Design and development of 11. BASIC CONCEPT OF PWM SCHEME
control circuit algorithm of 3-4» Voltage Source Inverter
(VSI) using Unipolar Sinusoidal Pulse Width Modulation The efficient method of output voltage control of
(SPWM) techniques is proposed using STM32F407VGTx inverter is to incorporate pulse width modulation control
discovery board interfaced with MA TLAB Simulink within the inverter. A fixed DC input voltage is supplied
Environment. For implementing 3-$ VSIj this method is to the inverter and a controlIed AC output voltage is
most useful as it will eliminate complexity of control circuit
obtained by controlling on-off period of the power
algorithm occurred due to analog circuitj reduces costj size
of filter required and improved overall inverter efficiency.
semiconductor devices used in inverter. The PWM method
Pulse width modulated voltage source inverter is preferred has many advantages such as; i.e. output voltage control
for high performance AC drives. The proposed control can be obtained without any additional components; with
scheme and the result obtained by embedded simulations this type of control; lower order harmonics can be
interfaced with STM32F4 microcontroller are presented and eliminated so that cost and time required for design of
discussed. A simple hardware implementation is proposed
filter circuit and size of filter is reduced. There are many
and experimental results of SPWM based VSI are also
methods to achieved PWM pulses; out of that SPWM
shown. The Simulation results of the proposed scheme have
excellent performance and compared with hardware results. method is illustrated in this paper. For SPWM techniques;
Keywords-SPWM-Sinusoidal Pulse Width Modulation; two signal are compared and based on comparison; gating
VSI-Voltage Source Inverter; STM32f4 Discovery Board; signal is generated to control on-off period of power
PWM-pulse Width Modulation; THD-Total Harmonie
semiconductor switches of inverter. For generation of
Distortion
gating signal using SPWM techniques; reference wave
I. INTRODUCTION having frequency of fr (sine wave) is compared with
carrier wave having frequency of fc (triangular wave);
The Voltage source inverter has a direct control over
when reference wave amplitude Ar is greater than carrier
output voltage. The output voltage waveform depends wave amplitude Ac; positive switch (upper switch) of
upon the type of inverter topologies used; i.e. voltage inverter is switch ON and when reference wave amplitude
source inverter and current source inverter. Output voltage
Ar is less than carrier wave amplitude Ac; negative (lower
of an inverter can be adjusted by internal control of switch) switch is ON and upper switch is switch is OFF.
inverter parameters. Most efficient method for internal
control of inverter parameters is Pulse Width Modulation �on, when
(PWM) techniques. In PWM techniques; input to the Ar>Ac
SI
�
inverter is constant stiff DC voltage and by changing on
off period of the power semiconductor switches; variable
output voltage can be obtained. PWM techniques are
characterized by constant amplitude pulses and width of Load
these pulses is modulated to obtain inverter output voltage
control and to reduce its harmonic content. The main
objective of this paper is to design three phase voltage
S4 6 2
source inverter using sinusoidal Pulse Width Modulation
� on,when
Ar <Ac
(SPWM) techniques to reduce cost and losses occur in
control circuit by implementing the whole control
algorithm in STM32F4 discovery board using embedded
Fig. I: Three Phase Voltage Source Inverter
MATLAB simulation.
Figure 1 basic configuration of three phase voItage Another method is unipolar SPWM technique. In unipolar
source inverter with fixed DC input voltage source. SPWM; two triangular wave with given offset is
TABLE 1: SWITCHlNG compared with sine wave and based on comparison;
Ar> Ac SI or S3 or S5 is ON gating signal is generated for internal control of inverter.
Ar< Ac S4 or S6 or S2 is ON Fig. 3 shows unipolar SPWM techniques waveforms with
gating signals.
When triangular carrier wave has its maximum value
. fc
" dent wlth zero 0f the sme
comcl ' wave; there are N
2fr
= -
r
T i me {s)
Bipolar Sinusoidal pulse width modulation index and it controls the harmonie content of the output
voItage waveform. For modulation index < 1; highest
Fig. 2: Generation of Gating Signal using Bipolar SPWM Technique for
value of harmonic in output voItage waveform is
One Lag of Three Phase Inverter
.
oe
e
�::
.. - ..
- ------ ------
. ..
... .. ..
-----
. ..
------ -
;
: -- ------ ------ ------ ------ -- ; - - ------ ------ ------ ------ -- :-- ---- - -
. .. .. .. .. . .. .. ... . . ... .:. ... ... .. .. .. .. .. . . ; .. ... .. . . .. .. ..
------ ------ ---
.. ..
associated with harmonics of order t±1
where N is the number of pulses per half cycle. So by
or 2N±1;
. mI[�r�·-�··�9+mm
increasing the number of pulses per half cycle; the order
of dominant harmonie frequency can be raised; which can
; ....
I
0.1 •• •• ••• • •••• • ••• ••• i
·· ·································· ·· · ... .. . � . .
.... . . . ... . .. .......... ....................
be then filtered out easily. For modulation index > 1;
:� � + ••••••••.• •••• •••• • lower order harmonic appear; since modulation index> 1;
pulse width is no longer a sinusoidal function of the
angular position of pulse. The output frequency of inverter
is decided by reference wave frequency. Generation of
gating signal using analog circuit is too much costly and
Unipolar Sinusiodal Pulse width modulation losses as it required separate dc power supply for IC 741
Fig. 3: Generation of Gating Signal using Unipolar SPWM Technique for as weIl as it will increase bulkiness of control structure. So
One Lag of Three Phase Inverter to avoid this problem; this paper demonstrate design of
whole control circuit algorithm in digital domain using
STM32F4 microcontroller; so that complexity of control
circuit as weIl as size and cost of circuit is reduced. Also it
PWIIo1I l1Iree I'ttase will improve reliability of the circuit. Fig. 4 shows basic
1151 ..g Opfo
Drit�C"wit
gene-:r,atlon n� ... I ..g
block diagram of practical setup of voltage source inverter
C�plt!'l"!125
.,.,.. 011 .....1.
willl belp ,of IRf53lO
OiRaiils
STM12F4 MOSFiET' using STM32F4 discovery kit board.
disooY"Y1IJt
[2]
t
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)
1I-t==:t===+== IThree
�-wv-�I
-Phase
:n-:b- Fig. 9: THD Analysis of Line Voltage (fr = 50 Hz and f e =2 kHz)
Series RLC Branch - (Without Filter)
&
VP1
100
A. Interfacing between MATLAB STM32F4 Discovery
Board
By using embedded coder target for STM32F4 and
-50
other functioning tools together with the Keil; real time
implementation of developed Simulink model can be
-100
developed and easily loaded into controller.
------- . -------- ,--------- --------
r -. ,..,
-150
, , , To run model file user need two hardware:
0.02 0.04 0.06
TiITlE-(S)
• ST Microelectronics STM32F4 discovery board.
• USB type A to mini B cable.
Fig. 7: Output Line Voltage of Three Phase Inverter with R Load
(fi= 50Hz and f e = 2 kHz)
Design a Simulink model comprises an embedded
target blocks as per requirements of application and
, ,
VP l
availability. The main directory path is located properly in
- ----------- ;- ------------:------------�------------� ------------
,
60
command window of MATLAB before building any
· ,
,, ,,
,, ,,
------- - :- --- - -- : - - - - - - - - - - - �- - - - - - - - - - - - � - --- -------
· ,
Simulink model file. The Support package for
------ - - -:- - - - -- - - - - - - -: - - - - - - -- - - - - -,: - - - - - - - - - - - - �, - - - ------ -
500 - -- - -- ---- -
· ,
· ,
,, ,,
· ,
- - - - STMicroelectronics STM32F4 discovery board enables
,
40
30
· , ,
user to create and run Simulink models on a discovery kit.
----------- - ----------- ; ----------- :------------ :, ------------
.,
· . . .
· . .
, ,
Support package includes a library of Simulink blocks for
,,
20
,, ,
1f) -
�'-'�'--"-,''-I
· ,
· ,
Fig. 8: THD Analysis of Line Voltage (fr = 50 Hz and F e =1 kHz) Figure 10 shows the embedded simulated model file
(Without Filter) of internal comparison of sine of 50 Hz and triangle wave
[3]
t
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)
of 1000 Hz for PWM generation. In which three sine wave VI. WAIJUNG BLOCK SET FOR STM32F4 DISCOVERY K1T
is of 1200 phase displacement is compared with the
Waijung is a third party interface for STM32F4
triangular wave. The output of comparator is given to
blocks along with MATLAB. In order to complete
GPIO E pin 8 and with using NOT 10gic signal is given to
GPIO E pin 9; similarly for others pins. User have to waijung block installation process user have to install
select model configuration parameters. Set solver type as STM link utility driver. Select parameter setting for target
fixed type and solver as discrete mode (no continuous setup as per requirement.
state). Periodic sampIe time constraint as unconstrained
and tasking mode for periodic sampIe times as single
tasking. After selecting solver setting set target as STM
discovery board and select target loader complier file as Mljung:l •. 12.1
-,
erUIc; So as a resuIt of that when user build model file Compiler. GNU ARM
MCU: S1M32F.11IC
Auto Complle OOwn�d: ON SirwW.....'
PElO
sp..a (MH:): 100
1Y� (PfI'JOD): P!.IU! PuU
Chip En .. "1··c): .."05
through matlab simulation environment that embedded Full
AUlOrun.app:ON
: OFF
model will directly build C code and load into the micro 8ase '" (..c): 0.01
Fig. 10: Embedded Simulated Model for Three Phase SPWM Technique
in STM32F4 Discovery kit
JJlJLJL1LJLJU �
/
JU1Jlfl � �
CH2
i
Undo
Pk-Pk 3.04V Mean 2.47V
Autoset
Period �m.o)Js? Freq 1.008kHz?
[4]
t
1s IEEE International Conference on Power Electronics. Intelligent Control and Energy Systems (ICPEICES-2016)
[5]