Modelling of an Electric Car with Li-ion Battery.
AIM : Modelling of an Electric Car with Li-ion Battery.
INTRODUCTION :

Electric vehicle is a vehicle, which uses one or more electric motors for propulsion. Depending on the type of the vehicle motion may be provided by rotary motor or by linear motor (in tracked vehicle). The electricity stored in battery powered by electric motor & battery can be charged by plugging it in grid, like our phone. According to the degree of electricity used, electric vehicle is divided into 3 categories –BEV, PHEV & HEV.
Battery Electric Vehicles (BEV) –
BEVs are fully electric vehicles with rechargeable batteries with no engine. It stores power in battery pack & this power is used to run the vehicle & other peripherals. BEVs are charged by electricity from external source. BEVs don’t emit any hazardous emissions. Some most famous examples of this types of cars are – BMW i3, Tesla Model 3, Kia Soul, Toyota Rav4 etc.
Plug-In Hybrid Electric Vehicles (PHEV) –
These types of vehicles are propelled by motor as well as gasoline engine. Battery is charged with regenerative braking & it can be charged with external source. PHEVs can go from 10-40 miles before assistance of engine. Examples of PHEVs – Chevy Volt, Audi A3 E-Tron, BMW i8, Toyota Prius etc.
Hybrid Electric Vehicle (HEVs) –
HEVs are powered with both gasoline & electricity. Battery can be charged with regenerative power only. Motor supplies power from starting, engine takes care of high speed & heavy load. Controller is used to ensure best economy. HEVs are – Honda Civic Hybrid, Toyota Prius Hybrid, Toyota Camry Hybrid.
OBJECTIVES :
- Create a MATLAB model of electric car which uses lithium ion battery and suitable motor. Choose suitable blocks from Simscape or Powertrain block set.
- Implement the vehicle speed control using PI controller and generate brake and accelerator commands. Avoid using readymade driver block for speed control.
Prepare a report about your model including following :
- Objectives
- System level configurations
- Model parameters
- Results
- Conclusion
STUDY :
MATLAB Model of Electric Car which uses Li-ion Battery and Suitable Motor :

Electric Vehicle model Explanation -
- The electric vehicle model is represented by using MATLAB/Simulink. This model is a complete representation of an electric vehicle which is built using Powertrain Blockset.
- This model has vehicle dynamics & electrical system; the vehicle dynamics contains subsystem relates to the vehicle body & tires whereas the electrical system contains a subsystem related to motor & battery pack.
- This subsystem contains various other components which we will understand further.
PROCEDURE :
Vehicle Dynamics Subsystem Model –

- The vehicle dynamics is nothing but the study of the vehicle in motion & how the vehicle behaves in motion.
The vehicle Dynamics consist of 2 main subsystems which are –

1. Wheels & Brakes –
2. Vehicle Body –
1. Wheels & Brakes –
- The wheels used in this vehicle are longitudinal wheels which have brakes of disk type.
- Disk brakes have great stopping power and cause less wear & tear & provide precise braking. This block implements the longitudinal behaviour of the actual wheels.
- This vehicle is rear wheeled drive hence the axle torque is connected to the rear of the wheels & the axle of the front wheel is grounded.

- The longitudinal forces of the tires are set to magic formula constant. The magic formula is a separate form of a characteristic function of stiffness, shape, peak & curvature (BCDE).
Magic formula is given as (F = f (k, F ) = F Dsin (Ctan-1[{B -E [B – tan -1(B )]}]) - The brake input command for the front & rear wheels are connected commonly as one input port. Omega is the angular velocity of the wheels in the y-axis; hence this form is considered as torque input to the wheels.
Parameters for wheels –
- Wheels Inertia = 0.8 Kg*m
- Wheels Radius = 0.3 m.
- Tire pressure = 220000
- Brake Pad Radius = 0.117 m.
2. Vehicle Body –
- In this model Vehicle Body (1DOF) longitudinal block is implemented. This block helps us to determine the vehicle inertia & drag load.
- There are mainly 2 forces that are acting on the axle of the wheels which are longitudinal forces & normal forces. These forces act on the rear & front of the wheels, the longitudinal forces on the rear & front is given by (FwF, FwR).
- Whereas the normal forces are given by (FzF, FzR). This force is connected to the respective axle of the wheels.

- The vehicle body consists of Grade & Wind input ports which can be used to simulate Slope & Wind Drag but this port is been grounded to minimize the complexity of the model.
- The X-Dot output port is a longitudinal force in the x-axis which acts as the velocity/speed of the vehicle in m/s.

Torque Differential Subsystem Model –
- The torque differential block is connected between the motor shaft & axle of the wheels. The block consists of an open differential block & a torsional compliance.
- The open differential block is basically a set of Planetary gear systems. it matches the drive shaft gear to the crown gear& couple the transmission driveshaft to the wheel axle.
- The block uses a coordinate system that produces a positive tire & wheel motion.

- Input for the open differential drive shaft torque which accepts input from the motor drive shaft & axle torque which are connected to the axle of the wheels.
- On the other side torsional compliance is basically a spring damper which is a shaft that connect between the open differential & axle wheels.

Electrical Subsystem Model –

- The electrical system is the most important system in the whole drive cycle.
The electrical system is subdivided by –

1. Motor (Induction Motor) –
2. Battery (Lithium-Ion Battery) –
1. Induction Motor and Controller –
- This vehicle uses a three-phase induction motor as the main driving source. The Induction Motor also called as a synchronous motor.
- It is an AC motor that works on the principle of electromagnetic induction most of the electric car use IM as their man drive because as they offer high power torrque density and speed range and compact size.

- Induction Motor performance in field weakening constant power region but IM has low speed performance efficiency, heat loss which lead to low power factor and efficiency.
- Hence to control the speed and torque of the motor we need to use an IM controller. The IM controller blocks implemented a torque based field oriented controller with an outer speed loop control.


- The controller also implemets equation for speed control, torque determination regular some basic formula that the blocks implements are To calculate speed, frequency and poles formula required to calculate losses losses in the motor -
`eta_(sync) =120`f/p `Stator Copper Losses`
`eta_(sync) = Synchronous Speed` `P_(sc)-3I^2R_s`
F = frequency `Rotor Copper Losses`
P = Poles `P_(RC)=3I^2Rr`
Required Mechanical Power -
Motor Slip Calculation `P_(mech = P_(RC)(1-`S/S)
`S = (eta_(sync)-eta_m)eta_(sync)*100`
`eta_m = Mechanical Shaft Speed`
To Calculate Torque and Speed -
`T = P/omega_m`
T = Torque(N/m)
P = Power in KW
`omega_m` rad/min
- The corresponding phases (A,B) is connected to the motor controller the speed of the motor is constantly regulated by its controller closed loop speed control (SpdFdk port).
- The vehicle speed in(m/s) is converted to motor speed in (rad) by the help of unit conversion and signal specification block.
- Taking a product of motor speed and acceleration a torque command is genereted. The lookup table takes input as vehspd in rad which is then scaled by accelerator command and the product of two is implemented as a torque command.
Torque Command Data -



- The resultant motor torque signal is obtained from the bus selector.
2. Battery (Lithium-Ion Battery) –
- The Battery is the energy source of any system the battery used in the system is a Datasheet battery which implements a model for the lithium-ion battery.
- The question arise that why most of the EV uses lithium-ion cells as a source, like any other battery because battery like a lead acid battery which required constant maintenance and monitoring, hydrogen cells which are quite bulky and expensive also capacitor banks are used as a battery pack but they have a high discharge rate and drain quickly.

- Hence the Lithium-Ion Battery eliminates all such disadvantages and requires fewer maintenaince and operational cost are less.
- Longevity - The average lithium-ion battery life span for large capacity is mre than 8 years. Safety-reduce the risk of accidents by eliminating exposures to flammable fuels able to withstand even in the high temperature without explosions.
- Environment Impact - Lithium-Ion Battery provide significaant environmental benefits over fossil fuels. With the steady increase in the electric vehicle, we can see an immediate impact on the reduction in carbon emission. Hence knowing all such advantages of lithium-ion manufacturers prefer using lithium cells as their main source of energy.
- The battery pack is packed with 30 numbers of cells in series and 2 numbers of cells in parallel each.
- The Battery rated capacity is 100 Ah and rateed voltage is 12 volt the battery provides 1200kwh considering its charging / discharging.

- Charging of battery : If the applied current is 10 amperes, then it would be 100Ah/10A = 10 hrs. approximately.
- Discharging : Battery Ah X Battery Volt/ Applied load say, 100Ah X 12V/100 watts = 12 hrs. (With 40% loss at the max = 12 x 40/ 100 = 4.8 hrs). The Backup will last up to 4.8 hrs.
Formula to calculate SOC = SOC(t) = SOC(t-1)+`intI(/C_(Bat.dt)`
Where SOC(t) = State of charge at time t
SOC(t-1) = Initial state of charge
I = charge/discharge current(A)
T = time(H)
- The BattCurr and the BattVolt are connected to the motor controller respectively, the batt SOC can be determined by the bus selector SOC is scaled to 100 by using a gain block.
Driver Subsystem Model –

- The Driver block is basically a controller for the vehicle, it controls the acceleration, and braking of the vehivle. The block is implemented with a PID controller which is basically the main controller in the whole drive cycle.
- The PID controller works as colsed loop speed control, it takes the input as a reference speed and correct the erroe genereted by the vehicle speeds.

- PID conroller is tuned for the adequate acceleration and deacceleration command itis done by limiting its output to upper and lower saturation. Separting the output of the PID to accelerate and deacceleration command we use a saturation block for each command, for acc command we use an upper saturation value and for the deaccelerate command, we use a lower saturation value.
- Tuning is Proportional, derivative and integral values we should be able to track the reference speed. The below table gives us an idea for the manual tuning of the controller.

Results -

Drive Cycle (FTP75) :

Output Plots :
Vehicle Speed Plot :

MtrTrq Plot :

PwrLoss Plot :

BattCurr Plot :

MtrSpd Plot :

BattSoc Plot :

BattVolt Plot :

- The simulation was run for about 2500 sec and we have obtaoned result shown above. There are 6 individual graphs showing the result for motor nd the bateery in this result, we see that a max torque was obtained.
- The graph of the battery SOC shows a linear and a slow discharge rate, we alwo observe a peak of charging spik as a cause by the regeneretive braking of the vehicle.
- The Result for the Vehicle speed and reference speed is shown belowWe can see that the vehicle speed tracks the reference speeds Artemis Motorway thanks to the PID controller, the manual tuning of the PID controller help to track the reference speeds.
CONCLUSION :
- We Create a MATLAB model of electric car which uses lithium ion battery with suitable motor.
- By using suitable blocks from Simscape or Powertrain block set and we Implement the vehicle speed control using PI controller and generate brake and accelerator commands.
- we have seen System level configurations, Model parameters, the model run as per our reference input given with less error in it due to pid controller.