Project 1
AIM:
To develop a forward energy-based fuel consumption model for a conventional vehicle by the modeling process, writing scripts in Matlab, modeling in Simulink, and analyzing data.
OBJECTIVE:
- To develop a forward energy-based fuel consumption model of a conventional vehicle by using Simulink modeling.
- To simulate the vehicle on different drive cycles like UDDS, HWFET, FTP, NEDC, US06, and WLDPusing Matlab scripts.
- To compute the fuel economy numbers for the given vehicle (kmpl) on the urban cycle (UDDS) and highway cycle (HWFET).
- To analyze the vehicle operating points in terms of engine speed, torque, transmission speeds, pedal positions, gear, and distance traveled.
- To Plot the time trace for engine, transmission input, transmission output, and wheel speed on one plot.
- To Plot engine torque, engine power, fuel rate, and fuel consumption using subplots.
- To Plot accelerator and brake pedal, gear command, vehicle desired and actual speed, and vehicle distance using subplots.
- To Plot the engine operating points on the engine fuel map.
- To describe the vehicle behavior throughout the drive cycle and to generate the plots for both UDDS and HEFET cycles.
INITIATION SCRIPT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Skill-Lync -> Hybrid Drives Development
% Project 1 - Conventional Vehicle Model
% By - Ullekh Gambhira
% Description:
%% Initialization File
% Initialization file for loading the variables for the Conventional vehicle simulation model
%% Vehicle Parameters
M = 1500; % Vehicle weight [kg]
Cr = 0.015; % Rolling resistance coefficient
Rw = 0.35; % Rolling radius [m]
Cd = 0.33; % Drag coefficient
Af = 2; % Frontal area [m2]
rhoa = 1.225; % Air density [kg/m3]
Vwind = 0; % Wind velocity [kmph]
g = 9.81; % Gravitational acceleration [m/s2]
theta = 0; % Slope [deg]
myu_road_tire = 1; % Coefficient of friction between tire - road interface
%% Powertrain Parameters
FDR = 3.73; % Final Drive Ratio / Diff Ratio
DiffEff = 0.99; % Differential efficiency (assumed independent of operating conditions)
NumGear = 4; % Number of gears in transmission
TransGear = [1:NumGear]; % Transmission Gears
TransRatio = [3.06, 1.62, 1, 0.7]; % Corresponding Transmission ratios
TransEff = 0.90; % Transmission efficiency (assumed independent of operating conditions)
TC_SR = [0, .5, .6, .7, .8, .87, .92, .94, .96, .97, 1]; % Torque Converter Speed Ratio (Matlab default) -> TurbSpd/PumpSpd
TC_TR = [2.232, 1.5462, 1.4058, 1.2746, 1.1528, 1.0732, 1.0192, 1, 1, 1, 1]; % Torque Converter Torque Ratio (Matlab default) -> TurbTrq/PumpTrq
TC_Cf = 1e-4 * [.72558, .66322, .63463, .59042, .51331, .4144, .29287, .22444, .12186, .04386, 0]; % Torque Converter Capacity Factor (Matlab default) -> PumpTrq/PumpSpd^2 [Nm/rpm^2]
load Vehicle_Data/Engine_data_1_9L_Saturn_95kW
load Vehicle_Data/Trans_Shift_map
%% Driver Parameters
Kp = 10; % P gain for driver PI model
Ki = 1; % I gain for driver PI model
Drive_Cycle_Select = 1; % Drive cycle selection
% Drive cycle values in m/s
if Drive_Cycle_Select == 1
load DriveCycles/UDDS;
elseif Drive_Cycle_Select == 2
load DriveCycles/HWFET;
elseif Drive_Cycle_Select == 3
load DriveCycles/FTP;
elseif Drive_Cycle_Select == 4
load DriveCycles/US06;
elseif Drive_Cycle_Select == 5
load DriveCycles/NEDC;
elseif Drive_Cycle_Select == 6
load DriveCycles/WLTP;
end
time_end = cyc_time(end);
vel_end = cyc_vel(end);
SELECTION OF DRIVE CYCLE:
The drive cycle selection is done based on the user drive cycle input. The code is modified to select the drive cycle. The value for Drive_Cycle_Select is changed to the required value of the corresponding drive cycle as shown in the code eg:-1 for USSD and 2 For HWFT. the drive cycle variables are then loaded and the Simulink model is run.
SIMULINK MODEL

- DRIVER BLOCK

- The ‘Driver’ block, is a basic PI controller that generates accelerator and brake pedal outputs to match the desired and actual vehicle speeds.
- The driver block uses the Drive cycle, A drive cycle is typically represented by a series of data points that plots vehicle speed against time. Driving cycles are produced to assess the performance of vehicles in various ways, including fuel consumption and pollutant emissions.
- The vehicle's desired speed is provided in the relational operator and a boolean condition based upon the simulation stop will execute.
- The saturation block limits the upper and lower conditions based on the limits provided.
- UDDS
- HWFET
- CONTROLLER BLOCK
- The ‘Controller’ block is the brain of the vehicle, representing the electronic controls units. Based on the driver inputs, it generates desired engine torque, desired transmission gear, and desired brake torque.
- CONTROL SIGNALS
- UDDS
- HWFET
- UDDS
- ENGINE CONTROL UNIT
- The Engine control unit derives the Engine speed to execute the Engine torque requirement.
- In the Engine control unit, the maximum and minimum torque are mapped using a 1-D look-up table and the signals are combined with the idle speed controller.
- IDLE SPEED CONTROLLER
- In the Engine speed controller block the Engine idle speed is saturated to execute the Trottle idle speed.
- In which the Engine speed is gained and integrated using integrator block.
- TRANSMISSION CONTROL UNIT
- In the transmission control unit Throttle and vehicle, speed is inputted into the gear transmission logic control system.
- Based upon the vehicle speed and throttle response the gear command is controlled.
-

- GEAR SHIFT LOGIC
- Based on the vehicle speed and throttle response the gears are selected based on the state and during conditions.
- The up and down gears are shifted based on the conditions and actions of the logic.
- Based on the Simulink function using a 2-D look-up table to map the up shifting and down shifting conditions.
- BRAKE CONTROL UNIT
- The brake control unit is controlled based on the mass, gravity, wheel radius, and the coefficient of friction between the tire and the road surfaces.
- The brake and the Tire loads are multiplied to execute the brake torque requirements.
- The ‘Controller’ block is the brain of the vehicle, representing the electronic controls units. Based on the driver inputs, it generates desired engine torque, desired transmission gear, and desired brake torque.
- POWER TRAIN BLOCK
- The ‘Powertrain’ block represents the drivetrain of the vehicle. It consists of an ‘Engine’ connected to the ‘Automatic Transmission’ through a ‘Torque Converter’. The output of the transmission is connected to the ’Differential’, which powers the ‘Wheels’, which provide the tractive force for vehicle acceleration. The longitudinal dynamics of the vehicle along with the road load are represented in the ‘Vehicle Dynamics’ block.

- ENGINE BLOCK
- The Engine model is modeled using the Engine speed and Engine torque requirement.
- Based on the Engine torque and Engine speed the maximum and minimum torque are mapped using a 1-D look-up table and are saturated using upper and lower limits.
- The saturated executes the Engine fule rate and the integration of fuel flow rate gives the Fuel consumption of the engine.

- FUEL RATE AND CONSUMPTION
- UDDS

- HWFET

- UDDS
- TRANSMISSION
- The Engine torque and the Gear transmission are inputted into the transmission block.
- Based upon the transmission input torque and transmission output speed the positive and negative efficiencies are determined using switch threshold conditions.
- From which the transmission output torques are derived.
- UDDS
- HWFET
- TORQUE CONVERTER
- In the torque converter, the pump and turbine Torque is determined by using the 1-D mapped models.
- The pump torque is derived by using the C- factor mapped 1-D model.

- PUMP AND TURBINE TORQUE
- UDDS

- HWFET
- ENGINE OUTPUT
- UDDS
- HWFET
- UDDS
- DIFFERENTIAL
- The transmission output torque is inputted into the gain of Final Drive Ratio (FDR), by which the positive and negative differential efficiencies are derived by using switch threshold conditions.
- From the axle torque are determined.
- The wheel speed from the vehicle is inputted to compute the transmission output speed.
- WHEELS
- The net torque Axle torque and the Brake torque are transmitted into the wheel and the weel radius is determined to estimate the tractive forces.
- The wheel speed is determined by using the velocity of the vehicle and the wheel radius.
- VEHICLE DYNAMICS
- The vehicle dynamics is the motion of the vehicle generated by the steering action, through which the vehicle is capable of independent motion. In a vehicle, several forces act on it, and the net or resultant force governs the motion according to Newton's second law. The propulsion unit of the vehicle delivers the force necessary to move the vehicle forward. This force of the propulsion unit helps the vehicle to overcome the resisting forces due to gravity, air, and tire resistance.

- DYNAMIC FORCES AND LOADS
- UDDS
- HWFET
- UDDS
- The vehicle dynamics is the motion of the vehicle generated by the steering action, through which the vehicle is capable of independent motion. In a vehicle, several forces act on it, and the net or resultant force governs the motion according to Newton's second law. The propulsion unit of the vehicle delivers the force necessary to move the vehicle forward. This force of the propulsion unit helps the vehicle to overcome the resisting forces due to gravity, air, and tire resistance.
- The ‘Powertrain’ block represents the drivetrain of the vehicle. It consists of an ‘Engine’ connected to the ‘Automatic Transmission’ through a ‘Torque Converter’. The output of the transmission is connected to the ’Differential’, which powers the ‘Wheels’, which provide the tractive force for vehicle acceleration. The longitudinal dynamics of the vehicle along with the road load are represented in the ‘Vehicle Dynamics’ block.
BLOCKS USED IN MODELLING:
- Goto - The Goto block passes its input to its corresponding From blocks. The input can be an actual- or complex-valued signal or vector of any data type. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- From - The From block accepts a signal from a corresponding Goto block, then passes it an output. The data type of the output is the same as that of the input from the Goto block. From and Goto blocks allow you to pass a signal from one block to another without actually connecting them.
- Connection Port - The Connection Port block transfers a physical connection or signal across subsystem boundaries.
- Import blocks - Import blocks link signals from outside a system into the system.
- Outport blocks - Outport blocks link signals from a system to a destination outside of the system. they can connect signals flowing from a subsystem to other parts of the model. They can also supply external outputs at the top level of a model hierarchy.
- Constant block - The Constant block generates a real or complex constant value signal. This block provides a constant signal input.
- PS Lookup Table (1D) - The PS Lookup Table (1D) block computes an approximation to function for a given data vector. Both the input and the output are physical signals. The block generates output based on the input values using the selected interpolation and extrapolation methods.
- Scope - The scope block displays time-domain signals, and the scope displays simulation results for attached input signals.
- Integrator - The Integrator block outputs the value of the integral of its input signal concerning time.
- STOP - Stops the simulation of the model.
- Saturation - The Saturation block produces an output signal that is the value of the input signal bounded to the upper and lower saturation values. The upper and lower limits are specified by the parameters Upper limit and Lower limit.
- Dynamic Saturation - The Saturation Dynamic block produces an output signal that is the value of the input signal bounded to the saturation values from the input ports up and lo.
- Rate Limiter - The Rate Limiter block limits the first derivative of the signal passing through it. The output changes no faster than the specified limit.
- To workspace - The workspace block transfers the data to the workspace of Matlab.
- Bus Creator - The Bus Creator block combines a set of input elements into a bus.
- Bus Selector - The Bus Selector block outputs the elements selected from the input bus. The block can output the selected elements separately or in a new virtual bus. The Bus Selector block does not support mixing message and signal elements as outputs.
- Charts - A finite state machine is a representation of an event-driven (reactive) system. In an event-driven system, the system responds to an event by making a transition from one state (mode) to another. This transition occurs if the condition defining the change is true.
- Switch - The Switch block passes through the first input or the third input signal based on the value of the second input. The first and third inputs are data inputs. The second input is the control input. Specify the condition under which the block passes the first input by using the Criteria for giving the first input and Threshold parameters.
- Sin - Sine of argument in radians
- Cos - Cosine of argument in radians
- Clock - The block outputs the current simulation time at each step. This block is useful for other blocks that need simulation time.
POSTPROCESSING SCRIPT
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Skill-Lync -> Hybrid Drives Development
% Project 1 - Conventional Vehicle Model
% By - Ullekh Gambhira
% Description:
% The following file is to used with the Initialization file and Simulink
% results for post-processing of the data.
% The file is incomplete, has some examples of how the data is imported
% into a readable format, data analysis and plotting examples.
% Based on the project task, use commands in a similar format as given
% below, to analyse the data and generate required plots.
% You can change variable names if desired
%% Post-Processing File
% File for post-processing the Conventional vehicle simulation model data
%% Renaming variables
Time = out.tout;
Acc_Pdl = out.Acc_Pdl; % Accelerator pedal [%]
Brk_Pdl = out.Brk_Pdl; % Brake pedal [%]
Gear_Cmd = out.Gear_Cmd; % Transmission gear
Trans_In_Spd = out.Trans_In_Spd*30/pi; % Transmission input speed [rpm]
Trans_Out_Spd = out.Trans_Out_Spd*30/pi;% Transmission output speed [rpm]
Eng_Trq = out.Eng_Trq; % Engine brake torque [Nm]
Eng_Spd = out.Eng_Spd*30/pi; % Engine speed [rpm]
Eng_Fuel_Consump = out.Eng_Fuel_Consumption; % Engine fuel consumption [g]
Veh_Dist = out.Veh_Dist/1000; % Distance traveled by vehicle [km]
Veh_Spd = out.Veh_Spd*18/5; % Vehicle speed [kmph]
%% Data Analysis
Eng_Pwr = Eng_Spd.*pi/30.*Eng_Trq./1000; % Engine brake power [kW]
rho_petrol = 0.7197; % Density of petrol [kg/L]
kmpl = Veh_Dist(end)/(Eng_Fuel_Consump(end)/1000/rho_petrol); % Fuel economy [kmpl]
%% Plotting vehicle characteristics time trace
figure()
subplot(3,1,1)
hold on
grid on
plot(Time, Acc_Pdl, 'linewidth', 1, 'Color', 'black');
plot(Time, Brk_Pdl, 'linewidth', 1, 'Color', 'red');
ylabel('Pedal [%]')
xlim([0, Time(end)]);
legend('Accel','Brake');
subplot(3,1,2)
hold on
grid on
plot(Time, Trans_In_Spd, 'linewidth', 1, 'Color', 'black');
plot(Time, Trans_Out_Spd, 'linewidth', 1, 'Color', 'red');
ylabel('Speed [rpm]')
xlim([0, Time(end)]);
ylim([0, 6000]);
legend('Trans Input','Trans Output');
subplot(3,1,3)
hold on
grid on
plot(Time, Gear_Cmd, 'linewidth', 1, 'Color', 'black');
xlim([0, Time(end)]);
xlabel('Time [s]');
ylabel('Gear');
%% Plotting engine operating points on engine fuel map
figure('Name','Engine Operating Points');
hold on
grid on
title('Engine Operating Points','fontsize',12);
p1=plot(Eng_map_spd*30/pi,Eng_max_trq,'linewidth',2,'color','r');
p2=line([Eng_map_spd(end)*30/pi Eng_map_spd(end)*30/pi],[0 Eng_max_trq(end)]);
set(p2,'linewidth',1,'linestyle','--','color','k');
p3=line([Eng_map_spd(1)*30/pi Eng_map_spd(1)*30/pi],[0 Eng_max_trq(1)]);
set(p3,'linewidth',1,'linestyle','--','color','k');
[c,h] = contour(Eng_map_spd'*30/pi,Eng_map_trq,Eng_fuel_map');
clabel(c,h);
xlabel('Engine Speed [rpm]');
ylabel('Engine Torque [Nm]');
title('Engine Fuel Consumption Map [g/s]');
p4 = plot(Eng_Spd,Eng_Trq,'.','color','k');
legend([p1 p4],{'Max Curve','Operating Points'});
axis([Eng_map_spd(1)*30/pi Eng_map_spd(end)*30/pi 0 Eng_map_trq(end)]);
OBSERVATIONS
- UDDS
- DRIVE CYCLE
- FUEL ECONOMY

- From the UDDS drive cycle the computation has been done and for that 28.748 kmpl of fuel economy is observed.
- TIME TRACE
- Engine torque, engine power, fuel rate, and fuel consumption:
- The accelerator and brake pedal, gear command, vehicle desired and actual speed, and vehicle distance:
- The engine operating points on the engine fuel map:
- DRIVE CYCLE
- HWFET
- DRIVE CYCLE
- FUEL ECONOMY

- From the HWFET drive cycle the computation has been done and for that 40.267kmpl of fuel economy is observed
- The time trace for engine, transmission input, transmission output, and wheel speed :

- The plot describes the time and the speed of an engine.
- In this, the transmission input speed, transmission output speed, and wheel speed are plotted.
- Depending on the Desired velocity of the vehicle the wheel speed is computed with wheel radius.
- From the wheel speed, the transmission output speed is computed based on the FDR in the differential unit.
- The Transmission input speed is evaluated by the transmission output speed, gear ratios, and the transmission input torque.
- Engine torque, engine power, fuel rate, and fuel consumption:

- The Engine torque is determined by the Dynamic saturation block, with this, the maximum and minimum torque requirements are saturated based on upper and lower limits.
- The engine power is derived based on the engine speed and engine torque requirements.
- Based on the Engine torque and Engine speed the maximum and minimum torque are mapped using a 1-D look-up table and that is saturated using upper and lower limits.
- The saturated executes the Engine fule rate and the integration of fuel flow rate gives the Fuel consumption of the engine.
- The accelerator and brake pedal, gear command, vehicle desired and actual speed, and vehicle distance:

- The plot describes the Vehicle behavior of the engine parameters and user inputs.
- From the desired and actual drive velocities the axle and brake pedals are specified by the driver inputs.
- Based on the inputs, in the transmission system, the Gear ratios are shifted based on the velocities and torques.
- The distance of the vehicle is determined by the integration of the desired velocity by the vehicle.
- The engine operating points on the engine fuel map.

- The potting has been done for the maps with engine speed on the x-axis and engine brake torque on the y-axis, and the Engine operating points are represented using the contour function.
- From the plotting, the engine maximum and minimum torque are identified and the operating conditions are determined.
- The Engine fuel consumption is estimated by using the fuel map, based on the engine speed and engine torque @ operating conditions the fuel consumption of the vehicle is obtained.
- DRIVE CYCLE
RESULTS:
- From the UDDS and HWFET drive cycle, the fuel economy is observed as,
- In UDDS Drive cycle - 28.748 kmpl.
- In HWFET Drive cycle - 40.267 kmpl.
- Based on the fuel economy the HWFET drive cycle has a higher economy than the UDDS drive cycle, due to low braking and higher desired velocities.
- The development of a forward energy-based fuel consumption model of a conventional vehicle by using Simulink models is created and analyzed.
- The simulation on different drive cycles like UDDS, HWFET, FTP, NEDC, US06, and WLDP using Matlab scripts is done.
- The computation for the fuel economy numbers for the given vehicle (kmpl) on the urban cycle (UDDS) and highway cycle (HWFET) are carried out.
- The vehicle operating points in terms of engine speed, torque, transmission speeds, pedal positions, gear, and distance traveled are analyzed.
- The time trace for engine, transmission input, transmission output, and wheel speed on one plot is plotted.
- The engine torque, engine power, fuel rate, and fuel consumption using subplots are plotted.
- The accelerator and brake pedal, gear command, vehicle desired and actual speed, and vehicle distance using subplots are plotted.
- The engine operating points on the engine fuel map are carried out using the contour function.
- The vehicle behavior throughout the drive cycle and the plots for both UDDS and HWFET cycles are carried out.























