Cdnlive 2016 - Pspice - Matlab Paper
Cdnlive 2016 - Pspice - Matlab Paper
The Device Modeling Interface (DMI) and Exporting Models from Simulink
– Demo
Conclusion
2
Analog/Mixed-Signal Design
Example: Field-oriented Control of a Permanent-Magnet-Synchrone-Machine
This control technique is common in motor drive systems for hybrid electric vehicles,
manufacturing machinery, and industrial automation
vexp
Field-Oriented Power
PWM PMSM
Controller Inverter
Load
I
v
IMPLEMENTATION IMPLEMENTATION
Design trade-
offs difficult Digital Analog
C/C++
SPICE
4
Model-Based Design
Bottom-Up Workflow
DESIGN
– Starting point:
Environment Models
Transistor-level schematic
Digital Models Analog Models
6
Model-Based Design for Analog/Mixed-Signal
Top-Down Workflow
DESIGN
– Starting point:
Environment Models
Mathematical Model
Digital Models Analog Models
Physical Model
– Simulink
Multi-domain simulation environment for dynamic systems
Algorithm development and verification platform
– PSpice:
SPICE-based simulator
Simulation of electrical and electronic circuits
Circuit design platform Hardware
8
How does SLPS work?
9
Step 1: Algorithm Design and Verification
Time-continuous
PI Controllers
(speed, current)
Physical Models
of
Electrical Components
10
Step 1: Algorithm Design and Verification
IGBT
13
Step 3: Simulink/PSpice Co-Simulation (SLPS)
SLPS
Co-Simulation
Interface
14
Step 3: Simulink/PSpice Co-Simulation (SLPS)
Simulink / PSpice
Co-Simulation
Simulink Simulation (SLPS)
wm_ref, wm
wm_ref, wm
Te [Nm]
Te [Nm]
Vs_abc [V]
Vs_abc [V]
Is_abc [A]
Is_abc [A]
15
Automotive Engineering
Interdisciplinary Design Challenge
Vehicle
Electronics
Emission and
Safety &
Fuel
Quality
Economy
Comfort &
Performance
16
Automotive Engineering
Interdisciplinary Design Challenge
Vehicle Electronics
Explosion of Interconnected Electronic Systems with Embedded Software
having some very challenging Power Density issues created by System
miniatuarization for reliability, form & functions.
17
Automotive Engineering
Interdisciplinary Design Challenge
PSpice Solution
Design Trends
System Design linked to System
Interconnected • Mixed Signal Control “Drive By Implementation
Systems Wire” over bus protocols
Mixed Signal Accuracy
accelerated with System Model
Embedded • Complex Algorithmic Control, Abstractions
Software Configurability and
Maintenance Virtual Prototyping –
Model/HIL/SW Co-Simulation for
early S/W Validation
System • Reliability, smaller space,
Miniaturization increased Functions packaged Implementation across multiple
in Lower Power consumption design fabrics –
Chip/Package/Board
18
PSpice complex device macro-model
Analog behavioral
19
PSpice Models
Architectural
System Models (SystemC)
Functional
Digital Models with
IO/Timing/Constraint
Behavioral
Digital Functional Models
Gate Level
20
System Design Exploration to Implementation
Simulink Coder
to PSpice Block
PSpice PCB
Implementation
21
Device Modeling Interface
Digital
Devices
Analog
Behavioral DMI Model Code
Devices
Physical
Devices
22
Device Modeling Interface Libraries
PSpice Common
Model API Definitions
23
Device Modeling Interface – Embedded Coder Steps
24
Device Modeling Interface – Steps for integrating Simulink
models
Generated
C++ Code
OrCAD
Capture Embedded Coder
Code
Embedded
inside DMI
Embedded Coder
Associate
Compile and
PSpice Model
generate dll
with a Symbol
PSpice
PSpice
Run Simulation
25
Simulink Model Example
26
Simulink-PSpice Target Configuration – Code Generation
Embedded Coder
Target C++ Code
Custom Template
Makefile
27
Simulink-PSpice Target Configuration – Custom Code
28
Simulink-PSpice Target Configuration – Interface
Fucnction Prototype
29
Simulink-PSpice Target Configuration – Templates
Custom DMI
Wrapper Code
Template
30
Simulink Simulation Results
31
PSpice Model Example
32
PSpice DMI Library
Generated by
Embedded Coder
33
PSpice Simulation Results
34
Demo
35
Q&A
MathWorks’s Point-of-Contact:
– Bao Nguyen [email protected]
– Corey Mathis [email protected]
Cadence’s Point-of-Contact :
– Kishore Karnane [email protected]
36
Conclusion
37
Conclusion
38