File Exchange

image thumbnail

Simscape Vehicle Templates

version 20.2.2.0 (63.1 MB) by Steve Miller
Set of templates for creating custom vehicle models using Simscape for use within Simulink.

218 Downloads

Updated 30 Oct 2020

From GitHub

View license on GitHub

This library contains library blocks and a configurable vehicle model that you can use for a wide range vehicle design tasks. This video shows you some of the capabilities: https://youtu.be/kWfv_zZrO-4

For more details, see this page:
https://www.mathworks.com/solutions/physical-modeling/simscape-vehicle-templates.html

Here are some of the tasks you can perform:

1. Configure the powertrain architecture to model conventional, hybrid, battery electric, and even fuel cell vehicles.
2. Modify the suspension design by moving hardpoints obtained from a CAD.
3. Connect custom multi-link suspensions to passive and active hydraulic and pneumatic systems.
4. Design active chassis controls by integrating controls for anti-lock brakes, stability, and active roll control systems
5. Develop regenerative braking algorithms by incorporating electrical networks into your vehicle model.
6. Test your embedded software against a virtual vehicle by converting your Simscape model to C Code and running it on a real time computer, such as Speedgoat.

The templates are designed to be extendable. Create your own variant for any portion of the vehicle model (such as the brakes, suspension, or drivetrain) and you can adjust the libraries so that variant can be selected. It includes the tire modeling software MFeval, another submission on the File Exchange, which inspired this submission.

Please read the README.md file to get started.

The download button will let you access files compatible with the latest release (R2020b).
Use these hyperlinks to access versions from earlier releases.

For R2020b: Click on "Download from GitHub" button above.
For R2020a: https://github.com/mathworks/Simscape-Vehicle-Templates/archive/20.1.2.0.zip
For R2019b: https://github.com/mathworks/Simscape-Vehicle-Templates/archive/19.2.2.0.zip
For R2019a: https://github.com/mathworks/Simscape-Vehicle-Templates/archive/19.1.2.0.zip
For R2018b: https://github.com/mathworks/Simscape-Vehicle-Templates/archive/18.2.2.0.zip

Cite As

Steve Miller (2021). Simscape Vehicle Templates (https://github.com/mathworks/Simscape-Vehicle-Templates/releases/tag/20.2.2.0), GitHub. Retrieved .

Comments and Ratings (26)

krishna teja

Hi @steve miller
There seems to be significant difference in tire behavior between MFEval from this library and MFSwift (2020.2)
I have used standard 'Siemens_car205_60R15.tir' for this brake test.
please find the Fx and slip ratio curves here (https://drive.google.com/drive/folders/1ZYX9xx1G0UbpxDd01tprEzE6GHfxnB2p?usp=sharing). [blue-MFEval, red-MFSwift]
can you kindly provide a solution

thanks in advance

krishna teja

edit: blue - MFEval
red - MFSwift

Steve Miller

Hi @krishna teja - There are a couple maneuvers with cones. See Scene.Skidpad (cone locations are parameterized by circle radius), Scene.Double_Lane_Change (cone locations parameterized by lane location). The components used in the simulation models are in sm_car_lib.slx, there is a shortcut to open that library under "Project Shortcuts". I'll work on having it show up in the Simulink Library Browser.

krishna teja

hi,
I have x,y,z values of road and pylons. How do i use that to generate road and pylons. Will visualisation also get updated?

thanks in advance

krishna teja

hi, thanks for great templates
It would be helpful if its published as toolbox with each subsystems as library blocks (similar to vehicle dynamics toolbox).

Steve Miller

Hi Thulasi, i621148, and other visitors! Please note that version 2.0 which was added just before Christmas, includes 3-axle trucks (semi-trucks) and two axle trailers. The tanker has a slosh model as well.

Siddhi Pandey

can u please provide me this model for MATLAB R2015 b ?

Matthew Loew

Steve Miller

Hi Thulasi - I am working on creating a template for a 3-axle vehicle. For now, you could modify the existing template by copy-and-pasting one axle. An easier option would be to just enable the trailer and replace the spherical joint connection with a weld joint so all three axles are connected to the same chassis.

Thulasi Ram

kindly suggest me that how i can use this tool for design of 6 wheel vehicle including each motor at the wheel to drive vehicle

ismail Macit

Juho

Greeting Mr.Steve Miller,
I am appreciated that you have been creating this powerful tool.

Steve Miller

Hi Guilherme - does this track include height data or is it flat? Flat is easier, but both are possible. If you are defining a flat track, take a look at the files in "\Libraries\Event\Scene\Track_Mallory_Park". The easiest thing to do would be to modify those files and just use it directly. If you need to specify height as well, modify the files in folder "\Libraries\Event\Scene\CRG_Plateau\Data". Save a copy of the original files as a reference before you start changing them.

Hello!! Great job!! I have a question, what if I want to create my own layout? For example, I am from a Formula Student Team and I want to create the track that will be used in the competition. How do I add the track to the code? What parameters do I need to fill in excel?
Thanks for the attention!

Ronnie Debbe

Steve Miller

Hi i621148 - these models include a couple features that were first introduced in R2018b (the Simscape Bus for grouping physical connections). I cannot port this entire example back to R2017b. You may be able to work directly with the components sm_car_lib to build up your own model. We have plans to add a semi truck and trailer, so click on the "Follow" button up near the "Download from GitHub" button to be informed when we make an update.

i621148

How about a semi truck & trailer?

i621148

Please include working 2017b version?

Veer Alakshendra

Marco Furlan

Jan Van Rensburg

Please also comment on additional features you would like to see included in the Simscape Vehicle Templates

Oliver Jaehrig

Jan Van Rensburg

Toshinobu Shintai

Great! Thank you for uploading.

MATLAB Release Compatibility
Created with R2020b
Compatible with R2018b to R2020b
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Libraries

Libraries/Event

Libraries/Event/Maneuver

Libraries/Event/Scene/CRG_Custom

Libraries/Event/Scene/CRG_Custom/Data

Libraries/Event/Scene/CRG_Kyalami

Libraries/Event/Scene/CRG_Kyalami/Data

Libraries/Event/Scene/CRG_Mallory_Park

Libraries/Event/Scene/CRG_Mallory_Park/Data

Libraries/Event/Scene/CRG_Nurburgring_N

Libraries/Event/Scene/CRG_Nurburgring_N/Data

Libraries/Event/Scene/CRG_Pikes_Peak

Libraries/Event/Scene/CRG_Pikes_Peak/Data

Libraries/Event/Scene/CRG_Plateau

Libraries/Event/Scene/CRG_Plateau/Data

Libraries/Event/Scene/CRG_Suzuka

Libraries/Event/Scene/CRG_Suzuka/Data

Libraries/Event/Scene/Constant_Radius_CL

Libraries/Event/Scene/Double_Lane_Change

Libraries/Event/Scene/Ice_Patch

Libraries/Event/Scene/MCity

Libraries/Event/Scene/Plane_Grid

Libraries/Event/Scene/RDF

Libraries/Event/Scene/Road_Two_Lane

Libraries/Event/Scene/Skidpad

Libraries/Event/Scene/Track_Mallory_Park

Libraries/Event/Scene/Track_Mallory_Park_Obstacle

Libraries/Event/Tools

Libraries/Event/Tools/CRG_Tools

Libraries/Vehicle/Harness/Busses

Libraries/Vehicle/Harness/Linkage

Libraries/Vehicle/Linkage/Scripts

Libraries/Vehicle/Power/FuelCell

Libraries/Vehicle/Power/FuelCell/Components/+GasN

Libraries/Vehicle/Tire/CFL_Libs/Libraries

Libraries/Vehicle/Tire/CFL_Libs/Scripts_Data

Libraries/Vehicle/Tire/CFL_Libs/Scripts_Data/Extrusions

Libraries/Vehicle/Tire/MFEval/MFeval_4p0/MFeval

Libraries/Vehicle/Tire/MFEval/MFeval_4p0/MFeval/+mfeval

Libraries/Vehicle/Tire/MFEval/MFeval_4p0/MFeval/Simulink

Libraries/Vehicle/Tire/Testrig_4Post

Libraries/Vehicle/Utilities/SPL_Libs/Extrusion_Scripts

Libraries/Vehicle/Utilities/SPL_Libs/Libraries

Libraries/Vehicle/Utilities/SPL_Libs/Scripts_Data

Libraries/sm_car_doc

Scripts_Data

Scripts_Data/Compare_Struct

Scripts_Data/Configure_Event

Scripts_Data/Data_Vehicle

Scripts_Data/Data_Vehicle/Assemble_Vehicle

Scripts_Data/Data_Vehicle/Presets

Scripts_Data/Data_Vehicle/UI

Scripts_Data/Extrusions

Scripts_Data/Plots

Scripts_Data/Solver_Settings

SimResults

SimResults/Configs

Slides_Videos/Videos

Testrigs/Quarter_Car

Testrigs/Quarter_Car/Results

Workflows/Optimize/Traj_vx

Workflows/Optimize/Traj_vx/Overview

Workflows/Simplify

Libraries

Libraries/Event/Driver/Drive_Cycle

Libraries/Event/Driver/Gamepad

Libraries/Event/Driver/Long_Lat_Stanley

Libraries/Event/Driver/Open_Loop

Libraries/Event/Maneuver

Libraries/Event/Maneuver/Testrig_4Post

Libraries/Event/Scene/CRG_Custom

Libraries/Event/Scene/CRG_Kyalami

Libraries/Event/Scene/CRG_Mallory_Park

Libraries/Event/Scene/CRG_Nurburgring_N

Libraries/Event/Scene/CRG_Pikes_Peak

Libraries/Event/Scene/CRG_Plateau

Libraries/Event/Scene/CRG_Suzuka

Libraries/Event/Scene/Constant_Radius_CL

Libraries/Event/Scene/Double_Lane_Change

Libraries/Event/Scene/Ice_Patch

Libraries/Event/Scene/MCity

Libraries/Event/Scene/Objects/Traffic_Light

Libraries/Event/Scene/Plane_Grid

Libraries/Event/Scene/RDF

Libraries/Event/Scene/Road_Two_Lane

Libraries/Event/Scene/Skidpad

Libraries/Event/Scene/Track_Mallory_Park

Libraries/Event/Scene/Track_Mallory_Park_Obstacle

Libraries/Vehicle/Aero

Libraries/Vehicle/AntiRollBar

Libraries/Vehicle/Body

Libraries/Vehicle/Body/CAD

Libraries/Vehicle/Body/CAD/Bus_Makhulu

Libraries/Vehicle/Body/CAD/Sedan_Hamba

Libraries/Vehicle/Body/CAD/Sedan_Hamba/STL/Body

Libraries/Vehicle/Body/CAD/Trailer_Kumanzi

Libraries/Vehicle/Body/CAD/Trailer_Thwala

Libraries/Vehicle/Body/CAD/Truck_Amandla

Libraries/Vehicle/Body/Human

Libraries/Vehicle/Body/Load_Slosh

Libraries/Vehicle/Body/Sedan

Libraries/Vehicle/Body/Semi_Truck

Libraries/Vehicle/Body/Trailer

Libraries/Vehicle/Brakes

Libraries/Vehicle/Brakes/Axle1

Libraries/Vehicle/Brakes/Axle2

Libraries/Vehicle/Brakes/Axle3

Libraries/Vehicle/Chassis

Libraries/Vehicle/Dampers

Libraries/Vehicle/Dampers/Axle1

Libraries/Vehicle/Dampers/Axle2

Libraries/Vehicle/Dampers/Axle3

Libraries/Vehicle/Dampers/Damper

Libraries/Vehicle/Differential

Libraries/Vehicle/Differential/Gear1DShafts1D

Libraries/Vehicle/Differential/Gear1DShafts3D

Libraries/Vehicle/Differential/Gear1DShafts3Dfix

Libraries/Vehicle/Driveline

Libraries/Vehicle/Driveline/Axle1

Libraries/Vehicle/Driveline/Axle2

Libraries/Vehicle/Driveline/Axle3

Libraries/Vehicle/Driveshaft

Libraries/Vehicle/Harness/Body

Libraries/Vehicle/Harness/Busses

Libraries/Vehicle/Harness/Driveline

Libraries/Vehicle/Harness/Linkage

Libraries/Vehicle/Harness/Linkage/DW_A

Libraries/Vehicle/Harness/Linkage/DW_B

Libraries/Vehicle/Harness/Linkage/Link5_ShockR

Libraries/Vehicle/Harness/Linkage/SplitLA_ShockF

Libraries/Vehicle/Harness/Sensor

Libraries/Vehicle/Harness/Utilities

Libraries/Vehicle/Linkage/DW_A

Libraries/Vehicle/Linkage/DW_B

Libraries/Vehicle/Linkage/Link5C_S2LAF

Libraries/Vehicle/Linkage/Link5_S2LAF

Libraries/Vehicle/Linkage/Link5_S2LAR

Libraries/Vehicle/Linkage/SpLA_S2LAF

Libraries/Vehicle/Linkage/SpLA_S2LAR

Libraries/Vehicle/Power

Libraries/Vehicle/Power/Cooling

Libraries/Vehicle/Power/Cooling/Motor2

Libraries/Vehicle/Power/Cooling/Motor3

Libraries/Vehicle/Power/FuelCell

Libraries/Vehicle/Power/Shaft1

Libraries/Vehicle/Power/Shaft2

Libraries/Vehicle/Power/Shaft3

Libraries/Vehicle/Springs

Libraries/Vehicle/Springs/Axle1

Libraries/Vehicle/Springs/Axle2

Libraries/Vehicle/Springs/Axle3

Libraries/Vehicle/Springs/Spring

Libraries/Vehicle/Steer/Ackermann

Libraries/Vehicle/Steer/Rack

Libraries/Vehicle/Suspension/DOF15

Libraries/Vehicle/Suspension/LiveAxle

Libraries/Vehicle/Tire

Libraries/Vehicle/Tire/CFL

Libraries/Vehicle/Tire/CFL_Libs/Libraries

Libraries/Vehicle/Tire/Delft/Delft_6p2

Libraries/Vehicle/Tire/Delft/Delft_None

Libraries/Vehicle/Tire/MFEval

Libraries/Vehicle/Tire/MFEval/MFeval_4p0/MFeval/Simulink

Libraries/Vehicle/Tire/MFEval/MFeval_4p0/doc/examples

Libraries/Vehicle/Tire/MFSwift/MFSwift

Libraries/Vehicle/Tire/MFSwift/MFSwift_None

Libraries/Vehicle/Tire/Testrig_4Post

Libraries/Vehicle/Tire/TireBody

Libraries/Vehicle/Utilities

Libraries/Vehicle/Utilities/Camera

Libraries/Vehicle/Utilities/SPL_Libs/Libraries

Libraries/Vehicle/Vehicle

Libraries/Visualization

Testrigs/Quarter_Car

Libraries/Vehicle/Power/FuelCell/Overview

Libraries/Vehicle/Tire/CFL_Libs/Libraries/Help

Libraries/Vehicle/Tire/MFEval/MFeval_4p0/doc/examples

Libraries/sm_car_doc/brakes

Libraries/sm_car_doc/car

Libraries/sm_car_doc/chassis

Libraries/sm_car_doc/driveline

Libraries/sm_car_doc/power

Libraries/sm_car_doc/suspensions

Overview

Workflows/Optimize/Traj_vx/Overview