Challenge

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


To create a SIMULINK model of an electric vehicle (EV) that is powered by a lithium-ion battery with speed control implementation using a PID controller.

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

To model the EV in SIMULINK, we need to model the individual components of an EV such as the motor, controller, power converters, wheels, and batteries. All of these components are available as blocks from the simscape and powertrain blocksets. The various components of the EV will be modelled and explained in the sections below:

Vehicle Body

To model the body of the EV, we need to insert the vehicle body block shown in the image below:

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.

Double-clicking the vehicle body block opens the block parameters shown below:

Main Tab

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.

Drag Tab

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.

Tires

In this model, I have used the "Magic Formula" tires. There are various tire blocks that can be used, but the advantage of the magic formula ones is that they enable us to model the longitudinal behavior of tires on a highway. This block is shown below:

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.

Double-clicking the magic formula tire block, opens the block parameters window shown below:

Main

In the "Main" tab, we can model parameters such as tire nominal vertical load, and various coefficients. All values are kept as default.

Geometry

In the "Geometry" tab, we can model the rolling radius of the tire.

Dynamics

In the "Dynamics" tab, we can model parameters such as the tire inertia and initial velocity.

Rolling Resistance

In the "Rolling Resistance" tab, we can model the effect of rolling resistance more closely. In this model, I have turned on the effect of rolling resistance, and have used a constant rolling resistance coefficient.

Gear

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. This block is shown below:

Double-clicking this block, opens the block parameters where we can model additional parameters of the gear.

Main

In the "Main" tab, we can model the follower to base teeth ratio and the direction of rotation of the output shaft. These settings were kept as default.

Side Shaft

The side shaft block is used to create inertial effects on the simple gear. This block only has one mechanical rotational conserving port and the positive direction of the block is from the port to the reference point (simple gear block). The side shaft block is shown below:

Double-clicking the side shaft block, opens the side shaft block parameters shown below:

Vehicle Body Subsystem

The full vehicle body system is shown in the image above with all the aforementioned blocks connected together. Four magic tire block are used to represent a four-wheeled vehicle. This system is then converted to a subsystem shown in the image below:

Motor

For my EV model, I am using a DC motor block which is shown below:

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:

Electrical Torque

Under the "Electrical Torque" tab, we can model the electrical torque characteristics of the DC motor such as no-load speed, and rated DC supply voltage. I have used the values and settings shown in the image above.

After setting the DC motor block parameters, make the connections as given in the image below:

Power Converter

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. The electrical reference block is shown below:

In this EV model, we are using this block for 2 occasions. The first is for to create an electrical ground between the controlled voltage source, controlled PWM voltage and the H-Bridge blocks. The second is for the battery system which will be modelled afterwards,

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. The solver configuration block is shown below:

Battery System

The battery system is an essential part of the EV model as it will provide the electrical power required to power the DC motor. The components of the battery system are explained below:

Battery

The battery block used is a simple one and considers only the basic parameters. The battery block is shown below:

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. The controlled current source block is shown below:

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 current sensor block is shown below:

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.

From the image above, we can see that the current sensor is embedded in between the electrical side of the DC motor and the H-Bridge. The current sensor can be connected from its physical signal port to the remaining components in the battery system including an electrical reference block. This is shown in the image below:

Results

Motor RPM , SOC, Current:

For the default values, there appears to be a delayed response time in the actual vehicle speed. There is no overshoot and there is very minimal steady state error.

Speed, Torque, EMF :

Conclusion

In conclusion, the vehicle speed was controlled to some extent with the implementation of the controller block. Since this was not a linearized system, the auto-tune feature in the controller block could not be used. Trial and error was performed in a few attempts to control the speed of the vehicle to match the drive cycle reference speed more closely. Despite being able to manually tune the controller, the vehicle speed was still unable to reach the desired peak speed value of 5 m/s from the drive cycle. In addition, the vehicle was also unable to sustain said peak speed value from the drive cycle for the desired time period of 2 seconds.

These shortcomings maybe due to the various reasons. For instance, the vehicle may be unable to achieve a value of 5 m/s due to the rolling resistance effect between the road surface and tires.

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.