Project-1: Modelling an electric Car with Li-ion battery
Components of an EV -
- EVs have no need for the fuel engine and gear transmission, the two of the most crucial components for internal combustion vehicles.
- An electric powered car has three primary components - Battery, motor controller, and the electric motor.

(1) Battery : The battery of an electric car can be charged through the use of ordinary grid electricity at a specialized power station. But aside from the conventional lithium-ion battery technologies, there are also other major battery technologies which can be used for electric cars.
- Lithium-Ion Batteries : This battery technology gives extra performance and range. However, it also carries the highest price tag. Lithium-ion batteries are lighter than Lead acid and Nickel metal. These are also the batteries used in digital cameras and smartphones.
- Lead Acid Batteries : This battery technology is the most popular. It is also the cheapest among the battery technologies. What’s good about it is it’s 97% recyclable.
- Nickel Metal Hydride Batteries : This battery technology provides higher output and better performance but it costs much more than lead-acid batteries.
(2) Motor Controller : The motor controller of an electric car administers its complete operation and the distribution of its power at any given moment. It acts as a floodgate between the motor and batteries. It helps monitor and regulates all key performance indications such as the vehicle’s operator, motor, battery, and accelerator pedal. It has a microprocessor which can limit or redirect current. It is used to either improve the mechanical performance of the car or suit the operator’s driving style. There are also more refined controllers which are capable of greater accuracy and thus, higher efficiency.
(3) Electric Motor : Unlike a gasoline engine with lots of moving parts, a motor only has one moving part. This makes it a very reliable source of motive power. Choosing an electric motor depends on the car’s system voltage. They can be structured to use either AC or DC current. AC motors are less expensive and lighter compared to DC motors. They are also more common and they tend to suffer from less mechanical wear and tear. However, AC technology requires a more refined or sophisticated motor controller.
PROCEDURE :
(1) Vehicle Body Subsystem :
- The vehicle is assumed to be a front axle driven (4 wheels - 2 on each axle).
- The wheels are modelled using simple Tire (Magic formula) simulink blocks.

- The N port of the tire corresponds to the Normal Reaction acting on it.
The A port corresponds to the Mechanical Rotational conserving port for the wheel axle. Thus both the wheels on the same axle should form a connection through their respective A ports.
Connection H corresponds to the Mechanical Translational conserving port for the wheel hub through which the thrust developed by the tire is applied to the vehicle. Thus, all the 4 wheels form a connection through their respective H ports and this is in turn connected to the translational hub of the vehicle body.
The connection S represents the output port for slip of the tire.
- The tires are parameterized by Peak longitudinal force and corresponding slip.
- The other block parameters such as - rated vertical load, peak longitudinal force at rated load and slip at peak force at rated load - are kept with their default values.
- The tire radius is given as 0.3 m.
- The tire inertia is kept as 1 kg-m^2. Also, the rolling resistance is given with a constant coefficient of 0.015.

- This 2 axle (4 wheel) assebly is now connected to a Velocity Body simscape block.
- This block basically represents a two-axle vehicle body in longitudinal motion. The block accounts for -
body mass,
aerodynamic drag,
road incline,
weight distribution between axles due to acceleration
road profile. - Here, the connection H is the mechanical translational conserving port hub.
NF & NR correspond to the output ports for nomral reaction forces on front axle and rear axle wheels respectively.
Connection V represents the actual output translational velocity of the vehicle.
beta is the road inclination angle & W corresponds to the headwind speed (headwind - direction opposite to that of vehicle). - The gross weight is given to be 1200 kg.
- The geometric parameters of the vehicle are given as -

- To account for proper drag force on the vehicle, the related parameters are kept as -

(2) DC Motor :

- Simulink provides an inbuilt bodel block for DC motor which converts electrical input into mechanical rotational output.
- Here, the motor field type is kept as Permanent magnet and the model parameterization is done by rated load and speed.
The armature inductance and the mechanical parameters are given their default values.
All the other parameters are changed as shown below -

- The connection R represents the Rotor (rotational output) while the connection C is for the Casing (stationary). Thus, the R port is connected to the input of the vehicle subsystem created earlier. The C port is connected to a mechanical rotational reference.
- The + and - terminals of the motor are connected to the motor controller. If these terminals are directly connected to a battery, the required DC motor will run on the rated capacity of the battery. This will eventually result into no control over the DC motor and the vehicle will run at top speed throughout the simulation.
Thus, a motor controller is very much needed.
(3) Motor Controller :
- H-Bridge circuit -

- 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 enabled 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.
- Connection REF is for the reference input. This combined with the PWM connected will form the pulse input for the H-Bridge.
Here, the REF input is connected to the Electrical Reference (ground). - Connection REV corresponds to the reverse motion of the motor which essentially means, the backward motion of the vehicle.
Here, the backward motion of the vehicle is not accounted for and so, the port is connected to the electrical reference. - Connection BRK is for the braking of the vehicle.
- Since, the PWM mode results in a huge amount of simulation time, Averaged mode is selected for this simulation.
- Load current characteristics are considered to be smoothed here.
- Also, the regenerative braking is anabled for the simulation. This means, when the vehicle starts decelerating, corresponding amount of charge will be fed back to the battery.
Accordingly, the BRK input is connected to a Controlled Voltage Source. This will generate emf corresponding to the intensity of brakes applied and fed the power back to the battery.
- The Input Threshold parameters are left with their default values.

- The Output Voltage Amplitude of the H-Bridge circuit is given the same value as the rated DC supply voltage of the DC motor.

- Simulink provides an inbuilt Controlled PWM Voltage block. This block is used for providing the proper pulse inputs to the H-Brdige circuit.

The PWM & REF connections are for the corresponding ports on the H-Bridge circuit.
The 2 reference inputs correspond to the throttle inputs given by the driver. The block generates corresponding pulse width as per the accelerations and brakes apllied by the driver himself. - Here, the PWM frequency is 1000 Hz. Also, the simulation mode is Averaged as that in the H-Bridge circuit.
PID Controller:

PARAMETER

Saturation Block:

Parameters:
Acceleration:

Deceleration:

This block helps to limit the output signal from pid controller and separate deceleration and acceleration values.
The output from these blocks is sent to a transfer function then these are provided to motor controller block.
Motor Controller Subsystem:

- Controlled Voltage Source:
-
The Controlled Voltage Source block represents an ideal voltage source that is powerful enough to maintain the specified voltage at its output regardless of the current flowing through the source.
-
The output voltage is V = Vs, where Vs is the numerical value presented at the physical signal port.
-
- Controlled PWM Voltage:
- The Controlled PWM Voltage block represents a pulse-width modulated (PWM) voltage source. The block has two modeling variants,
-
Electrical input ports — The block calculates the duty cycle based on the reference voltage across its ref+ and ref- ports. This modeling variant is the default.
-
PS input — Specify the duty cycle value directly by using an input physical signal port.
-
For the Electrical input ports variant of the block, the demanded duty cycle is
100∗Vref−VminVmax−Vmin%100∗Vref−VminVmax−Vmin %
where:
-
Vref is the reference voltage across the ref+ and ref- ports.
-
Vmin is the minimum reference voltage.
-
Vmax is the maximum reference voltage.

- H-Bridge:
-
This block is used to change the polarity of the voltage applied across the DC motor so as to run the motor in forward and reverse direction as per the input command.
-


- DC motor:
- To convert the electrical energy to mechanical energy we use motors. In this electric vehicle model, we have used DC motor. This motor can act as a generator also in case of regenerative braking.

- Li-ion battery:

- The Battery block implements a generic dynamic model that represents most popular types of rechargeable batteries.

- Vehicle Body:
- The Vehicle Body block represents a two-axle vehicle body in longitudinal motion. The vehicle can have the same or a different number of wheels on each axle. For example, two wheels on the front axle and one wheel on the rear axle. The vehicle wheels are assumed identical in size. The vehicle can also have a center of gravity (CG) that is at or below the plane of travel.
- The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile. Optionally include pitch and suspension dynamics. The vehicle does not move vertically relative to the ground.
- The block has an option to include an externally-defined mass and an externally-defined inertia. The mass, inertia, and center of gravity of the vehicle body can vary over the course of simulation in response to system changes.

Simulation :
- The system is ran for simulation for 2474 s which is the total time for which the input drive cycle is defined.
- A Solver Configuration is added to ensure proper solving of the mathematical equations by the model.


CONCLUSION : The model was succesfully ran for simulation under the standard FTP75 drive cycle. The results have been properly analyzed.
Also, learnt quite a lot of interesting things like -
- how to model an EV and carry out a real time simulation
- how a motor controller works and what role it plays in the control of the electric motor
- how to calculate the SOC of the battery
- different powertrain blocks provided by simulink which can be used to simulate a vehicle model.
-