Challenge

Final Project: Design of an Electric Vehicle

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

Answer:-

Now:-

Step1) Designing the Load (Vehicle)

Here the vehicle is considered as a load on motor.

Required blocks to design vehicle are as follows:

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

Tire Model

The Tire (Magic Formula) block models the tire as a rigid wheel-tire combination in contact with the road and subject to slip. When torque is applied to the wheel axle, the tire pushes on the ground (while subject to contact friction) and transfers the resulting reaction as a force back on the wheel. This action pushes the wheel forward or backward. If you include the optional tire compliance, the tire also flexibly deforms under load.

The figure shows the forces acting on the tire. The table defines the tire model variables.

Parameter Settings:-

2)PS Terminator

Use the PS Terminator block to cap physical signal output ports that do not connect to other blocks

3)PS Constant

The PS Constant block generates a physical signal of a constant value. You specify the value and unit of the signal as the Constant parameter.

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

Model

The vehicle axles are parallel and form a plane. The longitudinal, x, direction lies in this plane and perpendicular to the axles. If the vehicle is traveling on an incline slope, β, the normal, z, direction is not parallel to gravity but is always perpendicular to the axle-longitudinal plane.

This figure and table define the vehicle motion model variables.

Vehicle Dynamics and Motion

Parameter Settings:-

5)Inertia

The Inertia block represents an ideal mechanical translational inertia that is described with the following equation:

T=Jdωdt

where:

  • T is inertia torque.

  • J is inertia.

  • ω is angular velocity.

  • t is time.

6)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, 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. You can easily add and remove backlash, faults, and thermal effects.

Matlab Model of Vehicle:-

Step2) DC motor and Conveter

Required blocks to design motor and converter are as follows:

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

Parameter settings:-

2)H-Bridge

The H-Bridge block represents an H-bridge motor driver. The block has the following two Simulation mode options:

  • 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

    The first and third options are sometimes referred to as synchronous operation.

    The signal at the REV port determines the polarity of the output. If the value of the signal at the REV port is less than the value of the Reverse threshold voltage parameter, the output has positive polarity; otherwise, it has negative polarity.

  • Averaged — This mode has two Load current characteristics options:

    • Smoothed

    • Unsmoothed or discontinuous

Parameter Setting:-

3) Controlled PWM Voltage

The Controlled PWM Voltage block represents a pulse-width modulated (PWM) voltage source. You can model electrical or physical signal input ports by setting the Modeling option parameter to either:

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

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

If you set Modeling option to Electrical input ports, the demanded duty cycle is

100∗Vref−VminVmax−Vmin 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.

Parameter Settings:-

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

5)Current Sensor

The Current Sensor 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.

Use the + and - ports to connect the sensor in series with the other blocks in the branch where you want to measure the current. Port I outputs the measurement result as a physical signal.

6)Solver Configuration

Each physical network represented by a connected Simscape™ block diagram requires solver settings information for simulation. The Solver Configuration block specifies the solver parameters that your model needs before you can begin simulation.

Each topologically distinct Simscape block diagram requires exactly one Solver Configuration block to be connected to it.

7)Electrical Reference

The Electrical Reference block represents an electrical ground. 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.

Matlab Model of DC Motor and Converter:-

Step3) Longitudinal Driver

The Longitudinal Driver block implements a longitudinal speed-tracking controller. Based on reference and feedback velocities, the block generates normalized acceleration and braking commands that can vary from 0 through 1. You can use the block to model the dynamic response of a driver or to generate the commands necessary to track a longitudinal drive cycle.

Parameter Settings:-

Step4)Drive Cycle

Parameter Settings:-

Step5)Battery SOC

1)Battery

Generally in electric vehicle we are using 48V battery.

Parameters Settings:

2)Controlled Current Source

The Controlled Voltage Source block converts a Simulink® input signal into an equivalent voltage source. The generated voltage is driven by the input signal of the block.

You can initialize the Controlled Voltage Source block with a specific AC or DC voltage. If you want to start the simulation in steady state, the Simulink input must be connected to a signal that begins the simulation as a sinusoidal or DC waveform that corresponds to the initial values.

3)Bus Selector

The Bus Selector block outputs the elements you select from the input bus. The block can output the selected elements separately or in a new virtual bus.

The Bus Selector block does not support mixing message and signal elements as outputs.

Matlab Model for Battery and SOC:-

Now Overall Matlab Model For ELectric Car:-

Simulation Results:-

Drive Cycle and Vehicle Velocity:-(Simulation time 100 sec)

The vehicle should follw the reference which is Drive cycle in this case. In below result we can see that the vehicle is following the referece. It is also called in wheel type motor.

SCO,Current,Voltage:-(Simulation time 100sec)

Now run Same simuation for around 700sec

We can see here also that the vehicle is following the reference.

Now changing the drive cycle: Make it WOT and run simulation for 30 sec

Conclusion:-

Here The first result is for the Drive Cycle and Vehicle Speed. We can observe from the graph that the vehicle is follwing the reference drive cycle source.

For SOC, Battery State of charge is reducing as the drive cycle is keep on going. Inbetween the battery has recharged at certain points.This is beacause of regenerative braking during the deceleration phase.

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.