热搜关键词: 电路基础ADC数字信号处理封装库PLC

pdf

PSIM自动代码生成实例操作

  • 1星
  • 2021-04-27
  • 958.74KB
  • 需要3积分
  • 9次下载
标签: 嵌入式

嵌入式

单片机

单片机

模拟电路

模拟电路

数字电路

数字电路

PSIM自动代码生成实例操作

11
FROM PSIM SIMULATION
TO HARDWARE IMPLEMENTATION
IN DSP
Hua Jin
11.1 INTRODUCTION
This chapter describes the basic functions and features of the simulation software
PSIM. Through a grid‐link inverter system example, it illustrates how to set up the
power and control circuits, and how to convert analog controllers to digital control-
lers. Furthermore, it shows how to prepare the system for automatic code generation
and processor‐in‐the‐loop (PIL) simulation with Texas Instruments F28335 DSP.
11.2 PSIM OVERVIEW
PSIM is a simulation software specifically designed for power electronics, motor
drives, and power conversion systems. It features a user‐friendly interface and a very
robust and fast simulation engine. In addition, its capability to generate code
automatically for TI DSP and perform PIL simulation with the DSP helps to speed
up the hardware implementation process significantly.
In PSIM, a circuit is represented in four parts: power circuit, control circuit,
sensors, and switch controllers, as illustrated in Figure 11.1.
A power circuit includes elements such as resistors, inductors, capacitors,
semiconductor switches, and some other elements that conduct electrical current.
A control circuit includes blocks that handle control signals, such as multipliers,
Modeling Power Electronics and Interfacing Energy Conversion Systems,
First Edition.
M. Godoy Simões and Felix A. Farret.
© 2017 John Wiley & Sons, Inc. Published 2017 by John Wiley & Sons, Inc.
256
FROM PSIM SIMULATION TO HARDWARE IMPLEMENTATION IN DSP
Power circuit
Switch controllers
Sensors
Control circuit
FIgURE 11.1
Circuit representation in PSIM.
dividers,
s‐domain,
and
z‐domain
transfer function blocks. Sensors include
voltage sensors, current sensors, and speed and torque sensors. Switch controllers
include blocks that control switches, such as ON–OFF controllers and PWM
controllers.
The structure of the PSIM element library and key elements are listed in the
following text.
Power:
• Resistors; inductors; capacitors; transformers; semiconductor switches
• Magnetic elements
• op. amp.; optocouplers; TL431
• Electric machines; encoders; speed/torque sensors; mechanical loads
• Inductors and semiconductor switches with power loss calculation capability
• Solar cells; wind turbines; batteries; ultracapacitors
• Link to finite element analysis software JMAG
Control:
• Computational function blocks
• Filters;
s‐domain
transfer function blocks
• Logic gates
z‐domain
transfer function blocks; zero‐order hold; unit delay; and other
function blocks for digital control
• Processor‐in‐the‐loop block
• Links to Matlab/Simulink and ModelSim
Other:
• Voltage/current sensors
• Switch controllers
• Probes and meters
FROM ANALOG CONTROL TO DIGITAL CONTROL
257
• Blocks that are common to power and control circuits, such as transformation
blocks, math function blocks, DLL blocks, and C blocks
• PWM ICs (e.g., UC3842, UC3854, UCC3895); driver ICs
• Sources
• Voltage/current sources
SimCoder:
• Event control
• Library for TI F2833x floating‐point DSP
• Library for TI F2803x fixed‐point DSP
• TI Digital Motor Control Library
To create a circuit in PSIM, access the PSIM element library either through the
Element menu or from the Library Browser. To launch the Library Browser, select
View
>>
Library Browser.
Note that in PSIM, one needs to define which voltages
and currents to display explicitly unless the option “Save all voltage and currents
during simulation” is checked. This option is under
Options
>>
general,
and by
default, it is unchecked. To display the voltage of a node or across two nodes, use a
voltage probe. To display the current of an element, either set the current flag of that
element to 1 or insert a current probe.
Once the circuit schematic is completed, select
Simulate
>>
Simulation Control,
and place it on the schematic. Define the simulation time step and total time. Then,
run the simulation by selecting
Simulate
>>
Run Simulation.
After the simulation is completed, the waveform display program Simview will be
launched, and waveforms can be selected for display. In Simview, one can also
perform mathematical calculations (i.e., multiplication of two waveforms, and calcu-
lation of average and RMS values) and FFT analysis.
For further details on how to use PSIM, refer to
PSIM User Manual
[1].
In the following sections, a grid‐link inverter example is used to illustrate how
such a system can be implemented in PSIM, and how the system can be modified to
generate code for TI F28335 DSP for hardware implementation.
11.3 FROM ANALOg CONTROL TO DIgITAL CONTROL
A power converter system may involve a complex control algorithm. In such a case,
a DSP will be well suited to implement the control algorithm. When designing a
digital controller, a common practice is to design the controller in analog domain and
then convert the analog controller to the digital controller. To illustrate this process,
we will use the grid‐link inverter system as an example.
Figure 11.2 shows a grid‐link inverter system. It consists of two stages: the DC–
DC boost converter and the grid‐link inverter. The boost converter provides the
voltage boost and the DC bus voltage control. The inverter is connected to a load and
a utility grid, and the active and reactive power flowing to the grid is regulated.
Figure 11.3 shows the boost controller and the inverter controller.
250u
Boost converter
vdc+
Inverter
ldc
A
Filter
La
la
1
Grid
V
control
208Y/120
3Phase
80
File
Vdc
V
4700u
vdc-
lb
lc
.1u
25
Qbst
Q1
Q4
Q6
Q5
Q3
Q2
1
vb
vc
va
Load
Boost controller
vdc+
Vm_bst
V
vdc+
vm
+
-
fs_bst
vdc–
Pref
V
Qbst
Va
Vb
Vc
la
lb
lc
Qref
V
Inverter controller
va
vb
vc
ia
ib
ic
Pref
Qref
ctrl
control
vma
vmb
vmc
Vma
V
+
+
+
Q1
Q4
Q3
Q6
Q5
Q2
vdc-
FIgURE 11.2
Grid‐link inverter system in analog control.
FROM ANALOG CONTROL TO DIGITAL CONTROL
259
(a)
C3
vdc+
1000
+
6.62
vdc–
R1 C1
R2
+
2.5
5
C2
0.95
vm
0.01
R11
(b)
Inverter controller
va
VgA
VgB
VgC
a
b
c
al
be
al
be
d
q
K
–1
K
theta
–1
Vgq
K
ctrl
Vgd
0
M
0
120pi
theta
V
V
VgA
vb
VgB
vc
VgC
ia
IgA
ib
IgB
ic
IgC
Iqref
ctrl
Pref
ctrl
Igq
Vgq
K
wL
K
÷
k
Iqref
V
+
–wL
+
MUX
+
IgA
IgB
IgC
a
b
c
al
be
al
be
+
Vgd
2.31
K
33
MUX
+
+
+
+
2pi
VgA
VgB
VgC
IgA
IgB
IgC
Q
P
d
q
theta
K
–1
K
–1
lgd
lgq
K
K
ctrl
+
+
+
mg
MUX
–1
K
–1
K
+
d
q
theta
al
be
al
be
a
b
c
K
K
MUX
K
vmb
vma
Igd
ldref
Qref
÷
K
ldref
V
MUX
MUX
+
K
K
ctrl
+
+
+
+
Vgd
md
vmc
ctrl
0
Vgd
K
+
K
MUX
K
+
+
–1
K
–1
K
d
q
al
be
al
be
a
b
c
ctrl
1
Vgq
K
ctrl
+
K
K
+
MUX
+
FIgURE 11.3
System controllers: (a) operational amplifier Type‐3 for the boost controller
and (b) analog‐based three‐phase inverter controller.
The boost controller uses an operational amplifier to implement a Type‐3 controller
to provide voltage control. The inverter controller, on the other hand, uses computa-
tional function blocks,
s‐domain
transfer function blocks, and transformation function
blocks from the PSIM’s control library to implement active/reactive power control
and voltage control. The inverter control algorithm is implemented in the
dq‐frame.
A C block is used to calculate the active/reactive power.
展开预览

文档解析

本文摘自《Modeling Power Electronics and Interfacing Energy Conversion Systems》一书的第11章,由Hua Jin撰写,介绍了从PSIM仿真到DSP硬件实现的过程。PSIM是一款专门用于电力电子、电机驱动和功率转换系统的仿真软件,具有用户友好的界面和快速稳健的仿真引擎。文中以并网逆变器系统为例,详细阐述了如何在PSIM中搭建电力和控制电路,如何将模拟控制器转换为数字控制器,并展示了如何准备系统以实现自动代码生成和基于Texas Instruments F28335 DSP的处理器在环(PIL)仿真。

文中首先概述了PSIM的基本功能和特点,然后通过实例讲解了从模拟控制到数字控制的转换过程,包括使用PSIM中的s2z转换器工具。接着,详细介绍了在PSIM中实现自动代码生成的步骤,包括定义DSP类型、添加ADC转换器、PWM发生器、数字输入/输出等DSP外设模块,并通过SimCoder工具和硬件目标库模块简化了代码生成过程。此外,还讨论了如何设置SCI块以实现实时监控和调试,以及如何通过PIL仿真验证手动编写的DSP代码。最后,作者提供了PSIM仿真文件的下载链接,并推荐了一些用户手册和在线教程以供进一步学习。

猜您喜欢

评论

登录/注册

意见反馈

求资源

回顶部

推荐内容

热门活动

热门器件

随便看看

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved
×