View License

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Hybrid-Electric Vehicle Model in Simulink

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

4.66667
4.7 | 29 ratings Rate this file 296 Downloads (last 30 days) File Size: 12.9 MB File ID: #28441 Version: 2.0
image thumbnail

Hybrid-Electric Vehicle Model in Simulink

by

Steve Miller (view profile)

 

10 Aug 2010 (Updated )

Model of a hybrid-electric vehicle with system-level and detailed variants of electrical system.

| Watch this File

File Information
Description

This file contains a hybrid-electric vehicle model built using Simscape, Simscape Electronics, Simscape Driveline, and Simscape Power Systems that can be configured for system-level tests or power quality analyses. Model variants for the electrical, battery, and vehicle dynamics systems can be selected using variant subsystems. A battery model created with the Simscape language is incorporated into the model. Supervisory logic is implemented with Stateflow. This model can be configured for hardware-in-the-loop testing.
Please read the README.txt file to get started.

To see the different variants included in this model, please watch the webinar, “Hybrid Electric Vehicle Modeling and Simulation“
http://www.mathworks.com/videos/hybrid-electric-vehicle-modeling-and-simulation-81751.html

To find other Simscape examples, search for posts with the keyword "physical modeling"
http://www.mathworks.com/matlabcentral/fileexchange/?term=%22physical+modeling%22

To learn more about MathWorks Simscape Products, go to:
http://www.mathworks.com/physical-modeling/

Required Products Simscape Driveline
Simscape Electronics
Simscape Power Systems
Simscape
Simulink
Stateflow
MATLAB release MATLAB 9.0 (R2016a)
MATLAB Search Path
/
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (79)
14 Aug 2016 said belhadj

Hello Mr. Miller, here I have questions about the design of the hybrid electric vehicle of the model in Simulink for matlab 2015
in the "HEV_ParallelSeries_R14a" "Libraries" "Electrical" "HEV_Electrical_Lib" the block named "Detailed" "Synchrounous Motor and Drive" "vect controller" you used any type of vector control? that is to sliding mode? what type? the parameter "Teb" it represents what? and how to recover its value in the model?
cordially.
Said Belhadj.

Comment only
05 Aug 2016 Jianghui Xu  
01 Aug 2016 said belhadj

Mr. Miller greetings, here I simulated the startup file and then the HEV Model HEV_SeriesParallel model and displays the following error:

""Failed to find library 'elec_lib' referenced by 'HEV_SeriesParallel/Electrical/System Level/Battery/Generic/Generic Battery'. This library must be on your MATLAB path.""

I inform you that I work with the matlab version 7.6.0 (R2008a)
Thank you for your help.
cordially.
Said Belhadj.

Comment only
31 Jul 2016 said belhadj

Mr. Miller greetings and thank you for your labor hybrid vehicle model.
here I would like to apply control of my system trying to follow your model.
I start with the electrical part.
here is for the file named: HEV_SeriesParallel we find the block: Electrical System Level, so I would complete my block with the data on the basis of your block.
my question is in the file named: HEV_Electrical_Lib,
 we find the block named: System Level, I am interested in the block named: Synchronous Motor & Drive, which Mot_TReq entry that represents what?
and three outputs: Mot_Sh ??? and just before the exit speed sensor1 ???
the other two outputs is feeding via the chopper? no?

also when i click in this block Synchronous Motor & Drive and was named the block: elec_lib / Actuators & Drivers / Rotational Actuators / Servomotor, is what plays the role of an electric motor like the one I used ? a synchronous motor with permanent magnets.
I am waiting for your answer .
cordially.
Said Belhadj.

Comment only
13 Jul 2016 iqra rabia

hi steeve,, this is a great effort by u but when I run this model get this error ,can u please help me

Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
Use 'mex -setup' to select a supported C-compiler.
thanks

17 Jun 2016 Abhay Kela

Hello Steve;

Thank you for sharing the model. It is really amazing with all the possible detail required to start work with.

I am trying to get start with the simulink model, but it is showing me error, "Failed to load library 'elec_lib' referenced by 'HEV_SeriesParallel/Electrical/System Level/Synchronous Motor & Drive/Servomotor".

Please suggest

16 Jun 2016 Jose Ugarte

Hello Steve, basically what I would like to do is incorporate the steering system here, but I am not sure I hope not to bother you but could I ask your recommendation on how might it be incorportated? Thanks again great day

Comment only
16 Jun 2016 Jose Ugarte

Greetings Steve,

First of all I would like to congratulate you on your effort it is really an amazing job. I have a strong interest in trying to simulate an autonomous path, I was wondering if you could give me advise to which variables would be the best to work with in the model.

04 Jun 2016 mohammad malekpour

m

Comment only
24 Apr 2016 Kartik Khanna

does the vehicle dynamics account for the rollimg frictional force acting on the wheels

Comment only
20 Apr 2016 mclau152

Hello Steve,

I would like to change most of this program to fit only a series hybrid configuration. As of now I believe disabling the power split device and enabling the electric motor at all times to charge the generator will achieve this effect to some extent. I am curious what other parameters perhaps in control systems I may need to change to achieve a fully series hybrid configuration?

Thank you

Comment only
05 Apr 2016 Steve Miller

Steve Miller (view profile)

@mclau152 - also note that there is a Simulink preference setting you can disable that will let you open the R2016a model in R2015b. I haven't tried this R16a->R15b, but in my experience with other releases you'll get a lot of warnings and then the model will just run.

@nadia -- what do you mean by a linear engine speed model?

Comment only
05 Apr 2016 nadia belhouchette

@Steve Miller-Hi, I am a Phd student, I thank you for the development of this model is realized well. I need the linear engine speed model, can you give it to me please?, I will be very grateful, thanks.

Comment only
04 Apr 2016 nadia belhouchette

@Steve Miller-Hi, I am a student at the university, I thank you for the development of this model is realized well. I need the linear engine model, can you give it to me please?, I will be very grateful, thanks.

Comment only
04 Apr 2016 Steve Miller

Steve Miller (view profile)

@mclau152 - the zip file you downloaded also has versions prior to R2015b. Try using one of those (for example, the folder HEV_ParallelSeries_R14a).

@chandresh - I don't have an HEV two wheeler yet. Would like to find the time to build one, though. :)

Comment only
04 Apr 2016 chandresh trivedi

Hello,is there any model for HEV two wheeler?

Comment only
04 Apr 2016 mclau152

Hello, I am currently using Matlab r2015b with all necessary addons. I cannot run the latest update r2016 as I get the following incompatibility error:

Error using startup_HEV_Model (line 27)
Model 'HEV_SeriesParallel' was created with a newer version (R2016a) of Simulink
To disable this error message, use Simulink preferences.
To create a model that is compatible with this version of Simulink, load the model in
Simulink R2016a and select File > Export Model to > Previous Version.

Is there someone with r2016a who can do a file export to r2015b so I can use the latest update? Or is this method incompatible with the latest version.

Thank you.

29 Mar 2016 Steve Miller

Steve Miller (view profile)

@Andy Ang - the Servomotor is a block in Simscape Electronics. You need to have that product installed to run the example.

@Moustafa -- you can connect different transmissions to the components in this model. The control system will also need to be modified if you change the transmission.

Comment only
29 Mar 2016 Andy Ang

Dear Steve,

Thanks for making this model. But when running the model on the system level I get the following error:

Failed to load library 'elec_lib' referenced by 'HEV_SeriesParallel/Electrical/System Level/Synchronous Generator & Drive/Servomotor'

I have looked into the electric library, but could not find the Servomotor.

Comment only
21 Mar 2016 Meera V

Thanks steve..the model is a real eye opener for me.

18 Mar 2016 Moustafa Abouelkheir

Thanks, Steve, for all this great work. Can I ask you if it's possible to connect a dual clutch transmission to this model and if I can connect an automatic transmission to it in another case?

16 Mar 2016 Steve Miller

Steve Miller (view profile)

Meera V - enter subfolder HEV_ParallelSeries_R14a, run startup_HEV_Model, and press run button. I just tested this and it worked fine. Your warning indicates you did not run the startup_HEV_Model file.

Comment only
16 Mar 2016 Meera V

Failed to load library 'HEV_Electrical_Lib' referenced by ''. What should i do to make the model run? I have MATLAB VERSION 2015a.

Comment only
13 Mar 2016 Faizrizwan Sabri

Thanks for this, Steve. I have been keeping my eyes on this model and would like to use it in my research. May somebody please provide me with any reference using this particular model so I can put this in my reference?

and is it possible to modify the model into TtR HEV?

24 Jan 2016 Kartik Khanna

i get this error while running the model

Making simulation target "HEV_SeriesParallel_sfun", ...


C:\Users\Kartik\Documents\MATLAB\HEV_ParallelSeries\slprj\_sfprj\HEV_SeriesParallel\_self\sfun\src>"C:\Program Files\MATLAB\R2014a\sys\lcc64\lcc64\bin\lccmake.exe" -f HEV_SeriesParallel_sfun.lmk
"C:\Program Files\MATLAB\R2014a\sys\lcc64\lcc64\bin\lcc64.exe" -dll -noregistrylookup -c -Zp8 -DLCC_WIN64 -DMATLAB_MEX_FILE -DMX_COMPAT_32 -nodeclspec -I"C:\Program Files\MATLAB\R2014a\sys\lcc64\lcc64\include64" -I"C:\Program Files\MATLAB\R2014a\extern\include" -I"C:\Program Files\MATLAB\R2014a\simulink\include" -I"C:\Program Files\MATLAB\R2014a\stateflow\c\mex\include" -I"C:\Program Files\MATLAB\R2014a\rtw\c\src" -I"C:\Users\Kartik\Documents\MATLAB\HEV_ParallelSeries\slprj\_sfprj\HEV_SeriesParallel\_self\sfun\src" "HEV_SeriesParallel_sfun.c"
C:\Program Files\MATLAB\R2014a\sys\lcc64\lcc64\bin\lccmake.exe: Error code -1073741819

It also says that icc64.exe has stopped working when i start simulation of this model. Earlier it used to run fine on my computer. But now , the model is giving this error. Can you please help?

Comment only
02 Nov 2015 Reynaldo Hartanto

Hi, thank you for providing this great HEV model.

Does it possible to improve the controller with PID+Fuzzy logic controller for better performance and efficiency?

Thank you very much

Comment only
04 Oct 2015 omar mouline

Hi
I am using a 2015b and it doesn t have simdriveline.
i keep getting this: error Failed to load library 'driveline' referenced by 'power_HEV_powertrain/Electrical Subsystem/SIm//SDL'. how to fix that error?

Comment only
15 Sep 2015 Deepak Pawade

Hi steve,
got the following errors (bunch of errors) while running the simulink model..

Warning: Loading model 'HEV_SeriesParallel' generated with a newer version (R2014a)
of Simulink
In general\private\openmdl at 13
In general\private\openslx at 9
In open at 159
In uiopen at 196
Warning: HEV_SeriesParallel (blockdiagram.xml, line 27): Error evaluating
'PreLoadFcn' callback of block_diagram 'HEV_SeriesParallel'.
In general\private\openmdl at 13
In general\private\openslx at 9
In open at 159
In uiopen at 196

etc etc.. please help me with these errors. thanks in advance

Comment only
15 Sep 2015 Deepak Pawade

Hi steve,
got the following errors (bunch of errors) while running the simulink model..

Warning: Loading model 'HEV_SeriesParallel' generated with a newer version (R2014a)
of Simulink
In general\private\openmdl at 13
In general\private\openslx at 9
In open at 159
In uiopen at 196
Warning: HEV_SeriesParallel (blockdiagram.xml, line 27): Error evaluating
'PreLoadFcn' callback of block_diagram 'HEV_SeriesParallel'.
In general\private\openmdl at 13
In general\private\openslx at 9
In open at 159
In uiopen at 196

etc etc.. please help me with these errors. thanks in advance

Comment only
15 Aug 2015 Shiwei Xu

Perfect!!!

14 Jul 2015 Mohamed Awadallah  
07 Jul 2015 Harith Mohanan  
03 Jun 2015 Jalashwa

Can you give me a file for MATLAB 2011 ?

Comment only
25 Apr 2015 John Knight  
12 Jan 2015 Nitish sharma

using i m using R2014a
following error
Unable to load block diagram 'HEV_Electrical_Lib'
help me out reply soon

Comment only
06 Jan 2015 Nitish sharma

it fails to load library plz help me out with this problem.

04 Jan 2015 Chung

Chung (view profile)

Hi, thank you for providing this excellent model. I'm a student in university. I want to design a controller for the power split ratio(as you did by the state flow), but in my way I need to know the transfer function of the system especially the engine, so I wonder how can I get these transfer function.
Thank you very much

Comment only
19 Dec 2014 nadia belhouchette

Hi, I am a student at the university, I thank you for the development of this model is realized well. I need the transfer function for this engine model, can there anybody give me the transfer function?, I will be very grateful. thanks

Comment only
18 Aug 2014 Hemanth kumar Varada Reddy

Hi,
Can you please tell me how to use Model Predictive control for this model.
This model uses PID controller, I want to use MPC instead. Please guide me how to do it.
Thanks

Comment only
19 May 2014 Ramoz

Ramoz (view profile)

 
16 Apr 2014 Qifei Hang

Why there is no R13b version? Can you post one?

Comment only
10 Apr 2014 Qifei Hang

Thank you!

08 Apr 2014 Qifei Hang  
21 Feb 2014 Julian

Julian (view profile)

Hi Steve!

I have a Problem with the Model, i tried to use a port of it and now it says:

Initial conditions solve failed to converge.
...Equations of one or more components may be dependent or inconsistent. This can cause problems in transient initialization. Here is the set of components involved:
'SystemSimulation/Subsystem1/Ideal Rotational Motion Sensor'
Equation location is:
'C:/Program Files/MATLAB/R2013b/toolbox/physmod/simscape/library/m/+foundation/+mechanical/+sensors/angular_velocity.ssc' (line 45)

'SystemSimulation/Subsystem1/Ideal Torque Source'
Equation location is:
'C:/Program Files/MATLAB/R2013b/toolbox/physmod/simscape/library/m/+foundation/+mechanical/+sources/torque.ssc' (line 35)

Any hints?

Thanks!

27 Jan 2014 shailesh

Hi Steve ,
Great Job !
When I run startup_HEV_Model.m it is showing an error
"
Undefined function or variable 'HEV_Model_PARAM'.

Error in startup_HEV_Model (line 14)
HEV_Model_PARAM

"

Pls help me ASAP.

Comment only
22 Jan 2014 girish s

How to connect BLDC motor controller(AC7) to tires(magic formula) in simulink,It seems parameters are not matching.please help.....

15 Jan 2014 Roopesh Mishra

Nice Steve Sir, I want to connect PHEV car with PV array for charging purpose...Can u help me in this regarding..and which version is suitable for that

13 Jan 2014 Yu Junquan  
28 Dec 2013 abdussalam omar

electric vehicles

Comment only
28 Dec 2013 abdussalam omar

i could not get the file

Comment only
11 Dec 2013 Ahmet Unsal

I would like to modify this model for public transportation which means that I need to change the vehicle dynamics. When I do that (meaning that I increase the vehicle mass and change CG) the programs crashes. Do you have a possible solution for this problem? Best regards...

Comment only
11 Dec 2013 Ahmet Unsal

I would like create model for public transportation which means that I need to change the vehicle dynamics. When I do that (meaning that I increase the vehicle mass and CG) the programs crashes. Do you have a possible solution for this problem? Best regards...

Comment only
28 Aug 2013 nypradjna

I can't open the file :(

Comment only
28 Feb 2013 Zhila

Zhila (view profile)

Dear Steve, Thank you very much for the great model.
I wonder if the files and codes for connecting the model to the optimization algorithm would also be available?
I have a model of PHEV power-train which I want to integrate with an optimization algorithm, and I would like to examine what requirements I should care about in making such connections.
I will be grateful if such part is available and possible to be exchanged.

Thanks again.

13 Feb 2013 Hakeem Akorede Shittu

Hello Steve,
I have been able to run this simulation but I have little experience with MATLAB, therefore I did not understand some of the information. What I will like to do though is connect a Solar Panel Model to this Model and see what the level in the state of charge (SOC) of the battery will be after couple of hours. Thanks in advance

Comment only
13 Feb 2013 Steve Miller

Steve Miller (view profile)

@MD Rashidul -- did you run the startup_HEV_Model.m? It is looking for a library file that needs to be on your path.

Comment only
22 Jan 2013 MD Rashidul

Hi,

while running 'HEV_ParallelSeries_10b / HEV_SeriesParallel', I got the following error. Would you please suggest something?

Thanks.

Error:

Failed to load library 'HEV_Electrical_Lib' referenced by 'HEV_SeriesParallel/Electrical'

Caused by:
Unable to load block diagram 'HEV_Electrical_Lib'

Comment only
15 Dec 2012 Loukia

Loukia (view profile)

 
01 Jul 2012 lll

lll (view profile)

I think the value of Motor_en in cruise mode(in the control stateflow, on the innermost level)should be '0', right?

Comment only
27 May 2012 indra setiawan

Dear Steve, i'm using R2011b.
And i found many errors. How i can open the model?
Thanks

Comment only
05 May 2012 Deepak AGARWAL  
02 May 2012 sajad anbaran

would you please tell me that how i can obtain C code, if i succeed to run simulation.
regards.

30 Apr 2012 sajad anbaran

Hello Steve,
i'm trying to run your system in parallel mode with different stateflow method.since i can't make change in electric subsystem, i put zero for generator required torque. by doing so i disabled Gen.however, when i want to run the simulation, vehicle is always in electric alone mode and doesn't switch to other modes.in other word, motor is the only working power source and engine speed becomes negative. but when i return Gen to the system, everything works nice. another issue is that do i need to change sun ring arrangement of the planetary gear to be operated in parallel HEV. please help me in these issues.

28 Mar 2012 KARTHIKEYAN

steve i am using R2009b.can i run this file in that??? i'm facing lots of error in that.. please make me clear.

Comment only
09 Jan 2012 Steve Miller

Steve Miller (view profile)

Thanks for your comments, Abhishek.

The Vehicle Dynamics Full subsystem has aerodynamic drag included in it. The "Vehicle Body" block includes aerodynamic drag. The parameters for Drag Coefficient and Frontal Area are included in that calculation. See the documentation for that block: http://www.mathworks.com/help/toolbox/physmod/sdl/ref/vehiclebody.html. --Steve

Comment only
06 Jan 2012 Abhishek Rai

Hi Steve,
First of all I should congratulate you for your wonderful work.
While I was browsing through the "vehicle dnamics full" subsystem I found that you have not included the aerodynamic drag that you included in "Vehicle Dynamic Simple" subsystem.
I am curious to know tha answer.
Anticipating a soon reply.

28 Dec 2011 Andres RM

Hello Steve, I must conglaturate you because of the model. I'd like to ask you, where did you find documentation to create vectorial controller?

Thanks.

Comment only
09 Dec 2011 Max

Max (view profile)

Good time. Can you send me the model code in C language?

02 Nov 2011 Wencong  
13 Aug 2011 lee

lee (view profile)

Dear Steve,when I use this model to simulate a HEV system in matlab 2010b,it suggests that :Unable to load block diagram 'sdl_lib'.Can you tell me the reasons please?

Comment only
13 Aug 2011 lee

lee (view profile)

Dear Steve,when I use this model to simulate a pure EV system in matlab 2010b,it suggests that :Unable to load block diagram 'sdl_lib'.Can you tell me the reasons please?

Comment only
29 Jul 2011 Steve Miller

Steve Miller (view profile)

Basil -- try the R2010b version that is included in the submission. It may work with R2010a with some warnings.

BearCat -- you can delete the gauges blocks. Road height can be added, but the model currently assumes flat roads.

Lucas -- I haven't parameterized the other battery types. I suggest pulling the battery model directly from the Simulink browser and entering the values there.

Comment only
29 Jun 2011 Basil Aljorani

can i run this model with 2010a.

Comment only
04 Feb 2011 Lucas Fuentes

Hi,
I am also interested in what BearCat asks. I need to be able to compare EVs to HEVs to conventional cars (internal combustion only).
Any tips on how to configure these types of vehicle?
Also, when I change the battery type from Ni-Hydride to anything but Li-Ion the simulation fails. I would be interested in comparing the different battery chemistries.
Thanks

Comment only
14 Nov 2010 BearCat

It cannot find gaugeslibv2.mdl when I start the simulation!

Does the simulation by any chance also consider fuel consumption depending on road topography?

These might be noob questions. But I hope you will answer anyway :-)

Comment only
06 Sep 2010 curryxt ??

Dear Steve, if I want to use this model to simulate a pure EV system, how should I configure the model? I will highly apprecialte your help.

Comment only
24 Aug 2010 curryxt ??

Thanks a lot. The above trouble has been removed. While, if I want to use this model to simulate a pure EV system, how should I configure the model?

21 Aug 2010 Steve Miller

Steve Miller (view profile)

curryxt -- are you running release 2010a? Do you have all required products? The missing files you mention are part of the Simscape and SimElectronics installation.

Comment only
20 Aug 2010 curryxt ??

Sorry, when running, three models -elec_lib.mdl, fl_lib.mdl and 'nesl_utility.mdl cannot be founded ,also some blocks cannot get right parameter values.

Comment only
Updates
13 Dec 2010 1.1

Fix typo in description.

15 Mar 2011 1.2

Update to fix simulation issue in R2010b.
Update for R2011a coming soon...

22 Mar 2011 1.3

Updated release (R2010b) and required products (Simulink)

15 Apr 2011 1.5

Updated for R2011a.
1. Uses new Simscape-based SimDriveline library (includes gear loss models).
2. Added calculation of fuel economy using Curve Fitting Toolbox.
Zip file includes both R2010b and R2011a versions.

21 Apr 2011 1.6

Updated for R2011a release. Uses new Simscape-based SimDriveline library, and includes fuel economy calculation via imported data fitted to a surface using Curve Fitting Toolbox. R2010b version using original SimDriveline library still included.

29 Jul 2011 1.7

Updated HEV_Model_PCT.mdl, removing link to old content.

18 Mar 2013 1.9

Zip now contains R2013a version. Also includes versions for R2011b, R2011a, and R2010b.

09 Apr 2014 1.12

Minor update to R2014a image.

17 Apr 2014 1.13

Fixed link to webinar.

07 Mar 2016 2.0

Added R2016a version that shows Simscape runtime parameters

Contact us