Challenge

Project-1: Modelling an electric Car with Li-ion battery

THEORY

Electric Vehicles (EVs) are vehicles that are powered by electrical energy. The main components of an EV are a motor/generator, motor controller, power converters, wheels, and batteries. The electric motor is used to provide the power required for the wheels to move and provide traction. The motor controller and power converters work together to control the amount of power that is delivered to the motor. The batteries store the electrical energy needed to power the motor.

Traditional vehicles use an Internal Combustion (IC) engine which is powered by chemical energy from fossil fuels such as petrol or diesel. Traditional vehicles still represent the majority of all the vehicles being used around the world, however, there are various disadvantages in their use. For instance, the gaseous emissions such as carbon dioxide from those vehicles pose various environmental threats such as air pollution. These threats are said to be related to global warming. In addition, traditional vehicles will only be in demand till the availability of fossil fuels is exhausted. Fossil fuels are an exhaustible fuel source with negative environmental effects in its production as well as its utilization. The biggest advantage in using fossil fuels is their excellent energy density. Fossil fuels are capable of storing enormous amounts of energy per unit weight or unit volume which makes them ideal for efficiency. EVs utilize electrical energy stored in batteries as their power source and till date, even battery technologies are yet to reach the same energy density as fossil fuels were capable of.

In this project, I will model an EV in SIMULINK using the powertrain blockset and simscape blocks. This model will implement speed control using a PID controller block. The input to this model will be a Wide Open Throttle (WOT) drive cycle. The output of this model will be blocks that show the total distance travelled by the model and the speed of the vehicle during a 30 second simulation period. The speed data will reflect both the actual speed of the vehicle and the command speed from the drive cycle data.

System level configurations

Motor

The motor converts electric energy into kinetic energy that moves the wheels. the EV powertrain is smaller than the engine, thus providing lots of additional space for efficient vehicle design. The motor is also in part an electric generator―it converts the kinetic energy generated while in neutral gear into electric energy saved to the battery. The same energy-saving idea applies when the car is reducing its speed, culminating in the so-called “regenerative braking system.”

Battery

The battery stores electrical energy and is the equivalent of a fuel tank in an internal combustion engine. The maximum driving distance of an EV is often determined by the battery capacity―the higher the capacity, the higher the driving distance. In that light, increasing the capacity may seem an obvious choice, since high driving distance reduces the annoying need for frequent stops at charging stations. But the choice actually isn’t so obvious, because the battery’s size and weight also have large implications on vehicle performance. The larger and heavier battery takes away from cabin/storage space and worsens the energy efficiency and fuel economy. The best way to optimize performance, then, is to maximize the battery’s energy density―that is, having a small, lightweight battery that stores as much electric energy as possible.

On-board Charger (OBC)

The On-board Charger (OBC) is used to convert Alternating Current (AC) from slow chargers or portable chargers used on home outlets into Direct Current(DC). This may make the OBC look similar to the traditional inverter, but they differ crucially in function; the OBC is for charging, and the inverter is for acceleration/deceleration. Incidentally, the OBC is not needed in fast-charging, since fast chargers already supply the electricity in direct current.

Electric Power Control Unit (EPCU)

The Electric Power Control Unit (EPCU) is an efficient integration of nearly all devices that control the flow of the electric power in the vehicle. It consists of the inverter, the Low voltage DC-DC Converter (LDC), and the Vehicle Control Unit (VCU).

Inverter

The inverter converts the battery’s DC into AC, which then is used to control the motor speed. The device is responsible for executing acceleration and deceleration, so it serves a crucial part in maximizing the EV’s drivability.

Low voltage DC-DC Converter

The LDC converts the high voltage electricity from the EV’s high-voltage battery into low-voltage(12V) and supplies it to the vehicle’s various electronic systems. All electronic systems in the EV use electricity in low voltage, so the high voltage in the battery must be converted first to be useful for these systems.

Vehicle Control Unit

As the control tower of all electric power control systems in the vehicle, The VCU is arguably the most important component of the EPCU. It oversees nearly all the vehicle’s power control mechanisms, including the motor control, regenerative braking control, A/C load management, and power supply for the electronic systems.

MODEL PARAMETERS

DRIVE CYCLE SOURCE BLOCK Generates a standard or user-specified longitudinal drive cycle. The block output is the vehicle longitudinal speed.

In order to control the vehicle, we need another system that decides how the vehicle will operate. This means that data needs to be input in to this model as commands for how we desire the vehicle to operate. In addition, we need blocks that control how the vehicle will operate as a response to its instantaneous state. This system is explained below:

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.

FTP75 is used as the drive cycle input, speed plot for the same is attached.

CONTROLLED PWM VOLTAGE BLOCK, 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. Duty cycle is set by the input value.

It is used to provide a controlled pulse width modulated voltage to the H-Bridge block. The block will output the PWM voltage through its 'PWM' and 'REF' ports which will feed in to the same ports found on the H-Bridge block. If the pulse is low the output voltage is considered 0V whereas if the pulse is high, the output voltage will be equal to the output voltage amplitude which was set to 330V in the H-Bridge block. The pulses of voltage created by this block are dependent on the duty cycle which is the ratio of the time that the switch is ON to the time taken for 1 cycle (which is the time for which the switch is ON and OFF). The duty cycle is set by the input of the controlled PWM voltage block.

H-BRIDGE BLOCK, this block represents an H-bridge motor drive. The block can be driven by the Controlled PWM Voltage block in PWM or Averaged mode. In PWM mode, the motor is powered if the PWM port voltage is above the Enable 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. Using this ratio and assumptions about the load, the block applies an average voltage to the load that achieves the correct average load current.

The H-Bridge block has 2 sides to it. The left side controls the voltage signals and the right side is for the terminals to provide the controlled voltage to the DC motor. The left side of the H-Bridge consists of ports which are explained below:

  • PWM - This stands for Pulse Width Modulation and provides voltage pulses to the H-Bridge in either the PWM mode 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 characteristics to the "Smoothed" option.

REF port is the reference input which along with PWM port forms the pulse input for the circuit. REV port is for reversing of vehicle while BRK is for braking of vehicle whose input is given from controlled PWM voltage block.

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.

ELECTRICAL REFERENCE

The electrical reference block is used to create a grounding effect for electrical circuits. Any model that uses electrical or electronics components will need to have atleast one electrical reference block in it.

SOLVER CONFIGURATION

The solver configuration block is used to solve any necessary equations in a model and in my case, I have used them in the connection to the 'REV' port of the H-Bridge block.

DC MOTOR BLOCK, his block represents the electrical and torque characteristics of a DC motor. The block assumes that no electromagnetic energy is lost, and hence the back-emf and torque constants have the same numerical value when in SI units.

R port represents rotor and is fed as input to vehicle velocity while C port is for stator hence is connected to a mechanical reference.

The left side of the motor represents the electrical part of the motor, whereas the right side represents the mechanical part. The mechanical part has 2 ports labelled C and R. C refers to the casing of the motor and R represents the rotation of the motor which produces the torque. The electrical part has 2 ends labelled with a positive and negative sign which represent the positive and negative terminals of the motor. Double-clicking the motor block opens the block parameters

SIMPLE GEAR BLOCK, represents a fixed-ratio gear or gear box. In this section, I have modelled the transmission of the EV. To simplify the transmission system of the EV model, I have used a "Simple Gear" block which uses a fixed gear ratio with no inertial effects.

SIMPLE BATTERY BLOCK, this block models a battery. To ensure supply of current as required by motor controller and not rated values, currents sensor and controlled current source is connected along with it.

CONTROLLED CURRENT SOURCE

The controlled current source block is a part of the battery system used in the EV model. Similar to the controlled voltage source, this block will represent an ideal current source that is powerful enough to maintain the specified current regardless of the voltage across it.

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.

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. NF represents the front axle neutral reaction force while NR is the same for rear axle. V is the output velocity beta is the road inclination angle and W is the head speed.

This block has 6 ports which represent various aspects of the modelling of the vehicle body:

  • H - This stands for hub and allows us to connect the hubs of the wheels of the vehicle to the body.
  • V - This stands for velocity and outputs the velocity of the vehicle.
  • W - This represents wind velocity and allows us to model a headwind (against the front of the vehicle) acting on the velocity by giving a speed for it.
  • NR - This represents the normal force on the rear wheels of the vehicle.
  • NF - This represents the normal force on the front wheels of the vehicle.
  • beta - This represents the grade (incline) of the surface that the vehicle travels on, as an angle to the horizontal.

From the "Main" tab, here, we can model the basic parameters of the vehicle such as mass, number of wheels per axle and even gravitational acceleration. For my model, I am using a mass of 800kg, 2 wheels per axle (total of 4 wheels), and a gravitational acceleration of 9.81 metres per second squared.

From the "Drag" tab, we can model the frontal area, drag coefficient, and the air density. I have used a frontal area, drag coefficient, and air density of 3, 0.3, and 1.18 respectively.

SIMPLE TIRE BLOCK, represents the longitudinal behaviour of a highway tire characterized by the tire Magic Formula. The block is built from Tire-Road Interaction (Magic Formula) and Simscape Foundation Library Wheel and Axle blocks. Optionally, the effects of tire inertia, stiffness, and damping can be included.

This block has 4 ports which represent various factors that can be modelled:

  • N - This port represents the normal force on the tire and the downward direction is considered positive.
  • S- This port represents the slip acting on the tire.
  • A - This port represents the axle and is the mechanical rotational conserving port for the wheel axle.
  • H - This port represents the hub and is the mechanical translational conserving port for the wheel hub.

N represents normal reaction acting on tire, while H represents translational speed hence all 4 are connected and A represents rotational speed hence both tire on same axel is connected.

PID Controller block, The PID Controller block implements a PID controller (PID, PI, PD, P only, or I only). The block is identical to the Discrete PID Controller block with the Time domain parameter set to Continuous-time. The PID controller block is essential for the speed control of the EV model. The PID controller block takes the error data between the drive cycle data and the actual speed of the vehicle (from the sum block) and works to minimize this error.

TRANSFER FUNCTION

The transfer function block is used when we want to insert a transfer function. A transfer function is defined as the ratio of the Laplace transform of the output of a system to the input of a system.

The subsystem has SATURATION block to limit duty cycle variation and also has ABS and TRANSFER FUNCTION block for proper working of PID CONTROLLER.

BATTERY SOC

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.

RESULTS

Upon multiple number of tuning efforts we finally found the PID Controller P I and D values for which the output velocity was matching the output velocity generated by Longitudinal driver block and hence we can say that the PID Controller was nicely tuned, though we see that there is variation in reference speed and output speed that is due to insufficient combination of motor and battery which could not achieve the reference speed values.

DISTANCE TRAVELLED

SOC OF BATTERY PACK

CONCLUSION

We have successfully designed an EV powertrain using PID controller where tuning of non-linear system was done, the powertrain and PID tuning everything was designed using all the knowledge we have gained throughout the coursework and have used all the key fundamentals.

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.