Challenge

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

Create a MATLAB model of electric car which uses lithium ion battery and suitable motor. Choose suitable blocks from Simscape or Powertrain block set. Implement the vehicle speed control using PI controller and generate brake and accelerator commands. Avoid using readymade driver block for speed control.

AIM:

To Create a MATLAB Model of Electric car using Lithium Ion Battery and Suitable Motor.

Objective:

Choose suitable blocks from Simscape or Powertrain block set. Implement the vehicle speed control using a PI controller and generate brake and accelerator commands. Avoid using readymade driver blocks for speed control. Prepare a report about your model including the following:

Objectives, System level configurations, Model parameters, Results, and Conclusion.

Electric Vehicle:

An Electric Vehicle is a vehicle which is propelled by an Traction Motor instead of Internal Combustion engine which uses mixture of fuel and air to move the vehicle. The Traction Motor is powered by an Battery Pack which has number of Lithium Ion cells which are stacked together inside a module through combination of series and parallel connection to form a battery pack. The EV is charged by an External Power supply called as an Electric Vehicle Supply Equipment(EVSE). The Electric Vehicle On board Charger consists of Rectifier and Converter circuit which converts the AC supply into DC supply and then this DC Supply is stepped up to match the battery pack voltage level which is supplied to battery pack. Since On board Charger has limitations due to space constarints it cannot charge Battery at faster Rate. Therefore EVSE is used to charge the EV quickly. If the Power supplied is High Voltage DC directly from EVSE then On board Charger will detect the type of supply and it will bypass the Rectifier and Converter circuit and activate high voltage Contactors so that HV DC supply is directly fed to the Battery Pack. The Battery pack Charging is continuouslty monitored by Battery Management System (BMS). The Main opeation of BMS is to  monitor and protect the Lithium Ion battery packs. It continuously monitors the individual cell voltages. The Promary Function of BMS is Over and Under Voltage protection, Thermal Protection, Over Current protection, State of Charge(SOC) Calculation, Cell balancing, Fault detection, Maximize the Life Span. The DC voltage from Battery pack is splitted through power splitter device and is suplied to DC-DC Converter. There are two types of DC-DC Converter used in EV. The Step Down Converter is used to step down Battery pack voltage to low voltage ie12V which is used by Auxilary loads such as Headlights, Tail Lights, Indicator Lights, etc. The High Volatge DC from Battery Pack is stepped up with the help of Step Up Converter to supplt to the 3 Phase Induction Motor or Synchronous Motor. The Inverter Converts the HV DC to AC Voltage which is then supplied to Traction Motor. The Inverter acts as an Motor Controller since in many EV the Inverter and Motor Controller are integrated to control the Speed of Motor. According to the Accelerator pedal input from driver the motor controller generates the duty cycle and PWM signal is generated which controls the speed of the motor. The Motor is connected to CVT or Single Speed Transmission and the transmission output is given to the wheels through differential.

The Electric Vehicle is Charged through Electric Vehicle Supply Equipment (EVSE). Depending upon the Type of Chargng level the charging time varies. There are three levels of Charging EV.

(a) Level 1 Charging: (Home Charging)

  • It uses 120V plug and standard Outlet.
  • Time required to charge the battery is about 18hours to 24hours and depending onnthe battery pack capacity.
  • Connectors Used: J1772, Tesla
    Charging Speed: 3 to 5 Miles Per Hour
    Locations: Home, Workplace & Public

(b) Level 2 Charging: 

  • Level 2 charging is the most commonly used level for daily EV charging. Level 2 charging equipment can be installed at home, at the workplace, as well as in public locations like shopping plazas, train stations and other destinations.
  • Level 2 charging can replenish between 12 and 80 miles of range per hour, depending on the power output of the Level 2 charger, and the vehicle’s maximum charge rate.
  • Connectors Used: J1772, Tesla
    Charging Speed: 12 to 80 Miles Per Hour

(c) Level 3 Charging:

  • Level 3 charging is the fastest type of charging available and can recharge an EV at a rate of 3 to 20 miles of range per minute.
  • It is also called as DC fast Charging.
  • Unlike Level 1 and Level 2 charging that uses alternating current (AC), Level 3 charging uses direct current (DC). The voltage is also much higher than Level 1 & 2 charging.
  • It can charge Electric Vehicles battery from 20% to 80% in about 30 minutes.
  • Connectors Used: Combined Charging System (Combo), CHAdeMO & Tesla
    Charging Speed: 3 to 20 Miles Per Minute

Types of Electric Vehicles:

There are a few different types of electric vehicles (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 - Plug-in Electric is called as BEV which purely runs on electricity and can be charged through external supply.
  • Plug-in hybrid - These cars mainly run on electricity but also have a traditional Internal Combustion Engine so the vehicle can use petrol or diesel too if they run out of charge. When running on fuel, these cars will produce emissions but when they're running on electricity, they won't. Plug-in hybrids can be plugged into an electricity source to recharge their battery or they can be charged through ICE also.
  • Hybrid-electric - These run mainly on fuel like petrol or diesel but also have an electric battery too, but the capacity of battery pack is les as compared to Plug in Hybrid and BEV. This battery is recharged through regenerative braking and ICE. Based on the architecture there are Series Hybrid, Parallel Hybrid and Series-Parallel hybrid. Based on there Controller unit these vehicles switch from ICE to Electric Motor and vice versa.

                                                 Configuration of Electric Vehicle

Components of Electric Vehicle:

1. TRACTION BATTERY:

  • An EV traction battery is rechargeable energy storage that supplies power to the electric motor very quickly, giving EVs high performance & rapid acceleration.
  • Prevoiusly for EV Batteries Nickel Metal Hydride, Lead Acid, Nickel Cadmium batteries were used but due to advancement in battery technology Lithium Ion batteries are used in Electric Vehicles.
  • The Lithium Ion Batteries have High Specific Energy, High Specific Power, less Self Discharge Rate, high nominal cell voltage and highe number of life cycles.
  • These batteries can be charged at higher C rate and with proper thermal management system they are best for EV applications. The different types of Cell Chemistries used are NMC,NCA, LTO and Lithium Ion Poshpate.
  • These cells can be manufactured in different types of form factors such as Cylindrical, Prismatic and Pouch. Mostly for EV Cylindrical cells are used because they are easy to manufacture.
  • The cells are connected in ether series   or parallel to form modules and these modules are further interconnected and enclosed in a casing to form a battery pack.
  • The Battery Pack Capacity is measured in KWh. The higher the KWh rating the Higher Range the Vehicle will give.

(2) Battery Management System:

Battery management systems (BMS) are electronic control circuits that monitor and regulate the charging and discharge of batteries. The battery characteristics to be monitored include the detection of battery type, voltages, temperature, capacity, state of charge, power consumption, remaining operating time, charging cycles, and some more characteristics.

(3) TRACTION MOTOR:

  • The Electric Motor uses receives power from the battery pack to propel the Vehicle.
  • The Motor Rating is measured in KW. Electric motors can deliver Higher Torque at zero RPM and can accelerate quickly. 
  • This means that the performance of a vehicle with a 100 kW electric motor exceeds that of a vehicle with a 100 kW internal combustion engine, which can only deliver its maximum torque within a limited range of engine speed.
  • The motors used for EV are BLDC Motor, 3Phase AC Induction Motor, Permanent Magnet Synchronous Motors. These motors can deliver max torque at different range of RPM.
  • These motors also works as generator when brakes are applied and convert the kinetic energy generated during braking into electrical energy and recharge the battery pack through Regenerative Braking.
  • The Electric Motors has efficiency between 80% to 93% depending on the type of motor used.

(4) Motor Controller:

  • It is a device which improves the performance of an electric motor. It is a machine that is used to regulate the torque generated by the motors of electric vehicles.
  • It acts as a bridge between Battery and Motor to control the speed.
  • It does so by means of modifying the energy flow from the power sources to the motor. Motor controllers can include an automatic or manual means for starting or stopping the motor.
  • It can choose forward or reverse rotation, can select and control the speed, can modify or limit the torque of the EV motor.
  • Motor Controller has MicroController which repeatedly detects the error rectifies it and sends the proper output power.
  • Hall Sensors inside the PMSM and BLDC Motors detect the position of rotor and it feds tis data to motor controller and depending on that Motor controller generates the Duty Cycle and PWM signal is generated which is given to power semiconductor switches and it controls the speed of motor as per the accelerator pedal input.

POWER CONVERTER UNIT:

(1) INVERTER:

  • An Inverter is used to Convert the DC supply of Battery into AC Supply which is fed to electric motor to control the sped of motor.
  • The inverter is also called as motor controller since in many EVs motor Controller and Inverter are integrated in a common enclosure.
  • Inverter have high efficiency because the range of vehilce depends upon how effectively and efficiently the inverter converts the power.

(2) DC-DC Converter:

  • DC-DC Converter is used to convert fixed DC into variable DC. There are 2 types of DC-DC converter Step-up and Step-down converter.
  • Step-up Converter is used to step up the battery pack voltage to the voltage level of Motor used in EV.
  • Step down converter is used to step down the high dc voltage from battery pack tom low voltage dc 12V or 24V which is used to run the auxilary load such as Head lights, Tails lights , indicator lights, Infotainment systems etc.

(3) On Board charger (Rectifier Circuit):

  • The On board charger consists of a Rectifier circuit which converts the AC supply to DC Supply. This charger is installed inside the vehicle.
  • The On board charger not only converts the AC to DC but it has to step the the DC voltage to the voltage which is required by battery pack.
  • When Fast Charging DC supply is applied so On board charger detects it and by passes the Rectifier circuit and sends dc supply directly to the battery.

SYSTEM LEVEL CONFIGURATIONS:

                                                                              SIMULINK MODEL

1. Vehicle Body Subsystem:

  • The Vehicle body subsystem consists of the powertrain blockset Vehicle Body 1DOF Longitudinal block which  implements a one degree-of-freedom (1DOF) rigid vehicle body with constant mass undergoing longitudinal (that is, forward and reverse) motion. 
  • The block accounts for body mass, aerodynamic drag, road incline, and force distribution between axles due to longitudinal acceleration.
  • There are different options in block to add external forces, external moments, wind components and Air temperature.
  • This block helps to determine the vehicle inertia and drag load. The two forces acting on the wheels are Longitudnal Force and Normal Force.
  • These forces act on the rear and front of the wheels, the longitudnal forces on rear and front is given by (FwF & FwR). Whereas the normal forces are given by (FzF & FzR). This forces is connected to the respective axle of the wheels.
  • The xdot port is longitudnal force in the X-Axis which calculates the velocity of the vehicle in metre/seconds.
  • A Two-Way Connection block is used to connect these forces as it has a two-way connector port, which transports Simulink signals both ways. You connect this port to another two-way connector port. The schematic below illustrates how the two-way connection works.
  • It carries the signal Signal1 from the input port of the first Two-Way Connection block to the output port of the second Two-Way Connection block, and at the same time carries the signal Signal2 from the input port of the second Two-Way Connection block to the output port of the first Two-Way Connection block.
     

PARAMETERS OF BLOCK:

2. Wheels and Brakes Subsystem:

  • The above figure represents the longitudinal behavior of a tire characterized by the tire Magic Formula or mapped data. The Block includes options for the rolling resistance and brakes.

  • This block is used in driveline and longitudinal vehicle simulations where low frequency tire-road and braking forces are required to determine vehicle acceleration, braking, and wheel-rolling resistance. For example, you can use the block to determine the torque and power requirements for a specified drive cycle or braking event. The block is not suitable for applications that require combined lateral slip.
  • The block has three types brakes options Disc, Drum and Mapped.
  • For simulation Disc brake type is selected as Disc brake has higher efficiency as compared to drum brakes and has great stopping power and less wear and tear.
  • The Brake input command for the front and rear wheels are connected commonly as one input port. Omega is the angular velocity of the wheels hence this force is considered as torque input to the wheels.

  • A disc brake converts brake cylinder pressure from the brake cylinder into force. The disc brake applies the force at the brake pad mean radius. The block uses these equations to calculate brake torque for the disc brake. 

     
     

PARAMETERS:

3. DIFFERENTIAL:

The Open Differential block implements a differential as a planetary bevel gear train. The block matches the driveshaft bevel gear to the crown (ring) bevel gear. You can specify:

  • Carrier-to-driveshaft ratio
  • Crown wheel location

  • Viscous and damping coefficients for the axles and carrier

    The Open Differential block implements a differential as a planetary bevel gear train. The block matches the driveshaft bevel gear to the crown (ring) bevel gear. You can specify:

    Use the Open Differential block to:

  • Dynamically couple the post-transmission driveshaft to the wheel axles or universal joints

  • Model simplified or older drivetrains when optimal traction control does not require passive or active torque vectoring

  • Model mechanical power splitting in generic gearbox and drive line scenarios

The block is suitable for use in hardware-in-the-loop (HIL) and optimization workflows. All the parameters are tunable.

The block uses a coordinate system that produces positive tire and vehicle motion for standard engine, transmission, and differential configurations. The arrows indicate positive motion.

The input ports are Driveshaft torque, AxelTorque 1 and Axle Torque 2. The Drive SHaft speed is given as input to Drive shaft torque. The efficiency factor selected is constant.

The Torsional Compliance block implements a parallel spring-damper to couple two rotating driveshafts. The block uses the driveshaft angular velocities, torsional stiffness, and torsional damping to determine the torques.

PARAMETERS OF BLOCK:

4. ELECTRICAL SYSTEM:

  • The Electrical Subsytem consist of Battery and Electric Motor. The Motor receives power from the battery and the mootor generates the requireed torque and is given as input to the differential.

4.1 Battery:

  • A datasheet battery is used since the Datasheet Battery block implements a lithium-ion, lithium-polymer, or lead-acid battery that you can parameterize using manufacturer data. To create the open-circuit voltage and internal resistance parameters that you need for the block, use the manufacturer discharge characteristics by temperature data.
  • To determine the battery output voltage, the block uses lookup tables for the battery open-circuit voltage and the internal resistance. The lookup tables are functions of the state-of charge (SOC) and battery temperature, characterizing the battery performance at various operating points:
  • The Input to battery is the current consumed by motor. The Ambient temperature for operation of battery pack is 27degeree and is converted to Kelvin.
  • The Battery output is SOC, Current and Voltage.
  • Formula to calculate SOC = SOC(t) = SOC(t-1)+∫ [I /C Bat.dt]
  • The SOC is converted into % by using multiplying it by 100.

Parameters of Block:

  • Battery Type = Lithium-Ion Battery
  • Battery Capacity = 100Ah
  • No of Cells in Series = 30 
  • No of Cells in Parallel = 2

4.2 MAPPED MOTOR:

  • The Mapped Motor block implements a mapped motor and drive electronics operating in torque-control mode. The output torque tracks the torque reference demand and includes a motor-response and drive-response time constant.
  • This block is used for fast system-level simulations when you do not know detailed motor parameters, for example, for motor power and torque tradeoff studies. The block assumes that the speed fluctuations due to mechanical load do not affect the motor torque tracking.
  • The above block is parametrized by using Max Torque and power. The Max torque considered is 245Nm and Power is 93000W.
  • The input to Motor Block is Battery Voltage, Vehicle Speed and Acceleartor pedal input.
  • The vehicle speed is converted from mps to rad/sec which is motor speed. Product of Speed and Acceleration is taken to generate the torque command. The lookup table is given as Motor Speed in rad/sec as input  which is then multiplied by accelerator command and the product of two is given as torque command to the Motor.

Parameters of Block:

5. DRIVER SUBSYSTEM:

  • The Driver subsystem consists of PID controlle which helps to generate the Acceleration and deceleration commands.
  • The Drive Cyccle speed is given as reference speed and actual Vehicle velocity is subtracted from reference to generate the error. The PID works in a closed loop system and tracks the error.
  • This Error is given to PID and PID generates the signals which follows the drive cycle input curve.
  • The PID output is seperated by uisng saturation limiit the upper saturation is applied for generating acceleration command and lower saturation is applied for generating deceleration commands.

PID Tuning:

PID Parameters:

Acceleration and Deceleration:

The Saturation block produces an output signal that is the value of the input signal bounded to the upper and lower saturation values. The upper and lower limits are specified by the parameters Upper limit and Lower limit.

  • The above blockhepls to calcutae the distance travlled by vehicle during the drive cycle.
  • The Vehicle speed is integrated and divided by 3600 to find the distance covered in Km.

6. DRIVE CYCLE:

The Drive Cycle Source generates a standard or user-specified longitudinal drive cycle. A drive cycle is typically represented by a series of data points which plots vehicle speed against time. Driving cycles are produced to assess the performance of vehicles in various ways, including fuel consumption and pollutant emissions.

RESULTS:

CASE 1: FTP 75

a.  Drive Cycle Plot:

  • The drive cycle selected is FTP 75 which has a run time of 2474seconds. The max velocity of this drive cycle is 90kmph.
  • The Yellow graph is the drive cycle curve ie Reference speed and blue color graph represents the actual vehicle speed.
  • The Vehicle speed is following the Drive cycle speed as the parameters selected for PID gains are working properly.
  • The Vehicle has covered a distance of 17.82Km.

b. SOC, Voltage, Current and Motor Torque Plot:

  • The above plot shows the Battery SOC plot, Voltaage, Current and Motor Torque graph.
  • The 1st graph represents the battery SOC. The Battery SOC has initial charge of 100% and after run of 2474seconds the SOC is reduced to 93.56% while the vehicle has covered a distance of 17.82Km.
  • The 2nd Graph represents the Battery Voltage.The Battery Max voltage is 126V and it has reduced to 124.3V after one drive cycle.
  • The 3rd graph represents the Battery Current. At max speed of 90kmph the battery is discharging at more than 200A and when the speed is between 0-60kmph the Battery is discharging at about 100A.
  • The 4th graph represents the Motor Torque. The motor is able to produce max torque of 245Nm. At start since the vehicle is accelerating from 0kmph so the torque produced by motor is above 100Nm.

CASE 2: WLTP Class 3

a.  Drive Cycle Plot:

  • The above plot shows the comparison of WLTP Class3 drive cycle graph and Actual Vehicle veloicty graph.
  • The Yellow colour graph is the WLTP Class3  drive cycle curve ie Reference speed and blue color graph represents the actual vehicle speed.
  • As in case 1 FTP75 here also the Vehicle speed is accurately following the Drive Cycle curve as PID Controller is generating proper acceleration and deceleration commands as per the drive cycle.
  • The Vehicle has covered  a distance of 23.33Km in 1800seconds with max velocity of 120kmph.

b. SOC, Voltage, Current and Motor Torque Plot:

  • The above plot shows the Battery SOC plot, Voltage, Current and Motor Torque graph.
  • The 1st graph represents the battery SOC. The Battery SOC has initial charge of 100% and after run of 1800 seconds the SOC is reduced to 87.78 % while the vehicle has covered a distance of 23.33Km.
  • The 2nd Graph represents the Battery Voltage.The Battery Max voltage is 126V and it has reduced to 122.2V after one drive cycle.
  • The 3rd graph represents the Battery Current. At max speed of 120kmph the battery is discharging at more than 350A which is more than 3C and when the speed is between 0-100 kmph the Battery is discharging at about 200A.
  • The 4th graph represents the Motor Torque. The motor is able to produce max torque of 245Nm. At start since the vehicle is accelerating from 0kmph so the torque produced by motor is above 100Nm.

Now Discharging the battery completely from 100% to 0% by using Repeat Cyclic Command in Drive Cycle.

1. FTP 75

The Vehicle has covered a distance of 250.8km when battery is discharged from 100% to 0%. The Max Velocity of Vehicle is 90kmph and Battery Max discharge current is 250A.

2. WLTP Class 3:

The Vehicle has covered a distance of 177.6km when battery is discharged from 100% to 0%. The Max Velocity of Vehicle is 120kmph and Battery Max discharge current is 390A. Since vehicle is running at higher speed of120kmph so battery is discharging at 390A so the range has reduced.

Parameters FTP75 Drive Cycle WLTP Class 3 Drive Cycle
Drive Cyle Run Time in Seconds 2474 1800
Distance Travelled in Km 17.82 23.33
SOC Remaining in % 93.56 87.78
Max Velocity (kmph) 90 120
Battery Voltage Remaining after 1 Cycle 124.3 122.2
Battery Voltage after SOC reduced to 0% 81.34 82.43
Vehicle Estimated Range in Km 250.8 177.6

CONCLUSION:

A MATLAB-Simulink model of Electric Car which uses lithium ion battery with  suitable motor is created  by using suitable blocks from Simscape or Powertrain block set. The vehicle speed control is and we Implemented using  PID controller to  generate acceleration and deceleration commands. The simulation is simulated by using 2 drive cycles FTP75 and WLTP Class3 and there graphs are compared and table is plotted for comparison and estimated range for both drive cycles are simulated.

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.