Challenge

Modelling an electric Car with Li-ion battery

Objectives :

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.

System level configurations:

Vehicle Parameters :

Drive train : Pure Electric Vehicle

Vehicle Type : Small Cargo Vehicle

Battery Pack : Li-ion Battery Pack (25 Modules)

Nominal Voltage : 308 V

Motor : 75 kW (Rated Power) DC Motor

Net Vehicle Mass : 1784 Kg

Payload : 500 Kg

Width : 1.765 m

Height : 1.595 m

EV Motor Power Calculations (Low Tyre Pressure)

Default EV

Rolling Resistance

Curb Weight (Kg)

1784

Payload(Kg)

500

Default EV

Coefficient of Rolling Resistance (urr)

0.0222

Rolling Resistance Force (N)

496.90704

Tyre 215/50R17

Dia

646.8

mm

Air Drag Calculation

Radius

0.3234

m

Air Density (Kg/m3)

1.25

Width (m)

1.765

Total Traction Force

3000.842586875

N

Height (m)

1.595

Frontal Area (m2)

2.815175

Gear

7

(1:7 Gear Ratio)

Drag Coefficient

0.2

Speed(kmph)

90

Wheel Torque (Nm)

970.472492595375

(Maximum)

Air Drag(N)

219.935546875

Motor Torque (Nm)

138.638927513625

(Maximum)

Total Power at given speed (kW) Air Drag + Rolling Resistance

17.921064671875

kW

Speed of axel

77.3036487322202

rad/s

Hill Climbing

Angle (Degree)

0

Speed of shaft

541.125541125541

rad/s

Speed during hill climbing (kmph)

25

Force(N)

0

Power (Rated)

75.021064671875

kW

Hill Climbing Power (kW)

0

kW

Acceleration Calculation

Final Speed (0 to x kmph)

90

Acceleration Time (sec)

25

Acceleration (m/s2)

1

Acceleration (N)

2284

Acceleration Power(kW)

The MATLAB model has five components :

1. Vehicle Body : It includes the vehicle body, tires and gear

2. Electrical System: It includes the power converter and dc motor

3. Battery : It includes calculation of State of Charge and battery model

4. Driver: It includes the PID control based on the actual and reference speed

5. The drive cycle : It includes reference speed with respect to time.

Fig 1 : System Level Design

Model parameters:

1. Vehicle Dynamics

It constitutes of the vehicle body, load, gear and the tire. We will look into each in detail.

Fig 2 : Vehicle Dynamics

The vehicle body has the total mass of 2284 Kg. There are two axels and two wheels on each axel. The frontal area of the vehicle is 2.815 m^2 for the calculation of drag force. H is the connection or horizontal movement of vehicle. W is the road incline angle, which we have taken as 0. The outputs are V or the velocity, in m/s. NF and NR are the front wheel and rear wheel force.

Fig 3 : Vehicle Body Parameters

The tires are modelled based on the longitudnal traction force. The peak traction force calculated is 4500 N which has been used as a parameter. The nominal force is taken as 4500 N. The Tire (Magic Formula) block is used here. Output here is the slip. The radius of wheels is taken as 0.3234 m which is same as for 215/50R17 model.

Fig 4 : Tire Paramters

The transmission gear box in electric vehicle has a single gear ratio. The gear ratio chosen is 7. The output and input shaft rotate in the same direction.

Fig 5 : Gear Ratio

2. Electrical System

The electrical system consistes of the power converter and DC motor. The throttle output is controlled by the driver. This output is the control signal for generating PWM signals for power converter. The power converter used here is 4-quadrant H bridge. This converter can work in all four quadrants and can be used for regenerative braking as well. Here a PMDC motor is used. The field is provided by permanent magnets. Here, solver configuration is set to use the Backward Euler solver, which increases the simulation speed significantly. The number of iterations are also high to get greater accuracy.

Fig 6 : Electrical System

The DC motor is using permanent magnets for in the stator. The rated output of the motor is the same as calculated i.e. 75 kW. The rated DC supply is 308 V. 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. When a positive current flows from the electrical + to - ports, a positive torque acts from the mechanical C to R ports. Motor torque direction can be changed by altering the sign of the back-emf or torque constants.

Fig 7 : DC Motor

The H Bridge is 4 quadrant DC-DC converter. It has four switches and can work in all four quadrants, i.e. Forward Motoring, Forward Braking, Reverse Motoring and Reverse Braking. In the drive cycle, only forward motoring and forward braking mode is used. The block is driven in PWM mode. In PWM mode, the motor is powered if the PWM port voltage is above the Enable threshold voltage. The Simulation mode parameter value must be the same for the Controlled PWM Voltage and H-Bridge blocks.

If the BRK port voltage is greater than the Braking threshold voltage, then the output terminals are short circuited via one bridge arm in series with the parallel combination of a second bridge arm and a freewheeling diode. This happens when the decceleration command is applied. Voltages at ports PWM, REV and BRK are defined relative to the REF port.

Fig 8: H Bridge Parameters

The gate signals are generated using Pulse Width Modulation technique. The carrier signal has the frequency of 5000 Hz. Acceleration command and Deceleration command vary from 0 to 100%. For a 0% signal, the controlled voltage source has a value of 0 V and for 100% throttle , the controlled voltage is 0.5. This value is decided by the output of the PID controller from the control block. This throttle signal is the control signal for generating PWM signals.

Fig 9 : PWM Controller Parameters

3. Battery / SOC

Here a rechargeable Li-ion battery pack is used. The battery SOC is calculated using the current flow through the battery. This is represented by a current source. The nominal voltage of the Li-ion battery as calculated as 308 V at 90% SOC. The rated capacity of the battery is 100 Ah. The battery gets depleted in the forward motoring mode as the DC machine absorbs power and acts as a motor.

Fig 10: Battery System

In the forward braking mode, the SOC of battery increase, as the battery gets charged. This is possible since the DC machine acts as a generator in the 2nd quadrant / regenerative braking mode. An internal power source of 308 V is provided. With the duty ratio of 100% the nominal voltage of 308 V is obtained at the output of the H bridge. THe enrgy consumed is also calculated with the units of Wh.

Fig 11 : Battery Parameters

4. Driver Control :

The control of the driver decides if the output speed of the vehicle follows the input speed. Here, this control is modelled using PID control. The input to the PID controller is the difference between the reference speed (VelRef) and the actual speed(VelFbk) . The output of the PID control is limited between 0.5 and 0 when the actual speed is less than the reference speed. In this case there is an acceleration command. Similarly, PID output is limited between 0 and -0.5 when the actual speed is more than the reference speed. In this case there is an deceleration or braking command.

Fig 12 :Driver / PID Control

Fig 13 : Saturation limit of PID Output

PID Tuning

First, the PID is tuned for step input driving cycle. Here, according to our vehicle data, 90 kmph (25 m/s) should be attained in 25 sec. A new plant is identified in the tuner. A step input is provided, and the response is tuned.

Fig 14 : Step Input Drive cycle used for tuning PID controller

For tuning, a new plant is identified. Here, the data is collected by tuning the PID controller with a step input at 15 sec.

Fig 15 : Plant identification with a step input at 15 sec

Further, the plant is estimated using two real poles. The data is analysed and tuned using Nonlinear least squares with automatically chosen line search method. This gives 97.8% fit model data.

Fig 16 : Plant identification and tuning

Fig 17 : Tuned PID controller

When these values of PID parameters are applied to the model, there is an overshoot. To reduce the overshoot in the actual drive cycle, we need to increase the derivative parameter.

Fig 18 : Tuned PID controller for final drive cycle

Results:

The WOT and FTP drive cycle is used for simulation. The FTP75 cycle runs for 2474 sec and covers 18.1 Km. The maximum speed is 91.25 Km/h and average speed is 25.82 Km/h. There are 22 stops in the cycle.

The actual speed and the reference speed from drive cycle are compared here. The results can be seen in Fig 19-20. The controller is working for most of the driving cycle. The controller needs to be further tuned for better speed control. Moreover, physical brakes have not been implemented in the model, do, the vehicle takes more time to decelerate. It is clear that 100% energy cannot be recovered through regenerative braking. The State of Charge % for FTP75 can be seen in Fig 23. THe SOC is 90 % at the start of the driving cycle. It is 86.4% at the end of the cycle. The SOC increases during deceleration due to regenerative braking.

Fig 19 : Reference speed v/s actual speed for WOT Drive Cycle

Fig 20 : Reference speed v/s actual speed for FTP75 Drive Cycle

Fig 21 : Calculation of total distance covered (Km)

Fig 22 : Calculation of energy consumed(Wh)

Fig 23 : Battery SOC %

Fig 24 : PWM control voltage

Fig 25 : Motor Input Voltage

Conclusion

The Simulink Model of an electrical vehicle is presented here. Powertrain blockset is used here, which simulates the real world electrical and mechanical systems. The controller and solver have to be tuned properly to get correct results. First, Wide Open Throttle (WOT) test was conducted for a sanity check on the parameters.Then the FTP drive cycle is evaluated.

It is observed that acceleration is faster than the deceleration. This is true in real world as well since the discharge rate of battery is generally more than the charging rate. Mechanical brakes and current limiter circuit are needed better braking action and faster response. Controller also needs to be tuned to get accurate and fast results. Speed of simulation depends on the solver configuration., thus it should be chosen carefully.

The model is able to complete the drive cycle with only 4% reduction in SOC at the end of drive cycle. The high amount of regenerative energy is fed back to battery as others losses like heat, noise and vibration are not taken in the simulation. However, this model proves that the given motor, power converter and battery pack can be used for this electric vehicle application.

The PID tuning is done in this project. For this, PID tuner app is used. First the PID is tuned for a step input. This gives a rough estimate of the PID values for robust response. The speed response is dependent on the vehicle parameters. Finally, for the given drive cycle, some slight PID tuning is done to get more accurate results.

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.