Project 2
Development of a forward energy-based fuel consumption model of a P1 Hybrid Electric vehicle.
Aim :
To develop a forward energy based fuel consumption model of a P1 Hybrid electric vehicle in MATLAB and simulink.
Objective :
- Understand the concept of forward energy based fuel consumption model of a P1 Hybrid electric vehicle.
- To understand the functioning various vehicle components including engine, electric motor, battery ,torque converter, transmission system, longitudinal dynamics etc.
- Development of a Matlab script used to load all the variables required for running the simulink model.
- Development of a simulink model of the vehicle.
- Development of a MATLAB script to do some basic post-process calculations and generate results and plots.
- Analyzing the results.
Given below the script for loading drive cycle data & variables in workspace.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Skill-Lync -> Hybrid Drives Development
% Project 1 - Conventional Vehicle Model
% By - Vishal Padekar
% 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
load Vehicle_Data/EM_Honda_Insight_10kW
load Vehicle_Data/ESS_NiMH6
ESS_init_soc = 0.8;
ESS_soc_max = 0.9;
ESS_soc_min = 0.6;
%% 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);
Screenshot of script & workspace



Simulink model for vehicle given below

- Hybrid vehicle modle consist of 3 blocks viz, Driver, Controller & Powertrain block.
- For each block simulink screen shot pasted below.
Driver Model :

It is modeled using a ‘Driver’ block, which is a basic PI controller that generates accelerator and brake pedal outputs to match the desired and actual vehicle speeds. In this we use drive cycles fro the based on these results of fuel consumption and emissions the vehicle gets certified and it also forms a basis of uniform asessment. It is based on time, velocity then its all integrate and creates output accelration pedal and brake pedal.
Controller Model :

The Controller block is the brains of the vehicle, representing the electronic controls units. It is based on the driver inputs, it generates desired engine torque, desired transmission gear desired motor torque and desired brake torque. These inputs are fed to the ‘Powertrain’ block which represents the drivetrain of the vehicle. In this we require to create stateflow block
1) Mode Selector chart :

In this we created four conditions as stop, start, drive and regeneration braking. The initial block represent the stop condition. In which the engine is OFF. The engine and motor throttle conditions are zero. Then the second block represent start condition. In which the mode is 1 the electric motor throttle is only used to provide the required torque and power to the vehicle the engine is off and engine throttle conditions zero.
The state 1 and state 2 are connected using the links so, it moves from state 1 to state 2 when acceleration is less than one or SOC is less then the minimum SOC. State 3 represtents mode 2 so engine is on and the engine throttle is also having positive value from the driver but the electric motor throattle is zero. It changes from state 2 to state 3 when engine speed is grater than or equal to engine idle speed. state 4 represents regenerative braking.
2) Engine Control unit :

In this control model We use engine control unit in that give input Engine speed through creating look up table. in that table we give input Maximum torque and map speed then also create 2nd look up trable in that give input ct torque and map speed then it substracts and multiplied. the engine speed also give to ideal contro speed to integrate from this we meet output of engine required torque.
3) Transmission Control Unit :

In this unit we create steadfy flow variable state for controlling of gears of vehicle as in ascending and descending order with respect to time, speed, distance. and give input to this steady state is vehicle speed in m/s to mph.
Shift Logic :

In this logic block entry given as logic gears with vehicle speed & throttle as input and output is gear command & clutch lockup to tranmsmission unit.
4) Electric Motor Control Unit :

According to driving condition and current speed of engine and motor torque requirement generated and sent to motor unit.
5) Brake control Unit :

Brake torque requrement is generated and accordingly brake torque provide to wheels.
Powertrain :

The powertrain block consist of several main subsystems are Engine, electrical motor, Crank hub, transmission, Differential, wheels, vehicle dynamics. The signal from the controller block are extracted using the bus selector, which consist of the signal for Engine torque requirement, Gear command and brake torque requirement.
1) Engine Unit :

In this model we used map based model to model the fuel consumption of engine. It is based on maximum torque and minimum torque from the controller. And then it saturated torque and give output then satureted torque and speed map give fuel consumption takes the speed and torque then the output goes into saturated then its integrated.
2) Electric Motor unit :

In this electric motor it get the engine speed as the input and it goes to the torque convertor. so it get the final motor torque and this torque is used to find the electric motor power by this torque and the speed of the motor as the inputs to thr 2D lookup table which is created by the power map has the torque data and the speed data for this it gives the corresponding electrical power as the output.
3) Crank Hub Unit :

Crank hub add both engine and electric motor torque and provid to transmission resulting in smoth power transfer.
4) Transmission Unit :

In these model we take engine torque, gear selector from controllerb for transmission of gear ratio. The ratio is multiply by transmission input torque and then the transmission efficiency positive torque and negative torque gives transmission input speed. In this case torque converter connects the engine to transmission it is part of transmission.
Torque Converter :

5) Diifferential Unit :

The Differential subsystem takes the output from the transmission system and reduce it as the gear ratio of the differential. The switch block is used to compensate for the negative and positive sign values.
6) Wheels :

The wheels subsystem takes the axle torque and brake torque as the input. The brake torque is to reduce the axle torque to maintain the desired vehicle speed. Dividing the dynamic radius of the wheel with equivalent torque and vehicle velocity gives the tractive force and the wheel speed.
7) Vehicle Dynamics :

The vehicle dynamics block is used to find the vehicle dynamic characteristics like velocity, acceleration and distance travelled from the tractive force. The vehicle force corresponding to the actual vehicle is the difference between the tractive and the road load. The road load constitutes the drag, rolling and grading resistance. The velocity saturation is multiplied with the rolling resistance to ensure that it is avoided when the vehicle is not in motion.
8) Battery Unit :

In this we give input as power then it multiply and give to pack current. Then from SOC estimation meet output SOC its give to terminal voltage as input and then meet terminal voltage as output.
Terminal Votage Estimation :

In this unit we use input SOC it is connected to 1D lookup table 1st table variable interpolated as state of charge and open voltage circuit. In 2nd lookup table is for the discharge resistance to the soc. And the 3rd lookup table is made of charging resistance to the soc states. Then it is passed through the switch block for controlling therushold then it give voltage limits as max volts to get terminal voltage.
SOC Estimation Block :

In this we integrate pack current and convert it rad to amp then saturated and meet SOC. and this current is divided by the maximum current capacity and it move to seperated by initial soc to get the final soc.
Script for simulink data post processing & plotting parameters
%% Skill-Lync -> Hybrid Drives Development
% Project 2 - Conventional Vehicle Model
% By - Vishal Padekar
%% Post-Processing File
% File for post-processing the Hybrid 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_Rate = out.Eng_Fuel_Rate; % Engine fuel rate in[gkW]
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]
Whl_Spd = out.Whl_Spd*30/pi; % Wheel speed [rpm]
Desired_spd = out.Desired_Velo*18/5; % Desired Speed [Kmph]
EM_Spd = out.EM_Spd; % Electical Motor Speed
EM_Pwr = out.EM_Pwr; % Electical Motor Power
EM_Trq = out.EM_Trq; % Electical Motor Torque
Term_volt = out.Term_volt; % Terminal Voltage of Battery
SOC = out.SOC; % State of charge
Pack_current = out.Pack_current;% Pack Current of Battery
%% 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]
%% Display Fuel Economy of the Cycle
fprintf('Fuel Economy = %2.2fKmpl',kmpl);
%% Plotting vehicle characteristics time trace
%% Plotting transmission input, transmission output and wheel speed
figure(1)
hold on;
grid on;
plot(Time, Trans_In_Spd, 'linewidth', 1, 'Color', 'black');
plot(Time, Trans_Out_Spd, 'linewidth', 1, 'Color', 'red');
plot(Time, Whl_Spd, 'linewidth', 1, 'Color', 'blue');
xlabel('Time [s]');
ylabel('Speed [rpm]');
xlim([0, Time(end)]);
legend('Trans Input','Trans Output','Wheel Speed');
%% Ploting engine torque, engine power, fuel rate and fuel consumption
figure(2)
subplot(411);
hold on;
grid on;
plot(Time, Eng_Trq, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]');
ylabel('Torque [Nm]');
xlim([0, Time(end)]);
subplot(412);
hold on;
grid on;
plot(Time, Eng_Pwr, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]');
ylabel('Power [KW]');
subplot(413);
hold on;
grid on;
plot(Time, Eng_Fuel_Rate, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]');
ylabel('Engine Fuel rate');
subplot(414);
hold on;
grid on;
plot(Time, Eng_Fuel_Consump, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]');
ylabel('Fuel Consumption [g]');
%% Ploting accelerator and brake pedal, gear command, vehicle desired and actual speed, vehicle distance
figure(3)
subplot(411);
hold on;
grid on;
plot(Time, Acc_Pdl, 'linewidth', 1, 'Color', 'black');
plot(Time, Brk_Pdl, 'linewidth', 1, 'Color', 'red');
xlabel('Time [s]');
ylabel('Pedal [%]')
xlim([0, Time(end)]);
legend('Accel','Brake');
subplot(412);
hold on;
grid on;
plot(Time, Gear_Cmd, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]');
ylabel('Gear');
subplot(413);
hold on;
grid on;
plot(Time, Veh_Spd, 'linewidth', 1, 'Color', 'red');
plot(Time, Desired_spd, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]');
ylabel('Speed [Kmph]');
legend('Actual speed','Desired speed');
subplot(414);
hold on;
grid on;
plot(Time, Veh_Dist, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]');
ylabel('Distance [Km]');
%% Test Results
Avg_speed = sum(Veh_Spd)/length(Veh_Spd);
Max_Speed = maxk(Veh_Spd,1);
table(Avg_speed,Max_Speed,kmpl,'VariableNames',{'Average Speed [kmph]','Maximum Speed [kmph]','Fuel Economy [kmpl]'})
%% Plotting Drive Cycle
figure(4)
hold on
grid on
plot(cyc_time, cyc_vel, 'linewidth', 1, 'Color', 'black');
xlabel('Time [s]')
ylabel('Velocity [Mph]')
title('Drive Cycle')
%% 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)]);
%% plot motor speed, torque, motor input power using subplots.
figure(6)
subplot(311);
grid on;
plot(EM_Spd);
xlabel('Time [s]');
ylabel('Speed [rpm]');
xlim([0, Time(end)]);
title('Electric Motor Speed [rpm]');
subplot(312);
grid on;
plot(EM_Trq, 'linewidth', 1, 'color', 'b');
xlabel('Time [s]');
ylabel('Torque [Nm]');
xlim([0, Time(end)]);
title('Electric Motor Torque [Nm]');
subplot(313);
grid on;
plot(EM_Pwr, 'linewidth', 1, 'color', 'r');
xlabel('Time [s]');
ylabel('power [W]');
xlim([0, Time(end)]);
title('Electric Motor Power [W]');
%% Plot pack voltage, current and SOC using subplots.
figure(7);
subplot(311);
grid on;
plot(Time, Term_volt, 'linewidth', 1, 'color', 'k');
xlabel('Time [s]');
ylabel('Voltage [V]');
xlim([0, Time(end)]);
title('Pack Voltage [V]');
subplot(312);
grid on;
plot(Time, Pack_current, 'linewidth', 1, 'color', 'b');
xlabel('Time [s]');
ylabel('Current [A]');
xlim([0, Time(end)]);
title('Pack Currenet [A]');
subplot(313);
grid on;
plot(Time, SOC, 'linewidth', 1, 'color', 'r');
xlabel('Time [s]');
ylabel('SOC [Ah]');
xlim([0, Time(end)]);
title('State of Charge [Ah]');
%% Plot the motor operating points on the motor input power map, with the motor max motoring and generating torque curves.
figure('name', 'EM Operating Points');
hold on;
grid on;
title('Electric Motor Operating Points','fontsize',12);
p1=plot(EM_map_spd*30/pi,EM_max_trq,'linewidth',2,'color','r');
p2=line([EM_map_spd(end)*30/pi EM_map_spd(end)*30/pi],[0 EM_max_trq(end)]);
set(p2,'linewidth',1,'linestyle','--','color','k');
p3=line([EM_map_spd(1)*30/pi EM_map_spd(1)*30/pi],[EM_max_gen_trq(1) EM_max_trq(1)]);
set(p3,'linewidth',1,'linestyle','--','color','k');
p4=plot(EM_map_spd*30/pi,EM_max_gen_trq,'linewidth',2,'color','b');
[c,h] = contour(EM_map_spd'*30/pi,EM_map_trq,EM_inpwr_map');
clabel(c,h);
xlabel('Motor Speed [rpm]');
ylabel('Motor Torque [Nm]');
title('Motor Input Power Map');
%p5=plot(EM_Spd,EM_Trq,'linewidth',2,'color','g');
legend([p1 p4],{'Max Curve','Regen Curve'});
axis([EM_map_spd(1)*30/pi EM_map_spd(end)*30/pi EM_max_gen_trq(1) EM_map_trq(1)]);
Screenshot of script and workspace








a. Tabulate the fuel economy numbers (kmpl) for UDDS and HWFET cycle. Compare these numbers with the baseline numbers for conventional vehicle model from Project 1.
Fuel Economy for UDDS cycle :
1)For conventional Vehicle from project 1 :

2)For P1 hybrid vehicle from project 2 :

Fuel Economy for HWFET cycle :
1)For conventional Vehicle from project 1 :

2)For P1 hybrid vehicle from project 2 :

- From Above Values fuel economy in HWFET is better than UDDS cycle due to braking in idle losses in UDDS cycle.
- Fuel economy in hybride vehicle is higher compared to conventional vehicle due secondary energy source EM.
b. Plot the time trace for engine, transmission input, transmission output and wheel speed on one plot.
1) UDDS Cycle :

2)HWFET Cycle :

- UDDS cycle having more fluctaitin transmission input & output speed as comapred to HWFET cycle.
- Resulting in more fluctation in wheel speed for UDDS cycle.
- HWFET cycle is smoother than UDDS cycle.
c. Plot engine torque, engine power, fuel rate and fuel consumption using subplots.
1) UDDS Cycle :

2) HWFET Cycle :

- HWFET cycle required constant torque and power requirement ande less negative power and torque requirement.
- UDDS has fluctuating positive and negative power requirment due to sudden braking and idelling losses.
- Engine fuel rate is more fluctuating in UDDS cycle as comapred to HWFET cycle.
- Fuel cosumption increases with time in drive cycle, but after ceretain time period fuel consumption increases slowly in HWFET as comapred to UDDS.
- HWFET cycle is more fuel efficient than UDDS cycle.
d. Plot accelerator and brake pedal, gear command, vehicle desired and actual speed, vehicle distance using subplots.
1) UDDS Cycle :

2) HWFET Cycle :

- In UDDS cycle accelerator & brake pedal are used more due to cycle is not smoother whreas in HWFET cycle accelerator used efficiently and brake pedal used less due to smother cycle.
- In UDDS cycle more gear shift required compared to HWFET cycle.
- In HWFET cycle speed increases with time constnatly and after certain time it remains constant with low fluctuations. In UDDS cycle fluctuation in speed increse is more.
- Distance covered in HWFET cycle is more due to less braking & engine idelling as comapared to UDDS cycle.
e. Plot the engine operating points on the engine fuel map.
1) UDDS Cycle :

2) HWFET Cycle :

- Both cycle engine operation point below max torque curve with some fluctuations.
- Mostly engine operating in UDDS at 1000rpm to 4000rpm & in HWFET at 1500rpm to 3000rpm.
- Torque requirment is more in UDDS cycle than HWFET cycle.
f. Plot motor speed, torque, motor input power using subplots.
1) UDDS Cycle :

2) HWFET Cycle :

electic motor used in low speed drive conditions as we mentioned in the mode logic unit. so at the urbon drive has lot of low speed drive so it used lot of motor power in UDDS cycle when compare to HWFET cycle as shown in the plots.
g. Plot pack voltage, current and SoC using subplots.
1) UDDS Cycle :

2) HWFET Cycle :

The pack voltage and current will have more fluctuations in UDDS as compared to HWFET cycle because of the frequent start and stops throughout the drive and the battery has to provide the energgy everytime when the car is starting from the idle position.
SOC decreased in the UDDS cycle wrt time but it has increased in HWFET cycle. It is because in UDDS we have frequent start and stops and battery has to provide the energy has evertytime when the caris starting from the idle position and the SOC decreases but in HWFET cycle The Vehicle will be moving continuously without braking frequently and the alternator is utilised to transfer some engine power to the battery through motor so SOC increase in the HWFET cycle.
h. Plot the motor operating points on the motor input power map, with the motor max motoring and generating torque curves.
1) UDDS Cycle :

2) HWFET Cycle :

j. Generate the plots for both drive cycles
1) UDDS Cycle :

2) HWFET Cycle :

- In UDDS cycle more fluctuation in velocity due to braking & idelling losses.
- IN HWFET cycle velocity constnt with rare fluctuations.
Conclusion:
Vehicle having mor efficeint operation HWFET cycle is all aspects as compared to UDDS cycle. UDDS cycle having more start and stop and braking. Energy lossed in braking is covered by regen braking.
Also from comparison of both fuel cosumption in conventional & hybrid vehicles. Hybrid vehicle are more efficient in both cycles than conventional vehicles.