Final Project: Design of an Electric Vehicle
DESIGN OF AN ELECTRIC VEHICLE
Aim:
Create a MATLAB model of electric car which uses a battery and a DC motor. Choose suitable blocks from Powertrain block set. Prepare a report about electric vehicle model.
Objectives:
- System level configurations
- Model parameters
- Results
- Conclusion
Software Used:
- MATLAB R2019a
Block Diagram:
There are several components and a vast network of connecting wires in the electric vehicle. In the case of an electric vehicle, the conventional IC engine is replaced by the motor. The working fuel that is the battery pack is supplied to the motor. The below block diagram will show significant components of the Electric Vehicle system.

Fig.1.1 Block Diagram Simple electric vehicle
The key components of electric vehicles are the motor, vehicle body, controller, and battery pack. There are several types of motors used in Electric Vehicles. BLDC motors, Brushed DC motors, and AC Induction Motors are commonly used electric motors. The vehicle body includes a gearbox, and tires. Earlier, we used the battery just to start the engine. But now we are using the battery as a working power. Combinations of cells will create a module, and many modules will form a battery pack together. The motor needs a power supply from the battery to perform operations. Suppose we connect the battery pack directly to the motor. In that case, the motor will run at a rated speed, and speed control is not possible. We can control the speed of the motor with the aid of the controller. The controller will operate by taking input from the driver.
Components of Electric vehicle System:
The main components of the electric vehicle system are,
- Battery
- Power Converters
- DC Motor/generator
- Motor Controller
- Vehicle Body
- Tyres and wheel
- Transmission System
Components of the Electric vehicle System:
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.
Nickel cadmium batteries: Nickel-cadmium battery is a source for DC voltage. Due to its properties and advantages, it is taking over lead acid -based batteries and gaining popularity in recent times. It is small, compact, easily travelled from one place to another. General uses of this battery are toys, calculators, small DC motors.
2.Power Converters:
The main dc-dc converter changes dc power from an on-board 200-800V high voltage battery into lower dc voltages (48V or 12V) to power headlights, interior lights, wiper and window motors, fans, pumps and many other systems within electric vehicles (EV) and hybrid electric vehicles (HEV). This high voltage to low voltage (HV-LV) dc-dc converter is often referred to as an auxiliary dc-dc, or Auxiliary Power Module (APM). Isolation is critical for separating the control systems from high-voltage domains.
3.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.
4.Electric Motor/Generator:
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.
System Level Configurations & Model Parameters:
- Vehicle Body Subsystem:
First, I've developed a vehicle body subsystem. I have included tires, gearbox, and vehicle body blocks from the Simscape library in the vehicle body subsystem. We can change the block parameters as per our requirements. Connect tires, differential, gearbox, and vehicle body blocks to each other to make the first subsystem.

Fig.1.2 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.

Fig.1.3 Tire Block Parameters
- 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.

Fig.1.4 Tire Parameters
These 2 axles (4 wheel) assembly 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 normal 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,

Fig.1.5 Vehicle Body Parameters
- To account for proper drag force on the vehicle, the related parameters are kept as,

Fig.1.6 Drag – Vehicle body Parameters
- The pitch dynamics for the vehicle are not considered for this simulation.
- The input for this subsystem is taken as the Rotational speedof the motor. This input is fed to the front axle through a Simple Gear representing the Final Drive Ratio of
- Here, the rotational direction of the output shaft is kept the same as that of the input shaft. Also, no meshing losses are considered for the simulation.

Fig.1.7 Simple gear parameters
2. Motor Circuit and Controller Subsystem:
The motor will take controlled power from the battery and convert electrical energy to mechanical energy. The mechanical energy produced is supplied to the gearbox and mechanical rotational frame. To make the subsystem, I have added the motor circuit and controller block from the Simscape library. I have used a simple DC motor, and to control the DC motor, I have used an H-bridge controller. With the help of an H-bridge controller, I can apply acceleration, deceleration, and breaking. To control the PMW wave, I have added a controlled PWM voltage block. We can change the block parameters as per our requirements.
The below diagram will show connections between each block to make a subsystem.
Motor Circuit and Controller Subsystem:
The motor will take controlled power from the battery and convert electrical energy to mechanical energy. The mechanical energy produced is supplied to the gearbox and mechanical rotational frame. To make the subsystem, I have added the motor circuit and controller block from the Simscape library. I have used a simple DC motor, and to control the DC motor, I have used an H-bridge controller. With the help of an H-bridge controller, I can apply acceleration, deceleration, and breaking. To control the PMW wave, I have added a controlled PWM voltage block. We can change the block parameters as per our requirements.
The below diagram will show connections between each block to make a subsystem.

Fig.1.8 Motor circuit and controller subsystem
Dc motor:
- Simulink provides an inbuilt model block for DC motor which converts electrical input into mechanical rotational output.
Here, the blue colour corresponds to the electrical side of the motor and the green colour corresponds to the mechanical side. - 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,


Fig.1.9 DC Motor block parameters
- 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.
Motor controller:
- It 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 enabled 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.



Fig.1.10 PWM H-Bridge block parameters
Controlled PWM Voltage:
- Simulink provides an inbuilt Controlled PWM Voltage This block is used for providing the proper pulse inputs to the H-Bridge 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 applied by the driver himself.
- Here, the PWM frequency is 1000 Hz. 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. Accordingly, the output voltage amplitude becomes 5V. - The H-Bridge circuit along with the PWM input, together form the motor controller circuit.



Fig.1.11 Controlled PWM Voltage Parameters
Driver Input Subsystem:
Longitudinal driver block from the powertrain block library produces normalized acceleration and braking commands based on reference and feedback speeds. Reference velocity will be given by the built-in drive cycle or we can generate our own signal by using the signal builder block. Feedback speed will be taken from actual vehicle speed. Based on the difference between the reference signal and the actual speed error will be generated. The error produced will result in acceleration or deceleration so that the vehicle's actual speed will try to match the reference speed.
I used the Longitudinal block and Multiport switch and drive cycle source and signal builder block to create the Drive Input Subsystem. The diagram below shows the connection between the blocks.

Fig.1.12 Driver input subsystem
Longitudinal Driver:
- Longitudinal Driver is an inbuilt block provided by the powertrain block set.
- It is a parametric longitudinal speed tracking controller for generating normalized Acceleration and Braking commands based on 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 feedback 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.
- Infogives the output for the bus signal for different block calculations like difference in reference vehicle speed and vehicle speed, etc.
- AccelCmd & DecelCmdcorrespond to the acceleration and deceleration commands generated respectively and are connected to the corresponding ports of the Controlled PWM Voltage block.
- Here, the selected control type is PI. Accordingly, the block implements proportional-integral (PI) control with tracking windup and feed-forward gains.

Fig.1.13 Longitudinal driver block parameters
Reference velocity (Drive Cycle source):
- The Drive Cycle Source block is used to provide the reference speed for the simulation.
- It generates a standard or user-specified longitudinal drive cycle.
- Here, the selected drive cycle is the standard Artemis motorway 150 kmph.
- This drive source and signal builder block connected to multiport switch. Then, switch signal through the longitudinal driver input.

Fig.1.14 Drive Cycle source Parameters
The plot of the drive cycle is shown below,

Fig.1.15 Velocity vs time plot for artemis motorway drive cycle
Battery Pack Subsystem:
The battery pack will provide power to the motor. Calculation of State of Charge (SOC) would give us information about how much we can drive before recharging and how much time we can use an existing battery. I have used a simple battery to check the SOC percentage, current. Battery charging and discharging we can examine with the help of SOC. The below diagram will show connections between each block to make a subsystem.

Fig.1.16 Battery pack subsystem
Battery Pack:
- To model the Battery, pack a simple Battery block is used. This is because, if the generic battery 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 dynamics are disabled.
- The Battery Nominal Voltage is given as 400V.
The Ampere-hour rating is assumed to be 50.
The rest all parameters are left with their default values.

Fig.1.17 Battery pack parameters
- To ensure the battery supplies current as per the requirements of the motor controller and not the rated current, a Current Sensor& 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 w.r.t. 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., 50 Ah. - Finally, the remaining charge is now converted into percentage value of the charging capacity of the battery.

Fig.1.18 State of charge estimate blocks
Overall Model:
Add scope and display block to examine outputs and behaviour of the Electric Vehicle model. With the help of the drive cycle source, I have created a reference signal. The reference signal and actual speed on the same graph will explain how the feedback loop is working. We can also calculate the average speed of the electric vehicle. With the SOC graph's help, we can analyse battery charging and discharge during deacceleration and acceleration command, respectively.
The below diagram will show the overall Electric Model that I have used to examine the vehicle's SOC percentage and average velocity.

Fig.1.19 Overall Electric vehicle Simulink model
Simulation:
- The system is running for simulation for Artemis motorway 135kmph runs 1068 secs 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
- Scopes are connected to analyse different outputs such as the SOC of the battery, the reference velocity & the actual velocity of the vehicle and the distance covered by the vehicle during the total run.
- The 2 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 Speed:

Fig.1.20 Plot for Reference speed vs actual speed
- As can be seen from the above picture, the actual velocity of the vehicle differs from the reference drive cycle velocity.
- This is because, the chosen battery capacity and motors are not able to propel the speed up to the required extent.
- If a battery of 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 small decelerations, the vehicle actually is accelerating with decreasing magnitudes. Reason being the same.
2.Vehicle Distance Covered:

Fig.1.21 Vehicle Distance
- It may be noted that, since, the reference velocity of the drive cycle never becomes negative (i.e., there is no backward motion of the vehicle), the distance is increasing throughout.
- The total distance covered by the vehicle is about 44.74 km.
3.Battery State of charge:

Fig.1.22 Battery state of charge (%)
- The State-of-Charge of the battery at the end of simulation run is nearly about 87.69 %.
- This means that the battery is not completely drained at the end and the vehicle can run on the same drive cycle for a few more times before the battery SOC becomes 0.
- Also, the thing to be noted here is, since we had enabled the regenerative braking for the simulation, the battery SOC increases slightly whenever the vehicle undergoes heavy deceleration.
- Again, this depends upon the generating tendency of the motor and the maximum amount of current that the battery can take.
Conclusion:
We have examined the SOC percentage and speed graph and distance covered. The SOC percentage graph indicates that the battery is discharged when there is an acceleration command. The battery is charged when there is a deceleration command. The Speed graph shows that the actual speed tries to meet the reference speed by considering feedback. The artemis motorway 135kmph model shows that the electric vehicle has travelled approximately 45 kilometres in 1068 seconds.
References:
- Power Converter for an Electric Vehicle (bradley.edu)
- https://matlabhelper.com/blog/simulink/electric-vehicle-simulation-in-simulink/
- https://www.youtube.com/watch?v=tM9Akdo8QeA
- https://www.youtube.com/watch?v=xmdUFEfiAKk