Final Project: Design of an Electric Vehicle
Aim: To create a MATLAB model of an electric car that uses a battery and a DC motor, choose suitable blocks from the Powertrain block set and prepare a report about the model including the following
1. System-level configurations
2. Model parameters
3. Results
4. Conclusion
Theory:
An electric vehicle (EV) is defined as a vehicle that uses an electric motor or a traction motor for propulsion as opposed to an internal combustion (IC) engine used by conventional vehicles. Electric vehicles use electricity for power instead of fossil fuels as conventional vehicles would and because of this difference, electric vehicles do not produce any exhaust gases or pollution. The power needed for the operation of an EV can come from a variety of sources such as batteries, generators, or through a collector system Batteries fitted into the body of an EV are capable of high energy densities in order for them to meet the power demands and range requirements. Generators are machines that generate electrical energy from an input of mechanical work and are a part of the electric motor, and they operate during braking to produce the phenomenon of regenerative braking Collector systems are off-vehicle systems that allow for the charging of an EV from homes or public charging stations. The electricity used for charging in these systems is generated from solar panels which can be used by the grid or by homes of EV owners so that they can charge their vehicles more conveniently.
EVS are increasing in demand in recent years due to the need to reduce vehicle emissions which are damaging to the environment. Government incentives and private companies are working on schemes to quicken the adoption of electric vehicles. Since EVs do not produce any emissions, they are more environmentally friendly than conventional vehicles are. The generation of the electricity used to charge the vehicles also comes from solar energy (a renewable energy source) and not fossil fuels which make them sustainable. EVs can meet the same performance standards of conventional vehicles and even surpass that of theirs and this has been seen with the automotive company Tesla. The Tesla Model 3 is the best-selling EV in the world and is capable of a range of approximately 350km on a single charge. It also has an acceleration of 0-60 mph in 5.6 seconds and a top speed of 130 mph.
EVS offer several advantages over conventional vehicles besides the lack of pollution and lack of need to rely on fossil fuels. One is that EVs are more efficient meaning that they offer more MPGe (miles per gallon gasoline equivalent), meaning that you will spend lesser on recharging an EV than you would refuel a conventional vehicle. This is because the more efficient the EV is, the more distance you travel with the available energy. In the US, Tesla owners can charge their EVs for free at their private charging stations for life which results in significant savings in fuel. Regenerative braking in EVs adds to their efficiency as the unused energy in braking gets reused purposefully. Another benefit is that EVs have fewer moving/rotating parts and this means lesser maintenance costs than you would have with IC engine vehicles eg. changing oil, transmission fluid This, in the long term would give better savings than you would get with conventional vehicles. Lesser moving parts means there is lesser friction between moving parts and hence quieter operation.
In spite of these feats, it will be difficult for the worldwide adoption of EVs for several reasons. One reason is convenience. In order for EVs to dominate the automotive market, there need to be more convenient ways for consumers to be able to charge their vehicles. There need to be several charging stations on the highways and roads and this can be supported if everyone's homes were generating solar power it needs to be as easy to charge an EV as it is to fill an IC engine vehicle with fuel at a petrol station. Another reason is the cost of the EVS. EVS is still a relatively new technology and only accounts for 2-3% of the worldwide market. This is because they cost considerably more than conventional vehicles due to the high cost of batteries and electric components. But, the cost of batteries is getting cheaper over time and manufacturers are developing newer and more efficient batteries. The goal is to produce a 'million-mile' battery which, if made will be a revolution in the automotive sector. Another disadvantage is that the components in EVs operate at high voltages and currents and this can be a hazard if the components explode or don't work as they should.
COMPONENTS:
The main components of the EV are:
• Wheels/tires
• Battery
• Motor/generator
• Motor controllers
• Power converters
• Transmission system
Main simulation diagram:
In the below picture, we have done the simulation of an electric vehicle using various drive cycles by using a powertrain blockset available in the Simulink library. First, there are the inputs where we have connected two different drive cycles which provides the reference for the longitudinal driver which compares the two speeds and gives accelerator and braking commands to the motor controller block. battery block and vehicle body blocks are further attached and scopes are used for displaying the working status.

System-level configuration
For modeling the whole vehicle in SIMULINK we need to model the above-mentioned components separately and make them work together All the main components are available in the library of SIMULINK blocks. so we add components and configure the parameters to fit the working requirements of the model.

This block contains 6 ports that can be used to model various aspects of the vehicle body. The ports are mentioned below.
• H- This stands for hub and is used to connect the hubs of the wheels to the main body of the vehicle.
• V-Physical signal output port which stands for 'velocity and is used the output the velocity of the vehicle
• W- Physical signal input port and allows us to model a wind velocity that acts against the vehicle.
• NR-Physical signal output port to connect the rear wheels
• NF-Physical signal output port to connect the front wheels of the vehicle.
• Beta- Physical signal input port that allows the vehicle to undergo an inclination of hill-climbing force.
• Model parameters to set up mass, frontal area, and others.

Vehicle Body Subsystem:

The above blocks are forming a subsystem that serves as a part of the whole vehicle. Four tires are connected, where the right two tires are the rear wheels and the remaining two are the front wheels. they are interconnected to the hub of the vehicle body block. and their respective axles are connected accordingly. We here have connected the rear axle with the gear as we want the model to be a rear-wheel-drive vehicle. Here the wind velocity port and hill-climbing angle ports are connected to physical constant blocks which are kept as zero.
Tyre Block Parameters:

The rolling resistance, geometry, dynamics and other parameters can be changed.
Simple Gear Block Parameters:


This block to model is a gear system with a fixed-gear ratio with no-inertia effects. However, we can modify the messing of the gear teeth, Here The follower to base teeth ratio has been set to 2 and the output shaft rotates in the same direction as the input shaft.
All these blocks are categorized into a single subsystem which we have named as vehicle body block, which takes the mechanical input from the motor and controller block into the gear and displays the velocity at which the vehicle body moves.
Motor and Controller Subsystem:

Components:
• DC Motor
• H-bridge
• Controlled PWM voltage
• Controlled voltage source
• Current sensor
DC-Motor

For the EV model, I have selected to use a DC motor block because DC motors are easy to model and have very few parameters to run for a particular application. There are two sides of the block, the mechanical side is on the right and the electrical side is on the left. the mechanical site has two ports C and R. C stands for casing and is the stable part and R is the rotor that produces a torque. The electrical side has a positive and negative side for the voltages to be applied. If a positive voltage is applied to the motor black from the positive to the negative terminal then a positive torque will act from C to R port. The direction of the torque can be changed by changing the sign of the back emf or the torque constant. Here I have connected the C port to the mechanical rotational reference because it will be stationary. The R port is connected to the gear in the vehicle body block.

Here I have chosen to parameterize the block by rated power, rates speed, and no-load speed. This lets us modify the parameters such as DC supply voltage, rated load. I have kept all values default except for the no-load speed, rated speed, and rated load.
H - Bridge:

This is a power converter that is needed to provide a power of the correct form and magnitude from one component to another. In the case of EVs, a power converter is needed to provide a DC voltage from the battery of the EV to the DC motor so that it can function properly at the required parameters. Here I have used an H-bridge motor drive as my power converter. The left side is for controlling the voltage signals and the right-side terminals to provide the controlled voltage to the DC motor the left side ports are:
• PWM- Pulse width modulation
• REF-Reference
• REV-Reverse
• BRL-Brake

The simulation is kept in the average mode because PWM mode will take longer durations of simulation. In the section of bridge parameters, the output voltage amplitude was modified to 400 volts according to the DC motor.
Controlled PWM voltage:


Here all the parameters are set to their default values. I have chosen the averaged simulation mode so that it will feed voltage pulses within quicker simulation times to the H-bridge. The remaining parameters of input scaling and output scaling are unchanged.
Controlled voltage source:

This block provides the necessary voltage that is powerful enough to maintain the voltage at the output regardless of the current that passes through it in this subsystem e control voltage blocks have been used. One block is used for acceleration and the other provides the voltage for deacceleration.
An electrical reference block is used to create a grounding effect for electrical circuits. In my model, we have used it in 2 parts. First to create an electrical ground between Controlled voltage source, controlled PWM voltage, H-bridge blocks. The second is for the battery system which will be modeled afterward.
A solver configuration block is used to solve any necessary equations in a model. I have used them in the connection to the REV port of the H-Bridge block.
Battery Subsystem:

The battery will be the energy store of the EV and will contain the electrical energy in DC form and provide this energy to operate.
Nominal voltage has been set to 600 volts, internal resistance has been set to 0.2 ohms, and an infinite charging capacity

Controlled Current Source:

This block is a part of the battery sub-system. Similar to the voltage source, this block produces an ideal current that is powerful enough to maintain the specified current regardless of the voltage across it.
SOC (State Of Charge) subsystem:

To measure the state of charge of the battery, a sub-system was created of various blocks. The first block is the integrator block used to handle data transfer and integrate the value of the current signal with respect to time and the next is the Gain block is used in order to multiplier divide the signal coming from the integrator block. This block will divide the current signal with the ampere rating of the battery which is 140(Ah)*3600(secs in an hour). Assuming the battery is always fully charged I have added the constant block with a value of 1 representing 100%. Next, a sum block is used to perform addition and subtraction operations at these blocks are made into a subsystem called SOC estimate. A scope block is used at the junction of the PS-Simulink converter block to plot the 3 output signal of the current from the battery.
Block Parameters of gain block:

Speed measurement:

In order to measure the speed. I have modified the scope block to have two input ports where one port takes the output velocity signal from the vehicle sub-system block and the other port takes the output signal from the drive cycle to the reference velocity port on the longitudinal driver block. This has been done to compare the two speeds and check whether they overlap and achieve the same speed.
Distance Measurement:

Mathematical blocks and scope block is used to measure the distance traveled by the vehicle. First, we had to implement the integrator block to integrate the velocity signal that is output from the velocity sub-system. Dividend block along with constant block having a value of 3600 is used to divide the integrated speed. This will give us the distance traveled in kilometers.
Longitudinal driver and drive cycle:

The longitudinal driver block is used for giving normalized acceleration and deacceleration commands to a controller based on two sets of data. The first data is the reference velocity and the second data is the feedback velocity. The reference velocity data comes from the drive cycle source and is compared to the feedback velocity data coming from the vehicle body. If the reference velocity is greater than the feedback velocity, an acceleration command will be given as an output to the controlled voltage source. If the reference velocity is lesser than the feedback velocity, a deacceleration command is given as output to another control voltage source. For the output acceleration and deacceleration commands, I have used the Simulink-PS converter block. In this case, the input signal; is velocity data and this is logic data which have to be converted to a voltage signal The ports in this block are:
• Velref-This stands for the reference velocity and it is the velocity data provided from a drive cycle source.
• Velfdbl-This stands for feedback velocity and it is coming from the vehicle's body velocity port
• Grade-This port provides a grade or inclination angle on which the vehicle is traveling in degrees. Info- This port is for the bus signals which consists of block calculations
• Accelcmnd- This port provides the acceleration command to a controlled voltage source
• Deacclcmd- This port provides the deacceleration command to another voltage source.
Drive cycle:
A drive cycle is a data set that contains velocity and time data for the purpose of modeling the motion of a vehicle. It is a plot of the vehicle velocity against the time and it is made to resemble typical driving conditions that a consumer may experience themselves in. Drive cycles are used by various testing procedures such as mileage, pollution tests, and acceleration and top speed tests. There are three ways of implementing a drive cycle. One method is to create your own drive cycle with a spreadsheet or excel sheet. Another method is a signal builder and creates signals according to the user and the method that we used I to implement industry-standard drive cycles which are previously used to test parameters of the vehicle.
Block parameters:

Observations and Results:

The above graph is the Speed Graph where both drive cycle speed and vehicle speed are plotted. We can observe that the vehicle speed is near to the drive cycle speed which means our Electric vehicle meets the necessary speeds.

The above graph represents the SOC.

The above graph represents the Current
Conclusion:
1. Thus, a simple Electric Model was modeled successfully.
2. Similar approach can be followed for modeling similar vehicle models in Matlab.
3. This model can be further improvised by increasing the complexity of the model for better results.
4. Further Extra features can be added to the Electric vehicle model.