Final Project: Design of an Electric Vehicle
Final project:- Desgn of an Electric Vehicle
AIM:-Create a MATLAB model of electric car which uses a battery and a DC motor.
Objectives:
1. System level configurations
2. Model parameters
3. Results
4. Conclusion
Electric Vehicle:-
The term electric motor/generator is used instead of alternator, electric motor and starter. In principle, any electric motor can also be used as an alternator. When the electric motor/generator is driven mechanically, it supplies electrical energy as an alternator.
When the electric motor/generator is supplied with an electric motor, it works as a drive. Electric motors/generators used for propulsion are water-cooled. Air cooling would also be possible but complex due to space and the amount of heat generated.
In full hybrid vehicles (HEV), the electric motor/generator also functions as the starter for the combustion engine.An electric vehicle (EV) is defined as a vehicle that uses an electric motor or a traction motor for propulsion as opposed to an internal combustion (IC) engine used by conventional vehicles. Electric vehicles use electricity for power instead of fossil fuels as conventional vehicles would and because of this difference, electric vehicles do not produce any exhaust gases or pollution. The power needed for the operation of an EV can come from a variety of sources such as batteries, generators, or through a collector system. Batteries fitted in to the body of an EV are capable of high energy densities in order for them to meet the power demands and range requirements. Generators are machines which generate electrical energy from an input of mechanical work and are a part of the electric motor, and they operate during braking to produce the phenomenon of 'regenerative braking'.
Several pairs of permanent magnets are located on the rotor in this synchronous motor. Since the three coils are supplied sequentially with a current, together they generate a rotating electrical field that causes the rotor to rotate when the electric motor/generator is used to drive the vehicle.
A compromise between IC engine vehicles and EVs exists as Hybrid Electric Vehicles (HEVs). HEVs combine an IC engine with an electric propulsion system to produce a 'hybrid' between the two different classes of vehicles. The purpose of this is to use the power available form the electric powertrain to improve the fuel economy of the vehicle so that it does not rely solely on the petrol/diesel it uses as fuel. This in turn will also improve the overall performance of the HEV. The IC engine can be used to power the electric motor to charge the battery or use directly in the electric drive motor with a combination of a motor and generator in one. HEVs also implement regenerative braking to recharge their batteries among other features used in EVs. Compared to EVs, HEVs represent more of the automotive market with a 19% market share on all automobiles in the world. This is because HEVs still run on fossil fuels which is still more convenient as a fuel source in most parts of the world. The all time best selling HEV to date is the Toyota Prius.
Components
The main components of an EV are:
- batteries
- power converters
- motor controllers
- motor/generator
- transmission system
- wheels/tires
1. System level configurations:-
To model an EV in SIMULINK, we will need to model the aforementioned components separately and then have them work together. All the main components are available in the library of SIMULINK blocks and we will be adding each component and configuring its parameters to fit the requirements of the model. First, I have modelled the vehicle main body.
Vehicle Body:-
This block contains 6 ports which can be used to model the various aspects of the vehicle body. The ports are mentioned and elaborated below:
- H - This stands for 'Hub' and is used to connect the hubs of the wheels to the main body of the vehicle.
- V - This is a physical signal output port which stands for 'Velocity' and is used to output the speed/velocity at which the vehicle is moving at.
- W - This is a physical signal input port and allows us to model a 'headwind' acting on the vehicle by giving a speed for it.
- NR - This is a physical signal output port to model the rear wheel normal forces.
- NF - This is a physical signal output to model the front wheel normal forces.
- beta - This is a physical signal input port and allows us to model the vehicle on an inclination angle to create the effect of a hill climbing force.
Tire:-
The tires used in this EV model are the 'magic formula' tires. There are several tire blocks that can be used for modelling a vehicle but I have used the magic formula ones because it allows us to model the longitudinal behavior of vehicle tires on highways. They also allow us to model extra effects such as tire inertia, stiffness which allow for greater accuracy of real world conditions. The magic formula tire block is shown below.
We can see that it has 4 ports and they are:
- N - This port stands for 'Normal' and is the physical signal input port for the normal force acting on the tire and is considered positive in the downwards direction.
- S - This port stands for 'Slip' and is the physical signal output port is that reports the slip acting on the tire.
- A - This port stands for 'Axle' and is the mechanical rotational conserving port for the wheel axle.
- H - This port stands for 'Hub' and is the mechanical translational conserving port for the wheel hub through which the thrust developed by the tires is applied to the vehicle body.
Geometry:-
The image below shows the parameters of the tire geometry. There is only one parameter that can be modified and it is the rolling radius and has been set to a nominal value of 0.46m.
Rolling Resistance
Here, we can model the rolling resistance parameters on the tires and I have chosen to switch ON the rolling resistance force on the tires. Also, I have selected a constant coefficient of rolling resistance of 0.015 and a velocity threshold of 1/e^−3 .
RearSlip:-
The 'S' port on the LR and LF tires are modelled with a certain degree of slip using a small subsystem. This subsystem uses a PS - Simulink converter which will be used again later on for other systems in this EV model. The slip subsystem used for the 'magic formula' tires is shown in the image below.
Gear
Next, we will model the transmission system of the EV. I have decided to use a 'Simple Gear' block so as to simplify the transmission system parameters. This block models a gear system with a fixed gear ratio with no inertia effects, however we can modify the effects of the meshing of the gear teeth. The simple gear block is shown below:
Side Shaft
An inertia block has been added to the workspace to provide an ideal mechanical rotational inertia for the simple gear block. This block has only one mechanical rotational conserving port and the positive direction of the block is from the port to the reference point which would be the simple gear in this case. The inertia torque acts in the positive direction is the inertia is accelerated in the positive direction.
Wind and Slope
As mentioned earlier, the velocity block allows us to model the effects of wind resistance and road inclination through the 'W' and 'beta' ports respectively. In my model, I have used a 'PS - Constant' block to model the parameters of wind and road inclination on the vehicle's motion. For the wind effect, I have given a constant signal of 5m/s and this acts in the opposite direction to the direction of motion i.e.. headwind. For the road inclination, I have given a constant signal of 0.
Velocity Subsystem:=
The velocity port which outputs the velocity signal of the vehicle body block has been modified. By default, the velocity signal that is output from the vehicle body block is measured in miles per hour. To change these units, I have implemented a small subsystem from the output of the velocity port. This subsystem uses the following blocks:
- PS - Simulink converter - this block will convert the physical signal of velocity to a logic signal.
- Gain - This block uses a multiplication factor of 1.6 to convert the miles per hour units to kilometres per hour.
- Zero - Order Hold - This block is used implement a zero order hold sample period.
Vehicle Body Subsystem:-
The normal ports of each tire are connected to the appropriate NR and NF ports on the vehicle body block. The hubs of each tire are connected together and an extra connection is made from them to the vehicle body block. The 'S' ports of the LR and LF tires have been modelled with a slip using a small subsystem. The simple gear and inertia blocks are connected to the axle port of the tires. The wind velocity and road incline are provided with constant physical signals of 5m/s and 0 degrees respectively. The velocity port has been connected to the velocity subsystem and the connection from the subsystem is open to the 'v' port. The base port of the simple gear has been left open to the 'R' port to take in a rotational signal.
Power Converter:-
The power converter is needed to provide power of the correct form and magnitude from one component to another. In the case of EVs, a power converter is needed to provide a DC voltage from the battery of the EV to the DC motor so that it can operate properly with the required parameters. As mentioned earlier, I have used an H-Bridge motor drive as my power converter.
The H Bridge has 2 sides to it: the left side is for the controlling of the voltage signals and the right side is for the terminals to provide the controlled voltage to the DC motor. The left side ports of the H-Bridge block are:
PWM - This stands for Pulse Width Modulation which will provide the voltage pulses to the H-Bridge either in the PWM or average mode.
- REF - This stands for Reference.
- REV - This stands for Reverse.
- BRK - This stands for Brake.
The main parameters are for the simulation mode and load assumptions of the H-Bridge. I have selected the H-Bridge to run on an internal power supply with an averaged simulation mode instead of the PWM mode. This is because using the PWM mode will result in significantly longer simulation times compared to using the averaged mode. I have enabled the regenerative braking mode and set the load current.
Controlled Voltage Source:-
The input ports of the controlled PWM voltage block are still unconnected and that is because they require a controlled voltage source to provide the voltages to produce the voltage pulses to be fed in to the H-Bridge. For this, I have used the controlled voltage source block. This block is useful because it will provide the necessary voltage that is powerful enough to maintain the voltage at the output regardless of the current that passes through it.
Longitudinal Driver
The longitudinal driver block is used for giving normalized acceleration and deceleration commands to a controller based on 2 sets of data. The first data set is the reference velocity and the second data set is the feedback velocity
- VelRef - This stands for the reference velocity and it is the velocity data provided from a drive cycle source.
- VelFdbk - This stands for the feedback velocity and it is the velocity data provided from the vehicle body's velocity port which outputs the velocity data.
- Grade - This port provides a grade or inclination angle for the surface on which the vehicle is travelling in degrees.
- Info - This port is for the bus signals which consist of block calculations e.g. acceleration/deceleration command, difference between reference and vehicle speed.
- AccelCmd - This port provides the acceleration command to a controlled voltage source.
- DecelCmd - This port provides the deceleration command to another controlled voltage source.
Drive Cycle
A drive cycle is a data set that contains velocity and time data for the purpose of modelling the motion of a vehicle. The drive cycle will be a plot of the velocity against the time and it is made to resemble typical driving conditions that a consumer may experience themselves in. For instance, they can model highway driving situations, driving in urban areas, or driving with full power etc. Drive cycles are used by automotive companies for various testing procedures such as mileage, pollution tests, and acceleration and top speed tests. There are various different drive cycles that are industry standard e.g. Urban Dynamometer Driving Schedule (UDDS), FTP 75.
In my EV model, a drive cycle is used as the reference velocity data for the longitudinal driver block to send acceleration or deceleration commands according to the drive cycle. There are 3 ways of implementing a drive cycle. One method is to create or own drive cycle with a spreadsheet of velocity data in one column and time data in another column. Another method is to use a signal builder block and create signals that represent the velocities at which the vehicle should travel and the durations for which those velocities are to be maintained. The last method is to use the industry standard drive cycles which are in - built in to the SIMULINK library. In my case, I have used an industry standard 'WOT' drive cycle. This drive cycle stands for 'Wide Open Throttle' and it models the situation where the vehicle is made to accelerate at full power and maintained at a particular speed and made to decelerate back to rest.
Battery System:-
Battery pack designs for electric vehicles (EVs) are complex and vary widely by manufacturer and specific application. However, they all incorporate a combination of several simple mechanical and electrical component systems which perform the basic required functions of the pack.
The actual battery cells can have different chemistry, physical shapes, and sizes as preferred by various pack manufacturers. Battery packs will always incorporate many discrete cells connected in series and parallel to achieve the total voltage and current requirements of the pack. Battery packs for all electric drive EVs can contain several hundred individual cells. Each cell has a nominal voltage of 3-4 volts depending on its chemical composition.

Current Sensor
The current sensor block represents an ideal current sensor and is used to convert the current measured in an electrical circuit to a physical signal that is proportional to the current. This block is used to measure the current between the battery circuit (controlled current source) and the DC motor.The positive and negative terminals represent the terminals across which the current sensor is inserted in to the circuit. The third port outputs the physical signal and in my model, it will send the signal to the controlled current source.


SOC & Current
SOC stands for state of charge and it is a measurement of the available charge in a battery. When a battery is fully charged, it is considered to have a 100% charge and conversely 0% charge if fully discharged. In this EV model, I want to measure the current and the SOC of the battery as the simulation is run. For this, I have used a scope block which shows the output signal we wish to measure as a plot against time. 2 scopes have been used, one for the current and the other for the SOC. In order for this to be measured, we need to use a 'PS - Simulink converter' block. This is because the current signal is a physical one and we are measuring it as a logic signal in the SIMULINK workspace.
SOC Subsystem
To measure the state of charge of the battery, a subsystem was created of various blocks. The first block is the 'Rate Transition' block and it is used to handle data transfer between different rates and tasks. Next, a 'Gain' block is used in order to multiply or divide the signal coming from the rate transition block. In this case, the gain block will divide the current signal with the ampere rating of the battery which has been taken as 80Ah multiplied by 3600 (seconds in an hour).
These blocks are then made in to a subsystem called 'SOC Estimate' and linked with the battery circuit using the PS-Simulink converter block. A scope block is used at the junction of the PS-Simulink converter block to plot the output signal of the current from the battery. Another scope is used to plot the output signal of the SOC from the SOC subsystem. This is shown in the image below:

Speed Measurement
In order to measure the speed of the EV model, I needed to use the scope block once again. I modified the scope block to have 2 input ports where one port takes the output velocity signal from the vehicle subsystem block and the other port takes the output signal from the drive cycle to the reference velocity port on the longitudinal driver block. This has been done so that the scope can show us the plots of the reference velocity and the actual velocity of the vehicle to see how they compare with each other.
Distance Measurement
I have used the scope block and mathematical operator blocks to measure the distance travelled by the vehicle according to the drive cycle data. The area under a velocity time graph tells us the distance travelled by an object and so in my model. This means that the integral of the velocity with respect to time, gives us the distance travelled. So, I have implemented the integrator block to integrate the velocity signal that is output from the vehicle subsystem.

Results:-
Speed scope1:-From this scope, we can see 2 signals. The blue signal represents the reference signal which originates from the drive cycle data whereas the yellow signal shows the actual velocity of the vehicle. The WOT drive cycle had been customized so that the vehicle begins acceleration under the WOT condition (i.e.. full power) at t = 5 seconds. This is supposed to be maintained till t = 20 seconds when the vehicle is supposed to begin deceleration. From t = 20 seconds to t = 30 seconds, the vehicle speed is back to 0m/s i.e.. rest. Because this is a reference signal, all the commands are instantaneous. This is why the increase and decrease in speed is very sudden within a fraction of a second. However, this effect will not be observed on the actual velocity of the vehicle. This is because in real world conditions, there are more considerations to factor in which will not make it possible for a vehicle to accelerate and decelerate as instantaneously as the drive cycle commanded. In the real world, the effects of rolling resistance, drag and road inclination make a difference because their presence would cause the vehicle's motion to deviate from the drive cycle commands. Other factors include, the vehicle's inertia and the inertia of the transmission system.

current scope;-The current scope shows how the current flowing from the battery to the motor varies with the drive cycle time. As we can see, initially the current flowing through the circuit is 0A and this corresponds to the drive cycle commanding the vehicle to be at rest for this time period. At t = 5 seconds, when the vehicle is commanded to accelerate, the current instantaneously increases to a maximum current of 235.8A. This maximum current is achieved because at t = 5 seconds, the vehicle accelerates at maximum power under the WOT condition and so this will demand a high current from the battery. From t = 5 seconds to t = 17.5 seconds, the current decreases gradually to 134.3A. The current must have decreased over time because as the vehicle was accelerating, it required lesser current from the battery to continue accelerating. The highest current is always required when accelerating from rest due to the inertia of the vehicle. But once the vehicle is already in motion, it requires significantly lesser energy to continue accelerating. From t = 17.5 seconds to t = 20 seconds, the current flowing from the battery decreases more rapidly to 85.6A. This is because at this time, the acceleration of the vehicle began to level off meaning that the increase in speed in those 2.5 seconds was lesser than the increase from t = 5 seconds to t = 17.5 seconds.

SOC scpoe3:-
The SOC scope shows how the state of charge of the battery varies over the drive cycle time. The battery was modelled to begin with an SOC of 1 (100%) and so when the simulation begins, the SOC is at 1 until t = 5 seconds. This is because the drive cycle commands the vehicle to be at rest for that duration and so no discharge occurs from the battery. At t = 5 seconds, the vehicle is commanded to accelerate under the WOT condition and so the SOC of the battery decreases. Because the vehicle is accelerating at full power, the SOC falls from 1 but the rate of discharge decreases over the acceleration period eventually settling at a minimum SOC of 0.9914 at t = 20 seconds. This corresponds to the current flow from the battery because as the vehicle accelerates, lesser energy is demanded to increase the speed. As mentioned before, the greatest discharge occurs when the greatest current flows from the battery and this is during the initial acceleration period. As the vehicle speed increases, the acceleration decreases causing the current and hence the rate of discharge to decrease but in a mild fashion. At t= 20 seconds, the vehicle is commanded to decelerate and so the vehicle velocity decreases. This results in regenerative braking to occur which causes a negative flow of current back to the battery. Because this effect charges the battery, the SOC of the battery increases during the deceleration period. The SOC increases very gently from 0.9914 to 0.9935 and this is because the gets charges by the regenerative braking effect. The negative flow of current corresponds to the increase in the SOC of the battery. Since the vehicle is commanded to decelerate until t = 30 seconds, the vehicle speed decreases but does not reach 0m/s, so the vehicle is under regenerative braking for the entire period after t = 20 seconds.

Conclusion:-
I had observed that the SOC of the battery used in my EV model did not get discharged in a way I had expected it to. This could be because the drive cycle commands did not push the EV model to its limits or it could be due to the fact that the battery model was very efficient and was suitable for the driving application. My EV model had also included some actual features of EVs such as regenerative braking and this was evident in the current - time and SOC - time graphs whenever the EV decelerated. If the duration of the WOT drive cycle was modified to be longer, I could have seen my EV model exhibit its true performance characteristics. For instance, the EV model may achieve its top speed and it may also have been possible to see the time it takes for the vehicle to decelerate from that top speed and hence the time taken for the acceleration e.g. 0 to 60 kmph.The discrepancy between the reference velocity and actual velocity of the vehicle may be attributed to a variety of factors e.g. vehicle inertia, transmission system, transmission inertia. If the EV model was designed in such a way as to improve upon those factors, the model would follow the reference signals more closely and would improve the performance characteristics as well. The distance travelled by my EV model was measured at 0.1106km and seems to be an appropriate value based on the WOT drive cycle used.