SOC Estimation and modelling of Electric Vehicle EV in MATLAB



By: Nachiketh.V. Boin 
YouTube Video: 

For Simulink Model File:   

Aim: Modeling and Simulation of Electric Vehicle (EV) using Matlab


Objectives: 

 1. To make a simple, low run-time model of an electric vehicle using individual component models.

 2. To check performance parameters: Speed, SOC, current, etc. with various drive cycles.

 3. To play with: motor power, vehicle body (rolling resistance, air drag, weight) inputs.

 4. To know MATLAB models and their configurations to match with an actual vehicle.


Software used:  MATLAB-SIMULINK  


MATLAB Packages Used: 

Simscape package, also need the driveline package, the powertrain block set package and electrical package. All for Simscape. 


Illustration of general EV Configuration: 


Block Diagram: 


MATLAB Model of Electric Vehicle: 


Model parameters: 

Vehicle Body & Transmission: 

Motor will produce the rotational output which will give to the vehicle body and transmission system. The rotational output is taken by the gear system here to maintain the constant speed throughout the transmission without any loss in speed from the motor to tires. Below is a diagram that is how it is how it inside the vehicle body and transmission system and in the main design, it is referred just only as a transmission system. 

Here you can see a Rear-wheel-drive transmission system.





Motor & Control system: 
Motor type: DC Motor

 

This 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. Motor parameters can either be specified directly or derived from no-load speed and stall torque. If no information is available on armature inductance, this parameter can be set to some small non-zero value.

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.

The Motor controller will get input from the longitudinal driver. Its tasks are to control the speed of the motor and drive according to the input of the driver. Majorly motor controlled we designed had two main parts named PWM voltage generator and H-Bridge. 


Controlled PWM Voltage source:





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. Right-click the block and select Simscape->Block choices to switch between electrical +ref/-ref ports and PS input u to specify the input value.

At time zero, the pulse is initialized as high unless the duty cycle is set to zero or the Pulse delay time is greater than zero.

The Simulation mode can be set to PWM or Averaged. In PWM mode, the output is a PWM signal. In Averaged mode, the output is constant with value equal to the averaged PWM signal.


Power Converter:

             H-Bridge:










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 Simulation mode parameter value must be the same for the Controlled PWM Voltage and H-Bridge blocks.

If the REV port voltage is greater than the Reverse threshold voltage, then the output voltage polarity is reversed. 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. Voltages at ports PWM, REV and BRK are defined relative to the REF port.

If exposing the power supply connections, the block only supports PWM mode.



Battery: 

The battery is required to power the controller and motor. The controller uses the battery power according to produce the input given by the motor to obtain maximum speed. The battery is also used to power every electrical component in the vehicle. The battery has two stage one is charging and another one is discharging state. The battery is of 80AH capacity.

 
Drive Cycle: 
Drive cycle is assumed as the driver's input of a vehicle, it replaced how a driver will drive a vehicle. These drive cycles are standard drive cycle which is used to test the vehicle performances. These drive cycle will have high speed, low speed, braking conditions in it. There are different drive cycles like WOT, FTP75 etc., Here in this model I have used FTP 75 Drive Cycle source. 


Driver Controller:

A parametric longitudinal speed tracking controller for generating normalized acceleration and braking commands based on reference and feedback velocities.

Use the external actions to input signals that can disable, hold, or override the closed-loop commands determined by the block. The block uses this priority for the input commands: disable, hold, override.

Drive cycle is connected to a longitudinal driver, it has six ports namely velocity reference, velocity feedback, grade, info, Acceleration, Deceleration.  











Results:

 Distance Travelled:  


Velocity vs Time Graph (for 100 s, 0.54 km travelled): 



Velocity vs Time Graph (for 11.4 km distance travelled): 



Conclusion:  
Hence, The Electric vehicle is created by MATLAB Simulink. EV has obtained an output according to the FTP75 drive cycle and it can be tested for any drive cycle by selecting in the drive cycle block. It has travelled 11.14km by the present 80AH battery capacity. If we increase the battery capacity to higher levels, we can travel more distance but in the real time this should be done by considering the space and cost.

              



Comments

Popular posts from this blog

Simple Production Line in Siemens Tecnomatix Plant Simulation

16x02 LCD via I2C (PCF8574) using STM32F103C8Tx microcontroller.