Project-1: Modelling an electric Car with Li-ion battery
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.
(Note- The simulink model file should be compulsorily attached)
All-electric vehicles (EVs) run on electricity only. They are propelled by one or more electric motors powered by rechargeable battery packs. EVs have several advantages over conventional vehicles:
- Energy efficient. EVs convert over 77% of the electrical energy from the grid to power at the wheels. Conventional gasoline vehicles only convert about 12%–30% of the energy stored in gasoline to power at the wheels.
- Environmentally friendly. EVs emit no tailpipe pollutants, although the power plant producing the electricity may emit them. Electricity from nuclear-, hydro-, solar-, or wind-powered plants causes no air pollutants.
- Performance benefits. Electric motors provide quiet, smooth operation and stronger acceleration and require less maintenance than internal combustion engines (ICEs).
- Reduced energy dependence. Electricity is a domestic energy source.
In this simulation we are designing a electric vehicle which are having following specifications: -
Total weight = 1500kg
Frontal area = 2.34m^s
Drag coefficient=0.24
PM DC motor= 120 kw
Rated DC supply= 300v
Battery:-
Lithium ion battery :-
Nominal voltage=300v
Rated capacity=50 ah
The Simulink model for the electric vehicle is as follows:-

As we can see in the above model that 3 different types of signals are been attached to the model for simulating in different driving conditions and along with it a signal builder block is been used where it provides the reference signals to the PID which acts as a controller instead of a ready made longitudinal block for fine tuning of the signals so that the response will get better and stable this signals are then been sent through the controlled current and voltage block to the PWM and H-bridge blocks .
A battery subsystem is been constructed by lithium ion cell. The motor is connected to the differential of the rikshaw at the rear wheel and in this way the model is constructed out.
Vehicle Subsystem :-

The MATLAB model is been created for the simulation of an electric vehicle , by assuming certain parameters and conditions while designing the model.
While developing this simulation the first of all frame of the vehicle is been modelled assuming the general parameters such as weight of the vehicle , frontal area , aerodynamic drag , rolling resistance for tires , air density etc. for this the VEHICLE BODY block is been used ,the graphical representation of block is as shown below-

Connection H is the mechanical translational conserving port associated with the horizontal motion of the vehicle body.
Connections V, NF, and NR are physical signal output ports for vehicle velocity and front and rear normal wheel forces, respectively.
Connections W and beta are physical signal input ports corresponding to headwind speed and road inclination angle, respectively.
The mass of the vehicle = 1500 kg
No. of wheel axle per =2
Horizontal distance from CG to front axle= 1.4m
Horizontal distance from CG to rear axle= 1.6m
CG height above ground= 0.5m
Gravitational acceleration= 9.81 m/s
Drag:-
Frontal area:2.34 m^2
Drag coefficient:0.24
Air density:1.18 kg/m^3
The parameters for vehicle body block are as follows-

The 4 tyres are been connected to the chassis , for this the Tire (magic formula) block is been used.

The block looks as shown above it consists of 4 ports:-
Connection A is the mechanical rotational conserving port for the wheel axle.
Connection H is the mechanical translational conserving port for the wheel hub through which the thrust developed by the tire is applied to the vehicle.
Connection N is a physical signal input port that applies the normal force acting on the tire. The force is considered positive if it acts downwards.
Connection S is a physical signal output port that reports the tire slip.
In this way 3 tire are been used one for the front wheel and two for the back wheel.
The parameters of the block are as follows:-
Rated vertical load: 4000N
Peak longitudinal force at rated load: 3500N
Slip at peak force at rated load (percent): 10
Geometry :-
Rolling radius: 0.32m
Dynamics:-
Compliance: No compliance - Suitable for HIL simulation
Inertia: No inertia
Advanced :-
Velocity threshold:0.1 m/s
Simple gear box:-

Connections B (base) and F (follower) are mechanical rotational conserving ports.
Inertia block:-

Block parameters :-

For calculation of the velocity , we have created , the block basically consists of PS-simulink converter , gain and zero order hold.

Gain block :- 1.61
Zero order hold :- 0.01
Battery Subsystem :-


The lithium ion battery pack is been selected.
Parameters:-
Nominal voltage(V)- 300
Rated capacity (Ah)- 50
Initial state of charge(%)-100
Battery response time(s)- 30
Discharge:-
Max capacity(Ah)-50
Cut off voltage (V)-300
Fully charged voltage(V)-400
Nominal discharge current(A)-100
Internal resistance (Ohms)-2
Capacity (Ah) at nominal voltage-4.8835
Exponential zone [Voltage (V), Capacity (Ah)]- [330 150]
Discharge current [i1, i2, i3,...] (A)- [6.5 13 32.5]
The discharge rate plot will be as follow-

Controlled current source :-
The controlled current source block converts the Simulink signal into equivalent current signal which is the connected to the battery . the AC or DC supply can be selected in the block.
The current direction is been showed by the direction of arrow. The positive terminal of controlled current source is connected to the negative of the battery and negative is connected to the positive of the battery.
Battery :-
The battery parameters are set as mention above.
Bus selector block :-
The bus selector allows us to take the output from the battery to check the parameters of the battery like current , voltage , SOC , etc.
PowerGui block :-
PowerGui block allows us to select between different method to solve the model.
SOC subsystem :-

The soc subsystem consists of following blocks :-
- Rate transition
- Gain
- Discrete time integration
Rate transition Block :-
This block is used to transmit data from output of one block operating at one rate to the input of other block operating at different rate.

Gain Block :-
The gain block multiples the input to a certain fixed level.
Here the gain given is = 1/(300/3600) , here 300 is the battery ampere and 3600 is the seconds.
Discrete Time Integration:-
The Discrete Time Integration block is used for:-
- Define initial conditions on the block dialog box or as input to the block
- Define an input gain (K) value
- Output the block state
- Define upper and lower limits on the integral
- Reset the state with an additional reset input

Sum block :-
In this negative terminal of sum block will be connected to Discrete Time Integration and positive to the constant block.
H-Bridge , PWM and Longitudinal Driver Block &DC Motor Subsystem :-

The DC motor with temperature sensor is as follows:-
The subsystem consists of following blocks:-
- DC Motor
- Ideal Rotational Motion sensor
- PS-Simulink converter
The parameters of DC Motor block are as follows:-

Parameters :-
Field type: Permanent magnet
Model parameterization: By rated load and speed
No-load speed: 8000 rpm
Armature inductance: 12e-6 H
Rated speed (at rated load): 6000 rpm
Rated load (mechanical power): 120kw
Rated DC supply voltage: 300 V
Rotor damping parameterization: By no load current
Mechanical Parameters :-
Rotor inertia: 0.01 g*cm^2
Rotor damping: 0 N*m/(rad/s)
Initial rotor speed: 0 rpm
Temperature dependence :-
Resistance temperature coefficient: 93e-3 1/K
Measurement temperature: 25 degC
Ideal rotational motion sensor:-
This block measures angular velocity or angle in a mechanical rotational network. The sensor is ideal since it does not account for inertia, friction, delays, energy consumption, and so on.
The connection of PWM and H-Bridge are as follows:-

Parameters of PWM block:-




This block creates a Pulse-Width Modulated (PWM) voltage across the PWM and REF ports. The output voltage is zero when the pulse is low, and is equal to the Output voltage amplitude parameter when high. Duty cycle is set by the input value. Right-click the block and select Simscape->Block choices to switch between electrical +ref/-ref ports and PS input u to specify the input value.
At time zero, the pulse is initialized as high unless the duty cycle is set to zero or the Pulse delay time is greater than zero.
The Simulation mode can be set to PWM or Averaged. In PWM mode, the output is a PWM signal. In Averaged mode, the output is constant with value equal to the averaged PWM signal.
H-Bridge parameters :-

This block represents an H-bridge motor drive. The block can be driven by the Controlled PWM Voltage block in PWM or Averaged mode. In PWM mode, the motor is powered if the PWM port voltage is above the Enable threshold voltage. In Averaged mode, the PWM port voltage divided by the PWM signal amplitude parameter defines the ratio of the on-time to the PWM period.


Bridge parameters :-
Output voltage amplitude: 300 v
Total bridge on resistance:0.1 ohm
Freewheeling diode on resistance: 0.05 ohm
Measurement temperature: 298.15k
Temperature dependence:-
Total bridge on resistance at second measurement temperature: 0.1 ohm
Freewheeling diode on resistance at second measurement temperature: 0.05 ohm
Second measurement temperature: 398.15 k
Thermal Port :-
Thermal mass: 100 J/k
Initial temperature: 298.15 k
Controlled Voltage Source :-
The block represents an ideal voltage source that is powerful enough to maintain the specified voltage at its output regardless of the current passing through it.
Solver configuration :-
Defines solver settings to use for simulation.

PID Subsystem :-
Instead of a ready made longitudinal block here the PID Block is been used to tune the results , the PID tunning is been done to get the proper output which will track the reference signals.
The PID subsystem is as follows:-

In this subsystem along with PID block the transfer function and abs blocks are also been used which will help in tunning the response of the controller.
After tunning of the PID block the signals are been given to the PWM and H-bridge block with the help of controlled voltage source block.
The PID is been tunned 3-4 times to get the perfect results , all the trials are been mentioned in this report along with there results-
PID block tunning which gave the perfect results are :-


Energy Consumption calculation Subsystem :-


Velocity in m/sec to km/hr conversion and velocity to distance calculation:-

|
Trial 1 |
Trial 2 |
Trial 3 |
|
|
PID set parameters value |
![]() |
![]() |
![]() |
|
Robustness |
![]() |
![]() |
![]() |
|
Tarcking of reference speed |
![]() |
![]() |
![]() |
|
Motor and Controller temperature @ end of test. |
Motor temperature – 740 degC Controller temperature – 75000 k |
Motor temperature – 740 degC Controller temperature – 72000 k |
Motor temperature – 380 degC Controller temperature – 22000 k |
|
SOC |
SOC – 0.67 |
SOC – 0.67 |
SOC – 0.67 |
|
Energy consumption |
In KWhr- 2.12 |
In KWhr- 1.91 |
In KWhr- 1.59 |
Many trials are been done to tune the PID to the perfect setting , amoung those 3 trials are been discussed above :-
trial No-3 results in detail:-
actual speed scope results:-

Motor and controller temperature scope:-

SOC:-

Conclusion :-
From this its clear that the third trial is the best one tunned and all the parameters are achieved proper , the racking of the reference is good as compared to the other 2 trials and even the motor and controller temperature are very low as compared to the 1 & 2 trial. And also the energy consumption is very low in third trial , so the trial no.3 is the best one tunned for the PID.














