Project 2
Project 2
Ans:
Here's a step-by-step breakdown of the tasks:
-
Set Up:
- Load the "Project2" folder as the current folder in MATLAB.
- Run the "Project2_InitFile.m" MATLAB script to initialize variables and select the drive cycle.
-
Model Modification:
- Copy the conventional vehicle Simulink model from Project 1 into the "Project2" folder.
- Modify this model to represent a P1 hybrid vehicle. You can refer to lecture presentations and reuse battery and supervisory controller models developed in previous assignments.
-
Data Transfer:
- Add additional "To Workspace" blocks in the Simulink model to transfer desired vehicle data into the MATLAB workspace for analysis.
-
Simulation:
- Simulate the hybrid model on the selected drive cycles (Urban UDDS and Highway HWFET).
-
Project Report: Write a comprehensive project report containing the following sections:
a. Fuel Economy Comparison:
- Tabulate and compare the fuel economy (kmpl) for both UDDS and HWFET cycles with baseline numbers from the conventional vehicle model in Project 1.
b. Time Trace Plot:
- Plot the time traces of engine speed, transmission input/output speed, and wheel speed on a single plot.
c. Engine Performance Subplots:
- Create subplots to visualize engine torque, engine power, fuel rate, and fuel consumption.
d. Vehicle Dynamics Subplots:
- Plot accelerator and brake pedal positions, gear command, desired and actual vehicle speed, and distance traveled.
e. Engine Operating Points:
- Plot engine operating points on the engine fuel map.
f. Motor Performance Subplots:
- Plot motor speed, torque, and motor input power.
g. Battery Performance Subplots:
- Plot pack voltage, current, and state of charge (SoC) for the battery.
h. Motor Operating Points:
- Plot motor operating points on the motor input power map, including max motoring and generating torque curves.
i. Behavioral Comments:
- Provide brief comments on each plot, describing the vehicle's behavior throughout the drive cycle.
j. Generate Plots:
- Generate similar plots for both Urban UDDS and Highway HWFET drive cycles.
1 Set Up:
Initialization Script
Simulink model
Driver
It contains a PI controller to get the accelerator and brake pedal signals depending upon the drive cycle requirements.
Controller
This is the brains of the vehicle
It generates desired engine and motor torque signals, gear signals, which are fed to the powertrain.
State flow – Mode Selection
The chart has 4 states, namely Stop, Start, Drive and Regen Braking.
These states are indicated by a mode going from 0 to 3.
Eng_on represents whether the engine is on or off
Eng_thr and EM_thr are for the engine and EM throttle respectively
States
The first state indicates that the vehicle has stopped.
The second state indicates starting phase which is why only EM is used.
The third state is the driving state where the engine is on and the EM is off
The fourth state indicates regenerative braking where the engine throttle is o and the EM throttle is equivalent to the brake pedal signal.
Transitions
State 1 – 2
Acc>1 || SOC<SOC_min
For the starting phase if the accelerator signal is more than 1 or if the SOC has fallen below the minimum value
State 2 – 3
Eng_Spd>Eng_idle_spd
Between the starting and driving phase the transitions happens when the engine speed is greater than the engine speed at idle state.
State 3 - 4
Spd>6 && Brk>=2 && SOC<SOC_max ... && ClutchLockup>0
From driving to regenerative braking, if speed and brake signal are above certain values and SOC is less than its max value and the Clutch lock up is more than 0.
State 4 – 3
Spd<=5 || Brk<1 || SOC>=SOC_max ... || ClutchLockup==0
If any of the previous conditions are not met then the vehicle will go from regen braking to the driving state.
State 3-1
after(1,sec) && Spd<0.5 && SOC<SOC_min && Acc==0
Driving and stop condition, transition is indicated by checking the Speed values are below a certain threshold and the SOC value is less than its minimum and the acceleration is 0. This is checked after every second.
Engine Control Unit
The idle speed controller keeps the speed above the idle speed and make sure that the engine is idling provided that the engine is on.
The accelerator pedal from the driver unit provides the throttle signal as an input.
It has two look up tables for maximum and minimum torque curves for various speed values.
The input to the tables is the engine speed. This input along with the throttle and idle speed controller signals are multiplied together to get the required engine torque.
Transmission Control Unit
It uses state flow to determine gear shifting.
Velocity and throttle are taken as inputs and the gear used currently is given as an output
Shift Logic
The Gear_state state block decides which gear to shift to using the UP and DOWN decision arrows.
The decision is done by the selection_state state block. Using the ComputeThreshold Simulink function it calculates the values of up_th and down_th which decide whether the gear state should be up or down.
Threshold Function
In image processing, thresholding is used to segment images by setting pixels above a certain intensity threshold to white and those below to black.
Threshold functions have a wide range of applications, including signal processing, image analysis, machine learning, decision-making systems, and more.
Electric Motor control Unit
Electric Motor Control Unit is a vital component in modern electric motor-driven systems, enabling precise control, efficient operation, and integration with various applications.
Brake Control Unit
The brake torque is calculated analytically and multiplying it with the brake signal, the magnitude of the brake torque which is required is generated.
The above three signals are connected to a bus, which is transferred to the powertrain block
Powertrain Model
Every component of the system that converts power into movement is included in the power train block
Engine
The max and min torque curves act as upper and lower bounds for the engine torque signal which is given to the 2D look up table of fuel consumption. The look up table gives the fuel flow rate and the integrator gives the total fuel consumed until that point.
Electric Motor
Electric motors operate based on the interaction between magnetic fields and electric currents. When an electric current flows through a conductor placed within a magnetic field, a force is exerted on the conductor, causing it to move. This movement is harnessed to generate mechanical motion.
Crank hub
A crank hub is a key component in internal combustion engines that connects the crankshaft to various engine components, enabling proper timing, synchronization, and power transmission
Transmission
The engine torque, transmission speed and the clutch lock up signal go into the torque converter.
The gear output signals are sent to the transmission gear ratio look up table.
The gear ratio is then multiplied with the transmission torque and transmission efficiency to get the transmission output torque.
The gear ratio is also multiplied with the transmission speed to get the transmission output speed.
Torque Converter
A torque converter is a hydraulic device used in automatic transmissions to transmit engine power to the wheels while providing smooth and efficient power transfer. Its ability to allow for automatic gear changes and ease of use makes it a key component in many vehicles with automatic transmissions.
Differential
The wheel speed is multiplied by the differential ratio to get the output speed
Transmission torque is further multiplied or divided by the differential efficiency depending on whether the torque is positive or negative respectively.
The output is the axle torque.
Wheels
The brake torque is subtracted from the axle torque to get the net torque, which is then divided by the wheel radius to get the tractive force.
The velocity is divided by the wheel radius to get wheel speed.
Vehicle Dynamics
The dynamic equation for calculating the road load is

This equation is represented using the various mathematical blocks, which after integrating gives us the velocity
Estimates Storage System model
The input to the subsystem is the Electric Power.
The outputs are the SOC and the power.
Subsystem ESS
The pack current is calculated by dividing the power by the voltage.
The SOC estimation subsystem is used to calculate the SOC which is used as input to the terminal voltage subsystem.
The battery voltage multiplied by the pack current gives the power.
SOC estimation
The pack current is integrated to get current in coulomb which is then divided by 3600 to get current in Ampere-hour.
This is divided by the max ampere hour capacity to get the current soc.
This after subtracting from the initial battery soc will give us the SOC value.
Terminal voltage
The pack current is divided by the no of parallel modules in the battery packs as the current in parallel is divided while the voltage remains the same. This gives us the current in one cell.
This current is connected to the control port of the switch block. The other two blocks are connected to the charging and discharging resistance look up tables. The criteria being, if the current is greater than zero than cell is discharging otherwise the cell is charging.
The input to the lookup tables is the SOC. The third lookup table gives us the open circuit voltage.
The switch block decides the internal resistance of the cell (R). This is multiplied by the current to get (IR). This when subtracted from the open circuit voltage gives us the battery pack voltage.
This battery pack voltage is divided but the no of modules in series to get the terminal voltage.
Post-Processing Script
Results
Are displayed in pictures