Project

Design of an Electric Vehicle

Project: Design of an Electric Vehicle

Aim: To create a MATLAB model of electric car which uses a battery and a DC motor. To choose suitable blocks from Powertrain block set and prepare a report about the model following the objectives mentioned below.

Objectives:

  • System level configurations
  • Model parameters
  • Results
  • Conclusion

Theory:

Electric Vehicle: Electric cars function by plugging into a charge point and taking electricity from the grid. They store the electricity in rechargeable batteries that power an electric motor, which turns the wheels. Electric cars accelerate faster than vehicles with traditional fuel engines – so they feel lighter to drive.

You can charge an electric vehicle by plugging it into a public charging station or into a home charging unit. But to get the best deal for home charging, it is important to get the right EV electricity tariff, so you can spend less money charging and save more on your bill. Each model has a different range, battery size and efficiency. The perfect electric car for you will be the one you can use for your normal journeys without having to stop and charge up halfway through [1].

Types of EVs:

here are a few different types of electric vehicle (EV). Some run purely on electricity, these are called pure electric vehicles. And some can also be run on petrol or diesel, these are called hybrid electric vehicles.

  • Plug-in electric - This means the car runs purely on electricity and get all their power when they are plugged in to charge. They don't need petrol or diesel to run so don't produce any emissions like traditional cars.
  • Plug-in hybrid - These mainly run on electricity but also have a traditional fuel engine so you can use petrol or diesel too. If you run out of charge, the car will switch to using fuel. When it is running on fuel, these cars will produce emissions but when they are running on electricity, they won't. Plug-in hybrids can be plugged in to an electricity source to recharge their battery.
  • Hybrid-electric - These run mainly on fuel like petrol or diesel but also have an electric battery too, which is recharged through regenerative breaking. These let you switch between using your fuel engine and using 'EV' mode at the touch of a button. These cars cannot be plugged in to an electricity source and rely on petrol or diesel for energy [1].

Inner Components of an EV:

EVs have 90% less moving parts that an ICE (Internal Combustion Engine) car. The breakdown of the parts that keep an EV moving:

  • Electric Motor: Provides power to rotate the wheels. It can be DC/AC type; however, AC motors are more common.
  • Inverter: Converts the electric current in the form of Direct Current (DC) into Alternating Current (AC)
  • Drivetrain: EVs have a single-speed transmission which sends power from the motor to the wheels.
  • Batteries: Store the electricity required to run an EV. The higher the kW of the battery, the higher the range.
  • Charging: Plug into an outlet or EV charging point to charge your battery [1].

Battery Capacity:

Kilowatts (kW) is a unit of power (how much energy a device needs to work). A kilowatt-hour(kWh) is a unit of energy (it shows how much energy has been used), e.g. a 100 watt lightbulb uses 0.1 kilowatts each hour. An average home consumes 3,100 kWh of energy a year. An electric car consumes an average of 2,000 kWh of energy a year [1].

When breaking in a traditional car, the kinetic energy caused usually goes to waste. However, in an electric car braking converts and stores thermal energy from brake pads and tyres' heat friction and reuses it to power the car. This is called regenerative braking.

Charging of an EV:

You can charge an electric vehicle either by plugging it into a socket or by plugging into a charging unit. There are plenty of charging stations around the UK to stay fully charged while you are out and about. There are three types of chargers:

  • Three pin plug for electric car charging: Three pin plug - a standard three-pin plug that you can connect to any 13 amp socket.
  • Socketed electric car charger: Socketed - a charge point where you can connect either a Type 1 or Type 2 cable.
  • Tethered electric car charger: Tethered - a charge point with a cable attached with either a Type 1 or Type 2 connector [1].

Time required to charge an EV:

There are three EV charging speeds:

  • Slow: typically rated up to 3kW. Often used to charge overnight or at the workplace. Charging time: 8-10 hours.
  • Fast: typically rated at either 7Kw or 22kW. Tend to be installed in car parks, supermarkets, leisure centres and houses with off-street parking. Charging time: 3-4 hours.
  • Rapid: typically rated from 43 kW. Only compatible with EVs that have rapid charging capability. Charging time: 30-60 minutes [1].

Simulink Modelling:

The electric vehicle was modelled in the Simulink environment, using the Simscape electrical, mechanical and Simulink blocks to model the vehicle. The screenshot of the model in the Simulink is as shown below.

Below shown is the list of the blocks used to model the EV vehicle and thereafter all the blocks are explained in detail further.

List of the blocks used to model the vehicle:

Sr No.

Name of the Block

Number of Blocks used

1

EV Model

1.1

Constant

2

1.2

Drive Cycle Source

1

1.3

From Spread Sheet Block

1

1.4

Multiport Switch

1

1.5

Longitudinal Driver

1

1.6

Scope

4

1.7

Battery Subsystem

1

1.8

DC Motor Subsystem

1

1.9

Vehicle Body Subsystem

1

1.10

Integrator

1

1.11

Division/Multiplication Block

1

1.12

Display

1

2

Battery

2.1

Battery Source

1

2.2

Controlled Current Source

1

2.3

Electrical Reference

1

2.4

PS-Simulink Converter

1

2.5

SOC Calculation Subsystem

1

2.5.1

Rate Transition Block

1

2.5.2

Gain

1

2.5.3

Discrete-Time Integrator

1

2.5.4

Constant

1

2.5.5

Sum

1

2.5.6

Gain

1

3

DC Motor

3.1

Controlled Voltage Source

2

3.2

Controlled PWM Voltage Block

1

3.3

H-Bridge

1

3.4

Current Sensor

1

3.5

Solver Configuration

1

3.6

DC Motor

1

3.7

Mechanical Rotational Reference

1

4

Vehicle Body

4.1

Vehicle Body Block

1

4.2

Tire (Magic Formula)

4

4.3

Simple Gear Block

1

4.4

Inertia Block

1

4.5

Velocity Conversion m/s to mph

1

4.5.1

PS-Simulink Converter

1

4.5.2

Gain

1

4.5.3

Zero-Order Hold

1

To model the electric vehicle the above listed blocks are the basic blocks that consists of the powertrain, battery, and DC motor. This model is the basic model of any electric vehicle, a much advanced modelling will be needed further on to simulate an actual vehicle. The explanation of the modelling is as carried out below.

EV Model:

Constant Block:

The constant block is connected to the multiport switch to select the modes to decide which drive cycle source to be used for the simulation. For this model FTP 75 drive cycle and a drive cycle made in an MS Excel sheet was taken into consideration for simulation

Drive Cycle Source:

FTP 75 drive cycle was considered to be simulated on this model, where the drive cycle was simulated for 2474 seconds and the output graphs were plotted for SOC, current, speed from the drive cycle and vehicle speed and acceleration given by the longitudinal driver.

From Spread Sheet:

This block take inputs of Time and Velocity values available in the external spread sheet file to input the velocity values to the DC motor to propel the vehicle. This spread sheet was made by random velocity values in m/s for 450 seconds.

Multiport Switch:

This switch acts as a selector switch to select what input has to be given further from multiple available input options. A constant block has to be connected to the top-most input port in this switch, where the connection number has to be input to select the input source. For this model two inputs were considered for simulation which were explained earlier.

Longitudinal Driver:

This block implements the longitudinal speed tracking controller. For this block the default inputs were considered for the model.

Control Type: This block implements proportional-integral (PI) control with tracking windup and feed-forward gains.

Reference and feedback unit: m/s

Connection Ports:

VelRef: This is the reference vehicle velocity which is connected to the result output speed scope it is in m/s.

VelFdbk: The vehicle velocity is connected to this port to get the feedback of the actual vehicle velocity from the vehicle body, which is further connected to the integrator.

Grade: Road grade angle is given to this connection with the help of a constant block. For this model no grade angle was considered for simulation.

Info: This is a bus signal which is an output port and is not considered for the simulation.

AccelCmd: This port is connected to the DC motor subsystem block to give acceleration command to the motor to propel the vehicle forward. This is connected to the controlled voltage source input signal with PS-Simulink converter .

DecelCmd: This port is again connected to the DC motor subsystem block to give the deceleration commands to the motor for the braking actions. This is connected to another controlled voltage source input with PS-Simulink converter, which is then connected to the BRK port of the H-bridge used in the DC motor subsystem.

Scope:

There were in total four scope blocks used to get the simulation results. One for longitudinal driver acceleration given to the vehicle, one for monitoring the state of charge (SOC) of the battery used in the vehicle, one to analyse the current passed from battery to DC motor and the last one to monitor the speed of the vehicle along with the drive cycle input.

Distance Calculation:

For distance calculation Integrator, Divide and Constant blocks were used to display the distance travelled by the vehicle.

Integrator: The output port of the vehicle body subsystem is connected to the integrator which basically gives the velocity output of the vehicle.

Divide: The output of the integrator is connected to the divide where it will be divided by the time to get the final distance output.

Time: A constant block was used to input the time. The time considered here is 3600 seconds.

Battery Subsystem:

Battery:

For this model a simple battery was used, however, some inputs were changed for the vehicle application as shown below.

In this the Finite battery charge option was selected, where the block models the battery as a series resistor and a charge-dependent voltage source. In the finite case, the voltage is a function of charge and has the following relationship:

Where,

SOC (state-of-charge): It is the ratio of current charge to rated battery capacity.

V0: It is the voltage when the battery is fully charged at no load, as defined by the Nominal voltage, Vnom parameter.

β: It is a constant that is calculated so that the battery voltage is V1 when the charge is AH1. Specify the voltage V1 and ampere-hour rating AH1 using block parameters. AH1 is the charge when the no-load (open-circuit) voltage is V1, and V1 is less than the nominal voltage.

The battery has two connections -ve and +ve. The negative terminal was connected to the electrical reference (ground) and controlled current source physical port to the positive direction that indicates the flow.

The positive terminal is also connected to the controlled current source of the electrical conserving port.

Controlled Current Source:

Controlled current source block represents an ideal current source that is powerful enough to maintain the specified current through it regardless of the voltage across the source. In this block the two ports are connected to the positive and negative ports of the battery and one conversing port is connected to PS-Simulink converter to the rate transition block for SOC calculation and the other to the scope output for current monitoring.

Electrical Reference:

This block is the electrical reference block which is the ground to any electric circuit in Simulink, this block is connected to the negative terminal of the battery in this model.

PS-Simulink Converter:

This block converts the input Physical Signal to a Simulink output signal. This block is used to get simulation outputs in the Simulink blocks such as scope and display, where physical signals are converted to the Simulink outputs.

SOC Calculation:

Rate Transition:

This block is used to handle data transfer between different rates and tasks. Where the input to this block comes from controlled current source via PS-Simulink converter, the output signal from this block is the input signal converted to the sample rate specified by the user. The block parameters are as shown below, which were kept default.

Gain:

The gain block multiplies the input with a given input specified constant value. The input can be scalar, vector or matrix.

Here the gain value input was 1/(50*3600), where 50 is battery ampere and 3600 is the number of seconds.

Discrete Time Integrator:

This 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:

This block performs addition or subtraction of the given inputs, a at the addition terminal a constant was connected and at the negative terminal discrete time integrator was connected.

Gain:

A gain block with value “100” was connected in the end in order to multiply the percentage value in decimals of SOC to get two digit battery percentage figures in the plot.

DC Motor Subsystem:

DC Motor:

The DC Motor block represents the electrical and torque characteristics of a DC motor using the following equivalent circuit model. Here in this model the positive terminal was connected to the current sensor negative terminal and negative terminal was connected to the negative terminal of the H-Bridge.

Here, R is the rotor shaft of the DC motor which is further connected to the rotor shaft of the gear box in the Vehicle body subsystem and C is the DC motor Case which is connected to the mechanical rotational reference. The configured parameters considered for the DC motor in this model is as shown below.

For this model the no-load speed was set to 11000 rpm, which is the speed of the motor when not driving a load and the rated speed was set to 10500 rpm, which is the motor speed at rated mechanical power level.

Mechanical Rotational Reference:

This block represents a mechanical rotational reference point, that is, a frame or a ground.

H-Bridge:

Block parameters:

Simulation Mode and Load Assumptions:

Power Supply: The power supply was selected to the Internal mode which is default.

Simulation mode: Averaged was selected as the time take to simulate in Averaged mode is less compared to when selected PWM mode. When selected Averaged mode this has two options: Regenerative Braking and Load current characteristics.

Regenerative Braking: was selected to be always enabled as regenerative braking is very useful to generate vehicle’s own electricity when braking or decelerating.

Load Current characteristics: Smoothed was the default option as it assumes that the current is practically continuous due to load inductance.

Input Thresholds:

Enable threshold voltage: 1.5 V, this is voltage above value of PWM at which the H-Bridge starts.

PWM signal amplitude: 5.0 V, it is the amplitude of the signal at the PWM input, which was kept as a default value.

Reverse threshold voltage: 1.5 V

Braking threshold voltage: 2.5 V

Bridge Parameters:

Output voltage amplitude: 320 V, this is the parameter that will be active only when “Internal” is selected for power supply mode of the H-Bridge and this is an amplitude of the voltage across the H-Bridge.

Total bridge on resistance: 0.1 Ohm

Freewheeling diode on resistance: 0.05 Ohm, default values were kept as same.

H-Bridge Connection Ports:

PWM: Pulse width modulus signal, in this the controlled PWM voltage block output port “PWM” is connected to this port.

REF: This is the reference port which is an electric conversing port associated with floating zero volts.

REV: Reverse port.

BRK: Brake port.

In this block, the PWM port is connected to the PWM port of the controlled PWM voltage block, REF and REV are connected to the REF block of the controlled PWM voltage block. The BRK port is connected to the another controlled voltage source which has input from the DecelCmd of the Longitudinal Driver. The positive terminal of H-Bridge is connected to the positive port of the current sensor and further connected to the positive terminal of the DC motor via negative terminal of the current sensor and the negative terminal is connected to the negative terminal of the DC motor.

Current Sensor:

This block represents an ideal current sensor, that is, a device that converts current measured in any electrical branch into a physical signal proportional to the current. Connections + and - are conserving electrical ports through which the sensor is inserted into the circuit. Connection I is a physical signal port that outputs current value. Here the positive terminal is connected to the positive of H-Bridge and the negative terminal is connected to DC motor positive terminal, terminal I is connected to the battery subsystem for the current output monitoring via PS-Simulink converter.

Controlled PWM Voltage:

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.

The block parameters were kept default for this block.

Port Connections:

ref+: Positive terminal, it is the positive electrical reference terminal connected with the controlled voltage source’s positive terminal which receives the drive cycle inputs from the AccelCmd port of the Longitudinal Driver.

ref-: Negative terminal, connected to the electrical reference (ground) and the negative terminal of controlled voltage source.

PWM: Pulse width modulated signal; an electrical reference signal port connected to the PWM port of the H-Bridge ­

REF: Floating zero reference, connected to REF and REV ports of the H-Bridge.

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. This block has one physical signal input port and two electrical ports associated with its electrical terminals.

Two of these blocks were used in this subsystem one for acceleration command coming from the longitudinal driver and one for the deceleration command coming from the longitudinal driver.

Solver Configuration:

This block is needed to start the simulation and is used in solving the Simulink model. This block is connected to the controlled PWM voltage and H-Bridge blocks with the electrical reference (ground).

Vehicle Body Subsystem:

Vehicle Body Block:

Vehicle Body block represents a two-axle vehicle body in longitudinal motion. The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile. The vehicle can have the same or a different number of wheels on each axle. Optionally include pitch and suspension dynamics or additional variable mass and inertia. The vehicle does not move vertically relative to the ground.

Input and Output Terminals of the block:

  • W: Physical signal input port for headwind speed.
  • beta: Physical signal input port for road incline angle.
  • H: Conserving port associated with the horizontal motion of the vehicle body. Connect tire traction motion to this port.
  • NR: Physical signal output port for normal force on the rear axle. Wheel forces are considered positive if acting downwards.
  • NF: Physical signal output port for normal force on the front axle. Wheel forces are considered positive if acting downwards.
  • V: Physical signal output port for vehicle longitudinal velocity.

The vehicle body parameters were changed from the default values which can be seen below.

Parameters:

  • Main parameters:
    1. Mass: 1147kg
    2. Number of wheels per axle: 2
    3. Horizontal distance from CG to front axle: 1854m
    4. Horizontal distance from CG to rear axle:2730m
    5. CG height above ground:5m
    6. Externally-defined additional mass: off
    7. Gravitational acceleration:81m/s^2
    8. Negative normal force warning: off
  • Drag parameters:
    1. Frontal area: 21m^2
    2. Drag coefficient:20
    3. Air density:81kg/m^3
  • Pitch:
    1. Pitch dynamics: off
  • Variables:
    1. Beginning value of Velocity: 0

The inputs for wind velocity (W) and incline angle (beta) were not considered for the simulation.

Velocity Calculation:

The subsystem for velocity calculation can be seen below:

The velocity coming from the drive cycle source and out from vehicle body is in m/s. Here the velocity is converted into mph.

PS-Simulink Converter: it converts physical signal to Simulink signals

Gain: it multiplies the value to the signal here the value was given as 1.61

Zero-Order Hold: this block holds the input for the user specified time which was input as 0.01s

Tire (magic formula):

The Tire (Magic Formula) block models the tire as a rigid wheel-tire combination in contact with the road and subject to slip. When torque is applied to the wheel axle, the tire pushes on the ground (while subject to contact friction) and transfers the resulting reaction as a force back on the wheel. This action pushes the wheel forward or backward. If you include the optional tire compliance, the tire also flexibly deforms under load.

The figure shows the forces acting on the tire. The table defines the tire model variables.

Where,

  • Fz: Vertical load on tire
  • Fx: Longitudinal force exerted on the tire at the contact point
  • Vx: Wheel hub longitudinal velocity
  • Ω: Wheel angular velocity

Block Terminals:

  • N (Normal Force): Physical signal input port associated with the normal force acting on the tire. The normal force is positive if it acts downward on the tire, pressing it against the pavement.
  • S (Slip): Physical signal output port associated with the relative slip between the tire and road.
  • H (Hub): Mechanical translational port associated with the wheel hub that transmits the thrust generated by the tire to the remainder of the vehicle.
  • A (Axle): Mechanical rotational port associated with the axle that the tire sits on. This port is connected to the simple gear transmission.

The block parameters are as shown below. The option Parameterize by was changed to Load-dependent Magic formula coefficients, which specifies the parameters that define the normal force which was kept default as 4000N.

The parameters were kept same for all four wheels.

Inertia Block:

The block represents an ideal mechanical rotational inertia. The block has one mechanical rotational conserving port. The block positive direction is from its port to the reference point. This means that the inertia torque is positive if the inertia is accelerated in the positive direction.

Where,

  • T: Inertia torque
  • J: Inertia
  • ω: Angular velocity
  • t: Time

Block Parameters:

Here the inertia is kept at 0.01 kg*m^2 at default value. This block is connected to the rear axle of the vehicle body and the simple gear as axle and gear shaft are rotating parts.

Simple Gear Block:

The Simple Gear block represents a gearbox that constrains the connected driveline axes of the base gear, B, and the follower gear, F, to co-rotate with a fixed ratio that you specify. You choose whether the follower axis rotates in the same or opposite direction as the base axis.

Simple Gear block parameters:

  • Main:
    1. Follower (F) to base (B) teeth ratio (NF/NB): 2
    2. Output shaft rotates: In same direction as input shaft.
  • Meshing Losses:
    1. Friction model: Constant efficiency
    2. Efficiency:86
    3. Follower power threshold:001W

The full electric model description completes here and the results and outcomes are discussed further on.

Results:

FTP 75 Drive Cycle

The simulation was first carried out on the FTP 75 drive cycle and the output plots are as shown below. The vehicle covered total distance of 6.582 m/s that is 23.69 kmph and the total time for simulation was for 2474 seconds.

Time VS Speed:

Here the yellow plot indicates the vehicle speed and the blue plot indicates the drive cycle reference speed. It is observed that both the plots do not follow the same speed path. However, the starting time of both the plots is the same.

Longitudinal Driver Control:

Here we can see the acceleration command signals given by the driver with reference to the drive cycle input data. These signals were then passed on to the DC motor for propulsion of the vehicle.

State of Charge (SOC):

It was observed that the battery started discharging from 20.1 seconds that is when the drive cycle starts and the vehicle starts moving ahead. A lot of regenerative charging is observed in the plot as we can see several peaks in the plot. The SOC at the end of the cycle is observed at 74.5%.

Current:

The starting of the current is again observed at 20 seconds and we can see the current is constant from 1719.355 seconds to 1988.963 seconds.

Excel Sheet Drive Cycle

An excel sheet drive cycle was made for experimental purpose. The excel sheet plot can be seen below.

Time VS Speed:

Longitudinal Driver Control:

State of Charge (SOC):

Current:

Conclusions:

  1. It can be concluded that the model simulation was carried out successfully. The vehicle covered roughly 23.69 kmph and the SOC was observed at 74.5%. It was observed that the plots of reference drive cycle and the vehicle plot were different however it can be said that the vehicle ran efficiently following the path of the drive cycle referring to the acceleration and deceleration commands.
  2. For Excel sheet drive cycle, it can be concluded that the vehicle followed the given path of acceleration and deceleration and covered roughly 4.2 kmph and the SOC is observed at 94.7%. The regenerative braking is also observed as there is a big peak observed in the graph. Therefore, it can be said that the vehicle functioned as it was expected.

References:

[1] https://www.edfenergy.com/for-home/energywise/how-do-electric-cars-work

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.