Challenge

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

Aim:-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.

Electric vehicle Model:-

Modelling of Vehicle Body System:-

Part 1:- Vehicle body

The Subsystem consists of different blocks namely

  • 4 tires
  • Vehicle body
  • Inertia
  • Simple Gear

The Subsystem is Shown below:-

Note:-The above figure shows that when the Rear wheels 1 & 2 moves Automatically Front wheel also moves.

Tire:-

A- Axles [Mechanical rotational port associated with the axle that the tire sits on.]

S- Slip [Physical signal output port associated with the relative slip between the tire and road.]

H- Hub [Mechanical translational port associated with the wheel hub that transmits the thrust generated by the tire to the remainder of the vehicle.]

N- Normal force [Physical signal input port associated with the normal force acting on the tire. The normal force is positive if it acts downward on the tire, pressing it against the pavement.]

These tires are connected to the vehicle body.

The vehicle body has various inputs can be modulated for the vehicle to have a basic setup as it consists of parameters

  • NR - Normal Force Rear [Physical signal output port for normal force on the rear axle. Wheel forces are considered positive if acting downwards.]
  • NF - Normal Force Front [Physical signal output port for normal force on the front axle. Wheel forces are considered positive if acting downwards.]
  • H - Horizontal motion[Conserving port associated with the horizontal motion of the vehicle body. Connect tire traction motion to this port.]
  • V - Longitudinal velocity,Speed of the vehicle body [Physical signal output port for vehicle longitudinal velocity.]
  • Beta - Road incline angle,The grade of the vehicle.[Physical signal input port for road incline angle.]

INERTIA:-

This block generally represents the mechanical rotational element.

`T=Jfrac{dw]{dt}`

Where,

T= Inertia torque

J = Inertia

Ω = Angular Velocity

T = Time

The inertia is connected to the simple gear to find the inertia because of axel and gear are a mechanical rotating devices.

SIMPLE GEAR

The Simple Gear block represents a gearbox that constrains the connected driveline axes of the base gear, B, and the follower gear F

B: The output B,base gear is connected with the input of DC motor R. It is a Rotational mechanical conserving port.

F: The output of F,Follower gear is connected with rear axle.It is also a Rotational mechanical conserving port.

Distance Subsystem:-

To find distance of the vehicle a Subsystem is shown below

Battery System:-

The Battery block represents a lithium-ion battery model.The Battery model is shown below.

Parameters for Battery Block:-

The Battery subsystem shows below

The Components used in Battery are

  1. Controlled Current Source
  2. Bus Selector (SOC,Current,Voltage)
  3. product
  4. integrator
  5. constant
  6. Divide
  7. Goto
  • If we select Infinite for the Battery charge capacity parameter, the block models the battery as a series resistor and a constant voltage source.
  • If we select Finite for the Battery charge capacity parameter, the block models the battery as a series resistor and a charge-dependent voltage source.
  • In the finite case, the voltage is a function of charge and has the following formula is mentioned as

`V=V_o(frac{SOC}{1-beta(1-SOC)})`

Where

  • SOC (state-of-charge) is the ratio of current charge to rated battery capacity.
  • V0 is the voltage when the battery is fully charged at no load, as defined by the Nominal voltage, Vnom parameter.
  • β is a constant that is calculated so that the battery voltage is V1 when the charge is AH1.

The connection of the battery is as follows,the negative(-)terminal is connected to the ground and then controls the current source physical port to the positive direction which indicates the flow of current.

The positive (+) terminal is connected to the controlled current source of electrical conserving ports.

Controlled Current Sensor:-

  • The Controlled Current Source block represents an ideal current source that is powerful enough to maintain the required current through the voltage across the source
  • In the controlled Current sensor,it has two-port connected to the battery and one electrical converting port is connected with the PS-Simulink converter to rate transition block and scope.
  • The current sensor is a device that detects and converts current to get an output voltage, which is directly proportional to the current in the designed path.
  • When current is passing through the circuit, a voltage drops across the path where the current is flowing. Also, a magnetic field is generated near the current-carrying conductor.

PS-Simulink Converter:-

  • The PS-Simulink Converter says about connecting the physical signal to the simulink signal. We use this block in the system to connect mostly scopes like physical signals to the simulink signal or simulink scope.
  • For Calculating the SOC we have to use Subsystems to connect different parameters like Rate transition,Gain block,Discrete Time Integrator,Constant and Sum block.

product Block:-

The Product block outputs the result of multiplying two inputs: two scalars, a scalar and a nonscalar, or two nonscalars that have the same dimensions. The default parameter values that specify this behavior are:

  • Multiplication: Element-wise(.*)

  • Number of inputs: 2

Powergui:-

The powergui block allows you to choose one of these methods to solve your circuit:

  • Continuous, which uses a variable-step solver from Simulink®

  • Discretization of the electrical system for a solution at fixed time steps

  • Continuous or discrete phasor solution

The powergui block also opens tools for steady-state and simulation results analysis and for advanced parameter design.

You need the powergui block to simulate any Simulink model containing Simscape™ Electrical™ Specialized Power Systems blocks. It stores the equivalent Simulink circuit that represents the state-space equations of the model.

When using one powergui block in a model:

  • Place the powergui block in the top-level diagram for optimal performance.

  • Make sure that the block is named powergui.

Motor and Controller System:-

The motor and Controller Subsystem is shown below

The Components Used in above figure are

  1. DC Motor
  2. Mechanical Reference
  3. H-Bridge
  4. Current sensor
  5. Controlled Voltage source
  6. Controlled PWM Voltage
  7. Solver Configuration
  8. Electrical Reference
  • DC Motor:-

T

Parameters:-

As we see in the above figure it mainly has 2 sides to the block.The Mechanical block is on the right and electrical block is on the left. Mechanical block has 2 ports ,C and R.The C refers to Casing and R refers to the rotor which produces a Torque.The electrical side has a positive and a negative terminal for the Voltages to be applied.If a positive voltage is Electrical conserving port associated with the DC motor.If a negative voltage is Electrical conserving port associated with the DC motor.

Here in this system ,the positive terminal is connected with the current sensor; the negative terminal is connected with the negative terminal of H-Bridge.

R is DC motor rotor which connects with mechanical rotational port where it is simple gear where as C is DC motor case it is connected to the mechanical rotational reference

Mechanical Reference:-

The mechanical reference block is shown below

The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports. All rotational ports that are rigidly clamped to the frame (ground) must be connected to a Mechanical Rotational Reference block.

H-Bridge:-

The power converter is needed to provide power of the correct form and magnitude from one component to another.In EV’s a power converter is needed to provide a DC voltage from battery of the EV to DC motor.As mentioned i have used a type of H-Bridge motor drive as my power converter.The block is shown below

The H-bridge has 2 ports:-the left side is for controlling of voltage signals and the right side for the terminals to provide the controlled voltage of DC motor.The left side ports of the H-Bridge are shown below

  • PWM:-This stands for Pulse Width Modulation which will provide the voltage pulses to the H-Bridge either in the PWM or average mode
  • REF:-This stands for the Reference
  • REV:-This stands for the Reverse
  • BRK:-This stands for the Brake

Here PWM output port is connected with PWM input port of controlled PWM voltage.The REF and REV port are connected with REF port of controlled PWM voltage port.The BRK port is connected with a controlled voltage source.

It shows that the Positive terminal is connected to the positive terminal of the current sensor and negative terminal is connected with the negative terminal of the DC motor.

Controlled PWM Voltage:-

The Controlled PWM Voltage block represents a pulse-width modulated (PWM) voltage source. The block is shown below.

Ref+:-Positive electrical reference voltage.

Ref - :-Negative electrical reference voltage

PWM:-Electrical conserving port associated with the pulse-width modulated signal.

REF:-Electrical conserving port associated with the floating zero volt reference

For the Electrical input ports variant of the block, the demanded duty cycle is

`100*frac{V_(ref)-V_(min)}{V_(max)-V_(min)} percent`

where:

  • Vref is the reference voltage across the ref+ and ref- ports.
  • Vmin is the minimum reference voltage.
  • Vmax is the maximum reference voltage.

The value of the Output voltage amplitude parameter determines amplitude of the output voltage.

Controlled Voltage Source:-

The Controlled Voltage Source block represents an ideal voltage source that is powerful enough to maintain the specified voltage at its output regardless of the current flowing through the source.The block is shown below

The output voltage is V = Vs, where Vs is the numerical value presented at the physical signal port.

The block has one physical signal input port and two electrical conserving ports associated with its electrical terminals.

Solver Configuration:-

The Solver Configuration block specifies the solver parameters that your model needs before you can begin simulation.The Block is shown below.

The block has one conserving port. You can add this block anywhere on a physical network circuit by creating a branching point and connecting it to the only port of the Solver Configuration block.

It is connected with the controlled PWM voltage and for a model only one solver configuration is connected.

Electrical Reference:-

  • The Electrical Reference block represents an electrical ground.As it shown below
  • Electrical conserving ports of all the blocks that are directly connected to ground must be connected to an Electrical Reference block.
  • A model with electrical elements must contain at least one Electrical Reference block.
  • In this we had connected the electrical reference for the battery and motor etc..

PID Block:-

The below block shows is Pid block

The components that are present in above figure is

  1. PID block
  2. Acceleration Saturation
  3. Decceleration Saturation
  4. Sum

PID block:-

The tuning values

Kp = 0.0100108019359488

Ki = 0.00101437091378446

Kd = 0.0234764426987

A closed-loop system like a PID controller includes a feedback control system. This system evaluates the feedback variable using a fixed point to generate an error signal. Based on that, it alters the system output. This procedure will continue till the error reaches Zero otherwise the value of the feedback variable becomes equivalent to a fixed point.

This controller provides good results as compared with the ON/OFF type controller. In the ON/OFF type controller, simply two conditions are obtainable to manage the system. Once the process value is lower than the fixed point, then it will turn ON. Similarly, it will turn OFF once the value is higher than a fixed value. The output is not stable in this kind of controller and it will swing frequently in the region of the fixed point. However, this controller is more steady & accurate as compared to the ON/OFF type controller.

Discussing about Connection:-

  • VelRef:-Reference vehicle velocity is connected with speed result block.its units is m/s.
  • VelFdbk:- Longitudinal vehicle velocity is connected with an integrator block for continuous-time integration of the VelFdbk signal.
  • AccelCmd:-Commanded vehicle acceleration is connected with controlled voltage source input signal by combination with PS-Simulink Converter.
  • DecelCmd:-Commanded vehicle deceleration is connected with another controlled voltage source signal by combination of PS-Simulink converter.

Saturation:-

Acceleration Saturation:-

The Saturation block imposes upper and lower bounds on a signal. When the input signal is within the range specified by the Lower limit and Upper limit parameters, the input signal passes through unchanged. When the input signal is outside these bounds, the signal is clipped to the upper or lower bound.

When the Lower limit and Upper limit parameters are set to the same value, the block outputs that value.

Parameters and Dialog Box:-

Decceleration Saturation:-

Upper limit
Specify the upper bound on the input signal. When the input signal to the Saturation block is above this value, the output of the block is clipped to this value.
Lower limit
Specify the lower bound on the input signal. When the input signal to the Saturation block is below this value, the output of the block is clipped to this value.
Treat as gain when linearizing
Linearization commands in Simulink treat this block as a gain in state space. Select this parameter to cause the linearization commands to treat the gain as 1; otherwise, the commands treat the gain as 0.
Enable zero crossing detection
Select to enable zero crossing detection. For more information, see Zero Crossing Detection in the Using Simulink documentation.

Drive Cycle Source:-

The Drive Cycle Source block generates a standard or user-specified longitudinal drive cycle.

In the model i have used FTP75 Drive Cycle Source.The drive cycle source is given below

The output plotted the model for FTP75 Model is

The connection drive cycle RefSpd is connected with the VelRef of Longitudinal driver and to the scoop results which generate vehicle reference speed.

The block output is the specified vehicle longitudinal speed, which we can use to:

  • Predict the engine torque and fuel consumption that a vehicle requires to achieve desired speed and acceleration for a given gear shift reference.
  • Produce realistic velocity and shift references for closed loop acceleration and braking commands for vehicle control and plant models.
  • Study, tune, and optimize vehicle control, system performance, and system robustness over multiple drive cycles.

Result:-

SOC and Vehicle_Speed:-

The Result for the Vehicle speed and reference speed is shown below

The simulation was run for about 2474 sec and we have obtained result shown above. There are 2 individual graphs showing the result for Soc and vehicle speed result.The graph of the battery SOC shows a linear and a slow discharge rate from 100 to 60.If we observe the 2nd graph the Vehicle speed is some similar to the Drive cycle source by increasing saturation values.

Conclusion:-

Hybrid cars are definitely more environmentally friendly than internal-combustion vehicles. Batteries are being engineered to have a long life. When the hybrid cars become more widespread, battery recycling will become economically possible.

The power losses are comaratively less than a conventional vehicle as they use a complex gear system but to use the EV at the full potential there is a need to increase a public charging station. The Manufacturing of Electric vehicles is domestic, for instance, come at a high cost, production of battery is largely expensive due to material like cobalt hence there is a need to find an alternate for such materials.

There is a need for adoption of thr electric vehicle especially for india as it could save up to $300bn in oi; imports and 1 gigaton of co2 emmision.

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.