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 blocks for speed control.

Prepare a report about your model including the following:

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

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

ANS:

AIM: Create a MATLAB model of an electric car that uses a battery and a DC motor.

ABSTRACT:

In this project, we will build the MATLAB model of an ELECTRIC CAR by using a DC motor and a suitable battery. Before that, we will know about what is Electric vehicle, how it works, and the benefits of EVs. Then we make an actual EV model in SIMULINK with suitable blocks from the powertrain block set. My main motto is to check "how my vehicle performs by the different drive cycles and different parameters.

OBJECTIVE:

  • To make the simple and low run-time vehicle model using the individual component model.
  • To check out performance parameters: Speed, SOC, current, etc. with various drive cycles.
  • To play with Motor power, vehicle body (Rolling resistance, Air drag, weight) inputs.
  • To know the MATLAB model and their configuration to match with the actual vehicle.

METHODOLOGY:

  • The electric vehicle consists of a battery, motors, and controller then it generates propulsion power.
  • For design first we have to calculate propulsion power, then the motor is selected.
  • Lastly based on the motor rating or operating range and no km/charge we want to depend on everything battery capacity and battery capacity is selected.
  • So the Design flow of the Electric vehicle engineer has to be like the following:

1) Identify what amount of propulsion power required

2) What is the best suitable motor for that propulsion power.

3) Then type of battery and range of battery according to the range.

PROCEDURE:

1) Identify what amount of propulsion power required

2) What is the best suitable motor for that propulsion power.

3) Then type of battery and range of battery according to the range.

Why we should be required to calculate 1st propulsion power?

The final outcome of the vehicle is propulsion power and therefore the start point should be what is propulsion power on the calculation of proper power, therefore, the study must begin with an estimation of propulsion power.

Why we should Design first instead of directly build the model of EV?

This mathematical model must be built before making an actual hardware design so this model offers great flexibility in conceptual design modification. For example, If I changed the components, you can do it easily in a mathematical model rather than in actual mode and check its parameters.

This model gives the performance idea with reasonable accuracy and avoided repetitive road tests. Models are very helpful in many situations can be realized safely only in analysis and calculation i.e .. thermal.

Yes, there are limitations of mathematical models also it is really difficult to implement all the aspects involves so those models are with certain assumptions with certain inaccuracies. But more and more aspects you covered the more and more benefit and accuracy will get.

Now we start to design the model from zero like from Wheel, vehicle body, then we get to the motor, battery and it will be full powertrain.

so we divided our model into some part as below:

1) Wheel and vehicle body (mechanical part).

2) Electric system.

3) Battery System and SOC.

4) Controller.

5) Inputs.

Wheel and vehicle body:

For wheel and vehicle body we have to consider the following parameters

Force acting on the vehicle- 1) To bring the vehicle to accelerate. 2) To maintain that speed.

Whhere,

1) ψ= Angle

2)fte= tractive force.

3)frr= Rolling resistance force.

4)fad= Airo dynamic drag force.

5)fhc= Hill climbing force.

In the above fig.

fte=frr+fad+fhc+acceleration force.

Tow type of acceleration force is their linear acceleration force and angular acceleration force.

Rolling resistance force -

The rolling resistance can be expressed by the generic equation,

Fr=cW (1)

where

Fr = rolling resistance or rolling friction (N, lbf)

c = rolling resistance coefficient - dimensionless (coefficient of rolling friction - CRF)

W = m ag

= normal force - or Weight - of the body (N, lbf)

m = mass of body (kg, lb)

ag = acceleration of gravity (9.81 m/s2, 32.174 ft/s2)

Note that the rolling resistance coefficient - c - is influenced by different variables like wheel design, rolling surface, wheel dimensions, and more.

The rolling resistance can alternatively be expressed as

Fr = cl W / r (2)

where

cl = rolling resistance coefficient - dimension length (coefficient of rolling friction) (mm, in)

r = radius of wheel (mm, in)

Some typical rolling coefficients:

Aerodynamic drag force:

This force considers the shape drag and skin friction basically for doby of vehicle

This force function of the frontal area, shape, side mirror, ducts, air passage, etc.

f(ad)=1/2*rho*A*C(d)*v^2

Where ρ">ρρ= Air density.

A =Frontal area.

Cd= drag coefficient

V= velocity m/s

Hill climbing force:

F(hc)=m(g)

This force is also represented by using GRADEABILITY. Gradeability can overcome by vehicle constant speed. There are two ways :

1) degree 2) percentage

The power output by the car's engine goes into the force-directed up the slope. This force is actually static friction exerted on the drive wheels by the road - the road exerts this force F because the engine causes the drive wheels to rotate.

By considering all parameters we can know the design of the vehicle body and Wheel of the car.

So we selected the following block for tire and vehicle body:

In the above body and tire model following blocks are used:

1) Tire (Magic Formula):

Represents the longitudinal behavior of a highway tire characterized by the tire Magic Formula. The block is built from Tire-Road Interaction (Magic Formula) and Simscape Foundation Library Wheel and Axle blocks. Optionally, the effects of tire inertia, stiffness, and damping can be included.

A is the mechanical rotational conserving port for the wheel axle

H is the mechanical translational conserving port for the wheel hub through which the thrust developed by the tire is applied to the vehicle.

N is a physical signal input port that applies the normal force acting on the tire.

S is a physical signal output port that reports the tire slip.

So this is a car we need 4 wheel and this tire ports connected to the appropriate signal as mention above.

Following parameters considered for tire:

Now we just take the default values to check how they perform but we can take parameters of the currently present car model.

2) Vehicle Body:

Represents a two-axle vehicle body in longitudinal motion. The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile. The vehicle can have the same or a different number of wheels on each axle. Optionally include pitch and suspension dynamics or additional variable mass and inertia.

H is the mechanical translational conserving port associated with the horizontal motion of the vehicle body. The resulting traction motion developed by tires should be connected to this port.

V, NF, and NR are physical signal output ports for vehicle velocity and front and rear normal wheel forces, respectively.

W and beta are physical signal input ports corresponding to headwind speed and road inclination angle, respectively.

Following parameters considered for vehicle body:

3)Simple gear:

Represents a fixed-ratio gear or gearbox. No inertia or compliance is modeled in this block. You can optionally include gear meshing and viscous bearing losses.

B (base) and F (follower) are mechanical rotational conserving ports.

Specify the relation between base and follower rotation directions with the Output shaft rotates parameter. Optionally include thermal effects and expose thermal conserving port H by setting the Friction model to a temperature-dependent setting.

Here we selected a gear ratio is 5.

Electric system:

Depending upon the tractive force, Environmental conditions, type of vehicle application we choose the motor for the vehicle. For that motor we will decide the controller

In Electric system Included the Motor, H-Bridge, controlled PWM voltage.

As per our Aim, we using the DC motor and for that motor, we used DC to Dc converter which is H-bridge.

Following is my Electric model used in this EV model:

To build this model we used the following blocks and parameters changed in it:

1)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 the 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.

Following parameters, we used for this Ev model:

This DC motor is Mechanically coupled with Simple gear Which having a gear ratio is 5.

For this DC motor, our rated DC voltage is 300v so we require an 300-volt battery this battery connected to the motor through H-bridge.

To change the speed and reverse the direction of the rotor we h-bridge in this model.

2)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.

The following parameters are selected for H-bridge:

3)Controlled PWM voltage:

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. The 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 a value equal to the averaged PWM signal.

Electrical input ports — The block calculates the duty cycle based on the reference voltage across its ref+ and ref- ports. This modeling variant is the default.

PS input — Specify the duty cycle value directly by using an input physical signal port.

Following parameters used in Controlled PMW voltage:

4)Controlled voltage source:

The block represents an ideal voltage source that is powerful enough to maintain the specified voltage at its output regardless of the current passing through it. The output voltage is V = Vs, where Vs is the numerical value presented at the physical signal port.

Electrical Reference:

Electrical reference port. A model must contain at least one electrical reference port (electrical ground).

Current sensor:

The block represents an ideal current sensor, that is, a device that converts current measured in any electrical branch into a physical signal proportional to the current.

Connections + and - are conserving electrical ports through which the sensor is inserted into the circuit. Connection I is a physical signal port that outputs the current value.

5)Battery System and SOC:

To give electric power to the EV model we need a battery set.

6)Battery:

This block models a battery. If you select Infinite for the Battery charge capacity parameter, the block models the battery as a series internal resistance and a constant voltage source. If you select Finite for the Battery charge capacity parameter, the block models the battery as a series internal resistance plus a charge-dependent voltage source defined by:

V = Vnom*SOC/(1-beta*(1-SOC))

where SOC is the state of charge and Vnom is the nominal voltage. The coefficient beta is calculated to satisfy a user-defined data point [AH1, V1].

7)(SOC) the state of charge estimator:

This estimator includes the above block which explained below:

Rate Transition: Handle data transfer between different rates and tasks.

Gain: Element-wise gain (y = K.*u) or matrix gain (y = K*u or y = u*K). Where we used 300v battery so our formula is like 1/(300*3600)

Discrete-time Integrator: Discrete-time integration or accumulation of the input signal.

Scope: to get the result of SOC, Current.

PS Simulink converter: Converts the input Physical Signal to a Simulink output signal.

9)Inputs:

for the Control hole EV model we give input which is Drive cycle, Signal Bilder, etc.

To select the one from these 2 we used the multiport switch as shown above.

10)Drive cycle:

generates a standard or user-specified longitudinal drive cycle. The block output is the vehicle longitudinal speed. You can import drive cycles from:

- Predefined sources

- Workspace variables, including arrays and time series objects

- mat, Xls, xlsx, or txt files

Use the fault tracking parameters to identify drive cycle faults within the specified speed and time tolerances.

We used Drive cycle is FTP75. According to the drive cycle, we have to change Simulink time.

Now run our model and get the result run time will be 2474.

EV model:

Result:

1) let check our model will follow the input drive cycle :

As seen in the graph our model follows the drive cycle.

2) Now we check the Battery state (SOC):

3) check the current Flow:

The vehicle traveled distance:

So for the drive cycle, our model covered 4.934km/ph distance.

Conclusion:

1) EV model Covers the 4.934 km/ph distance.

2) My Ev model followed the reference drive cycle. As we saw in the result our top speed is 26 km/h.

3) When we completed 4.934 km/ph distance SOC is 94.5%.

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.