25
© 2010 ANSYS, Inc. All rights reserved. 1 ANSYS, Inc. Proprietary © 2010 ANSYS, Inc. All rights reserved. 1 ANSYS, Inc. Proprietary System Simulation Using VHDL-AMS: Modeling Multiple Physical Domains for HEV Applications Xiao Hu Scott Stanton Leon Voss ANSYS Inc.

System Simulation Using VHDL-AMS: Modeling … UK/staticassets/03...Using VHDL-AMS: Modeling Multiple Physical Domains for HEV Applications Xiao Hu Scott Stanton Leon Voss ANSYS Inc

Embed Size (px)

Citation preview

© 2010 ANSYS, Inc. All rights reserved. 1 ANSYS, Inc. Proprietary© 2010 ANSYS, Inc. All rights reserved. 1 ANSYS, Inc. Proprietary

System Simulation

Using VHDL-AMS:

Modeling Multiple

Physical Domains for

HEV Applications

Xiao Hu

Scott Stanton

Leon Voss

ANSYS Inc.

© 2010 ANSYS, Inc. All rights reserved. 2 ANSYS, Inc. Proprietary

Introduction

• Ansys System Simulation

• Component Modelling:

– Battery: Electrochemistry

– Heat Exchanger: Fluid, Thermal

– PM Machine: Electromechanical

• Towards Virtual Prototyping …

© 2010 ANSYS, Inc. All rights reserved. 3 ANSYS, Inc. Proprietary

Power Supply Inverter Actuator Mechanic Load

Analog ControlDigital Control

Automotive and railway systems, electric drives, home

appliances and other systems consist of a variety of

components. Each component may influence the behavior

of another component.

System Simulation:

Drive System Example

© 2010 ANSYS, Inc. All rights reserved. 4 ANSYS, Inc. Proprietary

Electrical Magnetic Fluid Mechanical Thermal Acoustic

ANSYS Comprehensive Solution

Circuit

System

Component ANSYS Workbench

ANSYS

Mixed-Signal Multi-Domain

System Simulator

Model Extraction &

Cosimulation

© 2010 ANSYS, Inc. All rights reserved. 5 ANSYS, Inc. Proprietary

What is VHDL-AMS?

VHDL-AMS is a strict superset of IEEE Std. 1076

Very Large Scale Integrated Circuit Hardware

Description Language – Analog and Mixed-Signal

1993 1999

IEEE 1076

VHDL

IEEE 1076.1

VHDL-AMS

Description

& simulation

of event-

driven

systems

Description &

simulation of

analog and

mixed signal

circuits and

systems

© 2010 ANSYS, Inc. All rights reserved. 6 ANSYS, Inc. Proprietary

Why Use VHDL-AMS

• Standard Format Allows Model Portability

– Different engineering groups within same

company

– With Sub-Contractors

– Between different simulators

• Multi-level Modeling

– Different levels of abstraction of model behavior

• Multi-domain Modeling

– Electrical, Thermal, Magnetic, Mechanical, etc

• Mixed-signal Modeling

– Supports analog and digital modeling

© 2010 ANSYS, Inc. All rights reserved. 7 ANSYS, Inc. Proprietary

Architecture 3

Architecture 2

Architecture 1

VHDL-AMS Model Construct

• Entity– Interface description of a

subsystem or physical

device

– Specifies input and output

ports to the model

• Architecture– Behavior description

– Can be dataflow, structural,

procedural, etc

– Modeling can deal with both

analog (continuous) and

digital (discrete) domains

output ports

input ports

In-out ports

Architecture 2

Architecture 1

Entity

© 2010 ANSYS, Inc. All rights reserved. 8 ANSYS, Inc. Proprietary

VHDL-AMS Code for a Resistor

LIBRARY Ieee;

use Ieee.electrical_systems.ALL;

ENTITY vhdl_resistor IS

GENERIC (

resistance : resistance := 1.0e3

);

PORT (

QUANTITY temp : IN real := 300.0;

TERMINAL p : electrical;

TERMINAL n : electrical

);

END ENTITY vhdl_resistor;

• Entity– Interface description of a subsystem

or physical device

– Specifies input and output ports to

the model

The resistor

model has one

model constant,

one input quantity,

and two terminals

resistor

Current

Voltage

p m

Resistance value

Temperature

© 2010 ANSYS, Inc. All rights reserved. 9 ANSYS, Inc. Proprietary

VHDL-AMS Code for a Resistor

ARCHITECTURE arch_vhdl_resistor OF vhdl_resistor IS

QUANTITY voltage ACROSS current THROUGH p TO n;

BEGIN

voltage == current * resistance;

END ARCHITECTURE arch_vhdl_resistor;

• Architecture– Description of the model and no solving information is required

No solving

information is

needed!!

ARCHITECTURE arch_vhdl_resistor OF vhdl_resistor IS

QUANTITY voltage ACROSS current THROUGH p TO n;

BEGIN

voltage == current * resistance * (1.0+1.0e-

2*(temp-300.0)+1.1e-3*(temp-300.0)**2);

END ARCHITECTURE arch_vhdl_resistor;

A second

architecture is

possible!!

© 2010 ANSYS, Inc. All rights reserved. 10 ANSYS, Inc. Proprietary

VHDL-AMS Code for a Capacitor

LIBRARY Ieee;

use Ieee.electrical_systems.ALL;

ENTITY cap IS

GENERIC (

capacitance : capacitance := 1.0e-3

);

PORT (

QUANTITY init_v : IN voltage := 0.0;

TERMINAL p : electrical;

TERMINAL n : electrical

);

END ENTITY cap;

ARCHITECTURE arch_cap OF cap IS

QUANTITY voltage ACROSS current THROUGH p TO n;

BEGIN

IF (domain = quiescent_domain) USE

voltage == init_v;

ELSE

current == capacitance * voltage'dot;

END USE;

END ARCHITECTURE arch_cap;

The capacitor

entity has one

model constant,

one input, and two

terminals

The model description essentially

has two lines, one for initial

condition and one for the

governing equation!!

• Entity • Architecture

© 2010 ANSYS, Inc. All rights reserved. 11 ANSYS, Inc. Proprietary

VHDL-AMS Model of a Permanent magnet

Synchronous Generator

LIBRARY IEEE;

USE IEEE.ELECTRICAL_SYSTEMS.ALL;

USE IEEE.MECHANICAL_SYSTEMS.ALL;

USE IEEE.MATH_REAL.ALL;

ENTITY symp_mech_pin IS

GENERIC(

L1d : INDUCTANCE := 0.042;

L1q : INDUCTANCE := 0.042;

ke : INDUCTANCE := 0.875;

p : REAL := 2.0;

j : MOMENT_INERTIA := 0.075;

i1a0 : CURRENT := 0.0;

i1b0 : CURRENT := 0.0;

i1c0 : CURRENT := 0.0;

phi0 : ANGLE := 0.0 );

PORT(

TERMINAL a, b, c : ELECTRICAL;

TERMINAL m : ROTATIONAL_V;

QUANTITY r1 : IN RESISTANCE := 0.4;

QUANTITY n : OUT REAL;

QUANTITY phi : OUT ANGLE );

END ENTITY symp_mech_pin;

© 2010 ANSYS, Inc. All rights reserved. 12 ANSYS, Inc. Proprietary

VHDL-AMS Model of a Permanent magnet

Synchronous Generator

ARCHITECTURE behav OF symp_mech_pin IS

BEGIN

v1d == i1d * r1 + i1d'dot * l1d - omel * psi1q;

v1q == i1q * r1 + i1q'dot * l1q + omel * psi1d;

i1beta == bc2beta * (i1b - i1c);

i1d == i1a * cos(y) + i1beta * sin(y);

i1q == - i1a * sin(y) + i1beta * cos(y);

psi1d == i1d * l1d + ke;

psi1q == i1q * l1q;

mi == kmi * (psi1d * i1q - psi1q * i1d);

omg'dot == (1.0/j) * (mi + tld);

ang == omg'integ;

v1a == vbc * one_three + vab * two_three;

v1alpha == two_three * v1a - one_three * (v1b + v1c);

v1beta == bc2beta * (v1b - v1c);

v1d == v1alpha * cos(y) + v1beta * sin(y);

v1q == - v1alpha * sin(y) + v1beta * cos(y);

phi == y;

n == omg * om2n;

y == p * ang;

omel == p * omg;

END ARCHITECTURE behav;

Voltage Equations

Current transformation

Flux Equation

Electromagnetic Torque

Mechanics

Voltage transformation

Outputs

© 2010 ANSYS, Inc. All rights reserved. 13 ANSYS, Inc. Proprietary

VHDL-AMS Model of a Permanent magnet

Synchronous Generator

PM synchronous machine without damper VHDL-AMS model

driveTorq

R4

R=15ohm

R6

R=15ohm

R5

R=15ohm

0.00 0.25 0.50 0.75 1.00 1.25 1.50X-Axis [s]

-10.00

-5.00

0.00

5.00

10.00

Defa

ult

[A]

Curve Info min

U1.i1aTR

-8.4372

U1.i1bTR

-8.4247

U1.i1cTR

-8.4311

MS3 ~

B AC

m

f_rot1

0

0.00 0.25 0.50 0.75 1.00 1.25 1.50X-Axis [s]

-125.00

125.00

375.00

625.00

875.00

Defa

ult

Curve Info YAtXMax

U1.nTR

804.1093

U1.omgTR

84.2061

U1.miTR

-19.5649

0.00 0.25 0.50 0.75 1.00 1.25 1.50X-Axis [s]

-150.00

-50.00

50.00

150.00

Defa

ult

[V]

Curve Info min

U1.v 1aTR

-126.4163

U1.v 1bTR

-126.5138

U1.v 1cTR

-126.6025

© 2010 ANSYS, Inc. All rights reserved. 14 ANSYS, Inc. Proprietary

What About PDEs – Boundary Value

Problems?

• Example:

problem solved is described by the following equations:

ENTITY steady_state_boundary_value IS

generic (

phibc: real := 0.0

);

END ENTITY steady_state_boundary_value;

ARCHITECTURE arch_steady_state_boundary_value OF

steady_state_boundary_value IS

quantity phi1,phi2,phi3,phi4,phi5 : real;

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;

• Architecture• Entity

φ1 φ2 φ3 φ4 φ5

h

x=0

L=1.0

1 2 3 4 5

© 2010 ANSYS, Inc. All rights reserved. 15 ANSYS, Inc. Proprietary

What About PDEs – Initial Value

Problems?

• Example:

problem solved is described by the following equations:

ENTITY transient_diffusion IS

generic (

rho: real := 2000.0;

k: real := 2.0;

Cp: real := 1000.0);

END ENTITY transient_diffusion;

IF (domain = quiescent_domain) USE

T1 == 20.0;

T2 == 60.0;

T3 == 100.0;

T4 == 60.0;

T5 == 20.0;

ELSE

rho*Cp*T1'dot == -(N1p - N0p)/h;

rho*Cp*T2'dot == -(N2p - N1p)/h;

rho*Cp*T3'dot == -(N3p - N2p)/h;

rho*Cp*T4'dot == -(N4p - N3p)/h;

rho*Cp*T5'dot == -(N5p - N4p)/h;

END USE

• Architecture (main part)• Entity

© 2010 ANSYS, Inc. All rights reserved. 16 ANSYS, Inc. Proprietary

Newman’s 1d Electrochemistry Model

in Simplorer

Lithium Ion Batteries

• Electrochemical Kinetics

• Solid-State Li Transport

• Electrolytic Li Transport

• Charge Conservation/Transport

• (Thermal) Energy Conservation

Li+

e

Li+

Li+ Li+

LixC6 Lix-Metal-oxidee

Jump

Results from Simplorer Results from Newman

Li

eeee j

F

tcD

t

c

1)(

© 2010 ANSYS, Inc. All rights reserved. 17 ANSYS, Inc. Proprietary

Governing Equations

The governing equations of porous electrode model of

the lithium-ion battery (Electrochemical Systems, 3rd by

John Newman)

v

taj

Fz

ticD

t

c n

00

2 1

ctF

RTi ln1 0

22

s

cs

an

RT

F

RT

Fij

expexp0

12 iI

2iaFjn

A coupled set of

PDEs. The way to

solve them with

VHDL-AMS uses

the same technique

as before.

PDE: initial value

PDE: boundary value

PDE: boundary value

PDE: boundary value

Algebraic

© 2010 ANSYS, Inc. All rights reserved. 18 ANSYS, Inc. Proprietary

VHDL-AMS Implementation: Entity

LIBRARY Ieee;

use Ieee.thermal_systems.all;

use Ieee.fluidic_systems.all;

use Ieee.math_real.ALL;

use Ieee.electrical_systems.ALL;

ENTITY battery IS

generic (

diffD : real := 7.5e-11;

epslonn: real := 0.357;

epslonp: real := 0.444;

epslonfn: real := 0.172;

epslonfp: real := 0.259;

sigman : real := 100.0;

sigmap : real := 3.8;

diffDsn: real := 3.9e-14;

diffDsp: real := 1.0e-13;

kn: real := 2.334e-11;

kp: real := 2.334e-11;

Bruggn: real :=1.5;

Bruggp: real :=1.5;

zp : real := 1.0;

mup: real := 1.0;

sp : real :=-1.0;

n : real := 1.0;

csnmax: real := 26390.0;

cspmax: real := 22860.0;

alfa : real :=0.5;

deltas : real := 52.0e-6;

deltan : real := 100.0e-6;

deltap : real := 183.0e-6;

Rsn : real := 12.5e-6;

Rsp : real := 8.0e-6;

F : real := 96485.3;

T : real := 298.0;

R : real := 8.31;

init_c : real := 2000.0;

init_csn: real := 14870.0;

init_csp: real := 3900.0

);

PORT (

TERMINAL negative : electrical;

TERMINAL positive : electrical

);

END ENTITY battery;

Note that the model has two terminals and

the rest are simply parameters of the model.

© 2010 ANSYS, Inc. All rights reserved. 19 ANSYS, Inc. Proprietary

VHDL-AMS Implementation:

Architecture

© 2010 ANSYS, Inc. All rights reserved. 20 ANSYS, Inc. Proprietary

Results: Newman 1d Model

Simplorer’s Results

x=0

x=Lp+Ls+Ln

x=Lp+Ls

x=Lp

1/10 C

1/2 C

1 C

2 C

4 C

6 C

8 C

10 C

•Reference: Long Cai, Ralph E. White, Journal of Electrochem. Soc., 156 (3), A154-A161 (2009)

White’s Results

© 2010 ANSYS, Inc. All rights reserved. 21 ANSYS, Inc. Proprietary

Results: Newman 1d Model

Simplorer’s Results White’s Results

•Reference: Long Cai, Ralph E. White, Journal of Electrochem. Soc., 156 (3), A154-A161 (2009)

© 2010 ANSYS, Inc. All rights reserved. 22 ANSYS, Inc. Proprietary

What is Not Suitable for VHDL-

AMS?

• PDEs in 3D

– Discretization becomes complex without help of a

commercial code.

– It becomes tedious to write discretized equations.

– Efficiency

• If a specialized solver is needed to solve the

governing equations efficiently, then VHDL-

AMS might not be as efficient.

– 1D Euler equation in fluid dynamics

• Flux difference splitting (Roe’s method)

© 2010 ANSYS, Inc. All rights reserved. 23 ANSYS, Inc. Proprietary

Thermal Domain

Electrical Domain MechanicalDomain

0

R1 R2 R3

MASS_ROT1

DR1

SINE2

SINE1

A

A

A

IN_A

IN_B

IN_C

OUT_A

OUT_B

OUT_C

I_motSimplorer4

A

B

C

N

ROT1

ROT2

Induction_Motor_20kW

Q

Ambient

P1

P2

P3

P4

P5

P6

P7

P8 P

9

P1

0

P1

1

P1

2

P_

RE

F

z_um z_vm z_wm

z_wpz_vpz_up

+

V

VM311 R6 R5 R4

E1

RZM

DR1

RZM

0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00Time [ms]

-500.00

-250.00

0.00

250.00

500.00

Y1 [

V]

Curve Info rms

R1.VTR 230.9405

R4.VTR 313.3812

0.00 2.50 5.00 7.50 10.00 12.50 15.00 17.50 20.00Time [ms]

1475.00

1485.00

1495.00

1500.00

MA

SS

_R

OT

1.O

ME

GA

[rp

m]

0.00

50.00

100.00

150.00

180.00

MA

SS

_R

OT

1.P

HI

[deg]

Curve Info

MASS_ROT1.OMEGATR

MASS_ROT1.PHITR

Virtual Prototyping: Multi-domain

Drive System Optimization

Thermal Domain

Electrical Domain Mechanical

Domain

Model Extraction

from FEM / CFD

IGBT Device

Characterization

VHDL-AMS

Macro-Model

VHDL-AMS

Macro-Model

© 2010 ANSYS, Inc. All rights reserved. 24 ANSYS, Inc. Proprietary

Thermal MOR Coupling

Simplorer Results

© 2010 ANSYS, Inc. All rights reserved. 25 ANSYS, Inc. Proprietary

Conclusion

• VHDL-AMS is a means for users to include an existing

mathematical model in system level simulations.

• VHDL-AMS programmers only need to write the governing

equations after discretization. Solver and post-processing is

provided by the simulating environment, for instance, Simplorer.

• VHDL-AMS can easily handle devices governed by algebraic,

ODEs, and PDEs in 1D or even 2D.

• VHDL-AMS is a powerful technique contributing to the generation

of system-level models in combination with physical modeling

techniques