Project 2
Aim :- To create a FC Vehicle Model using different powertrains.
Objective :- Create a vehicle model using real life concepts and formulas and load the given .mat file values into the simulink model.
Theory :-
There are several subsystem created to complete FC vehicle model.We'll look into that one by one.
1) Driver Model :-
- For the driver model we are going to provide two inputs and two outputs.
- Inputs will be the desired velocity and actual velocity.The desired velocity will be provided through the repeating sequence block in that we are going to provide variables as a input to the block.
- For the actual velocity we will connect the final output of our model as a actual velocity to the model.
- The equations that we are applied here to complete the driver model are PID Controller equations.
- PID stands for Proportional,Integral and Derivative Controller.
- It mainly used to minimize the error in the system to get the error free output which will help us to model the vehicle for real life conditions.
- Proportional Gain : In this controller the correction factor is multiplied to the error.The factor multiplied is called as proportional gain
- Eq which represents Proportional gain : `Cout = K_p.e(t) + Co`
- Integral Gain : It fixes the any residual error in the system output.
- Eq which represents Integral gain : `Cout = Kiint_0^t e(t)dt + Co`
- Derivative Gain : It work to detect the rate of change of error.This helps to point out if the error is going to increase rapidly in the near future.
- Eq which represents Derivative gain : `Cout = K_d ((de(t))/dt) + Co`
- We apply all three equations to get the error free output,output will be the Braking and Acceleration command.
- If we get the output in the negative form the it will be the braking command otherwise it will be the acceleration command.
2). Vehicle Model :-
- In the vehicle model subsystem there is only one input and output.Input will be the traction force and output will be velocity.Velocity output is the final output which we are using as a input to the driver block subsystem.
- The input for the block is traction force which will we get from electric powertrain subsystem.
- To get the actual velocity of the vehicle we need to subtract all the resistances from traction force
- There are mainly three resistances applied on the vehicle while it moving.A) Rolling Resistance B). Aerodynamic drag Resistance C). Grade resistance
- We need to calculate those resistance before providing its output to the subtract,which will then subtract all the resistances from the traction force.
- Eq which gives Rolling resistance as a output : `F_p = M*G*mu*cos(alpha)`
- Eq which gives Aerodynamic Drag resistance as a output : `F_A = 1/2 *del*A_F*Cd*V^2`
- Eq which gives Grade resistance as a output : `F_g = M*G*sin(alpha)`
- Adding these equations output using add block we will get the total resistance as a output.
- Then we will feed traction force and total resistance to the add subtract block.
3). Electric Powertrain :-
- In this subsystem there are several subsystems presented for the working of the model as per power demand of the vehicle.
- In here we have done power calculation,energy management strategies,energy storage system,tractive force calculation and FC model with required number of cells.
Electric Powertrain Subsytems,
3.a) Accelerator/Brake Subsystem:
- In this subsystem the Acceleration and brake will be the input and torque request will be the output.
- For the acceleration part we have multiplied the acceleration input and maximum torque value and for the braking part we have multiplied braking input and min torque value.
- In the breaking part we've also check for the SOC of ultracapacitor if it is less than max threshold then regenerative power will be send to the UC.
- Then we've added both product block output to get torque request.
3.b) Power Calculation Subsystem:
- In this power calculation subsystem the output of the previous subsystem will be the input which is torque request and angular velocity also input for this block.
- Angular velocity input is provided using from block which came from the vehicle model block which is output for that subsystem.
- Here we've provide two 1D look up table which contain minimum and maximum electric motor values and angular velocity will be the input for that.This gives us torque as a output.
- For the power output we added 2D look up table which contain efficiency,torque and angular velocity values of the Electric motor.
3.c) Tractive Force Subsystem:
- Here we are going to provide torque as a input to the system which will gives us traction force as a output.
- There are mathematical equations which are provided here to develop subsystem for brakes(front/rear) and wheels.
3.d) Energy Management System :
- This subsystem consist of positive power demand and negative power demand.
- The input for the system is power and it coming from the power calculation subsystem.
- Here we have use a switch blocks which can differentiate between +ve power demand and -ve power demand as we set threshold and input values for them.
- For the +ve power demand we have all three power sources together to fullfill power demand but again we have set limits for them to use them when needed and for that we have use interval test block in which we can set limit for operation.
- We've also develop the backup power subsystem block which will help us supply the power when UC and battery is unable supply power due to low charge condition.In this condition only FC can supply power to wheels.
- For the -ve power demand or regenerative power there are only two sources available UC and Battery because FC doesn't the characteristics to recharge them or to store power.
- There are also conditions for -ve power,if the Battery or UC state of charge is less than maximum threshold only then the regen power is forwarded to the particular system for storing or charging the system.
3.e) Energy Storage System :
- From the EMS we got three output,two of them will be the input for the ESS.One is UC power and another one is Battery power.
- UC power input is connected to the UC subsystem block which consist of UC SOC,UC Current,UC OCV and charge on UC subsystems.
- Every subsystem in the UC model is designed using the mathematical equations.
- UC SOC eq : `SOC = int(I*eta)/Qdt`.
- UC Charge(Q) eq : `Q= C*OCV`.
- UC OCV eq : `OCV = int(I/C)dt`.
- UC Curent(I) eq : `I = (SOC*V_max-sqrt( SOC*V_max^2-4*R*PUC*eta))/(2*R)`.
- Battery power input is connected to the Battery model,battery model consist of two subsystem current calculation and SOC calculation.
- For the current calculation of the battery model we've added 1D look up table which consist of OCV vs SOC maps or values.
- For the charge and discharge of the battery we've added 1D look table which shows SOC vs Charge/Discharge values.
- To calculate SOC of battery we've implemet one equation which calculate SOC.
- Battery SOC Cal: `SOC(t) = SOC(t-1)+(I(t/(Qn))*Deltat)`.
3.f) Fuel Cell System :
- In the FC system there are also more than one subsystem,some of them are based on equations.
- First subsystem is power control from which we get Current as a output which is further connected to the FC stack model to get the voltage output.
- In the power control subsystem we've use feedback controller subsystem which is based on PID controller.
- Second subsystem of that block is FC system which consist of compressor model and FC stack model.
- Compressor model gives compressor power as a output in KW.In the model we use 2D maps to get adiabatic compression values with respect to the pressure.
- In the FC stack model we've two subsystem Stack voltage and Air and H2 consumption.
- O2 Consumption eq: `(i*FC(lambda)*FC(N)*32e^-3)/(4*96485)`.
- H2 Consumption eq: `(i*FC(N)*2e^-3)/(2*FC(mu)*96485)`
Matlab Script TO load variables:-
% Loading all the mat files into the workspace to run the Vehicel Model Simulation
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\BATT_Data.mat')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\EM_Data')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\VEH_Data')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\US06')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\EM_new_Data')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\ENV_Data')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\FC_data')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\Regen')
load('D:\Fuel cell and ultracapacitor\4th module imp files\Vehicle Model Mat Files\UC_Data')
% To convert km/hr to meters/sec by multiplying with 0.27778
v_cyc_mps = v_cyc*0.27778;
% Stop time
Stop = length(t_cyc)
Output OF Model:-