Challenge

Project 2

Pre-Processing:

  • A MATLAB script has been created "Project2_init_file" to load all the variables needed to run and post-process the Simulink model.
    Drive cycle selection is also done from here. Before running the Simulink vehicle model, the script is initialized at MATLAB to load all the variables in the workspace.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Skill-Lync -> Hybrid Drives Development

% Project 1 - Conventional Vehicle Model

% By - Sri Harsha Avvari

% 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);

  • The Drive Cycle can be selected from this MATLAB Script, By changing the variable Drive _Cycle _Select to,
  1. UDDS
  2. HWFET
  3. FTP
  4. USO6
  5. NEDC
  6. WLTP

Simulink modeling:

The vehicle design mainly consists of three parts Driver, Controller and the Powertrain.

Driver:

The Driver model shown is a basic PI controller that generates accelerator and brake pedal outputs to match the desired and actual vehicle speeds.

CONTROLLER:

The controller is the brain of the vehicle which represents the electronic controls units, Based on the driver inputs it generates an engine torque, a transmission gear and a brake torque. These inputs are fed from supervisory controller to the control unit which is then fed to the powertrain which drives the vehicle.

A state flow chart is used for the supervisory control unit which decides the operating mode whether it is start /stop mode or cruising mode or regen braking mode for each modes the engine drive and the motor drive are controlled.

ENGINE CONTROL UNIT:

In the existing Engine Control Unit for the Conventional Vehicle, there are some changes made to be a Hybrid Drivetrain. New input signals are implemented like 'Eng_on'. The logic behind this is to make the Vehicle more Fuel efficient by turning off the engine whenever it is not required.

IDLE SPEED CONTROL UNIT:

TRANSMISSION CONTROL UNIT:

The transmission control unit is used to control the gear shifting using the study flow variable chart. The gear shifting is controlled according to the vehicle speed and throttle input, the gear command is passed to the transmission block to select the desired gear ratio.

EM CONTROL UNIT:

Motor control unit compare EM speed with the max torque curve and max torque generation curve of the lookup table and give the required torque command to the electric motor. EM Control Unit gives us 'EMTrqReq' which is Engine Machine Torque Requirement.

BRAKE CONTROL UNIT:

Brake control unit produce required brake torque according to the brake pedal input and passes the brake torque in to the wheel block in the transmission model.

POWERTRAIN UNIT:

The power train unit has all the parts that transfer the power of the engine to get the vehicle in motion. This includes engine, electric motor, battery, transmission, differential, wheels, and vehicle body dynamics subsystem.

ENGINE:

The engine speed is the input given based on which the required torque is generated by staurating the max torque curve and min torque curve and sends the reuired engine torque to the crank.

ELECTRIC MOTOR:

Engine speed is given as input which is then saturated between EM max torque curve and EM nax generating torque curve which gives us the EM torque which is then sent to the crank, Electric power is also generated.

BATTERY:

The input to Battery pack is electric power and battery soc is the output. two different subsystems have been created to determine the soc estimation and terminal voltage separately soc is used to determine the terminal voltage.

SOC ESTIMATION:

Pack current in ampere is converted to amp-hr and is divided with max capacity and added with the initial soc to determine the soc of the battery, at each instance the soc value is limited between 0 to 1.

TERMINAL VOLTAGE:

Input is Pack current and SOC and output is the terminal voltage,the Voltage drop is subtracted with an open circuit voltage and then multiplied with gain block to calculate the terminal voltage

CRANK:

The crank hub adds the EM torque and the Engine torque to give the output as the crank torque which is sent to the transmission

TRANSMISSION:

in this the input is crank torque, ClutchLockup and gear selector from controller signal for transmission of gear ratio. The ratio is multiplied by transmission input torque and then the transmission efficiency positive torque and negative torque gives transmission outputspeed.

TORQUE CONVERTER:

The gear selection from the transmission control unit is multiplied by the engine torque and the efficiency and engine dynamics of the torque converter are applied in this model.Torque converter defines the pump torque and turbine torque by the clutchLock up status, and the combination gives us the transmission torque.

DIFFERENTIAL:

The TransOutTrq is the input which is multiplied by the differential ratio and differential efficiency and the obtained torque is transmitted to the wheels as the axle torque.

WHEELS:

  • The brake torque from the control model is subtracted from the Axle torque and divides from the rolling radius to determine the Tractive force.
  • The Wheel speed is calculated from the vehicle velocity and saved in the workspace.

VEHICLE DYNAMICS:

  • The longitudinal dynamics of the vehicle along with the road load is represented in the 'Vehicle Dynamics' block.
  • The Tractive force and the road load are used to calculate the vehicle acceleration and velocity.

The dynamic equation for designing the Vehicle dynamic block is

where,

p = air density [kg/m^3]

A = Frontal area [m^2]

Cd = drag Coefficiend

Vveh = velocity of vehicle [m/s^2]

Vwind = velocity of wind [m/s^2]

Cr = rolling resistance coefficient

M = mass in [Kg]

MATLAB code for post processing and plotting:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Skill-Lync -> Hybrid Drives Development
% Project 1 - Conventional Vehicle Model
% By - SRI HARSHA AVVARI
%% 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]
Wheel_Speed=out.Wh_Speed; % Wheel speed [kmph]
Eng_Fuel_Rate=out.Eng_Fuel_Rate; % Engine fuel rate [%]
ElecPwr=out.ElecPwr;
EM_Trq=out.EM_Trq;
EM_Spd=out.EM_Spd;
%% 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/(Eng_Fuel_Consump/1000/rho_petrol); % Fuel economy [kmpl]
%% Plotting vehicle characteristics time trace
figure(1)
subplot(411)
hold on
grid on
plot(Time,Acc_Pdl);
ylabel('Pedal [%]');
xlabel('Time [s]');
legend('Accel');
subplot(412)
plot(Time,Brk_Pdl);
ylabel('Brk Pedal [%]')
xlabel('Time [s]');
legend('Brake');
subplot(413)
hold on
grid on
plot(Time,Gear_Cmd);
xlabel('Time [s]');
ylabel('Gear');
legend('Gear');
subplot(414)
hold on
grid on
plot(Time,Veh_Dist);
xlabel('Time [s]');
ylabel('Veh_Dist[KM]');
legend('Veh_Dist');
figure(2)
subplot(311)
hold on
grid on
plot(Time,Trans_In_Spd);
ylabel('Speed [rpm]')
legend('Trans Input');
subplot(312)
plot(Time,Trans_Out_Spd);
ylabel('Speed [rpm]')
legend('Trans Output');
subplot(313)
plot(Time,Wheel_Speed);
ylabel('Speed [rpm]')
xlabel('Time [s]');
legend('Wheel_Speed');
figure(3)
subplot(411)
plot(Time,Eng_Fuel_Consump);
ylabel('Engine fuel[g]')
legend('Eng_Fuel_Consump')
subplot(412)
plot(Time,Eng_Fuel_Rate);
ylabel('Engine fuel rate [%]')
legend('Eng_Fuel_Rate');
subplot(413)
plot(Time,Eng_Trq)
ylabel('Engine brake torque [Nm]')
legend('Eng_Trq');
subplot(414)
plot(Time,Eng_Pwr);
ylabel('Eng_Pwr [KW]')
xlabel('Time [s]');
legend('Eng_Pwr');
%% 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)]);

g = gravity.

PLOTS:

For UDDS:

1] accelerator and brake pedal, gear command, and actual speed, vehicle distance.

2] time trace for engine, transmission input, transmission output and wheel speed

3] engine torque, engine power, fuel rate and fuel consumption.

4] Motor power, Torque, Speed.

5]ESS Terminal voltage, Current, SOC, Resistor.

6]engine operating points on the engine fuel map.

For HWFET:

1]accelerator and brake pedal, gear command, and actual speed, vehicle distance

2]time trace for engine, transmission input, transmission output and wheel speed

3] engine torque, engine power, fuel rate and fuel consumption.

4] Motor power, Torque, Speed.

5] ESS Terminal voltage, Current, SOC, Resistor.

6] engine operating points on the engine fuel map.

Conclusion:

The modeling process of a forward energy-based fuel consumption model of a P1 Hybrid vehicle is designed in MATLAB using codes and simulink in MATLAB. All the required plots during UDDS and HWFET cycle were generated.All the Post-processing calculations were executed and the graphs were successfully plotted.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.