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.

Prepare a report about your model including following:

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

(Note- The simulink model file should be compulsorily attached)

AIM : Modelling an Electric Car with Li-Ion Battery using FTP-75 Driving Source as a Speed Reference

Objectives:

• To create a Simple Matlab Model of an Electric Car showing all its major components as a subsystem starting from the Motor to the Vehicle Dynamics.

• To analyse and estimate the SOC, Vehicle Velocity, Distance Covered by the vehicle and overall energy consumption at driving source reference.

• Analysis of all the above parameters is done w.r.to  FTP-75 driving cycle.

• To simulate the entire model by changing the parameters corresponding to various subsystem like. DC Motor, Battery management system,Driver, Vehicle Body, so as to identify the dependencies of the subsystem parameters over the entire MATLAB model.

• To reduce the deviation of the actual vehicle velocity w.r.to the reference velocity which identifies as a error to the system and minimize the error to some extent by introducing a Pl Controller Subsystem.

Electric vehicle (EV) is defined as a vehicle that uses an electric motor or a traction motor for propulsion unlikely to an internal combustion (IC) engine used by conventional vehicles. Electric vehicles use electric power instead of  fuels as conventional vehicles would and because of this difference, electric vehicles do not produce any exhaust gases or pollution(Zero emission). 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. 

Let us consider a model in this report,  an electric vehicle with a dc motor and li-ion battery system used in SIMULINK . In modelling this EV for a drive cycle and to check performance parameters : to measure speed, SOC , and total distance travelled by the vehicle.

 

Primary Components of an EV:

  • EVs have no need for the fuel engine and gear transmission, the two of the most crucial components for internal combustion vehicles.
  • An electric powered car has three primary components - Battery, motor controller, and the electric motor.

(1) Battery : The battery of an electric car can be charged through the use of ordinary grid electricity at a specialized power station. But aside from the conventional lithium-ion battery technologies, there are also other major battery technologies which can be used for electric cars.

  • Lithium-Ion Batteries : This battery technology gives extra performance and range. However, it also carries the highest price tag. Lithium-ion batteries are lighter than Lead acid and Nickel metal. These are also the batteries used in digital cameras and smartphones.
  • Lead Acid Batteries : This battery technology is the most popular. It is also the cheapest among the battery technologies. What’s good about it is it’s 97% recyclable.
  • Nickel Metal Hydride Batteries : This battery technology provides higher output and better performance but it costs much more than lead-acid batteries.

(2) Motor Controller : The motor controller of an electric car administers its complete operation and the distribution of its power at any given moment. It acts as a floodgate between the motor and batteries. It helps monitor and regulates all key performance indications such as the vehicle’s operator, motor, battery, and accelerator pedal. It has a microprocessor which can limit or redirect current. It is used to either improve the mechanical performance of the car or suit the operator’s driving style. There are also more refined controllers which are capable of greater accuracy and thus, higher efficiency.

(3) Electric Motor : Unlike a gasoline engine with lots of moving parts, a motor only has one moving part. This makes it a very reliable source of motive power. Choosing an electric motor depends on the car’s system voltage. They can be structured to use either AC or DC current. AC motors are less expensive and lighter compared to DC motors. They are also more common and they tend to suffer from less mechanical wear and tear. However, AC technology requires a more refined or sophisticated motor controller.

 The detailed model we can see below:

It consists of 

  • Vehicle body subsystem
  • DC motor
  • motor controller
  • driver
  • Battery management system with li-ion battery
  • Drive cycle

1.Vehicle body subsystem:

This subsystem is consists of 4 tire blocks,vehicle body and simple gear

The vehicle is assumed to be a front axle driven (4 wheels - 2 on each axle).

i)Tire (Magic formula):.

The N port of the tire corresponds to the Normal Reaction acting on it.
The A port corresponds to the Mechanical Rotational conserving port for the wheel axle. Thus both the wheels on the same axle should form a connection through their respective A ports.
Connection H corresponds to the Mechanical Translational conserving port for the wheel hub through which the thrust developed by the tire is applied to the vehicle. Thus, all the 4 wheels form a connection through their respective H ports and this is in turn connected to the translational hub of the vehicle body.
The connection S represents the output port for slip of the tire.



  • The tires are parameterized by Peak longitudinal force and corresponding slip.
  • The other block parameters such as - rated vertical load, peak longitudinal force at rated load and slip at peak force at rated load - are kept with their default values.
  • The tire radius is given as 0.3 m.
  • Also, the rolling resistance is given with a constant coefficient of 0.015.


This 2 axle (4 wheel) assebly is now connected to a Velocity Body simscape block.

ii)Vehicle body:

              

  • This block basically represents a two-axle vehicle body in longitudinal motion. The block accounts for - 
    body mass,aerodynamic drag,road incline,weight distribution between axles due to acceleration road profile.
  • Here, the connection H is the mechanical translational conserving port hub.
    NF & NR correspond to the output ports for nomral reaction forces on front axle and rear axle wheels respectively.
    Connection V  represents the actual output translational velocity of the vehicle.
    beta is the road inclination angle & W corresponds to the headwind speed and it is kept as 1m/s (headwind - direction opposite to that of vehicle).
  • The gross weight is given to be 1200 kg.
  • The geometric parameters of the vehicle are given as default
  • 0.05 for proper drag force on the vehicle,Air density is 1.18kg/m^3 and the frontal area is kept as 3m^2
  • The pitch dynamics for the vehicle are not considered for this simulation.

The input for vehicle body subsystem is taken as the Rotational speed of the motor. This input is fed to the front axle through a Simple Gear representing the Final Drive Ratio of 3.73
Here, the rotational direction of the output shaft is kept the same as that of the input shaft. Also, no meshing losses are considered for the simulation.

2.DC Motor :

    

  • Simulink provides an inbuilt model block for DC motor which converts electrical input into mechanical rotational output.
    Note : Here, the blue colour corresponds to the electrical side of the motor and the green colour corresponds to the mechanical side.
  • Here, the motor field type is kept as Permanent magnet and the model parameterization is done by rated load and speed.
    The armature inductance and the mechanical parameters are given their default values.
  • The rated load is kept as 80kW power and rated DC supply voltage is 300V
    All the other parameters are changed as shown below - 



  • The connection R represents the Rotor (rotational output) while the connection C is for the Casing (stationary). Thus, the R port is connected to the input of the vehicle subsystem created earlier. The C port is connected to a mechanical rotational reference. 
  • The + and - terminals of the motor are connected to the motor controller. If these terminals are directly connected to a battery, the required DC motor will run on the rated capacity of the battery. This will eventually result into no control over the DC motor and the vehicle will run at top speed throughout the simulation.
    Thus, a motor controller is very much needed.

(3) Motor Controller :

The H-Bridge circuit along with the controlled PWM voltage together form the motor controller circuit.

       i.H-Bridge circuit -
   

  • This block represents an H-bdidge motor drive. The block can be driven by the Controlled PWM Voltage block in PWM or Averaged mode.
  • In PWM mode, the motor is powered if the PWM port voltage is above the enabled threshold voltage.
  • In Averaged mode, the PWM port voltage divided by the PWM signal amplitude parameter defines the ratio of the on-time to the PWM period.
  • Connection REF is for the reference input. This combined with the PWM connected will form the pulse input for the H-Bridge.
    Here, the REF input is connected to the Electrical Reference (ground).
  • Connection REV corresponds to the reverse motion of the motor which essentially means, the backward motion of the vehicle.
    Here, the backward motion of the vehicle is not accounted for and so, the port is connected to the electrical reference.
  • Connection BRK is for the braking of the vehicle.
  • Since, the PWM mode results in a huge amount of simulation time, Averaged mode is selected for this simulation.
  • Load current characteristics are considered to be smoothed here. 
  • Also, the regenerative braking is enabled for the simulation. This means, when the vehicle starts decelerating, corresponding amount of charge will be fed back to the battery.
    Accordingly, the BRK input is connected from a Controlled Voltage Source. This will generate emf corresponding to the intensity of brakes applied and fed the power back to the battery.
  • The Input Threshold parameters are left with their default values.
  • The Output Voltage Amplitude of the H-Bridge circuit is given the same value as the rated DC supply voltage of the DC motor.

     ii)Cotrolled PWM voltage:

     

  • Simulink provides an inbuilt Controlled PWM Voltage block. This block is used for providing the proper pulse inputs to the H-Brdige circuit.  
    The PWM & REF connections are for the corresponding ports on the H-Bridge circuit.
    The 2 reference inputs correspond to the throttle inputs given by the driver. The block generates corresponding pulse width as per the accelerations and brakes apllied by the driver himself.
  • Here, the PWM frequency is 1000 Hz. Also, the simulation mode is Averaged as that in the H-Bridge circuit.

       

  • The input scaling parameters given are -
    0V for 0% duty cycle and 3V for 100% duty cycle. Accordingly, the output voltage amplitude becomes 5V.

4.Driver :
     

  • It is a speed tracking controller for generating normalized Acceleration and Braking commands based on reference and feedback velocities.
  • The VelRef port is the reference velocity port where the input drive cycle data is fed.
  • The VelFdbk port corresponds to the feedback velocity. The actual velocity output given by the vehicle body is connected here. By comparing the actual (feedback) velocity with the reference velocity, the driver block generates acceleration and braking signals in order to minimise the error between the two concerned velocities.
  • AccelCmd & DecelCmd correspond to the acceleration and deceleration commands generated respectively and are connected to the corresponding ports of the Controlled PWM Voltage block.

    Lets see what is there inside the driver block

PID controller:

The block output is a weighted sum of the input signal, the integral of the input signal, and the derivative of the input signal. The weights are the proportional, integral, and derivative gain parameters.

The Driver block is  a controller for the vehicle, it controls the acceleration, and braking of the vehivle. The block is implemented with a PID controller which is basically the main controller in the whole drive cycle. The PID controller works as colsed loop speed control, it takes the input as a reference speed and correct the error genereted by the vehicle speeds. PID conroller is tuned for the adequate acceleration and deacceleration command itis done by limiting its output to upper and lower saturation. Separting the output of the PID to accelerate and deacceleration command we use a saturation block for each command, for acc command we use an upper saturation value and for the deaccelerate command, we use a lower saturation value.

PID gain tuning:

The PID controller coefficients are tunable either manually or automatically.

Here, the selected control type is PI. Acordingly, the block implements proportional-integral (PI) control with tracking windup and feed-forward gains.

          

    Saturation Block:

    

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 in the Command Block.

       Acceleration:

        

        Deceleration:

       

      This block helps to limit the output signal from PID controller and separate deceleration and acceleration values.

      The output from these blocks is sent to a transfer function then these are provided to motor controller block.

  5. Battery Management System:

      

The BMS will also control the recharging of the battery by redirecting the recovered energy (i.e.- from Regenerative Braking) back into the li-ion battery pack (typically composed of a number of battery modules, each composed of a number of cells). Battery thermal management systems can be either passive or active, and the cooling medium can either be air, liquid, or some form of phase change. Air cooling is advantageous in its simplicity. Such systems can be passive, relying only on the convection of the surrounding air, or active, utilizing fans for airflow. Commercially, the Honda Insight and Toyota Prius both utilize active air cooling of their battery systems.

The major disadvantage of air cooling is its inefficiency. Large amounts of power must be used to operate the cooling mechanism, far more than active liquid cooling. The additional components of the cooling mechanism also add weight to the BMS, reducing the efficiency of batteries used for transportation. Liquid cooling has a higher natural cooling potential than air cooling as liquid coolants tend to have higher thermal conductivities than air. The batteries can either be directly submerged in the coolant or coolant can flow through the BMS without directly contacting the battery. Indirect cooling has the potential to create large thermal gradients across the BMS due to the increased length of the cooling channels. This can be reduced by pumping the coolant faster through the system, creating a tradeoff between pumping speed and thermal consistency.

The equivalent circuit of the Battery Block is shown below:

i) Li-ion Battery Pack :

       

When the battery gets charge then there is a exponential voltage drop, and the width of the drop is depends upon the Battery Type. Since the battery is rechargable so a considerable amount of charge can be extracted from the battery until the voltage drops below the battery nominal voltage.

As per the project requirement, the Nominal Voltage of the Battery is set as 300V with initial SOC of 100%.

Its rated capacity is given as 80Ah

The positive terminal of the battery is connected to the Controlled Current Source Block where the current is controlled as per the voltage of the DC-motor.

The value of the parameters set for the Battery is given as a figure below:

ii) Controlled Current Source:

    

This block is responsible converting the Simulink input signal into an equivalent current source. The generated current is driven by the input signal of the block. The block is initialized as a AC current source type and the simulation is started in the steady state condition, so therefore the block input must be connected to a signal starting as a sinusoidal or DC waveform corresponding to the initial values.

The positive and the negative terminals of the block is connected across the Battery and the physical port 'S' is connected to the physical output port 'l' of the Current Sensor of the DC Motor Subsystem. It is arranged in a fashion that the current drawn by the DC Motor is coming form the Generic Battery.

Directly we are getting State of charge of the battery by connecting the bus selector to the m terminal of the battery

 the remaining charge is now converted into percentage value of the charging capacity of the battery.

6.Reference Velocity (Drive Cycle) :

The Drive Cycle Source block is used to provide the reference speed for the simulation.

It generates a standard or user-specified longitudinal drive cycle.

Here, the selected drive cycle is the standard FTP75. 

Simulation :

  • The system is ran for simulation for 2474 s which is the total time for which the input drive cycle is defined.
  • A Solver Configuration is added to ensure proper solving of the mathematical equations by the model.
  • Scopes are connected to analyze different outputs such as the SOC of the battery, the reference velocity & the actual velocity of the vehicle and the distance covered by the vehicle during the total run.
  • The 2 velocities are first converted from m/s to kmph values. For this, simple Gain blocks are used.
  • The distance is calculated by simply time-integration of the vehicle velocity.

Results:

i)Reference speed vs actual speed:-

As we can see from the above picture, the actual velocity of the vehicle differs from the reference drive cycle velocity.

This is because, the chosen battery capacity and motors are not able to propel the speed upto the required extent.

If a battery of higher capacity is chosen, the actual velocity will tend to match with the reference velocity.

but in this case the power rating of the motor also high and battery capacity is also enough if we change the voltage inside the PWM controlled voltage from 3 to 1 then speed will matches and it leads or gear ratio also matters if we lower the ratio from 3.73 to 2 then also the speed leads extremely above reference speed

Also, it may be noted that in certain regions, despite the drive cycle showing small decelerations, the vehicle actually is accelerating with decreasing magnitudes. Reason being the same.

ii)State of charge:-

The State-of-Charge of the battery at the end of simulation run is nearly about 82%.

This means that the battery is not completely drained at the end and the vehicle can run on the same drive cycle for a 5 more times before the battery SOC becomes 0.

Also, the thing to be noted here is, since we had enabled the regenerative braking for the simulation, the battery SOC increases slightly whenever the vehicle undergoes heavy deceleration.we can see the spikes which are emerging upwards

Again, this depends upon the generating tendency of the motor and the maximum amount of current that the battery can take.

iii)Total distance travelled

It may be noted that, since, the reference velocity of the drive cycle never becomes negative (i.e. there is no backward motion of the vehicle), the distance is increasing throughout.

The total distance covered by the vehicle is about 19.5km. 

this value is according acual velocity using reference drive cycle and if the speed of the vehicle matches with refrence velocity effectively then distance also increases with respect to the time.

CONCLUSION :

 The model was succesfully ran for simulation under the standard FTP75 drive cycle. The results have been properly analyzed.

Also, learnt quite a lot of interesting things like -

  • how to model an EV and carry out a real time simulation
  • how a motor controller works and what role it plays in the control of the electric motor
  • how to calculate the battery discharge and km per full charge
  • different powertrain blocks provided by simulink which can be used to simulate a vehicle model.
  • regenerative braking effect on battery(state of charge)
  • power rating of the motor and max speed of the vehicle

Using  this electric vehicle simulation,changing the motor rating values and checking maximum speed it can generate, changing battery capacity and checking the SOC(%) of the battery and changing many other parameters and how its affected on design is observed.

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.