Project 2
Answer-
MATLAB Iniliazing Code-
The simulink model of conventional vehicle-
- 'Project1_InitFile.m' is a Matlab script used to load all the variables required for running the Simulink model and for post-processing. The drive cycle selection is also done here. Before running the Simulink vehicle model, run this initialization script.
- In this project, a typical midsize car with a 1.9L engine and a 4-speed automatic transmission is considered`
- Data is taken from ADVISOR data base developed by NREL, USA. Transmission shift map and controller is taken from Matlab/Simulink example database.
- The model developed has the capability to simulate the vehicle on different drive cycles like-
| 1 | UDDS |
| 2 | HWFET |
| 3 | FTP |
| 4 | US06 |
| 5 | NEDC |
| 6 | WLTP |
- The Simulink model for the Hybrid Vehicle model is created using 3 main subblocks for the driver model, control model and powertrain block.
- The simulink model consist of three main subsystem are Driver, controller, powertrain as shown in figure.
- The Driver subsystem generates the accelerator and brake pedal outputs to match the desired and actual vehicle speed.
- The controller block repersents the electrinic control units, which genarates the desired engine torque, desired transmission gear, desired motor torque and desired brake torque based on the driver inputs.
- The powertrain subsystem represents the actual vehicle consisting of all vehicle components which inputs the control signal from controller and provides actual vehicle motion charecteristics.

Driver Model-

- Driver Model is a basic PI controller that generates accelerator and brake pedal outputs to match the desired and actual vehicle speeds. And PI controller is a feedback control loop that calculates an error signal by taking the difference between the output of a system.
- It multiplies the error with constant gain for P nd I it integrates and them multiply with a smaller gain. The constant value for P and I are found by trial and error method. Here the error is the difference between the desired vehicle speed and the actual vehicle speed.
- The PI controller controls the error between the required drive cycle and actual vehicle speed by providing acceleration and brake pedal output to the controller.
- 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.
- The saturation block extracts the positive and positive and negative signal as the acceleration pedal is passed on between the values 0 and 100 while for the brake pedal, the values between 100 and 0 are extracted.
- The comparative block compares the actual time and end time of drive cycle, similarly the current velocity is compared with the end velocity.
Controller Block-

- The output of the driver block which is the acceleration and brake pedal signal is passed on to the controller block. The controller block consist of four control unit are Engine control unit, Transmission control unit, EM control unit and Brake control unit.
- All these data from the four control unit goes to the bus creator. The bus creator is used to combine all these three signals to a one signal.
- This combined signal is then sent to the powertrain block.
- The ‘Controller’ block is the brains 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.
- These inputs are fed to the ‘Powertrain’ block which represents the drivetrain of the vehicle.
- The controller consists of an engine control unit, a transmission control unit and a brake control unit.
State Flow Chart (Mode Selection) for Controller-
- In this chart created four conditions as stop, start, drive and regeneration braking.
- The initial block represent the stop condition, means the engine is OFF and engine and motor throttle conditions are zero.
- The second block represent start condition, means 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.

Engine Control Unit-

- Engine Control Unit Compare engine speed with the maximum torque and minimum torque curves of the lookup table and give the required torque command to the engine block.
- The throttle input is combined with the idle speed throttle and gains with the torque output from the lookup table to estimate the torque input required for the engine.
- Throttle input, idle throttle and their sum can be scoped from this block..
- used engine control unit in that give input engine speed through creating lookup table in that table we give input Maximum torque and map speed then also create 2nd lookup table in that give input ct torque and map speed then it substracts and multiplied.
- The engine speed also give to ideal control speed to integrate from this we meet output of engine required torque.
Idle Speed Controller-

- The idle speed controller is a PI controller where the engine speed and the idle speed of the engine is compared.
- The error is then multiplied with constant P and the integrated error is multiplied with constant 1.
Transmission Control Unit-
- Created steady flow variable state for controlling of gears of vehicle as in ascenging and descending order with respect to time, speed, distance and give input to this steady state is vehicle speed in m/s to mph.
- 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

Shift Logic-

EM Control Unit-

- The most general configuration is that the ICE and EM are connected by an automatically controlled clutch.
- For the EM driving in low speeds, the clutch between the ICE and the EM is open and only the EM runs the vehicle.
- In high speeds, this clutch is closed and the ICE is started and propelled the vehicle while the EM is stopped off.
Brake Control Unit-

- The Brake Control Unit (computer) detects the inputs, and then checks the wheel speed sensors to determine vehicle speed, and to determine if a wheel lockup requires the ABS algorithm.
- The Brake Control System then checks the yaw sensor, steering wheel angle, and state of charge of the traction battery.
- The Brake pedal signal from the driver block is multiplied with the maximum friction, which gives the maximum braking torque. The gain block is used convert to actual value from the percentage.
Powertrain-

- This 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.
Battery Unit-

ESS Block-

- I has SOC and TERMINAL VOLTAGE where first we calculate SOC and that SOC use to calculate terminal voltage.
(soc= state of charge)
Terminal Voltage Block-

- Providing the input value in 1d lookup table for open curcuit voltage, internal resistance discharge , internal resistance charge and parall num module.
- Used 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-

- Firstly integrating the value of pack current which is in coulomb and with gain block we multiply it to convert into ahm-hr
- SOC = initial state of charge - used state of charge
- Used state of charge=pack current in amp-hr/maximum battery capicity (in ahm-hr)
- This values are been saturated with upper limit 1 and lower limit 0
- Why this ( because we have given the maximum value in ESS SOC start from 0 end to 1)
Crank Hub-

Engine Block-
- 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.

Electric Machine Block-
- In this block it get the engine speed as the input and it goes to the torque convertor.
- 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.

Transmission Block-
- In this model we take engine torque, gear selector from controller 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. In it basically engine dynamics and that is decoupled.

Torque Converter-
- The engine block is connected to the automatic transmission via a torque converter. The output of the transmission is connected to the differential.
- The gear selection from the transmission control unit is multiplied by the engine torque in this block, and the efficiency and engine dynamics of the torque converter are applied in this model.

Differential Block-

- The transmission output torque is multiplied by the differential ratio and differential efficiency in this block and the torque is transmitted to the wheel as the axle torque.
- 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.
- The required parameters are transferred between the other subsystem and the command window using the goto and to workspace blocks.
Wheels Block-

- 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.
- 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.
Vehicle Dynamic-
- Tractive Force and Road loads are used to calculate the vehicle velocity-

Where
ρ a - Air Density
A f - Frontal Ares
C d - Drag Coefficient
C r - Rolling Coefficient
M - Mass of Vehicle
g - Acceleration due to gravity
θ - Slope
- The longitudinal dynamics of the vehicle along with the road load is represented in the ‘Vehicle Dynamics’ block-

- 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.
MATLAB Processing Program-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
For the study of the developed vehicle model with various drive cycle, the program to plot the following gien as below-
- The time trace for engine, transmission input and output speed on one plot.
- The engine torque, engine power, fuel rate and fuel consumption using subplots.
- The accelerator and brake pedal, gear command, vehicle desired and acutual speed, vehicle distance using subplots.
- The engine operating points on the engine fuel map.
- The motor speed, torque, motor input power using subplot.
- The pack voltage, current and SOC using subplot.
- The motor operating ponits on the motor input power map.
Various Speed Plot (Transmission input, Transmission output and wheel speed)-
For UDDS Drive Cycle-

For HWFET Drive Cycle-

Plot for Time Vs (Torque, Power, Engine fuel rate, and fuel consumption)-
For UDDS Drive Cycle-

For HWFET Drive Cycle-

Plot for Time Vs (brake pedal, gear command, vehicle speed, vehicle distance)-
- The drive cycle velocity for HWFET is more in the higer range than the UDDS.
- The power requirement is directly proportional to the power of three for the aerodynamic drag and directly proportional to the rolling and grading resistance.
- Since, the proportion of higher velocity is more predominant in HWFET the vehicle requires more power to run HWFET than UDDS which means that, the fuel consumption of UDDS is less than HWFET even through the drive cycle time is more for UDDS.
For UDDS Drive Cycle-

For HWFET Drive Cycle-

Plot for Engine Fuel map and Operating Points-
For UDDS Drive Cycle-

For HWFET Drive Cycle-

Plot for motor speed, torque, motor input power-
- This plots for the motor speed and the torque. this 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.
For UDDS Drive Cycle-

For HWFET Drive Cycle-

Plot for pack voltage, current and SoC-
For UDDS Drive Cycle-

For HWFET Drive Cycle-

Plot for motor operating points on the motor input power map-
For UDDS Drive Cycle-

For HWFET Drive Cycle-

- The engine operating points are plotted on the fuel map and the operating point is under the maximum torque curve.
Project-02:- Fuel economy numbers (kmpl) for P1 Hybrid Vehicle Model-
For UDDS Drive Cycle-

For HWFET Drive Cycle-

Project-01:- Fuel economy numbers (kmpl) for Conventional Vehicle Model
for UDDS-


for HWFET-


CONCLUSION-
- Hence, the forward energy-based fuel consumption model of a P1 hybrid vehicle has been successfully Simulated using MATLAB and Simulink.
- Analyses and understands vehicle operating points based on engine speed, torque, transmission speed, pedal positions, gear, and distance travelled.
- Post process calculations were performed and the required graphs were successfully plotted.
- Successfully calculated vehicle fuel efficiency numbers (kmpl) for the given city cycle (UDDS) and highway cycle (HWFET).