0% found this document useful (0 votes)
1K views126 pages

Simscape Vehicle Templates PDF-مهم

The Simscape Vehicle Templates document provides an overview of the capabilities and features of the vehicle modeling tool, including customizable component libraries, integrated control algorithms, and modular design for various vehicle configurations. It outlines the user interface, parameterization, and integration with other capabilities such as photo-realistic animation and driver models. The document also details specific use cases for testing control algorithms and evaluating vehicle designs under various conditions.

Uploaded by

ali123456784444
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views126 pages

Simscape Vehicle Templates PDF-مهم

The Simscape Vehicle Templates document provides an overview of the capabilities and features of the vehicle modeling tool, including customizable component libraries, integrated control algorithms, and modular design for various vehicle configurations. It outlines the user interface, parameterization, and integration with other capabilities such as photo-realistic animation and driver models. The document also details specific use cases for testing control algorithms and evaluating vehicle designs under various conditions.

Uploaded by

ali123456784444
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 126

Simscape Vehicle Templates

Introduction

Table of Contents
1. Introduction
2. Capabilities
3. User Interface
4. Modular Design and Parameters
5. Suspension Models
6. Bushings
7. Road Definition: CRG
8. Tire Models
9. Powertrain: Electric
10. Powertrain: Fuel Cell
11. ADAS Examples
12. Real-Time Simulation
13. Optimization
Updated October 2024 for version 3.4 © 2024 The MathWorks, Inc.
1
Simscape Vehicle Templates
Available on File Exchange
▪ Download Simscape Vehicle Templates
directly from the File Exchange

– Get files saved for use with


MATLAB® releases R2018b and higher
▪ Recommend R2022a and higher

– Files hosted on GitHub so we


can react quickly to requests

https://www.mathworks.com/solutions/physical-modeling/simscape-vehicle-templates.html
https://www.mathworks.com/matlabcentral/fileexchange/79484-simscape-vehicle-templates 2
Simscape Vehicle Templates User Interface

Customizable Component Libraries

Configurable Vehicle Model with Controllers


3
Simscape Vehicle Templates User Interface

Customizable Component Libraries

Configurable Vehicle Model with Controllers


4
Simscape Vehicle Templates

Customizable Component Libraries

Configurable Vehicle Model with Controllers


5
Simscape Vehicle Templates
Model Overview

▪ Vehicle model with physical connections


enables easy customization

Configurable Vehicle Model with Controllers


6
Inputs, Controls, and Environment
Simscape Vehicle Templates Vehicle-Level Control
Model Overview
Control algorithms for Environment
Maneuver/
Driver brakes, suspension,
Drive Cycle
▪ Vehicle model with physical connections steering, powertrain

enables easy customization


▪ Integrated control algorithms and Tires Suspension Tires
vehicle model in a single environment

Battery Motor Drivetrain Brakes

Tires Suspension Tires

Configurable Vehicle Model with Controllers


Vehicle with Physical Network Architecture
7
Parameterized Models
Simscape Vehicle Templates 1 Axle
2 Axle
Model Overview

▪ Vehicle model with physical connections


enables easy customization
Specific Designs
▪ Integrated control algorithms and
vehicle model in a single environment

Configurable Vehicle Model with Controllers


8
Parameterized Models
Simscape Vehicle Templates 1 Axle
2 Axle
Model Overview Multi Axle

▪ Vehicle model with physical connections


enables easy customization
▪ Integrated control algorithms and
vehicle model in a single environment

Specific Designs

Configurable Vehicle Model with Controllers


9
Simscape Vehicle Templates Vehicle-Level Control
Use Cases
Control
Brake algorithms
Suspension
for Environment
Maneuver/
Driver Control
brakes, suspension,
Control
Drive Cycle
▪ Testing control algorithms from suppliers Supplier
steering, powertrain
Supplier

– Brake, power steering, and


active suspension control systems
Tires Suspension
Suspension Tires

▪ Evaluating new designs


– Suspension, brakes, drivetrain
Battery
Battery Motor
Motor Drivetrain
Drivetrain Brakes
Brakes
▪ Size components
– Battery, motor, engine

▪ Test design more fully Tires Suspension


Suspension Tires
– Fault scenarios
Vehicle with Physical Network Architecture
10
Integration with
Other Capabilities
1. Photo-realistic animation
via Unreal integration
– Measurements fed to
Unreal engine during
simulation or to replay

2. Longitudinal Driver and


Lateral Driver model
– Vehicle Dynamics Blockset
2

11
Using Simscape Vehicle Templates

▪ Considerations
Question Why ask
Do you need to model 3D vehicle dynamics? If pure 1D models are enough,
templates could be more than you need
Are you using or considering multibody simulation? If yes, 3D models are needed
Do you need Simulink integration? Simscape integration into Simulink is a
big strength over other solutions.
Dp you have a custom design (physical system)? Simscape is great if you need to create
a custom model (design, effects).

▪ Great applications
– Brake controls (ABS, traction control), chassis controls,
power steering system, custom suspension design

12
Using Simscape Vehicle Templates
Brake Controls: Trailer Stability Assist

▪ Purpose: Detect swerving caused


by trailer and take corrective action
▪ How it works:
– Yaw rate sensor used to detect condition
– Brakes applied at front left and right wheels
to damp oscillation
– Must coexist with other brake commands
(driver, stability control)
▪ How can simulation help:
– Identify requirements for sensor, brakes
– Develop and test algorithm under
wide range of conditions (vehicle types,
road surfaces, driving styles, fault conditions)
13
Using Simscape Vehicle Templates
Brake Controls: Trailer Stability Assist

Mercedes-Benz Trailer Stability Assist (TSA) Continental Trailer Stability Assist Volvo Trailer Stability Assist
14
Using Simscape Vehicle Templates
Brake Controls: Anti-Lock Braking
▪ Purpose: Maintain driver’s ability to steer
by preventing brakes from locking wheels
▪ How it works:
– Wheel speed and yaw rate sensors used to
detect condition of wheels and vehicle
– Brake pressures at all wheels individually
cycled between low and high pressure
to find point of maximum traction
▪ How can simulation help:
– Identify requirements for sensor, brakes
– Develop and test algorithm under
wide range of conditions (vehicle types,
road surfaces, driving styles, fault conditions)

15
Simscape Vehicle Templates
Capabilities

© 2024 The MathWorks, Inc.


16
Double-Lane Change

17
Racetrack: Mallory Park

18
Skidpad

19
Ice Patch

20
Rough Road

21
Trailer Disturbance

22
Four-Post Testrig

23
Configure Vehicle

24
Tank Trailer with Slosh Models

▪ Lateral only slosh model


– Easy to parameterize
– Only useful for basic steering events

25
Tank Trailer with Slosh Models

▪ Lateral only slosh model


– Easy to parameterize
– Only useful for basic steering events

26
Tank Trailer with Slosh Models

▪ Lateral and longitudinal slosh model


– Harder to parameterize (length, mass depend on tank shape and fill level)
– Useful for steering and braking events

27
Tank Trailer with Slosh Models

▪ Lateral and longitudinal slosh model


– Harder to parameterize (length, mass depend on tank shape and fill level)
– Useful for steering and braking events

28
Integration with
Other Capabilities
1. Photo-realistic animation
via Unreal integration
– Measurements fed to
Unreal engine during
simulation or to replay

2. Longitudinal Driver and


Lateral Driver model
– Vehicle Dynamics Blockset
2

29
Simscape Vehicle Templates
User Interface

© 2024 The MathWorks, Inc.


30
Simscape Vehicle Template
User Interface

Data

Vehicle Maneuver

Model

31
Simscape Vehicle Template
User Interface

Vehicle Model Test and Analysis Data

32
Updates with Update Diagram or Run
User Interface
Preset Tab

Triggers
Update

33
Updates with Update Diagram or Run
User Interface
Matrix Tab (Presets)

34
User Interface
Configure Tab

35
User Interface
Configure Tab

36
User Interface
Configure Tab Vehicle
1 2

37
User Interface
Event Tab 2

Selecting the maneuver changes


1. Surface
2. Open/Closed loop driver
− Open loop: Pedal and steering inputs
− Closed loop: Trajectory for driver
Speed and heading along specific path
3. Initial Position 3
4. Simulation stop time
Init
38
User Interface
Event Tab Plotting Maneuver on Event tab
shows inputs to the maneuver

Open loop maneuver: Pedal travel, steering angle

39
User Interface
Event Tab Plotting Maneuver on Event tab
shows inputs to the maneuver

Open loop maneuver: Pedal travel, steering angle


Closed loop maneuver: Position trajectory,
target yaw and speed along that path

40
User Interface
Results Tab

41
User Interface
Results Tab

42
User Interface
Results Tab

43
User Interface
Other Functions

▪ Hover your mouse over the UI feature


to see a tip about that feature‘s function

44
Simscape Vehicle Templates
Modular Design

Axle

© 2024 The MathWorks, Inc.


45
Corner
Modular Templates
2-Axle Vehicle

▪ Modular templates enable


streamlined maintenance
and simple parameterization
– Single, double, multi-axle vehicles

1-Axle Vehicle Axle

46
Multi-axle vehicles including trailers
1-Axle 2 Axle 3 Axle

▪ Same components
▪ Copy/paste for
vehicles with >3 axles

47
Modular Templates

▪ Modular templates enable


streamlined maintenance
and simple parameterization
– Single, double, multi-axle vehicles
Wheelbase
▪ Modular parameterization Sedan
enables rapid adjustment of
vehicle-level design parameters
– Wheelbase can be changed
Wheelbase
by adjusting a single value Bus

48
Parameterized Models
Modular Templates

▪ Modular templates enable


streamlined maintenance
and simple parameterization Specific Designs
– Single, double, multi-axle vehicles

▪ Modular parameterization
enables rapid adjustment of
vehicle-level design parameters
– Wheelbase can be changed
by adjusting a single value

▪ One set of templates can be


used to define many vehicles
49
Defining a Full Vehicle
Vehicle
Data Structure Model
▪ Must specify:
Vehicle.
– Selected variants .Brakes
▪ Powertrain type, suspension type, etc. .Chassis.
– Parameter values for selected variants .Aero
.Body
▪ Variants and values must be synchronized
.Damper
▪ Simscape Vehicle Templates .Spring
use a single MATLAB structure .SuspA1
.SuspA2
to define variants and values .TireL1
.TireR1
.TireL2
.TireR2
.Powertrain.
.Driveline
.Power

50
Defining a Full Vehicle Vehicle

▪ Must specify:
– Selected variants
▪ Powertrain type, suspension type, etc.
– Parameter values for selected variants
▪ Variants and values must be synchronized

▪ Simscape Vehicle Templates


use a single MATLAB structure
to define variants and values
>>Vehicle = Vehicle_Sedan >>Vehicle = Vehicle_Bus Variant selection in structure

51
Model Parameterization: 9 MATLAB Data Structures

Driver Maneuver Camera Scene Visual

Vehicle Init

Trailer

Init_Trailer 52
Model Parameterization Vehicle Init Maneuver Driver Scene Camera

Data Structure Model


▪ Data structure mirrors
Vehicle.
model structure .Brakes
.Chassis.
.Aero
▪ Contains parameter values .Body
and selected variants .Damper
– Structure varies based on .Spring
selected variants .SuspF
.SuspR
– Variant selection done by .TyreF
mask initialization
.TyreR
▪ Assembled by copying .Powertrain.
fields from MATLAB .Driveline
structure VDatabase .Power

53
Model Parameterization Vehicle Init Maneuver Driver Scene Camera

sm_car_data_... .xlsx
▪ Model uses Vehicle
▪ Vehicle parameters can come from
– VDatabase sm_car_import_database()
– Overwrite Vehicle using MATLAB Code
Custom Code VDatabase.Aero.(classes)_(instances)
Body.(classes)_(instances)
▪ VDatabase saved in a .mat file Brakes.(classes)_(instances)
Chassis.(classes)_(instances)
– Updated if a .xlsx file has a VDatabase
newer “Modified Date“ sm_car_vehcfg_setAero(),
▪ If.xlsx files are only modified, simply sm_car_vehcfg_setBody(),
press “Update Vehicle Database“ button ...
at bottom of User Interface Custom Code Vehicle.Chassis.Aero.(instance)
.Body.(instance)

.Powertrain.Driveline.(…)
Vehicle .Brakes.(instances)
▪ If a new sm_car_data...xlsx file is added,
you must reload the entire Vehicle database
– Update will scan for files that are named
sm_car_data**.xlsx

54
Model Parameterization Vehicle Init Maneuver Driver Scene Camera

sm_car_gen_init_database
▪ MATLAB code defines database of
initial states for the vehicle
– Vehicle position, orientation
– Chassis speed, wheel angular speed
IDatabase
▪ Initial state is extracted from database sm_car_config_maneuver()
based on event and vehicle type Init.Chassis.aChassis
.sChassis
.vChassis
.Axle1.nWheel
Init .Axle2.nWheel

Init_Trailer

55
Model Parameterization Vehicle Init Maneuver Driver Scene Camera

▪ MATLAB code defines database of sm_car_maneuverdata_... .m


maneuvers for vehicles
– Specific to event, vehicle type, and sm_car_import_maneuver_data
open-loop or closed-loop driver MDatabase.Skidpad.Sedan_Hamba
.Bus_Makhulu
.Ice_Patch.Sedan_Hamba
.(event).(vehicle) .
▪ Structure Manuever extracted from MDatabase
MDatabase and used by the model sm_car_config_maneuver()

Open Loop Closed Loop


Maneuver.Type Maneuver.Type
.Instance .Instance
Maneuver .Brake .xMaxLat
.Steer .vMinTarget
.Accel .Trajectory

56
Model Parameterization Vehicle Init Maneuver Driver Scene Camera

sm_car_gen_driver_database
▪ MATLAB code defines database of
drivers for vehicles
– Closed-loop driver parameters
specific to maneuver and vehicle type
DDatabase
▪ Structure Driver is sm_car_config_maneuver()
extracted from DDatabase
and used by the model Driver.Long
.Lateral

Driver

57
Model Parameterization Vehicle Init Maneuver Driver Scene Camera

▪ MATLAB code defines database of sm_car_scenedata_... .m


parameters for each scene
– Locations, sizes, colors, files, and sm_car_import_scene_data
other data to parameterize environment Scene.Ice_Patch
.CRG Mallory Park
.Plane_Grid

▪ Structure Scene is Scene


directly referenced by
variant subsystems that
define each scene

58
Model Parameterization Vehicle Init Maneuver Driver Scene Camera

▪ MATLAB code defines database of sm_car_scenedata_... .m


frame locations and orientations to
position dynamic cameras sm_car_gen_camera_database
– Depends on vehicle chassis size CDatabase.Camera.Hamba
.Makhulu
.(vehicle)
CDatabase
▪ Structure Camera extracted from
sm_car_config_camera
CDatabase and used by the model
Camera.FL.s
– sm_car_config_camera is called .a
during model initialization .FR.s
.a
– Uses first portion of Vehicle.config to Camera …

determine which set of frame locations to use


>> Vehicle.config
ans =
'Hamba_dwb_MFMbody_steady_fCVpCVr1D'
59
Number of Independent Variants Variant
Simscape Vehicle Templates for Vehicle only Manager
Testing (excludes trailer, events, solver settings)

▪ Automated set of tests (265 runs)


– Run in R22a through R24b
▪ Report of results
– Simulation duration, number of steps
– Final vehicle position
– Screenshot of plotted results

60
Simscape Vehicle Templates
Suspension Models

© 2024 The MathWorks, Inc.


61
Configure Vehicle
Suspension

62
Configure Suspension
Double-Wishbone

63
Configure Suspension
Multi-Link

64
Configure Suspension
Multi-Link

65
Configure Suspension
Multi-Link

66
Configure Suspension
Multi-Link

67
Parameterize
Suspension
Define Hardpoints

▪ Suspensions designed by
specifying hardpoints
– Global x-y-z locations
– Defines how wheel will move

Simionescu, P.A. (2014) Computer Aided Graphing and Simulation Tools for AutoCAD Users (1st ed.), Boca Raton, FL: CRC Press ISBN: 9-781-48225290-3. 68
Parameterize
Suspension
Define Hardpoints

▪ Suspensions designed by
specifying hardpoints
– Global x-y-z locations
– Defines how wheel will move

69
Parameterize
Suspension
Check Assembly

▪ Linkages
are mirrored

▪ Need to ensure
it will assemble
with any set of
points

▪ Defined test to
check it works

70
Abstract Suspension Multi-Link Suspension

▪ Can define abstract models as well


– Example: Suspension with roll and heave
degrees of freedom on front and rear axles
State Vector Execution
Suspension Size Time
Multi-link 155 9.5 ms
Roll & Heave 41 0.8 ms Roll & Heave, Front & Rear

Heave

Steer

Roll

71
Simscape Vehicle Templates
Bushings

© 2024 The MathWorks, Inc.


72
Enable Compliance on Inboard Link Connections

▪ All inboard
connections
can have
kinematic or
compliant
connections

▪ Enable using
UI or via
MATLAB

73
Enable Compliance on Inboard Link Connections
Wishbone

▪ Bushing placed at hardpoints


▪ Separate stiffness and damping
Hardpoint to
models for radial and axial define axis
– Linear, lookup table
– Nonlinear stiffness with hysteresis

▪ Axial direction
– Wishbone: line through hardpoints
– Links: Specified via additional hardpoint Links

74
Simscape Vehicle Templates
Road Definition: CRG

Curved Regular Grid

© 2024 The MathWorks, Inc.


75
3D Road Definition in CRG Format
Curved Regular Grid

▪ Frequent request from customers:


3D driving surface
– Commercial vehicles
(construction, agriculture, forestry)
– Passenger vehicles
▪ MF-Swift and Delft-Tyre both support
roads defined using CRG format

Curved Regular Grid

76
3D Road Definition in CRG Format
Curved Regular Grid
CRG Road XYZ map
▪ Frequent request from customers:
3D driving surface
– Commercial vehicles
(construction, agriculture, forestry)
– Passenger vehicles
▪ MF-Swift and Delft-Tyre both support
roads defined using CRG format
▪ Several famous roads are now part of
Simscape Vehicle Templates
– Includes examples of how to generate CRG file
and driver profile based on road centerline

77
Mallory Park Suzuka Circuit

Nurburgring Nordschleife Pikes Peak

78
Electric Vehicle Virtual Testing
19.8 km on Pikes Peak

▪ Uphill: Battery range, cooling system


▪ Downhill: Regenerative braking

79
3D Road Definition in CRG Format
Google Maps
Free tools
(GPS Visualizer)
▪ Current process converts
Centerline
GPS data to CRG and STL
– Smoothing and interpolating necessary
– For racetracks, tricky to get MATLAB Code
road start and finish to line up
Line and grid

▪ Also use CRG file to create CRG Tools


trajectory for driver
– Input: road curvature .CRG CRG File
– Output: target speed and vehicle yaw for tire model Simcenter
CRG Tools, Tyre
vs. distance along path
surf2stl
STL file
.STL for visualization
80
Use CRG with Multibody Tire
▪ Set x-y-z position, slope, bank, ▪ Determine positions and angles
and heading angles of Infinite based on position of wheel center
Plane, speed and accel = 0 – Search lookup table or query
curved-regular grid (CRG)

81
Use CRG with Multibody Tire
▪ Set x-y-z position, slope, bank,
and heading angles of Infinite
Plane; speed and accel = 0

82
Simscape Vehicle Templates
Tire Models

© 2024 The MathWorks, Inc.


83
Tire Models Integrated with Simscape Vehicle Templates

▪ Magic Formula Tire External Force and Torque


– Part of Simscape Multibody
– R2021b and higher

▪ MFEval
– All releases

▪ MF-Swift/MF-Tyre from Siemens


– All releases
– Formerly known as Delft Tyre

84
Tire Models Integrated with Simscape Vehicle Templates

▪ We have directly integrated a few models


– Any tire model can be integrated if you use the interfaces we provide
Simscape Simcenter MFEval
Author MathWorks Siemens Community
Category Pacejka Pacejka Pacejka
Interface Multibody Signals Signals
Flat Road Yes Yes Yes
CRG Road Yes* Yes No
Road Height Input Yes Yes Yes
Combined Slip Yes Yes Yes
Turn Slip Yes Yes Yes
Transients Exploring Yes Yes *See Use CRG with Multibody Tire
Rigid Ring Exploring Yes No

85
Simscape Multibody
Magic Formula Tire

▪ Model the tire-road interaction force


using the Magic Formula
– Read tire parameters from a TIR file.
– Sense contact force and torque between
the tire and the road
– Steady-state tire force and torque
for the combined slip

▪ Multibody interface
– Great numerical performance
– Will enable detailed surface definition in
future releases (flat surfaces in R2021b)

>> sm_car_heave_roll 86
Simscape Multibody
Tire Contact Weighted Penetration Method

▪ Approximate multi-point contact


between tire and ground
– Efficient modeling of rough road conditions
– Compute tire radial deflection

Ground

A2 Equivalent
A1 Contact Plane

87
Simscape Multibody
Tires on Uneven Surface Stress Test of Simscape Multibody Tire Model
14 Degree-of-Freedom vehicle model
10x faster than real time
▪ Model vehicle dynamics on uneven
surfaces
– Use the Grid Surface block with Magic
Formula Tire Force and Torque block

▪ Model variations in surface friction


– Vary friction scaling coefficients
during simulation

▪ Sense location and orientation of


contact frame

88
Simscape Multibody
Simulink Interface for Siemens MF-Tyre/MF-Swift Tire Model

▪ Download MF-Tyre/MF-Swift Tire model


directly from Add-on Explorer
– Includes examples with
Simscape Multibody,
Simulink, and MATLAB
– Available from R2021b forward

89
Simscape Vehicle Templates
Road Surfaces

© 2024 The MathWorks, Inc.


90
Road Surface

▪ Simscape Vehicle Templates uses tire models that support


– Flat road surfaces
– Varying coefficient of friction
– Uneven road surfaces

▪ Additional tire models can be integrated


– Look at subsystems for tires
– Copy/paste subsystem, integrate tire with same interface

91
Road height input
MFeval, Multibody tire
▪ Vary road height with
wheel center position
– Inject bumps into suspension
– Does model slope of road

▪ Separate variants for test case


– Same lookup table to all wheels
▪ Car can pitch but not roll
– Separate tables for left
and right side
▪ Car can pitch and roll

92
Rough Road Z Only, Plateau Z Only, CRG Plateau
Rough Road Z-Only

▪ Maneuvers to show effect of varying


road height with wheel center position

CRG Plateau Plateau Z-Only

93
Rough Road Z Only, Plateau Z Only, CRG Plateau

▪ Maneuvers to show effect of varying


road height with wheel center position

94
Effect of Ignoring Road Slope

▪ If only the tire model only knows road height,


it takes no additional effort to climb a hill
– CRG format specifies slope and banking

Road Height Only

Height and Slope

95
Simscape Vehicle Templates
Electric Powertrain

© 2024 The MathWorks, Inc.


96
Electric Powertrain

▪ New electric vehicle options


– Two motor (front, rear)

Driveline
2 powered shafts
Two Motor

97
Electric Powertrain

▪ New electric vehicle options


– Two motor (front, rear)
– Three motor (one front, two rear)

Driveline
3 powered shafts

Three Motor

98
Cooling System for Motors, Battery, and Inverter

▪ Single cooling loop to extract heat


▪ For 2 motor and 3 motor variants

Three Motor

99
Simscape Vehicle Templates
Fuel Cell Powertrain

© 2024 The MathWorks, Inc.


100
Fuel Cell Powertrain Variant

▪ Vehicle propelled by a single motor


powered by a fuel cell and a battery

101
Fuel Cell Powertrain Variant

▪ Vehicle propelled by a single motor


powered by a fuel cell and a battery
▪ Test with multibody or 1D driveline
with powertrain control algorithms

102
Fuel Cell Powertrain Variant

▪ Vehicle propelled by a single motor


powered by a fuel cell and a battery
▪ Test with multibody or 1D driveline
with powertrain control algorithms

103
Fuel Cell Powertrain Variant
Acceleration Deceleration Braking
SOC Drops SOC Increases Mechanical
Power Output Power to Battery Only
▪ Vehicle propelled by a single motor
powered by a fuel cell and a battery
▪ Test with multibody or 1D driveline
with powertrain control algorithms

104
Fuel Cell Powertrain Variant

▪ Configuring the vehicle


– Select preset to configure the
powertrain, brakes, and controller

105
Fuel Cell Powertrain Variant

▪ Configuring the vehicle


– Open 1D driveline model from Main tab

Click hyperlink
to set up test

Run model

Click hyperlink
to generate plot

106
Simscape Vehicle Templates
ADAS Examples

© 2024 The MathWorks, Inc.


107
Simscape Vehicle Templates
Use Case: Evaluate ADAS for Passenger Comfort

▪ True differentiator for autonomous vehicles may be passenger comfort


– Ricardo uses simulation to predict “Motion Sickness“
– Presented at MATLAB EXPO UK, 2019

https://www.matlabexpo.com/uk/2019/proceedings.html
108
Define Route Graphically in MCity Maneuver

▪ Based on Automated Driving Toolbox example


– Visualize Automated Parking Valet Using 3D Simulation

109
Simscape Vehicle Templates
Examples for ADAS Development

▪ Example for route planning based on Automated Driving Toolbox example


Visualize Automated Parking Valet Using 3D Simulation

Animation in Simscape Animation in Unreal

110
Simscape Vehicle Templates
Examples for ADAS Development

▪ Example of driver reacting to environment: Stoplight

▪ Driver considers
location of vehicle
and state of stoplight
– If in front of stoplight
and stoplight is yellow,
apply brakes.
– Remain stopped until
light turns green

111
Sensor Added to Passengers and Driver

▪ Measures position, speed, acceleration,


pitch, and roll using frame on human
as reference frame

112
Sensor Added to Passengers and Driver

▪ Measures position, speed,


acceleration, pitch, and roll
using frame on human
as reference frame

– Passenger measurements
are in Body hierarchy
▪ VehBus.Chassis.Body.Passengers.FL.aPitch

– Driver measurements
are within Steer hierarchy
▪ VehBus.Chassis.SuspF.Steer.Driver.aPitch

113
Simscape Vehicle Templates
Real-Time Simulation

© 2024 The MathWorks, Inc.


114
Real-Time Simulation Multi-Link Suspension

▪ Can define abstract models as well


– Example: Suspension with roll and heave
degrees of freedom on front and rear axles
State Vector Execution
Suspension Size Time
Multi-link 155 9.5 ms
Roll & Heave 41 0.8 ms Roll & Heave, Front & Rear

Heave

Steer

Roll

115
Profile Reports on Speedgoat Hardware
Complex Variant
Real-Time Simulation

▪ Can define abstract models as well


– Example: Suspension with roll and heave
degrees of freedom on front and rear axles

Basic Variant

116
Real-Time Simulation

▪ Configure model for real-time execution


1. Select appropriate preset 1
2. Configure solver for fixed-step simulation.
3. Select code generation target
(dropdown for Simulink Real-Time,
use Solver Configuration Panel for others)

117
Work with Speedgoat to use Simscape in Real-Time Testing
speedgoat.com

▪ Videos and explanations


demonstrating use of Simscape
in real-time simulation
– HIL testing
– Driver-in-the-Loop tests

▪ Hardware and model can be


tailored to use case
– Chassis controls
– Powertrain design

https://www.speedgoat.com/.../simscape-vehicle-templates 118
Simscape Vehicle Templates
Optimization

© 2024 The MathWorks, Inc.


119
Optimization Example: Use Simulation to Optimize Lap Time

▪ Simple example:
Adjust target speed along
path to minimize lap time
– Assume fixed target path
– Calculate road curvature
– Convert curvature to target speed
(not acceleration – easier to set up) Deviation < threshold?

▪ Requires:
– Measuring lap time
– Parameters to adjust Target Speed
target speed along path
Target Path Driver Vehicle Lap time
– Measuring lateral deviation
from target path Deviation
120
Simple Method for Adjusting Target Speed

▪ Three parameters: Maximum Speed, Minimum Speed, Scaling Factor


– Applied to default trajectory derived from path curvature

121
Plausible Results Produced
From Challenging Problem
▪ Better results than tuning by hand
▪ Managed to keep car on the track (most of the time)

122
Plausible Results Produced
From Challenging Problem
▪ Better results than tuning by hand
▪ Managed to keep car on the track

123
Plausible Results Produced
From Challenging Problem
▪ Better results than tuning by hand
▪ Managed to keep car on the track (most of the time)

Failed Run Successful Run

124
Common Method for Calculating Minimum Lap Time
Quasi-Steady State (QSS)
▪ Assume vehicle achieves maximum acceleration possible
in any direction at any speed
“Measured“ – does not
include QSS assumptions

• Transitions not at
maximum acceleration
• Dynamic effects (dampers)
• Driver behavior

Many papers on methods to


increase accuracy of QSS
using hybrid approaches
(including multibody models)

Simscape Vehicle Templates


could be used to refine
GGV Map
125
Constant Radius Maneuver

▪ Driver attempts to follow a circular


path as the vehicle speed increases
▪ Used to test suspension and find
maximum lateral acceleration

126

You might also like