Simscape Vehicle Templates PDF-مهم
Simscape Vehicle Templates PDF-مهم
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
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
Specific Designs
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
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
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
25
Tank Trailer with Slosh Models
26
Tank Trailer with Slosh Models
27
Tank Trailer with Slosh Models
28
Integration with
Other Capabilities
1. Photo-realistic animation
via Unreal integration
– Measurements fed to
Unreal engine during
simulation or to replay
29
Simscape Vehicle Templates
User Interface
Data
Vehicle Maneuver
Model
31
Simscape Vehicle Template
User Interface
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
39
User Interface
Event Tab Plotting Maneuver on Event tab
shows inputs to the maneuver
40
User Interface
Results Tab
41
User Interface
Results Tab
42
User Interface
Results Tab
43
User Interface
Other Functions
44
Simscape Vehicle Templates
Modular Design
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
48
Parameterized Models
Modular Templates
▪ Modular parameterization
enables rapid adjustment of
vehicle-level design parameters
– Wheelbase can be changed
by adjusting a single value
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
51
Model Parameterization: 9 MATLAB Data Structures
Vehicle Init
Trailer
Init_Trailer 52
Model Parameterization Vehicle Init Maneuver Driver Scene Camera
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
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
58
Model Parameterization Vehicle Init Maneuver Driver Scene Camera
60
Simscape Vehicle Templates
Suspension Models
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
Heave
Steer
Roll
71
Simscape Vehicle Templates
Bushings
▪ All inboard
connections
can have
kinematic or
compliant
connections
▪ Enable using
UI or via
MATLAB
73
Enable Compliance on Inboard Link Connections
Wishbone
▪ Axial direction
– Wishbone: line through hardpoints
– Links: Specified via additional hardpoint Links
74
Simscape Vehicle Templates
Road Definition: CRG
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
78
Electric Vehicle Virtual Testing
19.8 km on Pikes Peak
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
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
▪ MFEval
– All releases
84
Tire Models Integrated with Simscape Vehicle Templates
85
Simscape Multibody
Magic Formula Tire
▪ 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
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
88
Simscape Multibody
Simulink Interface for Siemens MF-Tyre/MF-Swift Tire Model
89
Simscape Vehicle Templates
Road Surfaces
91
Road height input
MFeval, Multibody tire
▪ Vary road height with
wheel center position
– Inject bumps into suspension
– Does model slope of road
92
Rough Road Z Only, Plateau Z Only, CRG Plateau
Rough Road Z-Only
93
Rough Road Z Only, Plateau Z Only, CRG Plateau
94
Effect of Ignoring Road Slope
95
Simscape Vehicle Templates
Electric Powertrain
Driveline
2 powered shafts
Two Motor
97
Electric Powertrain
Driveline
3 powered shafts
Three Motor
98
Cooling System for Motors, Battery, and Inverter
Three Motor
99
Simscape Vehicle Templates
Fuel Cell Powertrain
101
Fuel Cell Powertrain Variant
102
Fuel Cell Powertrain Variant
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
105
Fuel Cell Powertrain Variant
Click hyperlink
to set up test
Run model
Click hyperlink
to generate plot
106
Simscape Vehicle Templates
ADAS Examples
https://www.matlabexpo.com/uk/2019/proceedings.html
108
Define Route Graphically in MCity Maneuver
109
Simscape Vehicle Templates
Examples for ADAS Development
110
Simscape Vehicle Templates
Examples for ADAS Development
▪ 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
112
Sensor Added to Passengers and Driver
– 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
Heave
Steer
Roll
115
Profile Reports on Speedgoat Hardware
Complex Variant
Real-Time Simulation
Basic Variant
116
Real-Time Simulation
117
Work with Speedgoat to use Simscape in Real-Time Testing
speedgoat.com
https://www.speedgoat.com/.../simscape-vehicle-templates 118
Simscape Vehicle Templates
Optimization
▪ 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
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)
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
126