hi everybody you're watching the MATLAB
Simulink racing lounge part 2 of our
nice series about vehicle modeling and
I'm super glad that ad is still on board
hi ed how are you doing hi Christophe
good and you are very good I'm looking
forward to the second part of our series
and let's move to the agenda right away
what did we cover last video number one
what are we going to cover in that video
I'm just handing it over to you
excellent so as you mentioned we covered
before an equation based approach with
Simulink in the first episode today in
this episode what we're gonna cover is
modeling vehicle systems with the
powertrain blocks and it is a
data-driven approach as opposed to
equation based later on coming soon
we're gonna talk about sim scape and
also Sims cake multi-body again no
worries we will show you a lot of models
we will put everything on file exchange
so no need to rebuild models we will
share it with you and a second comment I
have at that point powertrain block said
is an add-on to Simulink and EDD will
touch that so it's not a completely new
tool it's just an extension of Simulink
I think it is going to show you what
powertrain box it is and what it can do
for you absolutely and as you said all
the models will be provided so sit back
relax and what I want to show here is
one of the models that I put together
with the powertrain block 7 this is what
we would end up with on the end of this
session so this is a conventional
vehicle model that models a vehicle with
a combustion engine and one of the
things that I want to start by showing
is some of the information that you can
get from these models so you can
actually visualize the maps for engine
speed and the actual torque output of
the engine and you can change these
parameters and maps to fit your custom
application and you can also get a lot
of information based on whatever data
you have even for fuel mass flow and
also the torque and speed of an engine
it sounds super interesting so bear with
us for 20 to 25 minutes and we will walk
you through the process of setting up a
model in powertrain blocks that we're
gonna do some software demos with the
powertrain block set and then we'll
summarize our key points as well so as
Christopher mentioned the powertrain
blocks it is an add-on to simulant
capabilities it is built on top of
simulate and the advantage of it is that
you can combine both of these plot
forms to for your modeling efforts so
Christophe if you look at this plot here
on the screen you can see that the
powertrain blocks it is great when you
have a lot of data so it can be used for
data-driven modeling and also for
analysis because it can provide
relatively high fidelity results
Simulink on the other hand it's more of
an equation based approach and I would
recommend it more to be used in design
stages you know when you're beginning
but know that simulating can also be
used for analysis if you have a very
high fidelity model that you've built
through the months and years and
simulation you can get pretty good
results for analysis from that so the
advantage of these two is again that you
can combine them right what I will take
from that slide is Simulink is to start
in early stages of the design and if I
have the equations I can set up the
Simulink model for powertrain blocks
that I need a bit more data and it's for
analyzing systems that I already have
and but I'm not worried at all because
powertrain block set is on top of
Simulink so even if a component would be
missing in powertrain block set one
could set it up in Simulink and can use
these tools in conjunction that that's
exactly excellent
yep so some of the advantages of the
powertrain blocks are it was built on
top of simulate it provides the ability
to customize your blocks with test data
that users may have and you can also
represent the operation of a single
component with a single block so before
in Simulink we were using a subsystem of
many blocks now you can just use a
single block and again it is also
supported the powertrain block set for
automatic code generation nice now if
the users are looking for
well-documented open and reconfigurable
models the powertrain blocks that is a
great choice also the users have access
to a lot of test data powertrain blocks
that is a great choice and finally the
powertrain blocks that can also decrease
the number of blocks in the model while
maintaining certain degree of fidelity I
think a very good example here is an
internal combustion engine if you want
to model the entire and thermodynamics
mechanical properties all the processes
happening there you would need a dozens
of simulant blocks I would say in the
powertrain block said use an engine
block parametrize
with the data available and you're good
to go correct all right so another
important aspect about the powertrain
block said that we have to keep in mind
is that it offers a variety of component
options and what I mean by that is for
example for to represent an engine
operation you can start with the most
basic type of blocks and these are
called mapped blocks so you can see you
know they usually use look-up tables or
maps but you can also model the details
and dynamics of an engine whether it's
compression ignited or spark ignited so
for this demo we're gonna stick to the
map version of the blocks and but you
can configure a lot of different aspects
for the operation of the engine like the
power the air mass flow rate the fuel
flow rate the temperature the efficiency
and even the emission aspects of the
engine also for transmissions we have a
variety of options you can have
continuously variable transmissions dual
clutch transmissions or in this case in
our models what we're gonna use is just
a discreet manual transmission again in
this models I created the shift logic
for my transmission using state flow so
that's a toolbox that is can add on to
Simulink and another piece of
information that people may need access
to is shift maps for the transmission so
determining at what speed an accelerator
pedal position the transmission would
shift gears so with that those are the
main components that I'm gonna touch in
my demo but again I have a lot of other
components like the vehicle dynamics
tires and also a drive line that I would
like to cover in the demos here so we
can start very simple with the glider
and we saw the glider in the first
episode of this series and here what
we're doing is we're adding another
degree of complexity we can add wheels
and brakes to our vehicle dynamics so
I'm gonna start here with the vehicle
dynamics system okay so from the
previous episode we saw that the vehicle
dynamics were the glider was represented
by doing a summation of forces many
different blocks in this case all of
that is summarized here in the vehicle
body block and iTouch from the aspect
that these blocks are open-ended and
also reconfigurable and what i mean by
that is you can actually
explore these blocks so for example if
you look under the mask you can actually
customize some of the aspects of this
block if you really want to get to that
level right but I do benefit from the
block you trust the meth works
engineers and developers that this was
implemented correctly and you just use
it so you have the freedom to choose
exactly so a lot of freedom when it
comes to this and again what I'm doing
here is just using some of the
parameters that I have I customize these
blocks and then I just plug them in my
model so nice a lot of simplification
here just one block to represent the
vehicle dynamics here what I'm doing is
representing the tires of the vehicles
so the front tires and the rear tires
this only models longitudinal dynamics
so well which is fair you need to start
at a certain point and as we see it here
the tire model is referencing to the
magic formula approach correct yep so it
can be parameterized using different
tire models in that case which was a
pretty simple approach but shake our
magic formula the good thing is we have
developed the tool for you and to obtain
the magic formula coefficients from tire
test data so we reference to the TTC
from Caliban this is another piece of
software that we are going to share with
you in another video and also on file
exchange so this will allow you to
obtain the coefficients B C D and D from
your tyre test data and I think bit by
bit we are really equipping you with all
the all the things you need to set up a
vehicle model all right so we covered
the wheels the vehicle dynamics and
again here in this subsystem we're just
gonna see a driver where we have a PID
taking the error between the reference
speed the vehicle speed and it outputs
the braking and actual tour commands
that we would desire nice again if we
run this model this is a drive cycle
that in reality is about 600 seconds but
this model can actually run probably
probably less so relatively quick and
you can also evaluate the results by
comparing the reference speed to the
speed that you're getting out of the
model and here I can say that my model
is actually meeting the drive cycle in
an attic
and another thing to remind the teams or
the users is that they can customize
these models to work with an input that
fits their needs whether it's a lap time
or drive cycle exactly all right so if
we move to our next model I want to show
a battery electric vehicle so how can
you model up an electric powertrain with
the powertrain blocks it and I want to
start here with the motor so the driver
is actually providing an accelerator
pedal position to the motor and you see
that this is much cleaner a lot less
blocks than what we had in the past with
Simulink and what i'm doing here is
first pre determining the torque
envelope for operation of the motor and
i scale that by the driver demand given
by the accelerator pedal position and
that comes in as my torque command so
this battery voltage is something that
comes from the battery model from the
battery block and this motor speed is
something that I'm calculating by the
linear relationship between vehicle
speed and the motor speed so I have all
these inputs and this block actually
gives me the battery load that actually
goes to the battery system and also the
torque output from that motor at a quick
question about the battery and in that
model are you using the battery modeling
approach that we introduced in the first
video of the series or as the power
drain block set and providing you a
block for batteries here that's a great
question I'm using the blog that is
provided by the powertrain blocks it so
I'm gonna getting the details of that
block in just a few seconds so here you
know you have the ability to
parameterize this motor to work with
whatever speeds and torques you may have
and my recommendation would be to start
again with some defaults that can meet
the requirements of the user and then
parameterize that based on test data
that you may have available later on
great so if we go to the battery system
here this is the block that is provided
by is a toolbox so again the load
current that comes from from the motor
subsystem an ambient temperature input
and we get the output voltage for the
battery right okay so here you can
definitely characterize the efficiency
and also the
of cells or the chemistry of the battery
in this case I decided to change the
number of cells in series and cells in
parallel to meet my drive cycle in this
model mm-hmm excellent
and again the rear differential it's
before we had some formulas modeling the
drive line now we just have an open
differential block so it simplifies
things and all I worried about here was
just putting the gear ratio in the final
drive
that's the only thing changed and then
that torque that comes from the motor to
the real differential passes through an
axle compliance in this block what it
does is it models a spring damper system
pretty much like a shaft would be or an
axle and then it goes to the wheels and
vehicle dynamic sub systems that we had
before so these didn't change from the
previous model so that's one of the
advantages of these models you can build
up the complexity you can start with
your very first models and add different
components to those perfect that's great
have we run that model already or do do
we want to give it a go and then let's
run it so again the drive cycle about
600 seconds but this model runs
relatively quick I think it runs in less
than 5 seconds nice so there it is and
we can visually inspect the high-level
results so am i meeting my drive cycle
or not in this case we are and these
models also can provide a lot more
detailed information for each one of the
components the battery the motor and
also the gear but I was just about to
comment that and so we we let that model
run and we show one default plot and but
you could attach a scope to pretty much
any signal in that model you could
monitor currents you could monitor
forces and compliance on your XO system
and information about battery so you you
you have an insight to everything it's
based on symbol link and you can save
signals to your workspace to MATLAB so
this these models are super accessible
and super easy to work with all right so
now the last model that I have that I
want to show is a conventional vehicle
so how can we model combustion engine
and again the driver subsystem
you know my driveline didn't actually
change I still have a rear differential
with an axle and the wheels and the
vehicle dynamics so what actually
changed was the powertrain right the
different components producing the
propulsion of the vehicle so here in
this case I have an accelerator pedal
position coming from the driver
subsystem to the engine and what I have
here is just a major block the mapped
spark ignited an engine so here what I
do is convert from accelerator pedal
position to a torque command based on
the characteristics of the engine and if
I open this block I can customize a lot
of different things so my recommendation
for the teams or the users would be to
start working with the defaults
characterize that and then parameterize
your components based on test data
the unit may get later on yeah I know
that a lot of teams have access to a
dyno so this is exactly and we obtain
all the input data to parameterize your
your engineer and as such as ed said
start with the defaults and add data as
you go all right so if we move on to the
last different component that is a
transmission here what we have is some
ideal fixed-gear transmission so I I
took care of the shifting logic with
state flow that's a different toolbox
yeah and then I don't have a clutch
model in this vehicle system so what I
did was I implemented some logic to
model that clutch operation so whenever
the brake is pressed and there's no
torque input then the transmission and
the engine decouple cool so I provide
those inputs to this transmission block
and I can get a lot of information from
the transmission block also the engine
speed which is used for feedback and
then the speed output which I can get
the torque output from and that is a
torque that starts going down the drive
line to the differential into the wheels
cool so the only component you haven't
modeled as an actual components the
clutch so what you've done is a logical
clutch which which is a very smart
simplification here and this is also the
freedom that similan gives you well set
the modeling depth on your own and if
you can model simple model simple
absolutely simplicity is always good
start and you know with this block you
have a lot of different things you can
parameterize for example the number of
gears and each one of the gear ratios
and even the efficiencies right and this
is absolutely opposed to fill those gaps
yeah right and this is about reading the
data sheet of your transmissions of the
transmission you have in mind
absolutely so again if we run this model
you should take this one takes a little
longer but it's still much less than 10
seconds nice ad well these demos have
been quite impressive great complexity
and with a decent amount of blocks can
we try to summarize the key takeaways of
today's episode a bit absolutely let's
do that
so the partnering components of as we
mentioned are built on simulating so
that gives a lot of flexibility and
these models are highly open and very
configurable there's a lot of
documentation available for how these
works and how you can make appropriate
modifications to these if necessary also
it's worth remembering that the
powertrain blocks of components are data
driven so your responsibility here is to
parameterize those components to
whatever test data you have available
and sometimes I think a recommender
workflow is starting with the default
that is already provided with the
components if you don't have access to
some of that data and there's many
options available as we mentioned for
example for engine options for
transmissions and even differentials as
well and vehicle bodies and all that so
a lot of flexibility offered with this
tool and the last thing I want to
highlight is that the powertrain is
supported also for cogeneration
if you need to do Hardware testing for
Harwood deployment later on I think that
that's a very good summary of today's
episode and there will be more videos so
next video will be about sim scape the
keyboard there is physical modeling so
actually modeling physical components
and if you feel that's interesting for
you stay tuned and can you can you try
to summarize next episode in one phrase
what are we going to do we're gonna do
sim scape physical modeling and it can
be very intuitive and a lot of fun so
stay tuned intuitive perfect well thanks
very much thank you first as a pleasure
to record with you and towards the end
of the episode you're used to that we
are super interested in your feedback if
you would send us emails or if you would
contact us on social media for example
Facebook that would be great
because that's the foundation of our
support the more you let the more you
share your questions the more you share
your problems the better our support can
be so please make use of that tool and
another link for the sake of
completeness find out racing launch
episodes under met works.com slash
racing lounge and in that ecosystem you
will also find a link to the software
offer and if you do use our software and
it would be would be glad if you use the
network's logo on your car or on your
reports
thanks for watching see you next time