Final Project: Design of an Electric Vehicle
AIM:-
Create a MATLAB model of electric car which uses a battery and a DC motor. by Choosing the suitable blocks from Powertrain block set.
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 electric

motors or traction motirs for propolusion an electric vehicle may be powered through a collecter system by electrically from off-vehicle sources or may be self contained with a battery ,solarbpanels,fuel cells or an electric generator to convert fuel to electricity.EVs include ,but are not limited to road and rail vehicles ,surfaces and underwater vessels electric aircraft and electric spacecrafts.

Components of an EV:
BATTERY:-


PROCEDURE:
1) Vehicle body subsytem:
- The vehicle is assumed to be a front axel driven( 4 wheels -2 on each axle)
- The wheels are modelled using simple tire (magic formula) simulink blocks.
m
- The N port of the tire corresponds to the normal reaction acting on it.the A port corresponds to the mechanical rotation conserving port for the wheel axle should form a connection through their respective A poets.
- connection H corresponds to the mechanical translational conserving port for the trust developed by the vehicle.thus,all the 4 wheels form a connection through their respective Hports and this is turn connected to the translational ub of the vehicle body.
- the connection Srepresents thr output port for slip of the tire.
- the tyres are parameterized by peak longitudinal force and corresponding slip.
- the other block parameters such as rated vertical load,peak longitudinal force at rated load and slip at peak force at rated load are kept with their default values.
- the tire radius is given as 0.3m
- the tire innertia is kept as 1kg-m^2.also the rolling resistance is given with a constant coefficient of 0.05


- thus 2 axle (4wheel) assembly is now connected to a velocity body simscape block.

- this block basically represents a two axle vehicle body in longitudinal motion.the block accounts for body mass,aerodynamic drag,road incline,weight distribution between axles due to acceleration road profile.
- here ,the connection H is the mechanical translational conserving port hub.NF&NR correspond to the output ports for normal reaction forces on front axle and rear axle wheels respectively.connection V represents the actual output traslatinal velocity of the vehicle. beta is the road inclination angle &w corresponds to the headwind speed(headwind-direction opposite to that of vehicle)
- the gross weight is given to be 1200 kg.
- the geometric parameters of the vehicle are given as.

- to account for proper drag force on the vehicle ,the related parameters are kept as

- the pitch dynamics for the vehicle are not cinsidered fir this simulation
- the complete subsystem is shown below:

- the input for this subsystem is taken as the rotational speed of the motor.this input is fed to the front axel through a simpe gear representing the final drive ratio of 3.73
- here the rotational dircetion of the output shaft is kep the same as that of thebinput shaft.also nomeshing losses are considered for the simulation.

2)DC motor:
- the simulink provides an inbuikt bodel block for DC motor which converts electrical input in mechanical rotational output. (NOTE:here,the blue colour corresponds to the electrical side of the motor and the green colour corresponds to the mechanical side.)
- here,the motor field type is kept as permanent magnet and the model parameterization is done by rated load and speed
- the armature inductance and the mechanical parameters are given their default values.all the other parameters are changed as shiwn below:



- the connection R represnts the rotor(rotational output)while the connection C is for the casing (stationary).thus the R port is connected to the input of the vehicle subsytem created earlier.the C port is connected to a mechanical rotational referance.
- the motor terminals are connected to the motor controller.if these terminals are directly connected to a battery,the rated capacity of the battery.this will eventually result into the vehicle will run at top speed throughout the simulation.this is motor controller is very much needed.
3)MOTOR CONTROLLER:
H-bridge circuit:

- this block represnts an H-bridge motor drive.the block can be driven by the controlled PWM voltage block in PWM or average mode.
- in PWM mode,the motor is powered if the PWM port voltage is above the enabled thereshold voltage.
- in average mode,the PWM port voltage divided by the PWM signal amplitude psrameter defines the ratio of the on time to the PWM period.
- connection REF is for the referance input.this combined with the PWM connected will form the pulse input for the H-bridge,the REF input is connected to the electrical referance(ground)
- connection BRK is for the braking of the vehicle.
- since,the PWM mode results in a hugr amount of simulation time,average mode is selected for this simulation.
- load current characteristics are considered to be smoothed here.
- also,the regenerative braking is anabled for the simulation.this means,when the vehicle starts decelerating,corresponding amount of charge will be fed back tp the battery.
- accordingly,the BRK input is connected to a controlled voltage source.this will generate emf corresponds to the intensity of brakes appiled and fed the power back to the battery.




- the input thereshold parameters are left with their default values.
- the output voltage amplitude of the H bridge circuit is given by the same value as the rated DC supply voltage of the DC motor.
- simulink provides an inbuilt controlled PWM voltage block.this block is used for providinf the proper pulse inputs to the H bridge.

- the PWM&REF connections are for corresponding ports on the H-bridge circuit.
- the 2 referance inputs correspond to the throttle inputs given by the driver.the block generates corresponding pulse width as per the acceleration and brakes appiled by the driver himself.
- here ,the PWM frequency is 1000hz also,the simulation mode is averaged as that in the H bridge circuit.
- the input scaling parameters given are:
- 0v for 0% duty cycle and 5v for 100%duty cyclr.accordinglr,the input voltage amplitude becomes 5v.

- the H bridge circuit along with the PWM input together form the motot controller circuit.

4)LONGITUDINAL DRIVE:
- Longitudinal drive is an inbuilt block provided by the powertrain blockset.

- it is a parametric logitudinal speed tracking controller for generating normalized acceleration and braking commands based on the referance and fedback velocities.
- the VelRef port is the referance 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 velocity with the referance velocity,the driver block generates velocity,the driver block generates acceleration snd braking signals in order ti minimize the error between the two connected velocities.
- Grade corresponds to the grade angle.for this simulation ,no inclination is considered and hence,a constant block with value 0 is connected. info gives the output for the bus signals for different block calculation like differance in referance vehicle speed and vehicle speed etc.. AccelCmd&DecelCmd corresponds to the acceleration and deceleration commands generated respectively and are connected to the corresponding ports of the controlled PWM voltage block.
- here,the selected control type is PI.accordingly,the block implements proportional integral control with tracking windup and feed forward gains.

5)Battery pack:

- to model the battery pack , is a simple battery block is used.this is because ,if the generic battery block is used insted of the simulation will run for a much longer timr.
- here,the selected option for battery charge capacity is finite .accordingly the block models the battery as a series internal resistance plus a charge dependent voltage source would have been constant.
- also,the self discharging of the battery and the battery dynamics are disabled
- the battery nominal voltage is given as 400v the ampere-hour rating is assumed to be 50.the rest all parameters are left with their default values.


- to ensure the battery supplies current as per the requirements of the motor controller and not the rated current a current sensor &controlled current source pair is connected,

6)Referance velocity(drive cycle):
- the drive cycle source block is used to provide the referance speed for the simulation.
- is generates a standard or user specified longitudinal drive cycle

- here the selected drive cycle is the standard FTP75.

- below the plot of the drive cycle is showned:

7)Battery state of charge:
- A small subsyastem is created to calcylate the state of charge of the battery
- This subsystem takes the battery current as the input.

- the essentia; process to calculate the SOC is by substracting the charge from the rated capacity of the battery
- accordingly,the current is integrated w.r.to time to get the charge in coulombs.now this coulomb value is modified into amepere hours.
- this value is now substasrcted from the charging capacity of the battery is 50Ah
- finally,the remaining charge is now converted into percentage value of the chargong capacity of the battery.
MODEL:

This is the simulink model for the electric car
* easy construction of electric car:

Simulation:
- the system is run for the simulation for the 2474 seconds which is the total time for which the input drive cyclr is defined.
- a solver configuration is added to endsure proper solving of the mathematical equations by the model.
- scopes are connected to analyze the different outputs such as the soc of the battery the referance velocity&the actual velocity of the vehicle and the distance covered by the vehicle during the total rin.
- the 2 velocities are converted from m/s to kmph values.for this,simple gain blovks are used.
- the distnce is calculated by the simple time integration of the vehicle velocity.
OUTPUTS:
1)Ref .speed v/s actual vehicle speed:

- as can be seen from the above picture,the actual velocity of the vehicle differs from the referance drive cycle velocity.
- this is because ,the choosen batery capacity and motors are not able tp propel the speed upto the required extent.if
- if a battery or higher capacity is chosen ,the actual velocity will gtend to match with the referance velocity.
- also,it may be noted that in certain regions,despite the drive cycle showing decelerations,the vehicle actually is accelerating with decreasing magnitudes.reason being tge same.
2)distance coverd:

- it may be noted that ,since the referance velocity of the drive cycle never becomes negative is no backward motion of the distance is incresing throughout.
- the total distance covered by the vehicle is about 3.8km
3)Battery state of charge:

- the state of charge of the battery at the end of the simulation run nearly about 77%
- this means that the battery is not completely drained at the end and the vehicle can run on the same drive cycle for a few more times before the battery SOC becomes 0
- also,the thing to nbe noted here is since,we had enabled the regenerative braking for the SOC increses slightly whenever the ivehicle undergoes heavy deceleration
- again,this depends upon the generating tendency of the motor and the maximum amount of curennt that the battery can tak4.
CONCLUSION:
The model was successfully run for the simulation under the standard FTP75 drive cycle.the results have been properly analyzed.
also,learn the quite a lot of intersting things like:
1)how to model an EV and carry out a real time simulation
2)how a motor controller works and what role it plays in the control of the electric motor
3)how to calulate the SOC of the battery
4)different powertrain block are provided by the simulink which can be used to simulate a vehicle model.
