Week 7 Challenge(A Simulink model to calculate the velocity of vehicle with respect to traction force from powertrain input)
CHALLENGE 7
Objective:
To create a simulink model of simple vehicle dynamics by using force equations acting on vehicle with respect to the traction force taken as input and output to see its changes in velocity of vehicle.
Inputs as traction force- From a signal builder block loaded with the traction force values created in excel file.
Output as Velocity of vehicle- To get by integrating the acceleration, which can be find from the actual traction force by dividing actual traction force by vehicle mass.
Forces acting on a vehicle:

To make a vehicle to move from rest positions a resultant force is needed. This resultant force is also known as traction force.
This traction force is provided by power train of a vehicle.But while vehicle starts moving it gets opposed by some resistance forces.
These resistance forces are as shown in above image and mentioned below as,
- Rolling resistance force(Fr).
- Aero dynamic force(Faero).
- Hill climbing force(Fhc) according to road gradeability.
Thus to overcome these resistance force an additional traction force should be provided.The resultant traction force can be given as,
Force(Resultant)=Traction force -(Addition of above mentioned resistance forces).
Model:

The values assigned for model from variables are loaded from a .mat file as seen in base workspace,

The assigned values are,
- Vehicle Mass: Mass =1200Kg.
- Acceleration due to gravity: g=9.8 m/s2.
- Vehicle frontal area: FA=2 m2.
- Aero drag coefficient: ADcoef=0.2
- Air density: Airden=1.225 Kg/m3.
- Rolling resistance Coefficient: RR=0.015.
Construction of resistance forces subsystems :
Rolling resistance force-
To find the rolling resistant force we have multiply vehicle mass(Kg),acceleration due to gravity(m/S2),rolling resistance coefficient and cosine of angle of grradeability(in radian).
This can be given as a relation,
Frr=Mass*g*RR*cos(Alpha)
The Mass, g, RR values are assigned in base workspace.
The gradeability angle is given by using a signal builder for 598 secs as shown below.

The gradeability angle in degree is converted to rad by a trigonometric function block atan.
This converted rad value is given to cosine block and multiplied with other parameters as shown in figure.
Gradeability angle in signal builder-
From 10 secs to 200 secs the gradeability angle is given as 10 deg and from 205 secs to 598 secs, given as 15 degree as shown below.

A switch is used to to give rolling resistance force value as zero when vehicle reaches to zero velocity( Vehicle at rest) conditions.
Untill the rolling resistance force value becomes zero the switch output as from input 1 port(Same RR force values).
If RR force value gets 0 at vehicle rest conditions, the switch output as 0 from second input port.
Aero drag resistance force:
To find the aero drag resistance force we have to multiply vehicle frontal area(m2),Air drag coefficient,air density(Kg/m3) and square of vehicle velocity(m/s).
This can be given as a relation,
Faero=0.5*FA*ADcoef*Airden*(Vehicle velocity ^2)
The FA,ADcoef,Airden values are assigned from base workspace.
The velocity of vehicle is get from a From block(output of model) and squared by square block.
All these parameters are get multiplied by a product block and again multiplied by a gain of 0.5 as per above relation.
This output is aero drag resistance force.

Hill climbing resistance force:
Hill climbing resistance force can be obtained by multiplying Mass of vehicle(Kg),Acceleration due to gravity(m/s^2),Rolling resistance coefficient and sine of angle of gradeability(in rad).
This can be given in relation as,
Fhc=Mass*g*RR*sin(Alpha)
The Mass,g,RR values are assigned from base workspace.
Sin of gradeability angle is obtained by a From block as angle is already converted to rad in Rolling resistance force calculation.
All parameters are get multiplied in a product block and get hill climbing resistance force as shown below,

Construction and Working of model:
Step 1:
Initially the traction force is given from a signal builder block.
The traction force data is imported from a excel file and feeded into signal builder block as shown below,

Click import from file option from File menu.

The above mention dialog box opens,from which click Browse button and select the excel file for traction force data.
After loaded,click Select All for data to import.Select Append selected signals to all groups.
Then click apply and click ok.
We get the loaded traction force signal as,

This signal is given as traction force input to the model.
Step 2:
All the resistance forces from subsystens are added by a sum block and given to a Goto block as Total_force. This added force is the total resistance force.

Step 3:
This Total resistance force is subtracted from Traction force input from signal builder to get the resultant traction force.
Step 4:
- The resultant force is divided by mass to get the acceleration values.
- This acceleration values are integrated by using integrator block to get the vehicle velocity output.
- The output from integrator block given to a saturation block to consider the velocity values from 0 to infinity as vehicle velocity output.

- The integrator block is get reseted when the vehicle velocity reaches 0. This is done because as we are using integrator block it produces a integral windup.
- Integral windup means when the actual velocity tends to make match with desired velocity,some times a shoot up of corrected signal occurs which again makes next shootdown signal to attain its steady state desired velocity.
- To avoid this situation when the vehicle velocity gets to zero,the integrator block should get reseted.
- This makes the integrator to start the action again from initial state after the vehicle move from its rest condition.
- This action will avoid the windup situations.
- This can be acheived in model by verifying acceleration and velocity signals as reaching to Zero velocity.
- When the acceleration signal crosses 0 means the output from memory block is 0,as memory block output is precious input.Its makes a step delay.
- As same for velocity signal crosses 0 means the output from memory block becomes 0.
- Both values are summed up and given to a switch condition.
- If summed up values is above 0,satisfying the switch condition.Thus makes no resetting of integrator for positive values.
- If summed up value gets 0, the switch condition fails.Thus makes the integrator to reset.
Step 5:
The vehicle velocity and traction force input are given to a scope for viewing the plots.
Results:
Run the simulation for 598 secs and the vehicle velocity output as shown below for the assigned vehicle parameter values.

- The first plot shows the vehicle velocity output as per input traction force given.
- The second plot shows the input traction force.
- From the scope we can clearly understand that, the vehicle velocity increase when input traction force increases and velocity decrease when traction force decreases.
- Also at initial starting duration of some time vehicle velocity is in zero although the traction force is around 900 N.
- This occurs as the resistance force is higher than the initial starting traction force.
- This can be shown as, at upto nearly 2 secs the velocity is 0 but the traction force at that time is around 950N.
Vehivle velocity-

Traction force-

Note: The simulink file,.mat file and Excel file are attached with this submission.
Submitted by,
Praveen Kumar L V,
Date:7/9/2021.