I Engineered the Future: Electric Vehicle Design with MATLAB!

Adityakale
8 min readJun 16, 2024

--

AIM:Create a MATLAB model of electric car which uses a battery and a DC motor. Choose suitable blocks from Powertrain block set. Prepare a report about your model including following:

Objectives:

1. System level configurations

2. Model parameters

3. Results

4. Conclusion

Theory:

An electric vehicle (EV) is a vehicle that uses one or more electrical motor for propulsiion. An electric vehicle may be powered through a collector system by electricity from off-vehicle sources, or may be self-contained with a battery, Solar pannel,fuel cell and generator to convert fuel to electricity.

In the 21st century, EVs have seen a resurgence due to technological developments, and an increased focus on renewable energy and the potential reduction of transportation’s impact on climate change and other environmental issue.

Electrical Vehiacle Block diagram:

Battery:

The battery is a very important component of any EV,it can be charged buy the grid supply,and can be used further to power the vehicle.

Varrious technology are used in battery depending on the different conditions and performance.

Type of battery:i)Lithium-ion,ii)Lead Acid Batteries,iii)Nickel Metal Hydride Batteries.

Motor controller:

The motor controller plays a major role in controlling the motor ,it acts as a link between the battery and the motor.

It helps monitor and regulates all key performance indications such as the vehicle’s operator, motor, battery, and accelerator pedal. It has a microprocessor which can limit or redirect current. It is used to either improve the mechanical performance of the car or suit the operator’s driving style. There are also more refined controllers which are capable of greater accuracy and thus, higher efficiency.

Motor:

For any electrical vehicle the motor is the heart of the vehicle,insted of other conventional vehicles in EV motor is very simpe with less moving parts as compared to the other gasoilne vehicles,due to there less complex design they are reliable and have high efficiency than other gassoline engines.

The motor is chossed based on the supply of the volatge ,it could be AC and DC type.

1. System level configurations(Vehicle Design):

a)Wheels:

i)The vehicle consist of 4 wheels ,and Rear wheel driven.

ii)The wheels are modelled using simple Tire (Magic formula) simulink blocks.

iii)the tire consist of N,A,H,S ports .

iv) The N ports is for the Normal Reaction acting on the tire.

v)The A port corresponds to the Mechanical Rotational conserving port for the wheel axle,so we should connect the same axle tires with each other.

vi)S port is for the Slip

vii)H port is the wheel hub through which the thrust developed by the tire is applied to the vehicle.So we need to connect the gears with the H port.

All the parameters are kept constant.

Vehicle Body:

The vehicle body block in the name suggest it holds all the components of the vehicle which needs to be mounted on it.

The block accounts for — body mass,aerodynamic drag,road incline,weight distribution between axles due to accelerationroad profile.

We can easily change the parameters depending upon the vehicle type and design.

In this model we kept all the default values.

To calculate the darg force we can change the following paameters.

The vehicle body Subsystem:

The simple gear box is used and aslo connected in the subsystem.

NR and NF are the front rear wheels mounts.

H is the hub connected with the Tiers hubs.

Other ports are keept constant.

DC Motor:

In this model we have used the DC motor as it is the most simple motor to use and control.

The bule part of the motor block is electrical and the Green part is the mechincal .

The motor is Parmanent magnet DC type,

To control the motor we use the controller circuit.

The Motor controller circuit:

H-Bridge-

PWM-Input pulse is given to this port with the help of Controlled PWM volatge Block.

H-bridge can operate in PWM and Average mode.

REF: The port is for the reference input.THE refernece input is connected to the ground.

REV:The port is used for the reverce motion of the motor ,but for this model use connect the REV with the REF port as we do not consider the backward motion of the vehicle.

BRK:This port is used for braking and the regenerative braking so when ever the vehicle speed reduces or deaccelerate the electrical power will be feed to the battery and the battery will get charge.

The inputs threshold is keept at there default values:

The bridge parameters: Volatge is keept at 300V,resistance-0.1ohm,resistance of the freeweeling diode-0.05ohm:

Controlled PWM voltage bolck connected with the H-bridge:

Controlled PWM Voltage Block:

The inputs ports is takens as the acceleration given by the driver,block generates corresponding pulse width as per the accelerations and brakes apllied by the driver himself.

The PWM and the REF ports are given to the H-bridge as the inputs.

Subsystem for the motor controller.

The Longitudinal driver:

  • It is a parametric longitudinal speed tracking controller for generating normalized Acceleration and Braking commands based on reference and feedback velocities.The VelRef port is the reference velocity port where the input drive cycle data is fed.The VelFdbk port corresponds to the feedback velocity. The actual velocity output given by the vehicle body is connected here. By comparing the actual (feedback) velocity with the reference velocity, the driver block generates acceleration and braking signals in order to minimise the error between the two concerned velocities.
  • The garde correspond to the grade angle.In this model we have not considered the grade angle.
  • Info is not used so it is connected to the PS Terminator.
  • Here we are using PI as the control type.

We can set the proportional and intergal gain as per our need for the proper control.

Drive cycle(source):

  • Here the drive cycle source gives the reference signal speed fo which the simulation need to be carried out.
  • here the drive cycle is the FTP75.
  • The drive cycle is for 2474 Seconds
  • Drive Cycle FTP75 plot.

Battery:

  • Simple battery block is used to supply the power to vehicle.
  • This block is simple to use and it will reduce the simulation time.
  • The nominal voltage is kept to 80V.
  • Other parametres are kept to the default value.

State of Charge (SOC):

  • This subsystem block is used to calculate the SOC of the battery.
  • Initialy we consider 100 % of battery charge.
  • ZOH block (zero order hold)is used to sample the input signal.
  • Gain(K)=1/(80*3600)
  • 80 is the volatge and 3600 is the time.

The output from the discrete time integrator is compared with the full charge of the battery and then we can get the current SOC of the battery.

Distance Calculation subsystem:

  • The velocity is given as the input to this subsystem and then the input is integrated and converted into distance and we can display the distance travel on the display.
  • The EV model:

The model is simulated for 2474 seconds as per the driving cycle.

OUTPUTS RESULTS:

Velocity input /Velocity Feedback.

From the above plot ,we can see that the actual velocity is different from the input velocity.The vehicle requires some more aditional time to match the input signal for acceleration as well as deaccelaration.

Sate of the charge(SOC):

  • At the end of the simulation the SOC of the battery is still 89%.This means battery is not completely drained .And the spikes upside in the above plot shows the regenerative braking taking place.Regerative braking is possible due to the controller we have used in the simulation.

Current(A):

Voltage(V):

Conclusion:

Thus we haves succesfully done the simulation for the standard FTP75 drive cycle using DC motor . Understand and analysed the results of the simulation.Use of different type of simulink blocks.

We have seen how to model an EV and carry out a real time simulation and how a motor controller works and what role it plays in the control of the electric and succesfully calculate the SOC of the battery.

--

--

Adityakale
Adityakale

Written by Adityakale

Software Engineer with expertise in CI/CD, containerization, and infrastructure monitoring.

No responses yet