Saber Co-simulation Help

 

Overview

ADVISOR/Saber Co-simulation Requirements

Using Existing ADVISOR/Saber Co-Simulation Configurations

Creating A Custom Co-simulation

 

Overview

The ADVISOR/Saber co-simulation improves and expands ADVISOR’s electric modeling capability.  It improves ADVISOR by providing the option for a more detailed voltage and current based analysis to capture fluctuations in the electrical power bus.  It expands ADVISOR by providing the capability to use industry-contributed models and Saber library models in ADVISOR.  These models include:

·        Industry-contributed:

o       Generator

o       DC/DC Converter

o       Regulator

o       Many Electrical Loads

·        Saber library

o       Lead Acid / Lithium Ion Batteries

o       Integrated Starter Generator, Alternator, Crankshaft Mounted Generators

o       Electrical Load Models And Characterization Tools

o       Behavioral To Detailed Electronic, Digital, Electrical, Mechanical, Hydraulic, and Pneumatic System Models

o       Top Down DC/DC Converters (Behavioral To Physical Models)

o       Bus Systems (CAN, FlexRay, TTP Etc.)

o       Power Management System

o       PEM And SOFC Fuel Cells (Models And Building Blocks)

o       Over 150 Complete Automotive Systems (From ABS To X-By-Wire)

Using models from both industry and the Saber library, additional vehicle configurations have been created:

·        Conventional, single voltage vehicle including a battery, generator, and electrical loads:

Figure 1.  Electrical Portion of Single Voltage Vehicle Configuration.

 

·        Conventional (14V/42V) dual voltage vehicle configuration:

 

Figure 2.  Electrical Portion of Dual Voltage Vehicle Configuration

·        Parallel electric hybrid vehicle configuration:

 

Figure 3.  Electrical Portion of Parallel Hybrid Electric Vehicle Configuration

·        Series electric hybrid vehicle configuration:

Figure 4.  Electrical Portion of Series Hybrid Electric Vehicle Configuration

 

ADVISOR/Saber Co-simulation Requirements

Co-simulation Requirements:

·        Standard Saber License

·        Optional Template Library License or Vehicle Electric Library License

How To Get Saber

If you want Saber please contact:

http://www.avanticorp.com/sales

or mailto:

saber-info@avanticorp.com

Using Existing ADVISOR/Saber Co-Simulation Configurations

Figure 5.  Selecting ADVISOR/Saber co-simulation.

Choose Saved Vehicle Configuration

An ADVISOR/Saber co-simulation is run by selecting a “saber_*” saved vehicle on the load file menu from the “Vehicle Input” screen, such as CONV_cosim_dv_in (dual voltage) seen in Figure 3.  Choosing a saved vehicle configuration automatically makes the correct combination of component selections.  These menu selections define parameters that correspond to the models created in Saber.  The parallel Saber model includes a 14-volt and a high voltage battery, a motor, and Saber auxiliary load models.

When choosing one of the “saber” drivetrain configurations, ADVISOR will only allow appropriate component selections.  The mapping for these selections are outlined in Table 1.

Load File (Saved Vehicle Name)

Components

Valid Versions

Valid Types

Valid File Names

Conv_cosim_dv_in

Energy Storage (HiV)

saber2

pb

all

 

 

rint

all

all

 

Energy Storage 2 (12v)

saber

pb

all

 

 

rint

all

all

 

Generator (HiV)

saber

all

all

 

Accessory

sabDV

all

all

 

Powertrain Control

sabDV

man

PTC_CONV_Saber_dv

 

Torque Coupling

-

-

TC_GC_TO_FC

Conv_cosim_sv_in

Energy Storage 2

saber

pb

all

 

 

rint

all

all

 

Generator

saber

all

all

 

Accessory

sabSV

Conv

all

 

Powertrain Control

sabSV

man

PTC_CONV_Saber_sv

 

Torque Coupling

-

-

TC_GC_TO_FC

SER_Saber_Cosim_in

Energy Storage

rint

all

all

 

 

saber2

all

all

 

Energy Storage 2

saber

pb

all

 

 

rint

all

all, scale voltage to 12v

 

Generator

reg

reg

all

 

Accessory

saber

Var

all

 

 

 

Const

all

 

Powertrain Control

sabSer

man

all

PAR_Saber_Cosim_in

Energy Storage

rint

all

all

 

 

saber2

all

all

 

Energy Storage 2

saber

pb

all

 

 

rint

all

all, scale voltage to 12v

 

Accessory

sabPar

Var

all

 

 

 

Const

all

 

Powertrain Control

sabPar

man

PTC_PAR_Saber

 

Torque Coupling

-

-

all but TC_GC_TO_FC

Table 1.  Valid selections for each Saber co-simulation configuration (saved vehicle file).

Define The Simulation

After defining the vehicle inputs, “continue” to the Simulation Setup Figure.  On that screen, the auxiliary loads, drive cycle, and other simulation parameters can be modified.  For running test procedures, we recommend first selecting the drive cycle radio button.  This allows the SOC balancing iterations to be changed to 1.  Then select the test procedure.  This prevents SOC balancing iterations, which may not be needed or desired for co-simulation runs. 

Run The Simulation

Finally, make sure Saber is not open, and click “Run.”  ADVISOR opens and runs Saber exchanging information between Saber and ADIVSOR at every ADVISOR time step.  At the end of the simulations, Saber is closed and ADVISOR displays the co-simulation results from both Saber and ADVISOR.

Creating A Custom Co-Simulation

Overview

Figure 6.  Custom co-simulation structure overview.

The general structure of the co-simulation can be seen in Figure 4.  The three numbered requirements in the figure include:

1.      Input parameter lists that correspond to Simulink inputs to Saber. 

2.      An output parameter list that corresponds to Saber outputs to Simulink.

3.      The name of the input/output list file as the third S-function parameter (for ADVISOR co-simulations, the first parameter is “vinf.tmppath” and the second is “time_step.”  The S-function name is always “SaberCosimSfun.”)

Steps To Create A Custom Co-Simulation

1.      Copy SaberCosimIO_Template.  Open and save a copy of the file “…advisor\gui\SaberCosim\SaberCosimIO_Template” with a unique name.  For the example, save it as “SaberCosimIO_Example.”

2.      Assign Input Parameter List, InputSaberParams.  Fill in the empty “InputSaberParams” list with Saber parameter names.  Follow the format as specified in the copied file (example:  ‘primitive.ref = ParameterName =’).  For the example change “InputSaberParams={’ ’};” to “InputSaberParams={’radio.radio1 = loadcontrol = ‘,’radio.radio1 = vehicletype =’};”

3.      Assign Output Parameter List, OutputSaberValues.  Fill in the empty “OutputSaberValues” list with Saber parameter names that need to be output from Saber to ADVISOR.  Follow the format as specified in the copied file (example:  ‘mech_pwr(generator_generic.generator_generic_42v)’). For the example change “OutputSaberValues={’’};” to “OutputSaberValues={’power(power_meter.generator)’,’p_radio(radio.radio1)’,’i(radio.radio1)’};”

4.      Create the Simulink Model.  Add a S-function block to a SIMULINK model where communication between Simulink and Saber should occur.  Similar to Figure 4, the inputs and outputs to the S-function should be in the same order as the parameters in the input and output lists.  For the example, create a SIMULINK model as seen in Figure 4.  The “radio loadcontrol” block is a “to workspace” block.  The “radio vehicletype” block is a constant block.  These input blocks go to a “Horizontal Matrix Concatenation” block, then a “S-function” block, then a “demux” block, and finally three “scopes.”  Double click the “Horizontal Matrix Concatenation” block to change the number of inputs to two.  Double click the “demux” block to change the number of outputs to three.

5.      Assign the Parameters for the S-Function.  Double click the S-function block that will control the co-simulation.  A “Block Parameters” dialog opens.  Change the “S-function name:” to “SaberCosimSfun.”  Three comma separated inputs go in the “S-function Parameters” edit box.  The first input is the location for temporary files to be written.  The second input is the fixed time step to be used.  The third input is the name of the file that contains the input and output lists.  For general ADVISOR co-simulations, the first input is “vinf.tmppath” and the second input is “time_step.”  For the example, enter:

strrep(which(’advisor’),’advisor.m’,’tmp\’),.2,’SaberCosimIO_Example’

This sets the temporary file path to the folder “tmp,” the fixed time step to 0.2 seconds, and the list file name to “SaberCosimIO_Example.”  Click OK.

Running The Example Custom Co-Simulation

1.      Open “CustomSaberDemo.mdl” from “…advisor\models\.”

2.      Click play.

Known Co-Simulation Limitations

Currently the co-simulation is only developed for a fixed time step in Simulink.  Saber can run at a variable time step in the co-simulation.


Back to Chapter 3
ADVISOR Documentation Contents

Last Revised: [26-August-2002]: ab