IEEE Power Electronics Magazine - June 2016 - 25

subroutine. If the variable is updated by the ADC hardware,
the values coming from PSIM are overwritten and the
simulation becomes incorrect.

The PIL block's output is the controller output voltage computed by the MCU. The variable corresponding to the controller output is read by the CS and its value is sent to the
SE. The voltage received is fed to the PWM conversion
module. The PWM conversion module consists of a voltage
comparator and a triangular voltage source. The voltage
source is configured to match the specification used by the
F28335 PWM block. The PWM is generated with the controller output fed to the comparator's positive terminal and
the voltage source to the negative terminal. The PWM
waveform generated is fed as the feedback to the plant and
the loop is completed. The PWM conversion module consists of a single comparator for one-phase operation and
three comparators connected in parallel for three-phase
operation. The comparators and voltage source are
provided in the PSIM library.

ac
Vin

PWM
Conversion
Block

FIG 7 The PFC circuit for the PIL simulation.

200

0

-200
0.50

0.51

0.52
0.53
Time (s)
(a)

0.54

0.55

0.51

0.52
0.53
Time (s)
(b)

0.54

0.55

0.51

0.52
0.53
Time (s)
(c)

0.54

0.55

Current (A)

10
0
-10
0.50

PFc system

10
Vm (V)

A PFC circuit with a simple power stage and double-loop
voltage and current digital control system with input voltage
sensing is simulated using the PSIM SE. The circuit for the
SIL simulation is presented in Figure 6. The parameters for
the circuit are presented in Table 3. For this example, both
the current and the voltage loop are running at 30 KHz. The
circuit is used to generate the code for the MCU by adding
the MCU peripheral modules for the ADC and PWM from
the SimCoder library. The code is compiled in CCS and the .
out file is generated. Figure 7 contains the circuit used for
the PIL simulation. The data sampling is done by the PIL
block, and therefore an ADC block is not needed.
The PIL block for the PFC circuit is a multi-input, single-output block. Each input is separately configured
according to the sampling frequency, gain, and delay for
the signal. The PIL block's output goes to a 1-ph PWM
converter block. The PWM block's output is fed back
into the circuit. Further, the PIL simulation setup with
the MCU (F28335) is connected to the PC running the
SE instance using an emulation board and USB cable,
and the setup is simulated. The resultant waveforms for
the inductor current, input and output voltage, and controller output voltage are presented in Figures 8 and 9

Power Stage

-

PIL
Block

Model Testing with PIL
The PIL system is tested with both simple power electronic
circuits and more complex motor control algorithms. The
testing is done with a power factor correction (PFC) circuit
and a permanent magnet synchronous motor (PMSM) fieldoriented control (FOC) motor drive example. The simulation results are compared with the SIL and MIL simulation
for the PFC and the PMSM FOC motor drive circuit is tested
and compared with the SIL simulations.

Ld
+

Voltage (V)

controller output to PwM conversion Module

Lin

5
0.50

FIG 8 The simulation results for a PFC circuit in SIL (using PSIM).
(a) Vin and downscaled Vo, (b) I (Lin) and Iref, and (c) controller output (Vm).

for PSIM and PIL simulations, respectively, and are
almost identical.

Foc of PMsM Motor Drive
The PMSM FOC is designed using PSIM with the MCU
peripheral modules based on the conventional FOC scheme
[19] through the drive as detailed in Figure 10 and Table 4.
The power stage is connected to the digital FOC algorithm
June 2016

z	IEEE PowEr ElEctronIcs MagazInE

25



Table of Contents for the Digital Edition of IEEE Power Electronics Magazine - June 2016

IEEE Power Electronics Magazine - June 2016 - Cover1
IEEE Power Electronics Magazine - June 2016 - Cover2
IEEE Power Electronics Magazine - June 2016 - 1
IEEE Power Electronics Magazine - June 2016 - 2
IEEE Power Electronics Magazine - June 2016 - 3
IEEE Power Electronics Magazine - June 2016 - 4
IEEE Power Electronics Magazine - June 2016 - 5
IEEE Power Electronics Magazine - June 2016 - 6
IEEE Power Electronics Magazine - June 2016 - 7
IEEE Power Electronics Magazine - June 2016 - 8
IEEE Power Electronics Magazine - June 2016 - 9
IEEE Power Electronics Magazine - June 2016 - 10
IEEE Power Electronics Magazine - June 2016 - 11
IEEE Power Electronics Magazine - June 2016 - 12
IEEE Power Electronics Magazine - June 2016 - 13
IEEE Power Electronics Magazine - June 2016 - 14
IEEE Power Electronics Magazine - June 2016 - 15
IEEE Power Electronics Magazine - June 2016 - 16
IEEE Power Electronics Magazine - June 2016 - 17
IEEE Power Electronics Magazine - June 2016 - 18
IEEE Power Electronics Magazine - June 2016 - 19
IEEE Power Electronics Magazine - June 2016 - 20
IEEE Power Electronics Magazine - June 2016 - 21
IEEE Power Electronics Magazine - June 2016 - 22
IEEE Power Electronics Magazine - June 2016 - 23
IEEE Power Electronics Magazine - June 2016 - 24
IEEE Power Electronics Magazine - June 2016 - 25
IEEE Power Electronics Magazine - June 2016 - 26
IEEE Power Electronics Magazine - June 2016 - 27
IEEE Power Electronics Magazine - June 2016 - 28
IEEE Power Electronics Magazine - June 2016 - 29
IEEE Power Electronics Magazine - June 2016 - 30
IEEE Power Electronics Magazine - June 2016 - 31
IEEE Power Electronics Magazine - June 2016 - 32
IEEE Power Electronics Magazine - June 2016 - 33
IEEE Power Electronics Magazine - June 2016 - 34
IEEE Power Electronics Magazine - June 2016 - 35
IEEE Power Electronics Magazine - June 2016 - 36
IEEE Power Electronics Magazine - June 2016 - 37
IEEE Power Electronics Magazine - June 2016 - 38
IEEE Power Electronics Magazine - June 2016 - 39
IEEE Power Electronics Magazine - June 2016 - 40
IEEE Power Electronics Magazine - June 2016 - 41
IEEE Power Electronics Magazine - June 2016 - 42
IEEE Power Electronics Magazine - June 2016 - 43
IEEE Power Electronics Magazine - June 2016 - 44
IEEE Power Electronics Magazine - June 2016 - 45
IEEE Power Electronics Magazine - June 2016 - 46
IEEE Power Electronics Magazine - June 2016 - 47
IEEE Power Electronics Magazine - June 2016 - 48
IEEE Power Electronics Magazine - June 2016 - 49
IEEE Power Electronics Magazine - June 2016 - 50
IEEE Power Electronics Magazine - June 2016 - Cover3
IEEE Power Electronics Magazine - June 2016 - Cover4
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2023
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2023
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2023
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2022
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2021
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2020
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2019
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2018
https://www.nxtbook.com/nxtbooks/ieee/pelcompendium_march2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2018
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2017
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2017
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2017
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2016
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2015
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_december2014
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_september2014
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_june2014
https://www.nxtbook.com/nxtbooks/ieee/powerelectronics_march2014
https://www.nxtbookmedia.com