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
Aim
* To create a simulink model of an Electric Vehicle by using battery,drive cycle,motor,h-bridge & vehicle body and run the simulation then checking the speed of motor and voltage, current & soc of battery.Then performance of vechicle also checked with FTP drive cycle
Electric vehicle
An electric vehicle (EV) is one that operates on an electric motor, instead of an internal-combustion engine that generates power by burning a mix of fuel and gases. Therefore, such as vehicle is seen as a possible replacement for current-generation automobile, in order to address the issue of rising pollution, global warming, depleting natural resources, etc. Though the concept of electric vehicles has been around for a long time, it has drawn a considerable amount of interest in the past decade amid a rising carbon footprint and other environmental impacts of fuel-based vehicles
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.

ELECTRIC CAR CONSIST OF:
- Battery
- Charge port;
- DC/DC Convertor;
- Electric traction motor;
- Onboard charger;
- Power electronics controller;
- Thermal system;
- Traction battery pack;
- Transmission
Traction Battery Pack (A)

The function of the battery in an electric car is as an electrical energy storage system in the form of direct-current electricity (DC). If it gets a signal from the controller, the battery will flow DC electrical energy to the inverter to then be used to drive the motor. The type of battery used is a rechargeable battery that is arranged in such a way as to form what is called a traction battery pack.
There are various types of electric car batteries. The most widely used is the type of lithium-ion batteries.
Power Inverter

The inverter functions to change the direct current (DC) on the battery into an alternating current (AC) and then this alternating current is used by an electric motor. In addition, the inverter on an electric car also has a function to change the AC current when regenerative braking to DC current and then used to recharge the battery. The type of inverter used in some electric car models is the bi-directional inverter category.
Controller

The main function of the controller is as a regulator of electrical energy from batteries and inverters that will be distributed to electric motors. While the controller itself gets the main input from the car pedal (which is set by the driver). This pedal setting will determine the frequency variation or voltage variation that will enter the motor, and at the same time determine the car’s speed.
In brief, this unit manages the flow of electrical energy delivered by the traction battery, controlling the speed of the electric traction motor and the torque it produces. This component will determine how electric car work.
Electric traction motor

Because the controller provides electrical power from the traction battery, the electric traction motors will work turning the transmission and wheels. Some hybrid electric cars use a type of generator-motor that performs the functions of propulsion and regeneration. In general, the type of electric motor used is the BLDC (brushless DC) motor
Charger (E) is a battery charging device. Chargers get electricity from outside sources, such as the utility grid or solar power plants. AC electricity is converted into DC electricity and then stored in the battery. There are 2 types of electric car chargers:
- On-board charger: the charger is located and installed in the car
- Off-board charger: the charger is not located or not installed in the car.
- Transmission (F):The transmission transfers mechanical power from the electric traction motor to drive the wheels.
- DC/DC Converter (G):This one of electric car parts that to converts higher-voltage DC power from the traction battery pack to the lower-voltage DC power needed to run vehicle accessories and recharge the auxiliary battery.
- Battery (H):In an electric drive vehicle, the auxiliary battery provides electricity to power vehicle accessories.
- Thermal System – Cooling (I):This system maintains a proper operating temperature range of the engine, electric motor, power electronics, and other components.
- Charge Port (J):The charge port allows the vehicle to connect to an external power supply in order to charge the traction battery pack.

Different types of electric cars changed and are developed continuously giving users and potential users choices. Today the world is increasingly familiar with the terms BEV, HEV, PHEV and FCEV. How does an electric car work? How an electric vehicle works is depend on the type. This article will briefly discuss the types and working principles of electric cars or vehicles marketed in the World and Indonesia today.
An electric car is a vehicle that is fully or partially propelled by electric motors, using energy stored in rechargeable batteries. The first practical electric cars were produced in the 1880s. Electric cars were popular in the late 19th century and early 20th century. Innovation and advanced development in internal combustion engines (ICE) and mass production of cheaper gasoline vehicles has led to a decline in the use of electric vehicles.
When pedal of the car is pressed, then:
- Controller takes and regulates electrical energy from batteries and inverters
- With the controller set, the inverter then sends a certain amount of electrical energy to the motor (according to the depth of pressure on the pedal)
- Electric motor converts electrical energy into mechanical energy (rotation)
- Rotation of the motor rotor rotates the transmission so the wheels turn and then the car moves.
Note: The working principle above is for battery electric vehicle (BEV) type.
Types of Electric Cars
There are 4 (four) types of electric cars, with the following outline:
- Battery Electric Vehicle (BEV)
- Hybrid Electric Vehicle (HEV)
- Plug-in Hybrid Electric Vehicle (PHEV)
Battery Electric Vehicle (BEV)
A Battery Electric Vehicle (BEV), also called All-Electric Vehicle (AEV), runs entirely on a battery and electric drive train. This types of electric cars do not have an ICE. Electricity is stored in a large battery pack that is charged by plugging into the electricity grid. The battery pack, in turn, provides power to one or more electric motors to run the electric car.
Architecture and main components of BEV

Components of BEV
- Electric motor
- Inverter
- Battery
- Control Module
- Drive train
Working principle of BEV
- Power is converted from the DC battery to AC for the electric motor
- The accelerator pedal sends a signal to the controller which adjusts the vehicle’s speed by changing the frequency of the AC power from the inverter to the motor
- The motor connects and turns the wheels through a cog
- When the brakes are pressed or the electric car is decelerating, the motor becomes an alternator and produces power, which is sent back to the battery
Examples of BEV
Volkswagen e-Golf, Tesla Model 3, BMW i3, Chevy Bolt, Chevy Spark, Nissan LEAF, Ford Focus Electric, Hyundai Ioniq, Karma Revera, Kia Soul, Mitsubishi i-MiEV, Tesla X, Toyota Rav4.
Hybrid Electric Vehicle (HEV)
This type of hybrid cars is often called as standard hybrid or paralel hybrid. HEV has both an ICE and an electric motor. In this types of electric cars, internal combustion engine gets energy from fuel (gasoline and others type of fuels), while the motor gets electricity from batteries. The gasoline engine and electric motor simultaneously rotate the transmission, which drives the wheels.
The difference between HEV compared to BEV and PHEV is where the batteries in HEV can only charged by the ICE, the motion of the wheels or a combination of both. There is no charging port, so that the battery cannot be recharged from outside of the system, for example from the electricity grid.
Architecture and main components of HEV

Components of HEV
- Engine
- Electric motor
- Battery pack with controller & inverter
- Fuel tank
- Control module
Working principle of HEV
- Has a fuel tank that supplies gas to the engine like a regular car
- It also has a set of batteries that run an electric motor
- Both the engine and electric motor can turn the transmission at the same time.
Examples of HEV
Honda Civic Hybrid, Toyota Prius Hybrid, Honda Civic Hybrid, Toyota Camry Hybrid.
Plug-in Hybrid Electric Vehicle (PHEV)
PHEV is a type of hybrid vehicle that both an ICE and a motor, often called as series hybrid. This type of electric cars offers a choice of fuels. This type of electric cars is powered by a conventional fuel (such as gasoline) or an alternative fuel (such bio-diesel) and by a rechargeable battery pack. The battery can be charged up with electricity by plugging into an electrical outlet or electrical vehicle charging station (EVCS).
PHEV typically can run in at least two modes:
- All-electric Mode, in which the motor and battery provide all the car’s energy
- Hybrid Mode, in which both electricity and gasoline are employed.
Some PHEVs can travel more than 70 miles on electricity alone
Architecture and main components of PHEV

Components of PHEV
- Electric motor
- Engine
- Inverter
- Battery
- Fuel tank
- Control module
- Battery Charger (if onboard model)
Working principle of PHEV
PHEVs typically start up in all-electric mode and operate on electricity until their battery pack is depleted. Some models shift to hybrid mode when they reach highway cruising speed, generally above 60 or 70 miles per hour. Once the battery is empty, the engine takes over and the vehicle operates as a conventional, non-plug-in hybrid.
In addition to plugging into an outside electric power source, PHEV batteries can be charged by an internal combustion engine or regenerative braking. During braking, the electric motor acts as a generator, using the energy to charge the battery. The electric motor supplements the engine’s power; as a result, smaller engines can be used, increasing the car’s fuel efficiency without compromising performance.
Examples of PHEV
Porsche Cayenne S E-Hybrid , Chevy Volt, Chrysler Pacifica, Ford C-Max Energi, Ford Fusion Energi, Mercedes C350e, Mercedes S550e, Mercedes GLE550e, Mini Cooper SE Countryman, Audi A3 E-Tron, BMW 330e, BMW i8, BMW X5 xdrive40e, Fiat 500e, Hyundai Sonata, Kia Optima, Porsche Panamera S E-hybrid, Volvo XC90 T8.
Block diagram of EV

Drive cycle is used for input of the driver controller The driver controller controls the Acceleration and Braking of the power converter. The power converter H- Bridge is having a regenerative braking system. The DC motor is driven by the H-Bridge power converter. DC motor is connected to the vehicle body block. This block consists of vehicle transmission components like gear, wheels, and vehicle body. Finally, the battery is connected to the power converter block. This block consists of battery parameters charge, discharge, and SOC. The driver controller block has velocity feedback from the vehicle body to control the power converter.
MATLAB model for elecrtic vehicle
Model is developed by using drive cycle,Longitudinial driver,motor,H-bridge,vehicle body & battery blocks.the model is shown below

Detailed explanation of the model
1.Drive cycle: It is taken as a input of the model with respect time and certain road and traffic conditions.
The Drive Cycle Source block generates a standard or user-specified longitudinal drive cycle. The block output is the specified vehicle longitudinal speed, which you can use to: Predict the engine torque and fuel consumption that a vehicle requires to achieve desired speed and acceleration for a given gear shift reference.
-
Produce realistic velocity and shift references for closed loop acceleration and braking commands for vehicle control and plant models.
-
Identify the faults within tolerances specified by standardized tests, including:
-
EPA dynamometer driving schedules
-
Worldwide Harmonised Light Vehicle Test Procedure (WLTP) laboratory tests
-
it has various types of cycles in this block
1. FTP75
2. Wide open throtal (WOT)
3. Work space and other options from where we can import the data
the below figure represents the drive cycle block

But in the model i am taken FTP75 drive cycle with a time of 2474 sec below i am attaching the image of the drive cycle that i had implemented in my model and its parameters.

Then it is connected to Longitudinial driver block of VELref port and also connected to scope .
2.Longitudinial 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.
the below figure represents the Longitudinial driver block
Coming to the connections VelRef is connected to drive cycle then
and VELFdbk port is connected to the feedback port from the vehicle body (V terminal). and the grade is connected to the ground block as the gradeability is not considered in this model. the INFO port is connected to the termonator block and the acceleration and deceleration command ports is connected to the respective ports of the motor control sub-system.
coming to the block parameters the control type is taken as PI. PI means proprtiona integral control with tracking wind-up and feed-forward gain. for the scheduled PI configuration the block used feed forward gains that are a function of vehicle velocity. and below i am attaching the image of the parameters considered for the following block

3.Motor control sub-system
Below i am attaching the inside of the motor control sub-system

In this above subsystem i am used some blocks that are given below
i) H-bridge
ii) Controlled PWM voltage
iii) DC Motor
iv) Controlled voltage source
Remaining blocks can be considered as a general blocks of the sub-system but those are also important blocks for the smooth and efficient operation, and those blocks are
v) Solver configuration
vi) Electric reference
vii) current sensor
viii) voltage sensor
ix) connection port
x) Scope
xi) mechanical rotational reference
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.
The parameters of block shown below

In this block PWM port is connected to controlled pwm voltage then REF & REV ports are connected to electrical referance & BRK port is connected to controlled voltage source and input of the controlled voltage source is connected to decelration comand port of the longitudinal driver block then positive port is connected to motor through current sensor & negative port is connected to electrical ref.
Controlled PWM voltage source:
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.
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.
- If you use a fixed-step or local solver and the discrete-time switching event type, the following restrictions apply to the Sample timeparameter value:
- The sample time must be a multiple of the simulation step size.
- The sample time must be small compared to the PWM period, to ensure sufficient resolution.
ref+ port is connected to positive terminal of the controlled voltage source, ref- & REF ports are connected to electrical referance and also i am attaching the block parameters as below.



DC motor:
This block represents the electrical and torque characteristics of a DC motor.
The block assumes that no electromagnetic energy is lost, and hence the back-emf and torque constants have the same numerical value when in SI units. Motor parameters can either be specified directly, or derived from no-load speed and stall torque. If no information is available on armature inductance, this parameter can be set to some small non-zero value.
When a positive current flows from the electrical + to - ports, a positive torque acts from the mechanical C to R ports. Motor torque direction can be changed by altering the sign of the back-emf or torque constants.
The positive and negative terminals of the dc motor is connected to the positive and negative terminal of the H-bridge and the C terminal of the motor is connected to the mechanical rotational reference and the R port is connected to the Shaft of the transmission system. below i am attaching the image of the DC motor parameters which are considered.


Controlled voltage source:
The block represents an ideal voltage source that is powerful enough to maintain the specified voltage at its output regardless of the current passing through it. 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.
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.
It is connected to ground of the system.

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.
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. this is also known as a type of ammeter which is used to mesure the value of current that is flowing in the circuit.
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. Use a ps simulink block to connect this port to Simulink blocks, such as Scope or Display. below picture represents the basic block of the current sensor
Voltage sensor:
The Voltage Sensor block represents an ideal voltage sensor, that is, a device that converts voltage measured between two points of an electrical circuit into a physical signal proportional to the voltage. in electrical terminology it is also known as a voltmeter which is used to measure the voltage between the two terminals in the system or the corcuit.
Use the + and - ports to connect the sensor in parallel with the block (or several blocks) where you want to measure the voltage. Port V outputs the measurement result as a physical signal. Use a ps simulink converter block to connect this port to Simulink blocks, such as Scope or Display. below picture represents the basic block of the voltage sensor.
connection port:
The Connection Port block transfers a physical connection or signal across subsystem boundaries. Physical connections include Simscape conserving and physical signal connections, Simscape Multibody connections, and Vehicle Dynamics Blockset two-way connection ports, among others. we can connect subsystems and individual blocks by using this connection port.
Scope :
Scope, Floating Scope (Simulink Reference) The Scope block displays its input with respect to simulation time. The Scope block can have multiple axes (one per port); all axes have a common time range with independent y-axes. The Scope allows you to adjust the amount of time and the range of input values displayed.
we can connect multiple inputs to the scope so not only one output is displayed and we can also observe the other outputs also in scope. the below picture shows the basic block of the scope

mechanical rotational reference :
The Mechanical Rotational Reference block represents a reference point, or frame, for all mechanical rotational ports. All rotational ports that are rigidly clamped to the frame (ground) must be connected to a Mechanical Rotational Reference block.
as we have a dc motor and it is also a mechanicalpart so the C port of the motor is connected to the mechanical rotational reference part. below image represents the basic block of the mechanical rotational reference.
Battery sub-system:

Below i am showing SOC subsystem

The above subsystem i am used some blocks that are given below
i) Battery
ii) controlled current source
iii) rate transition
iv) Integrator
v) gain
vi) constant
vii) add
viii) connection port.
Battery:
This block models a battery. If you select Infinite for the Battery charge capacity parameter, the block models the battery as a series internal resistance and a constant voltage source. If you select Finite for the Battery charge capacity parameter, the block models the battery as a series internal resistance plus a charge-dependent voltage source defined by:
V = Vnom*SOC/(1-beta*(1-SOC))
where SOC is the state of charge and Vnom is the nominal voltage. Coefficient beta is calculated to satisfy a user-defined data point [AH1,V1].
Battery is connected to controlled current source.
The block parameters are shown below

Controlled Current Source
The Controlled Current Source block converts the Simulink input signal into an equivalent current source. The generated current is driven by the input signal of the block. The positive current direction is as shown by the arrow in the block icon. You can initialize the Controlled Current Source block with a specific AC or DC current.
The block represents an ideal current source that is powerful enough to maintain the specified current through it regardless of the voltage across it. The output current is I = Is, where Is is the numerical value presented at the physical signal port.
Rate transition :
The Rate Transition block transfers data from the output of a block operating at one rate to the input of a block operating at a different rate. Use the block parameters to trade data integrity and deterministic transfer for faster response or lower memory requirements.
it is used to calculate the SOC curent in the model and the below image represents the block of rate transition.

Integrator:
The Integrator block outputs the value of the integral of its input signal with respect to time. Simulink ® treats the Integrator block as a dynamic system with one state.

the block parameters are shown below

Gain :
Gain (Using Simulink) The Gain block generates its output by multiplying its input by a specified gain factor. You can enter the gain as a numeric value, or as a variable or expression in the Gain parameter field. The input and gain can be a scalar, vector, or matrix.
I am using gain block to ampere per hour to ampere per sec (1/3600)


constant:

The Constant block generates a real or complex constant value signal. Use this block to provide a constant signal input. The block generates scalar, vector, or matrix output, depending on:
-
The dimensionality of the Constant value parameter
-
The setting of the Interpret vector parameters as 1-D parameter
The output of the block has the same dimensions and elements as the Constant value parameter. If you specify for this parameter a vector that you want the block to interpret as a vector, select the Interpret vector parameters as 1-D check box. Otherwise, if you specify a vector for the Constant value parameter, the block treats that vector as a matrix.
Transmission subsystem:

in the above subsystem i am used some blocks that are given below
i) simple gear
ii) tire (magic formula)
iii) vehicle body
simple gear :
Represents a fixed-ratio gear or gear box. No inertia or compliance is modeled in this block. You can optionally include gear meshing and viscous bearing losses.
Connections B (base) and F (follower) are mechanical rotational conserving ports. Specify the relation between base and follower rotation directions with the Output shaft rotates parameter. Optionally include thermal effects and expose thermal conserving port H by setting Friction model to a temperature-dependent setting.
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.
the below image represents the basic block of the simple gear.
Block parameters are shown below


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. below image represents the tire basic block.
the block parameters are shown below





N-port: Physical signal input port associated with the normal force acting on the tire. The normal force is positive if it acts downward on the tire, pressing it against the pavement.
S-port: Physical signal output port associated with the relative slip between the tire and road.
A-axle port: Physical signal output port associated with the relative slip between the tire and road.
H-hub port: Mechanical translational port associated with the wheel hub that transmits the thrust generated by the tire to the remainder of the vehicle.
PS Constant:

This block generates the physical signal of a constant value. The Constant parameter accepts both positive and negative values. The block output is a physical signal port. The PS constant block parameters are shown 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.
he 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. below picture represents the basic block of the vehicle body
The vehicle body is having the following ports:
NR- It is a rear axle force port.
NF- It is a front axle force port.
Beta – This is a road incline angle port.
H – This port is connected to the horizontal motion of the vehicle’s body.
V – it is a vehicle longitudinal velocity port.
W – is the Headwind speed port.
the block parameters are shown below



Here we are taking the integrator block at the velocity feedback port. When the velocity is integrated with respect to the time, the total distance is covered from the initial position to the final position of the vehicle. The integrated output of distance is multiplied and divided by the constant value of 1000 to get the distance in Kilometres. The total distance in kilometres is visible in the display block.
Finally all the subsystems are connected as shown below

The simulation time is 2474seconds is taken as per the drive cycle run time. When the simulation is started the Drive Cycle Source is giving the reference speed as an input to the Longitudinal driver block and this block is having a controller. PI controller is used in the longitudinal driver block this was generating normalized acceleration and braking commands based on the reference and feedback velocities. The acceleration and deceleration commands are given to the motor controller block.
In the Motor Controller block, two controlled voltage source blocks are taken for acceleration and deceleration ports. When the Acceleration command is generated from the longitudinal driver block it is given to the controller voltage source common terminal. At time zero, the pulse is initialized as high unless the duty cycle is set to zero or the Pulse delay time is greater than zero. The output voltage is zero when the pulse is low and is equal to the Output voltage amplitude parameter when high. The duty cycle is set by the input value. This block represents an H-bridge motor drive. The block can be driven by the Controlled PWM Voltage block in PWM or Averaged mode. In PWM mode, the motor is powered if the PWM port voltage is above the Enable threshold voltage. In Averaged mode, the PWM port voltage divided by the PWM signal amplitude parameter defines the ratio of the on-time to the PWM period. Using this ratio and assumptions about the load, the block applies an average voltage to the load that achieves the correct average load current. The Simulation mode parameter value must be the same for the Controlled PWM Voltage and H-Bridge blocks. The PWM block positive output port is connected to the current sensor Positive input port. This current sensor converts the current measured in any electrical branch into a physical signal proportional to the current. The connection I is a physical signal port that outputs the current value. This output is given to the battery subsystems controlled current source common terminal. The motor positive terminal is connected to the current sensor negative terminal. Motor mechanical R port is connected to the simple gear. A voltage sensor is placed in parallel with DC Motor to measure the voltage. A solver is placed at common ground. In the transmission subsystem Gear is the input signal and the vehicle body is connected to the tires.
The vehicle body has the inclination angle and wind force ports these are connected to PS constant blocks. This vehicle body has an H port this port is connected to the wheel’s hub port of all four wheels. Tires force N port is connected to NR and NF these are rear force and font force. V port is the velocity of the vehicle body is output for the longitudinal driver block which is feedback.
In the battery subsystem, we are calculating the battery SOC. For this subsystem, the current is input, and output is connected to the scope to view the battery SOC. The battery is connected to the controlled current source common port is connected to the motor controller current sensor output port. The rate transition is transmitting the signal physical to Simulink form and it multiplied with gain then it was integrated with discrete time integrator and addition with some constant value it calculated with gain block.
To calculate the vehicle total distance covered by the vehicle, we took the feedback speed of the vehicle body and integrated it with an integrator. The output of the integrator speed is divided by 1000 to know the vehicle covered the distance in Kilometres.
Run the simulation and then the results are shown below.

In this scope, we can observe the two plots which are the Drive cycle source and Feedback velocity. These plots are indicated in different colours yellow colour plot is the Drive cycle source and the blue one is feedback velocity. We can observe that both plots are similar with small variations. Sudden changes in acceleration and braking apply to the vehicle. Inclination angle and wind force acting on the vehicle also affect the vehicle performance. In real-time vehicle running vehicle drag force, acceleration, braking, and wind force are considered. These are affecting the vehicle speed as compared with reference drive cycle speed.

The first plot is observed from the scope of the current sensor which is connected between the H-Bridge and DC motor.
The first plot observed the current variations of the motor according to the drive cycle. The current is increasing when the acceleration is applied and when the braking or deceleration command is applied current value is decreased. When the vehicle is at constant speed the current value also maintains constant. When the braking is applied the vehicle speed is decreasing and the current value is a negative region.
The plot is observed from the battery subsystem for the battery state of charge, charging, and discharging. When we compare this battery plot with the drive cycle plot we can observe, that when the vehicle is accelerating to high speed the battery consumption is high as a result the battery discharges more. When the braking is applied the vehicle is in regenerative braking mode so in this condition battery was getting charged, this variation we can view in the plot. We can see the battery discharging and charging in this scope.
The third plot is observed for the voltage variation across the DC motor. The voltage sensor is connected across the DC motor. The voltage is compared with the feedback velocity, we can observe the change in voltage respective to the velocity variations. When the vehicle is accelerated, voltage is also increasing and then the voltage is decreasing when the breaking is applied. The voltage is constant with the respective vehicle speed is constant.
Conclusion:
The MATLAB model of a electric vehicle is designed by using battery, dc motor, drive cycle & vehicle body and the performance is checked then shown the results of battery SOC ,voltage ,current of the motor and explained it clearly.