Final Project: Design of an Electric Vehicle
FINAL PROJECT:DESIGN OF ELECTRIC CAR
AIM: Create a MATLAB model of electric car which uses a battery and a DC motor. Choose suitable blocks from Powertrain block set
OBJECTIVE:
1. System level configurations
2. Model parameters
3. Results
4. Conclusion
INTRODUCTION:
ElECTRIC VEHICLE:
An EV is a shortened acronym for an electric vehicle. EVs are vehicles that are either partially or fully powered on electric power.Electric vehicles have low running costs as they have less moving parts for maintaining and also very environmentally friendly as they use little or no fossil fuels (petrol or diesel). While some EVs used lead acid or nickel metal hydride batteries, the standard for modern battery electric vehicles is now considered to be lithium ion batteries as they have a greater longevity and are excellent at retaining energy, with a self discharge rate of just 5% per month. Despite this improved efficiency, there are still challenges with these batteries as they can experience thermal runaway, which have, for example, caused fires or explosions in the Tesla model S, although efforts have been made to improve the safety of these batteries.
COMPONENTS OF ELECTRIC CAR : Battery,Charge port,DC/DC converter,Electric traction motor,On board charger,power electronic control and traction battery pack





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.Its inputs are velocity reference,velocity feedback and grade .Acceleration command,deceleration command are the output.This block give output command by analysing the input.
Design:For this model we are using PI type controller we set proportional gain to 1000 and integral gain to 100 .and set average speed of the vehicle 100 and speed unit in m/s

Electrical system:

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−Vmin/Vmax−Vminpercent
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.At time zero, the pulse is initialized as high, unless the Pulse delay time parameter is greater than zero, or the demanded duty cycle is zero.You can use parameters Pulse delay time and Pulse width offset to add a small turn-on delay and a small turn-off advance. This can be useful when fine-tuning switching times so as to minimize switching losses.In PWM mode, the block has two options for the type of switching event when moving between output high and output low states:Asynchronous – Best for variable-step solvers — Asynchronous events are better suited to variable step solvers, because they require fewer simulation steps for the same level of accuracy. In asynchronous mode the PWM switching events generate zero crossings, and therefore switching times are always determined accurately, regardless of the simulation maximum step size.Discrete—time – Best for fixed-step solvers — Discrete-time events are better suited to fixed-step operation, because then the switching events are always synchronized with the simulation step. Using an asynchronous implementation with fixed-step solvers may sometimes result in events being up to one simulation step late. For more information, see Simulating with Fixed Time Step — Local and Global Fixed-Step Solvers.


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
The Smoothed option assumes that the current is practically continuous due to load inductance. In this case, the H-Bridge block output is:
(VO*VPWM/APWM)−IOUT*RON
where:
VO is the value of the Output voltage amplitude parameter.
VPWM is the value of the voltage at the PWM port.
APWM is the value of the PWM signal amplitude parameter.
IOUT is the value of the output current.
RON is the Bridge on resistance parameter.
The current will be smooth if the PWM frequency is large enough. Synchronous operation where freewheeling is via a bridge arm back to the supply also helps smooth the current. For cases where the current is not smooth, or possibly discontinuous (that is, it goes to zero between PWM cycles), use the Unsmoothed or discontinuous option. For this option, you must also provide values for the Total load series resistance, Total load series inductance, and PWM frequency. During simulation, the block uses these values to calculate a more accurate value for H-bridge output voltage that achieves the same average current as would be present if simulating in PWM mode.
Design: For this model we selected power supply internal and simulation mode set to averaged and enabled regeneration braking ,we select smoothed load current charactesristics.All other values are set to default,we set the Simulation mode parameter to Averaged to speed up simulations and this applies the average of the demanded PWM voltage to the motor.

4)Current Sensor:


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:
vb=kvω
where kv is the Back-emf constant and ω is the angular velocity. The motor produces the following torque, which is proportional to the motor current i:
TE=kti
where kt is the Torque constant. The DC Motor block assumes that there are no electromagnetic losses. This means that mechanical power is equal to the electrical power dissipated by the back emf in the armature. Equating these two terms gives:
TEω=vbi
ktiω=kvωi
kv=kt
As a result, you specify either kv or kt in the block parameters.
If the magnetic field is generated from the current flowing through the windings, the Back-emf constant depends on the field current If:
kv=LafIf
where Laf is the Field-armature mutual inductance.
The torque-speed characteristic for the DC Motor block is related to the parameters in the preceding figure. When you set the Model parameterization parameter to By stall torque & no-load speed or By rated power, rated speed & no-load speed, the block solves for the equivalent circuit parameters as follows:
For the steady-state torque-speed relationship, L has no effect.
Sum the voltages around the loop and rearrange for i:
i=(V−vb)/R=V−kvω/R
Substitute this value of i into the equation for torque:
TE=(kt/R)*(V−kvω)
When you set the Model parameterization parameter to By stall torque & no-load speed, the block uses the stall torque and no-load speed to determine values for R and kt (and equivalently kv).
When you set the Model parameterization parameter to By rated power, rated speed & no-load speed, the block uses the rated speed and power to calculate the rated torque. The block uses the rated torque and no-load speed values to determine values for R and kt.
The block models motor inertia J and damping λ for all values of the Model parameterization parameter. The resulting torque across the block is:
T=kt/R*(V−kvω)−J˙ω−λω
It is not always possible to measure rotor damping, and rotor damping is not always provided on a manufacturer datasheet. An alternative is to use the no-load current to infer a value for rotor damping.
For no-load, the electrically-generated mechanical torque must equal the rotor damping torque:
ktinoload=λωnoload
where inoload is the no-load current. If you select By no-load current for the Rotor damping parameterization parameter, then this equation is used in addition to the torque-speed equation to determine values for λ and the other equation coefficients.
The value for rotor damping, whether specified directly or in terms of no-load current, is taken into account when determining equivalent circuit parameters for Model parameterization options By stall torque and no-load speed and By rated power, rated speed and no-load speed.
When a positive current flows from the electrical + to - ports, a positive torque acts from the mechanical C to R ports.
Design: Here we set permanent magnet type dc motor it is parameterized by rated load and speed and we set no lod speed 25000 and rated speed=20000rpm ,rated load value set to 1500kW and rated dc supply voltage is set to 500V and all other parameter value kept default

6)MECHANICAL ROTATIONAL REFERENCE:

This block represents a mechanical rotational reference point, that is, a frame or a ground. Use it to connect mechanical rotational ports that are rigidly affixed to the frame (ground).This is actually a mechanical system block .
7)ElECTRICAL REFERENCE:


The Battery (Table-Based) block represents a high-fidelity battery model. The block calculates no-load voltage as a function of charge level and optional temperature using lookup tables and includes several modeling options:Self-discharge,Battery fade,Charge dynamics,Calendar aging
Design:Here we gave the nominal voltage of the battery same as the rated dc supply voltage of the motor 500V


The Controlled Current Source block represents an ideal current source that is powerful enough to maintain the specified current through it regardless of the voltage across the source.
The output current is I = Is, where Is is the numerical value presented at the physical signal port.The positive direction of the current flow is indicated by the arrow.
10)POWERGUI

We need the powergui block to simulate any Simulink model containing SimscapeElectrical Specialized Power Systems blocks. It stores the equivalent Simulink circuit that represents the state-space equations of the model.
The electric system is shown below:

BLOCK DIAGRAM EXPLANATION:
Input:Acceleration and braking command from longitudinal vehicle
Output:Mechanicalpower from dc motor
Here we used controlled coltage source because our system should work with control signals from longitudinal driver block ,Here we used 2 controlled voltage source one for acceleration and other for braking,controlled voltagesource 1 is connected to controlled PWM voltage ,which is connected to H bridge where the controlling action take place ,the second controlled voltage source is given to H bridge directly ,The output from H bridge is given to a dc motor,here we use internal powersupply in H bridge so to calculate soc percentage we connected a battery but the current flow through the controller circuit control the battery so , we used a controlled current source here.
VEHICLE BODY SUBSYSTEM:

The Tire (Magic Formula) block models a tire with longitudinal behavior given by the Magic Formula , 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.Connection A is the mechanical rotational conserving port for the wheel axle. Connection H is the mechanical translational conserving port for the wheel hub through which the thrust developed by the tire is applied to the vehicle. Connection N is a physical signal input port that applies the normal force acting on the tire. The force is considered positive if it acts downwards. Connection S is a physical signal output port that reports the tire slip. Optionally expose physical signal port M by setting Parameterize by to Physical signal Magic Formula coefficients




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.
By default, the block has one mechanical translational conserving port. The block positive direction is from its port to the reference point. This means that the inertia torque is positive if inertia is accelerated in the positive direction.
Design:Inertia block help to move the vehicle ,here we set inertia value 0.01


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.ThisRepresents 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. The vehicle does not move vertically relative to the ground.Connection 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. Connections V, NF, and NR are physical signal output ports for vehicle velocity and front and rear normal wheel forces, respectively. Wheel forces are considered positive if acting downwards. Connections W and beta are physical signal input ports corresponding to headwind speed and road inclination angle, respectively. If variable mass is modeled, the physical signal input ports CG and M are exposed. CG accepts a two- element vector representing the x and y distance offsets from vehicle CG to additional load mass CG. M represents the additional mass. If both variable mass and pitch dynamics are included, the physical signal port J accepts the inertia of the additional mass about its own CG.
Design:Here for we set mass of our vehicle body to 1200kg and other parameter as shown below





The PS-Simulink Converter block converts a physical signal into a Simulink output signal. Use this block to connect outputs of a Simscape physical network to Simulink scopes or other Simulink blocks.
3)SCOPE




The Gain block multiplies the input by a constant value (gain). The input and the gain can each be a scalar, vector, or matrix.You specify the value of gain in the Gain parameter. The Multiplication parameter lets you specify element-wise or matrix multiplication. For matrix multiplication, this parameter also lets you indicate the order of the multiplicands.




- The Drive Cycle Source block generates a FTP75 longitudinal drive cycle and give specified vehicle longitudinal speed, .It Produce realistic velocity and shift references for closed loop acceleration and braking commands for vehicle control according to FTP75 drive cycle its value varies from 0 to 1.
- This acceleration and brak commands are given to simulink to ps converter ,this block converts those signals to physical system signal
- This signal is given to physically controlled voltage source,It produces voltage output according to the physical signal input,these output are also varies between zero to 1
- The output of controlled voltage source1 goes to controlled PWM voltage and output of controlled voltage source goes to brak input of H bridge
- In controlled PWM voltage we set mininum input voltage 0 and maximum input voltage 1 because the input varies between 0 and 1 .It give output according to input signals
- These output values is fed to a H bridge If the input signal has a value greater than the Enable threshold voltage parameter value 2.5V the H-Bridge block output is on and has a value equal to the value of the Output voltage amplitude 800V. If it has a value less than the Enable threshold voltage parameter value, the block maintains the load circuit using freewheeling diode.
- The Output of H bridge is connected to dc motor the motor rotates according to the voltage output fom h bridge.
- The current flowing through H bridge given goes to controlled current source and it controled current in battery circuit and give SOC% accordingly
- The transmission is happening in dc motor here the electrical energy is converting to mechanical energy.
- The mechanical outputfrom the motor is given to vehical body subsytem ,It first go to a simple gear with tooth ratio 10,So it multiply torque to tentimes and given to the axle ,the inertia block provide proper inertia to tire to move.
- The resulting traction motion developed by tires is given to vehicle body through port H. Then physical signal output ports NF and NR goes to front and rear tires thses are normal wheel forces, which moves the tires.Headwindspeed and road inclination values are also given
- The vehicle body gives the Speed output according to the input given to it.
- Stop time set to 2474seconds which is duration of FTP75drive cycle
- We select solver variable step auto

- Run the simulation and results are shown below
RESULT:
Run the simulation and observed scope output
1)Velocity Output:
- We got the output plot as shown below

2)Input -Output comparison:
- Here we plot Drive cycle and velocity input on the same graph to compare the values

OBSERVATION:
- Here we can see two plots overlaping exactly on one another
- We can see very small difference in graph at the time of braking because of inertia and control parameters of the vehicle vehicle ,it cant follow the drivecycle
3)SOC plot
- SOC% plot is shown below,

OBSERVATION
- Battery is discharging as time increases
- Initially battery is fully charged and battery got discharged with time and 78% battery is remaining
- So at averagespeed of 100m/s 22% of battery got discharged
- At some portions of the plot we can see increase in soc value it is because of the regenerative braking,during regenerative braking motor act as generator and charges the battery
4)Total distance travelled:
We got the total distance traveled by the vehicle from the display ,for given FTP75 Drive cycle=4.943km
CONCLUSION:
Created matlab model of electric car with FTP75 drive cycle as input and average speed of 100m/s with PI controler type with proportional gain 1000 and integral gain 100 .we used battery of 500V and dc motor of power rating 1500kW,regenerative breaking is enabled ,The distance traveled by the car is measured ,The car cover 4.943km in 2747 seconds ,78% of battey is remaining