7

Click here to load reader

ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

  • Upload
    dinhanh

  • View
    212

  • Download
    0

Embed Size (px)

Citation preview

Page 1: ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

ECE5325 Smart Sensors and Fuel Cell Laboratory #3

Creating Automotive Battery Model Objectives:

1. To learn about Battery modeling using electronics equivalent circuit 2. To create VHDL-AMS model of the battery

I. Battery Model In a lead-acid battery, chemical energy is transformed to electrical energy at the battery electrodes through chemical reaction of the acid molecules with the electrode materials. The chemical reaction at the battery electrodes results in a lower concentrations of the lead acid near the electrodes during discharge. The diffusion of the acid molecules between regions of high and low concentration is modeled with three models: the diffusion resistor, a ‘slow’, and a ‘fast’ capacitor. Since the acid near the battery electrodes is consumed faster, its concentration is lower. This is modeled as a fast capacitor (fc) that discharge quickly. The acid concentration farther from the electrodes is not consumed as fast, so it is modeled as a ‘slow’ capacitor (sc) that discharges slowly. The actual diffusion of the acid molecules between the regions of low and high concentrations is modeled with a diffusion resistor (rd). The electrical resistance of the electrodes is modeled as the internal resistance (ri) of the battery.

p

m

t1 t2

fc sc

ri rdv_ri v_rd

Battery Electronics Equivalent Circuit.

II. VHDL-AMS Model of the Battery Create the VHDL-AMS shown below, and Edit the symbol to look like a battery symbol. LIBRARY IEEE; USE IEEE.ELECTRICAL_SYSTEMS.ALL; ENTITY batt IS GENERIC( factor : REAL :=1.0;

Page 2: ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

v_init : REAL := 12.0); PORT ( TERMINAL p, m : ELECTRICAL; QUANTITY v_out : OUT REAL :=0.0); END ENTITY batt; ARCHITECTURE behav OF batt IS TERMINAL t1, t2: ELECTRICAL; QUANTITY v_ri ACROSS i_ri THROUGH p TO t1; QUANTITY v_fc ACROSS i_fc THROUGH t1 TO m; QUANTITY v_rd ACROSS i_rd THROUGH t1 TO t2; QUANTITY v_sc ACROSS i_sc THROUGH t2 TO m; QUANTITY v ACROSS p TO m; CONSTANT ri: REAL := 1.0e-2; CONSTANT fc: REAL := 60.0; CONSTANT rd: REAL := 4.0e-2; CONSTANT sc: REAL := 2.0e4; BEGIN BREAK v_fc => v_init, v_sc => v_init; v_ri == i_ri * ri; v_fc'DOT == 1.0/(fc * factor) * i_fc; v_rd == i_rd * rd; v_sc'DOT == 1.0/(sc * factor) * i_sc; v_out == v; END ARCHITECTURE behav; The ‘DOT attribute is used to evaluate the derivative of an analog quantity in a simultaneous differential equation (DAE). BREAK statements are used to indicate the occurrence of a discontinuity to the analog solver. NOTE: The solvability of a set of equation in a mixed signal model description should satisfy the following two rules:

1. The number of equations specified in the model should be equal to the number of free quantities, through quantities, and port quantities of mode OUT.

2. Any free quantities and any port quantities of mode OUT must appear in a simultaneous equation within the architecture of the model.

In the above example: Free quantities: (=0) Through quantities: i_ri, i_fc,I_rd,I_sc (=4) Port quantities of mode OUT: v_out (=1) That is the total number of equations is 5, as highlighted in the VHDL-AMS code.

Page 3: ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

MyBattery+ -

batt1

i1i := -1

factor := 1.0v_init := 12.0

batt1.v_out

t [s]

11.99

11.911.91

11.92

11.93

11.94

11.95

11.96

11.97

11.98

0 0.63k0.1k 0.2k 0.3k 0.4k 0.5k

III. Refining the Battery Model by Adding Battery State of Charge (SoC).

The state of charge of the battery is based on the maximum and initial voltage values of the battery. The IF-USE statement is used to limit the charging of the battery when its SoC value approaches ‘1’, and the internal resistor is used to limit the discharging of the battery when its SoC value approaches ‘0’. Unrealistic values of SoC can occur by forcing/drawing large current to/from the battery. LIBRARY IEEE; USE IEEE.ELECTRICAL_SYSTEMS.ALL; ENTITY bat_soc IS GENERIC(

Page 4: ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

factor: REAL :=1.0; v_init: REAL := 12.0; v_max: REAL := 14.0); PORT( TERMINAL p, m : ELECTRICAL; QUANTITY soc_out: OUT REAL :=0.0; QUANTITY v_out: OUT REAL :=0.0); END ENTITY bat_soc; ARCHITECTURE behav OF bat_soc IS TERMINAL t1, t2: ELECTRICAL; CONSTANT ri: REAL := 1.0e-2; CONSTANT fc: REAL := 60.0; CONSTANT rd: REAL := 4.0e-2; CONSTANT sc: REAL := 2.0e4; CONSTANT init_charge : REAL := ((fc+sc)*factor)*v_init; CONSTANT max_charge : REAL := ((fc+sc)*factor)*v_max; QUANTITY v_ri ACROSS i_ri THROUGH p TO t1; QUANTITY v_fc ACROSS i_fc THROUGH t1 TO m; QUANTITY v_rd ACROSS i_rd THROUGH t1 TO t2; QUANTITY v_sc ACROSS i_sc THROUGH t2 TO m; QUANTITY v ACROSS p TO m; QUANTITY ri_val : REAL := ri; QUANTITY total_charge : REAL := init_charge; BEGIN BREAK v_fc => v_init, v_sc => v_init; BREAK i_ri => v_init/ri; BREAK soc_out => init_charge/max_charge; IF (i_ri <0.0) OR (soc_out < 0.1) USE ri_val == (2.0*ri)**2/(1.0-soc_out); ELSE ri_val == (2.0*ri)**2/soc_out; END USE; v_ri == i_ri * ri_val; total_charge == ((fc*factor)*v_fc) + ((sc*factor)*v_sc); soc_out == total_charge/max_charge; v_fc'DOT == 1.0/(fc * factor) * i_fc; v_rd == i_rd * rd; v_sc'DOT == 1.0/(sc * factor) * i_sc; v_out == v; END ARCHITECTURE behav;

Page 5: ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

MyBatt_Soc

+ -

bat_soc1

i2

factor := 1.0v_init := 12.0v_max := 14.0

i := -1

bat_soc1.v_ou

t [s]

12

11.9

11.9211.9311.9411.9511.9611.9711.98

0 0.63k0.1k 0.2k 0.3k 0.4k 0.5k

bat_soc1.

t [s]

0.86

0.85

0.86

0.86

0.86

0 0.63k0.1k 0.2k 0.3k 0.4k

IV. Modifying Lab 2 Load Simulation Using Battery Model with SoC

Page 6: ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

MyLoad

p

m

ctrl

load1

r1 r2

c1 triang1Q=>RS

realqty_realsig1r := 3m r := 10m

ampl := 1freq := 1off := 0tdelay := 0

c := 10m p_nom := 1v_nom := 14t_ramp := 5m

MyBatt_Soc

+ -bat_soc1

factor := 1.0v_init := 12.0v_max := 14.0

MyLoad

p

m

ctrlQ=>RS

load1

p_nom := 50v_nom := 12t_ramp := 5m

r1

r := 3m

r2

r := 10m

c1

c := 10m

realqty_realsig1step1

t0 := 0.25ts := 0ampl := 1

MyBatt_Soc

+ -

bat_soc1

factor := 1.0v_init := 12.0v_max := 14.0

MyLoad

p

m

ctrlQ=>RS

load1

v_nom := 12p_nom := 20

t_ramp := 5m

r1

r := 3m

r2

r := 10m

c1

c := 10m

realqty_realsig1pulse1

ampl := 0.5freq := 5off := 0.5tdelay := 0

MyBatt_Soc

+ -

bat_soc1

factor := 1.0v_init := 12.0v_max := 14.0

For each circuit shows the state of charge of the battery. Interpret the meaning of SoC, due to different loading conditions. REFERENCES

1. “Simulation System SIMPLORER VHDL-AMS Tutorial,” English

Edition, © 2003 Ansoft Corporation. 2. Simulation System SIMPLORER® v.6.0 User Manual, English Edition, ©

1996-2002, Ansoft Corporation.

Page 7: ECE5325 Smart Sensors and Fuel Cell Laboratory #3 …webpages.eng.wayne.edu/cadence/ECE5325/doc/AET_LAB/AET-Lab3.pdfECE5325 Smart Sensors and Fuel Cell Laboratory #3 Creating Automotive

3. Simulation System SIMPLORER® 6.0 Getting Started, English Edition, © 1996-2002, Ansoft Corporation.