Drive Cycle Source

Standard or specified longitudinal drive cycle

  • Library:
  • Powertrain Blockset / Vehicle Scenario Builder

    Vehicle Dynamics Blockset / Vehicle Scenarios / Drive Cycle and Maneuvers

Description

The Drive Cycle Source block generates a standard or user-specified longitudinal drive cycle. The block output is the specified vehicle longitudinal speed, which you can use to:

  • Predict the engine torque and fuel consumption that a vehicle requires to achieve desired speed and acceleration for a given gear shift reference.

  • Produce realistic velocity and shift references for closed loop acceleration and braking commands for vehicle control and plant models.

  • Study, tune, and optimize vehicle control, system performance, and system robustness over multiple drive cycles.

For the drive cycles, you can use:

  • Drive cycles from predefined sources. By default, the block includes the FTP–75 drive cycle. To install additional drive cycles from a support package, see Install Drive Cycle Data. The support package has drive cycles that include the gear shift schedules, for example JC08 and CUEDC.

  • Workspace variables.

  • .mat, .xls, .xlsx, or .txt files.

  • Wide open throttle (WOT) parameters, including initial and nominal reference speed, deceleration start time, and final reference speed.

To achieve the goals listed in the table, use the specified Drive Cycle Source block parameter options.

GoalAction

Repeat the drive cycle if the simulation run time exceeds the drive cycle length.

Select Repeat cyclically.

Output the acceleration, as calculated by Savitzky-Golay differentiation.

Select Output acceleration.

Specify a sample period for discrete applications.

Specify a Output sample period (0 for continuous), dt parameter.

Update the simulation run time so that it equals the length of the drive cycle.

Click Update simulation time. If a model configuration reference exists, the block does not enable this option.

Plot the drive cycle in a MATLAB® figure.

Click Plot drive cycle.

Specify the drive cycle using a workspace variable.

Click Specify variable. The block:

  • Sets the Drive cycle source parameter to Workspace variable.

  • Enables the From workspace parameter.

Specify the workspace variable so that it contains time, velocity, and, optionally, the gear shift schedule.

Specify the drive cycle using a file.

Click Select file. The block:

  • Sets the Drive cycle source parameter to .mat, .xls, .xlsx or .txt file.

  • Enables the Drive cycle source file parameter.

Specify a file that contains time, velocity, and, optionally, the gear shift schedule.

Output drive cycle gear.

Specify a drive cycle that contains a gear shift schedule. You can use:

  • A support package to install standard drive cycles that include the gear shift schedules, for example JC08 and CUEDC.

  • Workspace variables.

  • .mat, .xls, .xlsx, or .txt files.

Click Output gear shift data.

Install additional drive cycles from a support package.

Click Install additional drive cycles. The block enables the parameter if you can install additional drive cycles from a support package.

Ports

Output

expand all

Vehicle reference speed, in units that you specify. To specify the units, use the Output velocity units parameter.

To calculate the acceleration, the block implements Savitzky-Golay differentiation using a second-order polynomial with a three-sample point filter.

Dependencies

To create the output acceleration port, select Output acceleration. Selecting Output acceleration enables the Output acceleration units parameter.

Dependencies

To create this port:

  1. Specify a drive cycle that contains a gear shift schedule. You can use:

    • A support package to install standard drive cycles that include the gear shift schedules, for example JC08 and CUEDC.

    • Workspace variables.

    • .mat, .xls, .xlsx, or .txt files.

  2. Select Output gear shift data.

Parameters

expand all

Drive Cycle

  • FTP75 — Load the FTP75 drive cycle from a .mat file into a 1-D Lookup Table block. The FTP75 represents a city drive cycle that you can use to determine tailpipe emissions and fuel economy of passenger cars. To install additional drive cycles from a support package, see Install Drive Cycle Data.

  • Wide Open Throttle (WOT) — Use WOT parameters to specify a drive cycle for performance testing.

  • Workspace variable — Specify time, speed, and, optionally, gear data as a structure, 2-D array, or time series object.

  • .mat, .xls, .xlsx or .txt file — Specify a file that contains time, speed and, optionally, gear data in column format.

Once you have installed additional cycles, you can use set_param to set the drive cycle. For example, to use drive cycle US06:

set_param([gcs '/Drive Cycle Source'],'cycleVar','US06')

Dependencies

The table summarizes the parameter dependencies.

Drive Cycle SourceEnables Parameter
Wide Open Throttle (WOT)

Start time, t_wot1

Initial reference speed, xdot_woto

Nominal reference speed, xdot_wot1

Time to start deceleration, wot2

Final reference speed, xdot_wot2

WOT simulation time, t_wotend

Source velocity units

Workspace variable

From workspace

Source velocity units

Output gear shift data, if drive cycle includes gear shift schedule

.mat, .xls, .xlsx or .txt file

Drive cycle source file
Source velocity units

Output gear shift data, if drive cycle includes gear shift schedule

Monotonically increasing time, velocity, and, optionally, gear data, specified by a structure, 2-D array, or time series object. Enter units for velocity in the Source velocity units parameter field.

A valid point must exist for each corresponding time value. You cannot specify inf, empty, or NaN.

Workspace VariableSource Velocity UnitOutput Velocity UnitDrive Cycle Plot

Structure without a gear shift schedule. From workspace set to myCycleS.

t = 0:1:100;
xdot = 5.*sin(t)+10;
myCycleS.time = t';
myCycleS.signals.values = xdot';

m/smph

Structure with a gear shift schedule. From workspace set to myCycleS.

gears=[0, 1, 2, 3, 3, 4, 4, 4, 4, 4, 4];
t=0:1:10;
xdot=[0,5,10,15,20,25,30,30,30,30,30];
myCycleS.time=t';
myCycleS.signals.values=[xdot',gears'];

m/smph

2-D array without a gear shift schedule. From workspace set to myCycleA.

t = 0:1:100;
xdot = 5.*sin(t)+5;
myCycleA = [t',xdot'];

m/smph

2-D array with a gear shift schedule. From workspace set to myCycleA.

gears=[0, 1, 2, 3, 4, 4, 4, 5, 5, 5, 5];
t=0:1:10;
xdot=[0,5,10,15,20,25,30,40,50,60,60];
myCycleA=[t',xdot',gears'];

mphmph

Time series object without a gear shift schedule. From workspace set to myCycleT.

myCycleT = timeseries;
t = 0:1:100;
xdot = 5.*sin(t)+20;
myCycleT.Data = xdot';
myCycleT.Time = t;

m/smph

Time series object without a gear shift schedule. From workspace set to myCycleT.

myCycleT = timeseries;
gears=[0, 1, 2, 3, 4, 4, 4, 5, 5, 5, 5];
t=0:1:10;
xdot=[0,10,20,30,32,33,34,40,50,60,60];
myCycleT.Data = [xdot',gears'];
myCycleT.Time = t';

mphmph

Dependencies

To enable this parameter, select Workspace variable from Drive cycle source.

File containing monotonically increasing time, velocity, and, optionally, gear in column or comma-separated format. The block ignores units in the file. Enter units for velocity in the Source velocity units parameter field.

FileSource Velocity UnitOutput Velocity UnitDrive Cycle Plot

An .xls or .xlsx file with time in column A and velocity in column B.

mphmph

An .xls or .xlsx file with time in column A, velocity in column B, and gear in column C. The block:

  • Ignores the units in the file.

  • Converts the gear information to integers:

    • N to 0

    • D to 2

mphmph

A .txt with time in column 1 and velocity in column 2. The block ignores the header and units information.

mphmph

If you provide the gear schedule using P, R, N, D, L, OD, the block maps the gears to integers.

Gear

Integer

P

80

R

-1

N

0

L

1

D

2

OD

Next integer after highest specified gear.

For example, the block converts the gear schedule P P N L D 3 4 5 6 5 4 5 6 7 OD 7 to 80 80 0 1 2 3 4 5 6 5 4 5 6 7 8 7.

Dependencies

To enable this parameter, select .mat, .xls, .xlsx or .txt file from Drive cycle source.

Repeat the drive cycle if the simulation run time exceeds the length of the drive cycle.

To calculate the acceleration, the block implements Savitzky-Golay differentiation using a second-order polynomial with a three-sample point filter.

Dependencies

To create the output acceleration port, select Output acceleration. Selecting Output acceleration enables the Output acceleration units parameter.

Dependencies

  • Specify a drive cycle that contains a gear shift schedule. You can use:

    • A support package to install standard drive cycles that include the gear shift schedules, for example JC08 and CUEDC.

    • Workspace variables.

    • .mat, .xls, .xlsx, or .txt files.

  • Clicking this parameter creates input port Gear.

WOT

Drive cycle start time, in s. For example, this plot shows a drive cycle with a start time of 10 s.

Dependencies

To enable this parameter, select the Drive cycle source parameter Wide Open Throttle (WOT).

Initial reference speed, in units that you specify with the Source velocity units parameter. For example, this plot shows a drive cycle with an initial reference speed of 4 m/s.

Dependencies

To enable this parameter, select the Drive cycle source parameter Wide Open Throttle (WOT).

Nominal reference speed, in units that you specify with the Source velocity units parameter. For example, this plot shows a drive cycle with a nominal reference speed of 30 m/s.

Dependencies

To enable this parameter, select the Drive cycle source parameter Wide Open Throttle (WOT).

Time to start vehicle deceleration, in s. For example, this plot shows a drive cycle with vehicle deceleration starting at 25 s.

Dependencies

To enable this parameter, select the Drive cycle source parameter Wide Open Throttle (WOT).

Final reference speed, in units that you specify with the Source velocity units parameter. For example, this plot shows a drive cycle with a final reference speed of 2 m/s.

Dependencies

To enable this parameter, select the Drive cycle source parameter Wide Open Throttle (WOT).

Drive cycle WOT simulation time, in s. For example, this plot shows a drive cycle with a simulation time of 50 s.

Dependencies

To enable this parameter, select the Drive cycle source parameter Wide Open Throttle (WOT).

Units and Sample Period

Input velocity units.

Dependencies

To enable this parameter, select the Drive cycle source parameter Wide Open Throttle (WOT), Workspace variable, or .mat, .xls, .xlsx or .txt file.

Output velocity units.

Specify the output acceleration units.

Dependencies

To enable this parameter, select Output acceleration.

Sample rate. Set to 0 for continuous sample period. For a discrete period, specify a non-zero rate.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Introduced in R2017a