Simulink As APlatform For Full Vehicle Simulation

Download as pdf or txt
Download as pdf or txt
You are on page 1of 78

Simulink as a Platform for Full Vehicle Simulation

Mike Sasena (Product Manager)


Lars Krause (Application Engineer)
Ryan Chladny (Development)

© 2018 The MathWorks, Inc.


1
Fuel Economy Simulation

2
Vehicle Dynamics Simulation

Ride & handling Chassis controls

ADAS / AD 3
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do Why are these cool?


– Engine modeling and calibration – Reduce time on HIL, dyno, vehicle testing
– Cooling circuit modeling – Account for complex thermal behavior
– Aftertreatment modeling – Estimate tailpipe emissions more accurately
– Ride and handling analysis – Assess longitudinal / lateral dynamics
– Chassis controls development – Perform closed-loop testing
– ADAS / AD testing – Test in a virtual 3D environment

4
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration
– Cooling circuit modeling
– Aftertreatment modeling
– Ride and handling analysis
– Chassis controls development
– ADAS / AD testing

5
Background

▪ Context
– Automotive engineers need to evaluate powertrain systems as early as possible
▪ What is the expected fuel economy, performance and emissions of my vehicle?
▪ What is the impact of my controller on system efficiency?
▪ Which electrification strategy should we develop?
– Model-Based Design has become an important methodology for answering these
questions and accelerating the development process

▪ Challenges
– It’s hard to do good Model-Based Design without good models

6
Powertrain Blockset

▪ Goals:
– Provide starting point for engineers to build good plant / controller models
– Provide open and documented models
– Provide very fast-running models that work with popular HIL systems

Lower the barrier to entry for Model-Based Design 7


Powertrain Blockset Features

Library of blocks Pre-built reference applications

8
Drivetrain Energy Storage Propulsion Transmission Vehicle Dynamics Vehicle Scenario Builder
and Auxiliary Drive

9
Reference Applications
▪ Full vehicle models (conventional, EV, multi-mode HEV, input power-split HEV)
▪ Virtual engine dynamometers (compression ignition, spark ignition)

10
Four Use Cases. One Framework.

Requirements Vehicle
Test
UC1 UC4 System
Closed-loop
Test (HIL)
Simulation

Rapid
UC2 Adapt UC3
System
Prototyping Test
and
Subsystem Reuse Subsystem
Design Test
Use Cases:
Unit Unit
1. System design and optimization Design Test

2. Controller parameter optimization Production Code


Generation
3. System integration test
4. Software-hardware integration test (HIL)

11
Powertrain Blockset Value Proposition

▪ Open and documented library of component and subsystem models


▪ Prebuilt vehicle models that you can parameterize and customize
▪ Fast-running models that are ready for HIL deployment

12
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration
– Cooling circuit modeling
– Aftertreatment modeling
– Ride and handling analysis
– Chassis controls development
– ADAS / AD testing

13
Background

▪ Context
– Automotive OEM’s and Tier 1 suppliers must assess vehicle’s dynamic performance
▪ Will the vehicle roll over?
▪ What’s the stopping distance of the vehicle?
▪ Do the stability controls perform adequately?
– Answer questions by building prototypes and / or running simulations

▪ Challenges
– Prototypes are expensive, so must achieve a good design as early as possible
– Specialized vehicle dynamics simulation software is quite expensive and difficult to use
– Integrating 3rd party vehicle dynamics software with Simulink controls is cumbersome

14
Vehicle Dynamics Blockset
New product (R2018a)

▪ Model and simulate vehicle dynamics in a virtual 3D environment


▪ Use Vehicle Dynamics Blockset for:
– Ride & handling: characterize vehicle performance under standard driving maneuvers
– Chassis controls: design and test chassis control systems
– ADAS / AD: create virtual 3D test ground for ADAS and automated driving features

Ride & handling Chassis controls ADAS / AD


15
Vehicle Dynamics Blockset Features

Pre-built reference applications

Library of blocks

Game engine
16
Block Library

Powertrain Wheels and Tires Steering

Suspension Vehicle Body Vehicle Scenarios

17
Game Engine Co-Simulation

Simulink vehicle / camera location Unreal Engine


• Physics of vehicle • Rendering / lighting
• Initialization of game engine • Physics of non-Simulink
camera camera image, ground height, … objects
• Collision detection

18
Reference Applications

Vehicle Maneuvers Scene Interrogation


Analyze ride and handling on driving Configure the interface to the 3D
maneuvers such as: environment
– Double-lane change
– Swept sine steering
– Slowly increasing steering

19
Vehicle Dynamics Blockset Value Proposition

▪ Open and documented library of component and subsystem models


▪ Prebuilt vehicle models that you can parameterize and customize
▪ Fast-running models that are ready for HIL deployment
▪ Interface to Unreal Engine

20
Powertrain Blockset and Vehicle Dynamics Blockset:
Flexible Modeling Framework

1. Choose a vehicle configuration 3. Customize the controllers


– Select a reference application as a – Parameterize the controllers
starting point – Customize supervisory control logic
– Add your own controller variants
2. Customize the plant model
– Parameterize the components 4. Perform closed-loop system
– Customize existing subsystems testing
– Add your own subsystem variants – Design optimization
– Sensitivity analyses
– MIL / SIL / HIL testing

21
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration – Reduce time on HIL, dyno, vehicle testing
– Cooling circuit modeling
– Aftertreatment modeling
– Ride and handling analysis
– Chassis controls development
– ADAS / AD testing

22
Engine Dynamometer Reference Application

▪ Powertrain Blockset
includes virtual engine
dynamometer reference
applications

▪ These can be used for a


variety of engine controls
development and
calibration activities

▪ Includes several pre-


defined experiments
23
Pre-defined Experiments for Automating Analyses

Simulate engine over


grid of steady state
operating points

Import engine Follow transient Calibrate controller to Scale engine and


dynamometer test data torque / speed profile match torque command recalibrate controller
24
Automated Calibration Experiment

25
Executable Test Specification

▪ Describe the calibration


procedure as a Stateflow chart
(not a Word doc)

▪ Test the procedure virtually

▪ Validate / plan calibration


procedure with test engineers

▪ Start testing on real hardware


with refined procedure

26
Flexible Testing Framework

Use Powertrain Blockset mapped


engine blocks with your own data

Connect in your own engine


Create custom engine models
model (e.g., 3rd party CAE tool)
using Powertrain Blockset
library components 27
Controls Validation with Engine Model Co-Simulation

28
Controls-oriented Model Creation

Detailed, design-oriented model

Fast, but accurate controls-oriented model


29
How Accurate is the Mapped Engine Model?

Mapped engine model


Auto-generated mapped engine Design-oriented engine model
model vs. co-simulation with
design-oriented CAE model:
▪ 0.3% fuel economy difference
▪ 50x faster

30
Engine Test Data Import

31
Engine Modeling and Calibration

▪ Calibrate engine control inputs to match torque command

▪ Define and simulate custom calibration procedures

▪ Generate engine maps from CAE models or engine dyno data

32
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration
– Cooling circuit modeling – Account for complex thermal behavior
– Aftertreatment modeling
– Ride and handling analysis
– Chassis controls development
– ADAS / AD testing

33
Engine Cooling System

▪ Take customization
one step further

▪ Start with “Custom


Driveline” variant

▪ Add Engine Cooling


subsystem adapted from
sscfluids_engine_cooling_system
34
Conventional Vehicle with Simscape Engine Cooling
1. Heat rejection calculation 1

2. Heat distributed between 2


oil and coolant

3. Temperature of cylinder
used to validate cooling
system performance 1

2
3

35
Cooling Circuit Modeling

▪ Create detailed, multi-domain subsystem models with Simscape

▪ Incorporate them into system level vehicle models from Powertrain Blockset

▪ Validate subsystem performance with closed loop simulation

36
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration
– Cooling circuit modeling
– Aftertreatment modeling – Estimate tailpipe emissions more accurately
– Ride and handling analysis
– Chassis controls development
– ADAS / AD testing

37
Exothermia

▪ Exothermia is a MathWorks Connections Partner


▪ axisuite®: modular software for the simulation of
exhaust aftertreatment devices and systems
– axitrap: for wall-flow particulate filters
– axicat: for flow-through catalytic converters with any kind
of catalytic coating
– axifoam: for foam-based or fiber-based filters and
catalysts, with any type of catalytic coating
– axiheat: for connecting pipes
▪ Models can be exported as S-functions for
coupling with Simulink-based software, e.g.
Powertrain Blockset
axisuite® is a trademark of Exothermia
www.exothermia.com
38
Catalyst simulation in the ‘V-shape’ development process

Systems integration
Catalyst experts

Controls department

Concept analysis

CFD, FEA experts


CFD and control experts use their
Model calibration with axisuite:
preferred simulation platforms. No
obtain the reaction rate parameters
need for recalibration of chemistry.
of each coating technology
39
Catalyst Modeling Scales

3D 2D 1D Reduced Spreadsheet
CFD 3D+1D 2D+1D 1D+1D models calculations
More detail Less detail
(slower) (faster)

▪ Dedicated simulation software for catalytic exhaust aftertreatment


▪ Extensively validated and applied by most automotive OEMs and suppliers
40
Overview of Flow-through Catalyst Model Equations in axisuite

Koltsakis et al, Appl. Catal B., 1997.


Pontikakis et al., Top. In Catal, 2001
Tsinoglou & Koltsakis, Proc. IMechE, 2007
41
Use Cases: Aftertreatment System Design

▪ Use axisuite to design aftertreatment system


– Determine required flow rates, thermal properties, etc.
– Estimate conversion efficiency, O2 storage dynamics, etc.

▪ Couple with Powertrain Blockset to evaluate at vehicle level


– Test on different drive cycles, ambient conditions, etc.
– Perform design studies, sensitivity analysis, etc.

Catalyst experts Concept analysis CFD, FEA experts

42
Use Cases: Aftertreatment Controls Development

▪ Closed-loop testing of controls features


– AFR control (rear trim), SCR control, etc.
– Catalyst light-off calibration, thermal management, etc.

▪ Diagnostics and predictive maintenance


– OBD catalyst monitoring
– Front / rear O2 sensor feedback
– DPF regeneration feedback
Controls department Systems integration

43
Example: Conventional Vehicle + TWC / GPF

• Started with ConVeh project


• Replaced default TWC with axisuite model

44
Results

Vehicle
Catalyst
speed
temp

Exhaust
gas flow Tailpipe
rate emissions

Lambda
Conversion
(post TWC)
efficiency

45
Aftertreatment Modeling

▪ Account for system level interactions (driver, vehicle, engine, aftertreatment,


etc.) in a single environment

▪ Study impact of design and control changes on overall vehicle performance

▪ Couple high-fidelity aftertreatment model with real driving conditions

46
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration
– Cooling circuit modeling
– Aftertreatment modeling
– Ride and handling analysis – Assess longitudinal / lateral dynamics
– Chassis controls development
– ADAS / AD testing

47
Reference Application: Double Lange Change

48
Reference Application: Double Lange Change (Maneuver)

Set target velocity and lateral position


49
Reference Application: Double Lange Change (Driver)
PI controller sets throttle
/ brake command

Predictive driver model sets


steering wheel angle command

50
Reference Application: Double Lange Change (Environment)

▪ Simple open-loop commands, by default


▪ Customize the subsystem as needed:
– Maneuver-specific inputs
– Closed-loop feedback
– Test data playback

51
Reference Application: Double Lange Change (Controllers)

▪ Basic controllers provided for engine, transmission and brakes


▪ Incorporate your own variants, as needed
52
Reference Application: Double Lange Change (Plant)

▪ Use default plant model provided


▪ Select variants of interest
▪ Customize subsystems Engine

Vehicle body

Steering
Suspension
Tire
Transmission

Driveline

53
Reference Application: Double Lange Change (Visualization)

▪ Scopes, gauges, plotters, logs


▪ 3D engine interface

54
Ride and Handling Study: Double Lane Change at 30 mph

55
Ride and Handling Study: Double Lane Change at 50 mph

56
Ride and Handling

▪ Analyze ride and handling metric of interest


– Lateral acceleration
– Roll-over propensity
– Understeer / oversteer

▪ Simulate the vehicle over various driving maneuvers


– Double lane change
– Slowly increasing steering
– Swept sine steering
– Customer maneuver

57
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration
– Cooling circuit modeling
– Aftertreatment modeling
– Ride and handling analysis
– Chassis controls development – Perform closed-loop testing
– ADAS / AD testing

58
Chassis Controls Study: Braking Test

Open loop brake controller


simply passes through
brake pressure command

Disc brakes
59
Chassis Controls Study: Braking Test

60
Chassis Controls Study: ABS Controller

▪ Added custom MPC variant


to brake controller subsystem MPC
▪ At each time step, finds Controller
optimal brake pressure for
target slip ratio

61
Chassis Controls Study: ABS Controller

Vehicle Speed
Open-loop brakes
MPC-based ABS

Tire lock-up
Slip Ratio

Ideal slip ratio

62
Chassis Controls Study: Braking Test with ABS

63
Split Mu Test

64
Chassis Controls Study: Split Mu Test

65
Chassis Controls Development

▪ Study the impact of controller on vehicle behavior

▪ Incorporate custom control features

▪ Test the closed-loop system over a wide range of scenarios

66
Agenda

▪ Product overview
– Powertrain Blockset
– Vehicle Dynamics Blockset

▪ Six Cool Things You Can Do


– Engine modeling and calibration
– Cooling circuit modeling
– Aftertreatment modeling
– Ride and handling analysis
– Chassis controls development
– ADAS / AD testing – Test in a virtual 3D environment

67
ADAS / AD Testing: Virtual 3D Scene

Camera sensor sends video to Simulink

Synthetic video used for testing vision-


based algorithms (e.g., lane detection)

68
Stop Sign Detection and Braking

69
Customizing Scene with Support Package
▪ Create your own scenes with Unreal Editor and our Simulink plug-in
▪ Unreal Editor project files available in our Support Package:
“Vehicle Dynamics Blockset interface for Unreal Engine 4”

70
Editing Support Package Scene to Add Stop Sign

71
Training Stop Sign Detector

▪ Train a stop sign detector as an


ACF object detector

▪ The detector is trained based on


the CVST example and saved as
a MAT-file

72
Implementing Detector as System Object
classdef StopSignDetector < matlab.System & ...
matlab.system.mixin.Propagates
% Stop Sign Detector
% Pre-computed constants
▪ Implement the stop sign detector properties(Access = private)
as a system object in Simulink detector
end
▪ Simulate using “Interpreted
methods(Access = protected)
execution” mode function setupImpl(obj)
d = load('acfDetector');
obj.detector = d.acfDetector;
end

function [bbox,score] = stepImpl(obj,img)


[bboxes,scores] = detect(obj.detector,img);
if ~isempty(bboxes)
[score,idx] = max(scores);
bbox = bboxes(idx,:);
else
bbox = nan(1,4);
score = nan(1,1);
end
end
:
: 73
Implementing Braking Logic
Add switching logic
▪ Start with Scene Interrogation reference application
▪ Add braking logic to stop when the stop sign appears

Add stop sign detector as


MATLAB System Object 74
Changing the Lighting to Night Conditions

75
ADAS / AD Testing

▪ Use Unreal Engine as a virtual test environment for ADAS / AD control


features

▪ Incorporate and test custom sensor models

▪ Create custom scenes for exercising the system

76
Value Proposition

▪ MathWorks provides vertical products to serve automotive industry, including


– Powertrain Blockset: powertrain controls, fuel economy and performance simulation
– Vehicle Dynamics Blockset: ride and handling, chassis controls, AD / ADAS testing

▪ These products offer


– Open and documented library of
component and subsystem models
– Prebuilt vehicle models that you can
parameterize and customize
– Fast-running models that are ready for
HIL deployment
– Framework that supports integration
with 3rd party software

77
Thank You

Mike Sasena, PhD


Product Manager
mike.sasena@mathworks.com

© 2018 The MathWorks, Inc.


78

You might also like