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

Prepare a report about your model including following:

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

Aim of the project:

The aim of this project is to simulate an electric vehicle drive. Using any drive cycle. The control of the electric vehicle speed should be done by and implemented model and not a control block. Get familarise with the tuning of the controler.

Block diagram of the model:

*The drive controller has to be modeled using a PI controller so that it follows the input drive cyce.

Vehicle Body Subsystem.

This subsystem comprises of vehicle body block, tires and gear. It summarises the body framework of a vehicle including its tires, Axel , suspentions and gearbox. The blocks making up this subsystem are explained below.

Vehicle body:

The Vehicle Body block represents a two-axle vehicle body in longitudinal motion. The vehicle can have the same or a different number of wheels on each axle. For example, two wheels on the front axle and one wheel on the rear axle. The vehicle wheels are assumed identical in size. The vehicle can also have a center of gravity (CG) that is at or below the plane of travel.

The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile. Optionally include pitch and suspension dynamics. The vehicle does not move vertically relative to the ground.

The block has an option to include an externally-defined mass and an externally-defined inertia. The mass, inertia, and center of gravity of the vehicle body can vary over the course of simulation in response to system changes.

Tire (Magic formula):

The Tire (Magic Formula) block models a tire with longitudinal behavior given by the Magic Formula [1], an empirical equation based on four fitting coefficients. The block can model tire dynamics under constant or variable pavement conditions.

The longitudinal direction of the tire is the same as its direction of motion as it rolls on pavement. This block is a structural component based on the Tire-Road Interaction(Magic Formula) block.

To increase the fidelity of the tire model, you can specify properties such as tire compliance, inertia, and rolling resistance. However, these properties increase the complexity of the tire model and can slow down simulation. Consider ignoring tire compliance and inertia if simulating the model in real time or if preparing the model for hardware-in-the-loop (HIL) simulation.

Simple Gear and Differential:

The Simple Gear block represents a gearbox that constrains the connected driveline axes of the base gear, B, and the follower gear, F, to corotate with a fixed ratio that you specify. You choose whether the follower axis rotates in the same or opposite direction as the base axis. If they rotate in the same direction, the angular velocity of the follower, ωF, and the angular velocity of the base, ωB, have the same sign. If they rotate in opposite directions, ωF and ωB have opposite signs.

Motor Control Subsystem.

In this subsystem a DC motor , H-bridge controler and a PWM are conected to provide the motor with the appropriate voltage to produce the required speed.

DC Motor:

The DC Motor block represents the electrical and torque characteristics of a DC motor using the following equivalent circuit model:

You specify the equivalent circuit parameters for this model when you set the Model parameterization parameter to By equivalent circuit parameters. The resistor R corresponds to the resistance you specify in the Armature resistance parameter. The inductor L corresponds to the inductance you specify in the Armature inductance parameter.

You can specify how to generate the magnetic field of the DC motor by setting the Field type parameter to the desired option. The permanent magnets in the motor induce the following back emf vb in the armature:

H-Bridge:

PWM — The H-Bridge block output is a controlled voltage that depends on the input signal at the PWM port. If the input signal has a value greater than the Enable threshold voltage parameter value, the H-Bridge block output is on and has a value equal to the value of the Output voltage amplitude parameter. If it has a value less than the Enable threshold voltage parameter value, the block maintains the load circuit using one of the following three Freewheeling mode options:

  • Via one semiconductor switch and one freewheeling diode

  • Via two freewheeling diodes

  • Via two semiconductor switches and one freewheeling diode

Driver Subsystem.

This subsytem contains Drive cycle inputs and a controller subsytem. The drive cycle is just a predefine velocity in refference to time data. This data is then given to the controller who the accelerates and deccelerate the vehicle in refference to input drive cycle.For this siulation three drive cycles are connected to a multi switch block, and a conctant block is given to choose which drive cycle the vehicle should follow.

The Longitudinal Driver block was replaced by a PID controller subsystem. the cotroller system was builed as shown below. The input drive cylce and the vehicle feedback is calculated and the difference is send into the controller. From the controller output acceleration and decceleration is are limited using a saturation block. for the decceleration to avoid going into negative the absolute value is calculated using a abs block.

Controller tuning.

The controller can not be tuned automacicaly cause the system is non linear. hence tuning steps was carried as shown below.

Battery:

Here a battery is conected to supply the motor with power.Three scopes are connected to show battery state of charge, Current and voltage

Distance Calculation:

-The velocity from vehicle body is intergrated to calculate the distance in m/sec and divided by 3600 to give results km/hr.

Tuning 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.