SystemSimulationUsingVHDL AMS
SystemSimulationUsingVHDL AMS
Using VHDL-AMS:
Modeling Multiple
Physical Domains for
HEV Applications
Xiao Hu
Scott Stanton
Vincent Delafosse
ANSYS Inc.
Overview of VHDL-AMS
Applications:
Battery: Electrochemistry
Heat Exchanger: Fluid, Thermal
1993 1999
Entity Architecture
Interface description of a Behavior description
subsystem or physical Can be dataflow, structural,
device procedural, etc
Specifies input and output Modeling can deal with both
ports to the model analog (continuous) and
digital (discrete) domains
Entity Voltage
Architecture
Description of the model and no solving information is required
Entity Architecture
LIBRARY Ieee; ARCHITECTURE arch_cap OF cap IS
use Ieee.electrical_systems.ALL; QUANTITY voltage ACROSS current THROUGH p TO n;
ENTITY cap IS BEGIN
GENERIC (
capacitance : capacitance := 1.0e-3 IF (domain = quiescent_domain) USE
);
PORT ( voltage == init_v;
QUANTITY init_v : IN voltage := 0.0;
TERMINAL p : electrical; ELSE
TERMINAL n : electrical
); current == capacitance * voltage'dot;
END ENTITY cap;
END USE;
The capacitor
entity has one
model constant, The model description essentially
one input, and two has two lines, one for initial
terminals condition and one for the
governing equation!!
2010 ANSYS, Inc. All rights reserved. 8 ANSYS, Inc. Proprietary
Open VHDL-AMS Basic Library
PM Motor example
Slip rate
-20.00
-35.00
0 500.00m 1.00
0 0 0
TBar.TORQUE [Nm]
SPRING_ROTB2.TORQUE [Nm] -4.20
-4.20 -4.20
0 500.00m 1.00
0 500.00m 1.00 0 500.00m 1.00
Entity Architecture
ENTITY steady_state_boundary_value IS ARCHITECTURE arch_steady_state_boundary_value OF
generic ( steady_state_boundary_value IS
phibc: real := 0.0
); quantity phi1,phi2,phi3,phi4,phi5 : real;
END ENTITY steady_state_boundary_value; constant h : real := 0.25;
BEGIN
phi1 == phibc;
(phi3-phi1)/(2.0*h) == 1.0*h;
(phi4-phi2)/(2.0*h) == 2.0*h;
(phi5-phi3)/(2.0*h) == 3.0*h;
(1.0*phi3-4.0*phi4+3.0*phi5)/(2.0*h) == 4.0*h;
END ARCHITECTURE
arch_steady_state_boundary_value;
Entity
ENTITY transient_diffusion IS Architecture (main part)
generic ( IF (domain = quiescent_domain) USE
rho: real := 2000.0;
k: real := 2.0; T1 == 20.0;
Cp: real := 1000.0); T2 == 60.0;
END ENTITY transient_diffusion; T3 == 100.0;
T4 == 60.0;
T5 == 20.0;
ELSE
END USE
Li+
Li+
( e ce ) 1 t Li
e De ce j
t
LixC6 F e
Lix-Metal-oxide
Electrochemical Kinetics
Solid-State Li Transport
Charge Conservation/Transport
Electrolytic Li Transport (Thermal) Energy Conservation
F F
jn i0 exp a s exp c s Algebraic
RT RT
2010 ANSYS, Inc. All rights reserved. 18 ANSYS, Inc. Proprietary
VHDL-AMS Implementation: Entity
LIBRARY Ieee;
use Ieee.thermal_systems.all; csnmax: real := 26390.0;
use Ieee.fluidic_systems.all; cspmax: real := 22860.0;
use Ieee.math_real.ALL;
use Ieee.electrical_systems.ALL; alfa : real :=0.5;
ENTITY battery IS
generic ( deltas : real := 52.0e-6;
deltan : real := 100.0e-6;
diffD : real := 7.5e-11; deltap : real := 183.0e-6;
epslonn: real := 0.357; Rsn : real := 12.5e-6;
epslonp: real := 0.444; Rsp : real := 8.0e-6;
epslonfn: real := 0.172;
epslonfp: real := 0.259; F : real := 96485.3;
sigman : real := 100.0; T : real := 298.0;
sigmap : real := 3.8; R : real := 8.31;
diffDsn: real := 3.9e-14;
diffDsp: real := 1.0e-13; init_c : real := 2000.0;
kn: real := 2.334e-11; init_csn: real := 14870.0;
kp: real := 2.334e-11; init_csp: real := 3900.0
Bruggn: real :=1.5; );
Bruggp: real :=1.5;
PORT (
zp : real := 1.0; TERMINAL negative : electrical;
mup: real := 1.0; TERMINAL positive : electrical
sp : real :=-1.0; );
n : real := 1.0;
END ENTITY battery;
x=Lp+Ls+Ln
x=Lp+Ls
x=Lp
x=0
1/10 C
1/2 C
1C
2C
4C
6C
8C
10 C
Reference:
2010 ANSYS, Inc. Long Cai, Ralph E. White, Journal of Electrochem.
All rights reserved. 23 Soc., 156 (3), A154-A161 (2009) ANSYS, Inc. Proprietary
Results: Newman 1d Model
Reference:
2010 ANSYS, Inc. C. R. reserved.
All rights Pals and J. Newman Journal of Electrochem.
24 Soc., 142 (10), 3274-3281 (1995) ANSYS, Inc. Proprietary
Heat Exchanger for IGBT Package
550.00 550.00
500.00 500.00
Y1 [kel]
Y2 [kel]
450.00 450.00
400.00 400.00
350.00 350.00
300.00 300.00
0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00 0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00
Time [s] Time [s]
550.00 550.00
500.00 500.00
Y2 [kel]
Y1 [kel]
450.00 450.00
400.00 400.00
350.00 350.00
300.00 300.00
0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00 0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00
Time [s] Time [s]
550.00 550.00
500.00 500.00
Y1 [kel]
Y2 [kel]
450.00 450.00
400.00 400.00
350.00 350.00
300.00 300.00
0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00 0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00
Time [s] Time [s]
PDEs in 3D
Discretization becomes complex without help of a
commercial code.
It becomes tedious to write discretized equations.
Efficiency
Select Terminal.
Add two terminals as shown below by pressing the add button.
Do NOT press the OK button yet.
Select Quantity.
Add one quantity as shown below.
Do NOT press the OK button yet.
Select Generic
Add one generic as shown below.
Press the OK button.
Select the vhdl_resistor tab and the entity part of the VHDL-AMS
should look as follows.
Note that you could have edited the entity directly. But as a
beginner, you may find using the panel easier.
Follow the same procedure to create the model for the capacitor.
You are ready to connect them to create a RC circuit.
BEGIN
phi1 == phibc;
(phi3-phi1)/(2.0*h) == 1.0*h;
(phi4-phi2)/(2.0*h) == 2.0*h;
(phi5-phi3)/(2.0*h) == 3.0*h;
(1.0*phi3-4.0*phi4+3.0*phi5)/(2.0*h) == 4.0*h;
quantity T1, T2, T3, T4, T5, N0p, N1p, N2p, N3p, N4p, N5p : real;
constant h : real := 2.0e-3;
BEGIN
N0p == -k*(4.0*T1-0.5*(T1+T2))/h;
N1p == -k*(T2-T1)/h;
N2p == -k*(T3-T2)/h;
N3p == -k*(T4-T3)/h;
N4p == -k*(T5-T4)/h;
N5p == -k*(0.5*(T4+T5)-4.0*T5)/h;
T1 == 20.0;
T2 == 60.0;
T3 == 100.0;
T4 == 60.0;
T5 == 20.0;
ELSE
END USE;