File Exchange

image thumbnail

Dual Clutch Transmission Model in Simulink

version 2.6.0.0 (15 MB) by Steve Miller
Model of a dual-clutch transmission with MATLAB scripts for optimizing the shift schedule.

48 Downloads

Updated 18 Apr 2019

View License

This file contains a dual-clutch transmission model built using Simscape and Simscape Driveline that can be configured for control algorithm development or optimization tests. The clutch states and pre-selection of the gears via dog clutches is controlled by a state machine modeled in Stateflow. Model variants for the transmission and vehicle dynamics can be selected using configurable subsystems. MATLAB scripts demonstrate how to optimize a shift schedule for maximum fuel economy, and how to speed that process using parallel computing. This model can be configured for hardware-in-the-loop testing.

Please read the README.txt file to get started.

See the optimization examples in this video (5 min):
https://www.mathworks.com/videos/optimizing-shift-schedule-to-maximize-fuel-economy-68820.html

Learn about model tuning, parameter sweeps, and optimization tasks in this webinar:
https://www.mathworks.com/videos/shift-schedule-optimization-of-a-dual-clutch-transmission-81828.html

Find other Simscape examples by searching posts for the keyword "physical modeling"
https://www.mathworks.com/matlabcentral/fileexchange/?term=%22physical+modeling%22

Learn more about MathWorks Simscape Products:
https://www.mathworks.com/physical-modeling/

Cite As

Steve Miller (2019). Dual Clutch Transmission Model in Simulink (https://www.mathworks.com/matlabcentral/fileexchange/32246-dual-clutch-transmission-model-in-simulink), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (26)

Hello Steve - Can you explain clearly all the mathematical models used in the engine model ?

Steve Miller

@Catalin - if you provide me your email address, I can send you a version saved in R2015b.

Hello Steve - 1.Open Matlab
2. Run startup_DCT_Model.m
3."DCT Model Demo Scirpt" is opened.
4.Click on "a. Shift Map Parameterization: Shift Map Parameterization GUI" link

As result I get the following errors: "Error using +
Matrix dimensions must agree.

Error in Calc_Shift_Map_RO (line 16)
newpts(:,i) = newpts(:,1)+(i-1)*mingeardiff+rampconst*(i-1)*pedalpos;

Error in ShiftMapParamGUI>ShiftMapParamGUI_OpeningFcn (line 69)
[Upshift_Speeds Downshift_Speeds Pedal_Positions] = Calc_Shift_Map_RO(values{1},values{2});

Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ShiftMapParamGUI (line 44)
gui_mainfcn(gui_State, varargin{:});"

Should the problem be that I use a 2015b Matlab? I opened the 2017b version on another laptop and save it as 2015b because I don't have a 2017b license.

Thank you very much for your time!
Have a good day -- Catalin

Steve Miller

Hi Catalin - I just tested the files (running >>ShiftMapParamGUI) and did not get this error. If you search the files for "FU_SET", you will find it is defined in ./Optim/setup_optim2D_plots.m, and not in the files your diagnostic cites. Please make sure you ran the startup_DCT_Model.m file. If you can tell me the steps you ran that generated this error, I can try them myself. --Steve

Hello. I have a lot of errors on the scripts. Can someone help me please? For example when I try to run "Shift Map Parameterization GUI" from DTC Model Demo Script I get the following erros: Undefined function or variable 'FU_SET'.

Error using +
Matrix dimensions must agree.

Error in Calc_Shift_Map_RO (line 16)
newpts(:,i) = newpts(:,1)+(i-1)*mingeardiff+rampconst*(i-1)*pedalpos;

Error in ShiftMapParamGUI>ShiftMapParamGUI_OpeningFcn (line 69)
[Upshift_Speeds Downshift_Speeds Pedal_Positions] = Calc_Shift_Map_RO(values{1},values{2});

Error in gui_mainfcn (line 220)
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ShiftMapParamGUI (line 44)
gui_mainfcn(gui_State, varargin{:});

Thank you!

LiAM

So good. THX

https://imgur.com/a/zoy65

That's the error when i'm trying to run the model simulation in addition to the error when trying to run the gear simulation that i mentioned above.

Steve Miller

Hi tupac1971ful - the drive cycle data is loaded into the workspace by the PreLoadFcn of the model Dual_Clutch_Trans.slx. If you run startup_DCT_Model, everything should work fine. The data itself is saved in subfolder Scripts_Data. --Steve

Hello, I'm trying to run the Gear selection animation on Matlab R17a but i get the following error, can you help me?

Invalid setting in 'Dual_Clutch_Trans/Speed Demand/ECE 15 Cycle (Europe)' for parameter 'VariableName'.
Caused by:
Error evaluating parameter 'VariableName' in 'Dual_Clutch_Trans/Speed Demand/ECE 15 Cycle (Europe)'
Undefined variable "UrbanCycle1" or class "UrbanCycle1.time".

kevin Tosh

kevin Tosh

Mr. Zhu

Great, works well.

league yan

very helpful

baby_23

amazing

xiang ge

It is perfect!

Shiwei Xu

This demo is so good!!!

Steve Miller

Hi Chris -- do you have a license for the MathWorks product Model-Based Calibration Toolbox? That product is required for the data-driven model we have used. If you ">>which xregmaskinitialization -all" and get "xregmaskinitialization not found" then you don't have it. You could probably get a trial license of it from your sales rep.

--Steve

Chris

This is a great model but whenever I change the Block choice of the Engine to 'Data Driven' I get the following error.

"Error in 'Dual_Clutch_Trans/Engine/Data Driven/MBC Engine Model From Dynamometer Data/MBC Brake Torque/xregtwostage/Local Model': Initialization commands cannot be evaluated.

Caused by:
Undefined function or variable 'xregmaskinitialization'."

Its a pity as I am building a diesel engine model and this would have been a great model to learn from.

olivier

Sorry, I've realized that we don't have xPCtarget ...

olivier

I've tried to run the simulation, but I get the following error:

Making simulation target "Dual_Clutch_Trans_sfun", ...

'Dual_Clutch_Trans_sfun.bat' is not recognized as an internal or external command,
operable program or batch file.

I'm running Matlab 64bits on Windows 7 with all the necessary toolboxes and compilers.

Venche

Shusen

Updates

2.6.0.0

Added R2019a version.

2.5.0.0

Added R2018b version.

2.4.0.0

Updated for R2018a

2.3.0.0

Added R2017b version

2.2.0.0

Added R2017a version and text for citing submission in other works. Made startup file compatible with Mac

2.1.0.0

Added R2016b version.

2.0.0.1

Updated license

2.0.0.0

Fixed broken hyperlink in submission description.

2.0.0.0

Fixed webinar link only.

2.0.0.0

Updated for R2016a. Added hyperlinks to model canvas to change subsystem variants.

1.10.0.0

Fixed webinar link.

1.9.0.0

Updated link to optimization tasks video in "Description". No change to submission files.

1.8.0.0

Updated MATLAB Release information to R2013a

1.6.0.0

Zip contains R2013a version, as well as R2012b and R2011b versions.

1.5.0.0

Corrected release (zip file contains R2011b version)

1.2.0.0

Added 3D animation. The gearbox VRML model is based on Bachelor Thesis of Mr. Jaroslav Prochazka, Department of Computer Graphics and Interaction, Czech Technical University in Prague, Czech Republic.

1.1.0.0

Added link to video.

MATLAB Release Compatibility
Created with R2019a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor

Dual_Clutch_Trans_R16b

Dual_Clutch_Trans_R16b/Fuel_Consumption

Dual_Clutch_Trans_R16b/Libraries/Animation

Dual_Clutch_Trans_R16b/Libraries/Engine

Dual_Clutch_Trans_R16b/Local_Solver

Dual_Clutch_Trans_R16b/Optim

Dual_Clutch_Trans_R16b/Param_Sweep

Dual_Clutch_Trans_R16b/Param_Sweep/Param_Sweep_Res

Dual_Clutch_Trans_R16b/Reports

Dual_Clutch_Trans_R16b/Scripts_Data

Dual_Clutch_Trans_R18b

Dual_Clutch_Trans_R18b/Fuel_Consumption

Dual_Clutch_Trans_R18b/Libraries/Animation

Dual_Clutch_Trans_R18b/Libraries/Engine

Dual_Clutch_Trans_R18b/Local_Solver

Dual_Clutch_Trans_R18b/Optim

Dual_Clutch_Trans_R18b/Param_Sweep

Dual_Clutch_Trans_R18b/Param_Sweep/Param_Sweep_Res

Dual_Clutch_Trans_R18b/Reports

Dual_Clutch_Trans_R18b/Scripts_Data

Dual_Clutch_Trans_R19a

Dual_Clutch_Trans_R19a/Fuel_Consumption

Dual_Clutch_Trans_R19a/Libraries/Animation

Dual_Clutch_Trans_R19a/Libraries/Engine

Dual_Clutch_Trans_R19a/Local_Solver

Dual_Clutch_Trans_R19a/Optim

Dual_Clutch_Trans_R19a/Param_Sweep

Dual_Clutch_Trans_R19a/Param_Sweep/Param_Sweep_Res

Dual_Clutch_Trans_R19a/Reports

Dual_Clutch_Trans_R19a/Scripts_Data

Dual_Clutch_Trans_R16b

Dual_Clutch_Trans_R16b/Libraries/Animation

Dual_Clutch_Trans_R16b/Libraries/Engine

Dual_Clutch_Trans_R16b/Libraries/Transmission

Dual_Clutch_Trans_R16b/Libraries/Vehicle

Dual_Clutch_Trans_R16b/Tune_Abstr_Model

Dual_Clutch_Trans_R18b

Dual_Clutch_Trans_R18b/Libraries/Animation

Dual_Clutch_Trans_R18b/Libraries/Engine

Dual_Clutch_Trans_R18b/Libraries/Transmission

Dual_Clutch_Trans_R18b/Libraries/Vehicle

Dual_Clutch_Trans_R18b/Tune_Abstr_Model

Dual_Clutch_Trans_R19a

Dual_Clutch_Trans_R19a/Libraries/Animation

Dual_Clutch_Trans_R19a/Libraries/Engine

Dual_Clutch_Trans_R19a/Libraries/Transmission

Dual_Clutch_Trans_R19a/Libraries/Vehicle

Dual_Clutch_Trans_R19a/Tune_Abstr_Model