Final Project: Design of an Electric Vehicle
Aim:
To Create a MATLAB model of an electric car in which we uses a DC motor by choosing a suitable blocks from the Powertrain block set.
Objectives:
To prepare the technical report about the EV model including
- System level configurations
- Model parameters
- Results
- Conclusion
Theory:
An electric car is powered by the electric motor instead of a petrol engine. The electric motor gets energy from the controller, which regulates the amount of powerbased on the driver’s use of an accelerator pedal. The electric car (also known as electric vehicle or EV) uses the energy stored in its rechargeable batteries, which it recharged by common household electricity.
Thus an electric vehicle will have three basic components :
- Energy Storage Unit
- Controller
- Propulsion system
The energy storage unit will have a way to store power. The controller acts as a pipeline or gateway to the electric motor. The controller acts like brains of the system.The electric motor, which is the propulsion system, converts the electric power and converts this into physical energy for movement. The whole system is a much simpler, more efficient device than the combustion engine found in most cars, enabling you to get the most mileage for your charge.

Electric Vehicle Components
Basic Main Components of Electrical Vehicle:
The basic main elements of electric cars installed in almost all types of electric cars are as follows:
Traction Battery Pack:
- The function of the battery in an electric car is to energy storage system in the form of (DC). If it gets a signal from controller, the battery will flow DC electrical energy to the inverter and then be used to drive the motor. The type of battery used is rechargeable battery that is arranged in such a way as to form what is called a traction battery pack.
- There are various types of electric car batteries. The most widely used is the type of lithium-ion batteries.
Power Inverter:
- The inverter functions to change the direct current (DC) on the battery into an alternating current (AC) this alternating current is used by an electric motor. In addition to the inverter on an electric car also has a function to change the AC current when regenerative braking to DC current and then used to recharge the battery. This type of inverter used in some electric car models is the bi-directional inverter category.
Controller:
- The main function of the controller is as a regulator of electrical energy from batteries and inverters that will be distributed to electric motors. While the controller itself gets the main input from the car pedal (which is set by the driver). This pedal setting will determine the frequency variation or voltage variation that will enter the motor, and at the same time determine the car’s speed.
Electrical Traction Motor:
- Because the controller provides electrical power from the traction battery, the electric traction motors will work turning the transmission and also to wheels. Some hybrid electric cars use a type of generator-motor that performs the functions of propulsion and regeneration.
Other Electric Car Components:
Charger
This is a battery charging device. Chargers get electricity from outside sources. AC electricity is converted into DC electricity and then stored in the battery.
There are 2 types of electric car chargers:
- On-board charger: the charger is located and installed in the car(inside the car)
- Off-board charger: the charger is not located or not installed in the car (outside the car)
Transmission :
The transmission transfers mechanical power from the electric traction motor to drive the wheels.
DC/DC Converter:
This one of electric car parts that to converts higher-voltage DC power from the traction battery pack to the lower-voltage DC power needed to run vehicle accessories and recharge the auxiliary battery.
Battery :
In an electric drive vehicle, the auxiliary battery provides electricity to power vehicle accessories.
Thermal System – Cooling :
This system maintains a proper operating temperature range of the engine, electric motor, power electronics, and other components.
Charge Port :
The charge port allows the vehicle to connect to an external power supply in order to charge the traction battery pack.
Procedure:
Vehicle Body Subsystem:
The Vehicle is assumed to be the front axle driven( 4 wheels and in 2 on each axle)
Tire
- The Tire (Magic Formula) block models a tire with longitudinal behavior given by the Magic Formula, an empirical equation based on four fitting coefficients. The block can model tire dynamics under constant or variable pavement conditions.
- The longitudinal direction of the tire is the same as its direction of motion as it rolls on pavement.
- To increase the fidelity of the tire model, you can specify properties such as tire compliance, inertia, and rolling resistance. However, these properties increase the complexity of the tire model and can slow down simulation. Consider ignoring tire compliance and inertia if simulating the model in real time or if preparing the model for hardware-in-the-loop (HIL) simulation
The wheels are modelled using simple Tire( Magical 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 four 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 four wheels form a connection through their respective H ports and thus in turn connected to the translationa; hub of the vehicle body.
The connection S represent the output port for the slip of the tire.

- The tires are parameterized by the peak longitudinal force and corresponding slip.
- The other block parameter 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.3m.
- The tire inertia is kept as 1 kg-m^2. Also the rolling resistance is given with a constant coefficient of 0.015


Velocity Body:
This 2 axle (4 wheel) assembly is now connected to a velocity Body simscape block.

This block basically represent 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 NF and Nr are said to be a normal reaction forces on the front axle and the rear wheels respectively.Connection V represent the actual output translational velocity of the vehicle.
- Beta is the road inclinational angle and W corresponds to the headwind speed (headwind-direction opposite to that of the vehice)
- The gross weight is given to be 800Kg
The geometric paramerters of the vehicle is given as

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

The pitch dynamics for the vehicle are not considered for this simulation
Signal Builder:
- The Signal Builder block allows you to create interchangeable groups of piecewise linear signal sources and use them in a model. You can quickly switch the signal groups into and out of a model to facilitate testing. In the Signal Builder window, create signals and define the output waveforms.
- Signal generate waveform for road inclination angle (Beta) and wind and we send the information to the Vehicle Body.

Simple Gear

- The Simple Gear block represents a gearbox that constrains the connected driveline axes of the base gear, B, and the follower gear, F, to corotate with a fixed ratio that you specify. You choose whether the follower axis rotates in the same or opposite direction as the base axis. If they rotate in the same direction, the angular velocity of the follower, ωF, and the angular velocity of the base, ωB, have the same sign. If they rotate in opposite directions, ωF and ωB have opposite signs.
The input for this subsystem is taken as the Rotational speed of the motor.

And here the rotational direction of the output shaft is kept as the same as the input shaft. Also, no meshing losses are considered for the simulation.
Inertia:
A concrete block which serves as a base for mechanical equipment such as fans or pumps; the block is mounted on a resilient support to reduce the transmission of vibration to the EV structure.
The complete subsystem is shown below

DC Motor:

- Simulink Provides an inbuilt model block for a DC motor which converts electrical input into mechanical rotational output.
- Note the blue colour corresponds to the electrical side of the motor and the green colour corresponds to the mechanical side
- Here thr motor field type is kept as Permanent magnet and the model parameterization is done by ratedd load and speed. The armature inductance and the mechanical parameters are given as their default values.
All the other parameters are changed as shoen in below.


- The connection R represent the Rotor while the connection C is for Casting (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 - ve terminal 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 resulta into no control over the DC motor and the vehicle will run at the top speed through out the simulation.
Motor Controller:
H-Bridge circuit:

The H-Bridge block represents an H-bridge motor driver. The block has the following two Simulation mode options:
-
PWM— The H-Bridge block output is a controlled voltage that depends on the input signal at the PWM port. If the input signal has a value greater than the Enable threshold voltage parameter value, the H-Bridge block output is on and has a value equal to the value of the Output voltage amplitude parameter. If it has a value less than the Enable threshold voltage parameter value, the block maintains the load circuit using one of the following three Freewheeling mode options:-
Via one semiconductor switch and one freewheeling diode -
Via two freewheeling diodes -
Via two semiconductor switches and one freewheeling diode
The first and third options are sometimes referred to as synchronous operation.
The signal at the REV port determines the polarity of the output. If the value of the signal at the REV port is less than the value of the Reverse threshold voltage parameter, the output has positive polarity; otherwise, it has negative polarity.
-
-
Averaged— This mode has two Load current characteristics options:-
Smoothed -
Unsmoothed or discontinuous
-
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 amplitudes parameter defines that the ratio of on time yo 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.It is Electrical Reference
- 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 the Vehicle
- 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.
- The regenerative braking is enabled for the simulation. This means when the vehicle starts decelerating corresponding amount of charge will be fed back to the battery.
- 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.

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

Controlled PWM Voltage block
Simulink provides an inbuilt Controlled PWM Voltage block. This block is used for providing the proper pulse input to the block

The Controlled PWM Voltage block represents a pulse-width modulated (PWM) voltage source.
-
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 - Vmin}/{Vmax-Vmin}`percent
where:
-
Vref is the reference voltage across the ref+ and ref- ports.
-
Vmin is the minimum reference voltage.
-
Vmax is the maximum reference voltage.
The PWM and REF connection are for the corresponding ports on the H-Bridge Circuit.The two reference inputs corresponds to the throttle inputs given by the driver.The block generates corresponding pulse width as per the acceleration and brakes applied by the driver himself.Here the PWM frquency is 4000Hz. Also the simulation mode is Averaged as that in the H-Bridge circuit.


The input Scaling Parameters given are
- 0V for 0% duty cycle and 5V for 100% duty cycle. So the output voltage amplitudes becomes 5V.
The H-Bridge circuit along with the PWM input, together form the motor controller circuit.

Longitudinal Driver:

- The Longitudinal Driver block implements a longitudinal speed-tracking controller. Based on reference and feedback velocities, the block generates normalized acceleration and braking commands that can vary from 0 through 1. You can use the block to model the dynamic response of a driver or to generate the commands necessary to track a longitudinal drive cycle.
- It is an inbuilt block provided by the Powertrain Blockset.
- It is parametric longitudinal speed tracking controller for generating normalized Acceleration and Braking commands based on the reference and feedback velocities.
- The VelRef port is the reference velocity port where the input drive cycle data is fed.
- The VelFdbk port corresponds to the feed back velocity. The actual Velocity output given by the vehicle body is connected here. By comparing the actual (feedback) velocity with the reference velocity, the driver block generates acceleration and braking signals in order to minimise the error between the two concerned velocities.
- Grade corresponds to the grade angle. For this simulation, no inclination is considered and hence a constant block with value 0 is connected.
- Info gives the output for thr bus signale for thr different block calculationa like difference in reference vehicle speed and Vehicle speed etc.,
Here the selected control type is PI .Accordingly the block implements PI control with tracking windup and feed forward gains.

Battery:

The Battery block represents a simple battery model. The block has four modeling variants,
-
Uninstrumented | No thermal port — Basic model that does not output battery charge level or simulate thermal effects. This modeling variant is the default.
-
Uninstrumented | Show thermal port — Model with exposed thermal port. This model does not measure internal charge level of the battery.
-
Instrumented | No thermal port — Model with exposed charge output port. This model does not simulate thermal effects.
-
Instrumented | Show thermal port — Model that lets you measure internal charge level of the battery and simulate thermal effects. Both the thermal port and the charge output port are exposed.
The instrumented variants have an extra physical signal port that outputs the internal state of charge. Use this functionality to change load behavior as a function of state of charge, without the complexity of building a charge state estimator.
- To model the Battery Pack a simple Battery block is used this is because of the generic block is used instead the simulation will run for a much longer time.
- Here the selected option for Battery charge capacity is Finite. Accordingly, the block models the battery as a series internal resistance plus a charge-dependent Voltage source.
- If the chosen option had been Infinite the Voltage source would have been constant.
- Also the self - discharging of the battery and the battery dynamica are disabled.
- The Battery Nominal Voltage is given as 300V.
- The Ampere - hour rating is assumed to be 75.
- The rest all Parameters are left with the default values.

To ensure the Battery Supplies current as per the requirements of the motor controller and not the rated current, a current sensor and controlled current source pair is connected.

Battery State of Charge:
A Small subsystem is created to calculate the State of Charge of the Battery
This subsystem takes the battery current as the input.

- The essential process to calculate the SOC is by subtracting the charge from the rated capacity of the battery.
- Accordingly the current is integrated with respect to time to get the charge in coulombs.Now this Coulomb value is modified into Ampere hours.
- This Value is now subtracted from the charging capacity of the battery i.e, 75Ah
- Finally the remaining charge is now converted into percentage value of the charging capacity of the battery.
Reference Velocity(Drive Cycle):
- The Drive cycle source block is used to provide the reference speed for the simulation.
- It generates is a standard or user-specified longitudinal drive cycle.

Here, the selected drive cycle is the standard FTP75.

The plot of the drive cycle is shown below

Model:

Simulation:
- The system can run 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 model
- The Scopes are connected to analyze different output such as the SOC of the battery, the reference velocity and the actual velocity of the vehicle and distance covered by the vehicle during the total run.
- The two velocities are first converted from m/s to Kmph values. For this, Simple Gain blocks are used.
- The distance is calculated by simply time-integration of the Vehicle Velocity.
Outputs:
Reference Speed Vs Actual Vehicle Speed:

- The above graph is the comparison between the drive cycle source Vs Vehicle speed that get it from the Vehicle body
- In this graph the Drive cycle is taken as FTP75 which it run for 2747sec based on the information it send to the Longitudinal driver it produce a command based on the drive cycle and it send to PWM and H-bridge controller and it generate Pulse based on the drive cycle. So that DC motor operate based on the drive cycle source.The DC drives the Vehicle .From their it produce actual velocity based on the input drive cycle.
- The actual velocity of the vehicle will tend to match the reference Velocity.
- This is because the chosen battery capacity and motors are not able to propel the speed upto the required extent
- If the battery is higher capacity is chosen, the actual velocity will tend to match with the reference velocity.
- Also it may be noted that in certain regions despite the drive cycle showing a small deceleration, the vehicle is accelerating with decrease in magnitude.
Distance travelled:
- It may be noted that the refrence velocity of the drive cycle never becomes neagtive, the distance is increased throughout.
- Based on the Actual Velocity that generated by vehicle based on assumption it converted into distance travelled by the Vehicle.Here the Vehicle travelled upto 6.325Km
State of Charge:
- EV System the power source is battery. The battery is used to produce power to drive a Dc motor. And it is noted that the charge of the battery started from 100% at the initial Level and during the operation of the vehicle for 2474 seconds using FTP75 Drive cycle.
- Battery got discharge nearly 5% and after the acceleration was been released the battery started recharging as the Regenertive in between while deccelerating and while braking battery started recharging because during this time duration Motor acts as a Generator and flow negative current back to battery.So that sometimes Spike starts increasing.
- Finally it depends upon the generating tendency of the motor and the maximum amount of current that the battery caan take.

Motor Speed:
- DC motor operates based on the drive cycle source in this DC motor operate when the drive cycle is operated otherwise if the DC motor stops only when the drive cycle source is Zero that type of operation is performed by the DC motor.

Conclusion:
The model was successfully run for the simulation under the standard FTP75 drive cycle .These are the result analyzed.
- How to model 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 the simulink which can be used to simulate a vehicle model.





