Aim : To create a MATLAB model of electric car which uses a battery and DC motor from powertrain blockset.
Software used - MATLAB R2020a
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 late 19th century and early 20th century.
- Innovation and advanced development in the internal combustion engines (ICE) and mass production of cheaper gasoline vehicles has led to a decline in the use of electric vehicles.
- Different types of electric cars changed and are developed continuosly 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?
- 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 of the motor rotor rotates the transmission. So the wheels turn and then car moves.
Types of electric cars -
- Battery electric vehicle (BEV)
- Hybrid electric vehicle (HEV)
- Plug - in Hybrid electric vehicle (PHEV)
- Fuel cell electric vehicle (FCEV)
1. BEV -
- It is also called as, All - electric vehicle (AEV), runs entirely on a battery and electric drive train.
- This types of electric cars donot have an ICE. Energy 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 components of BEV -
Components of BEV -
- Electric motor
- Inverter
- Battery
- Control module
- Drive train
Working principle of BEV -
- Power is converted from DC battery to AC for the electric motor.
- The accelerator pedal sends a signal to the controller which adjusts the vehicle 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 - Volkswagen e - Golf, Tesla model 3, BMW i3, chevy bolt, chevy spark, Nissan LEAF, Ford Focus Electric, Hyundai Ioniq, Karma Revera.
2. HEV -
- This type of hybrid cars is often called as standard hybrid or parallel hybrid.
- HEV has both an ICE and an electric motor.
- In this types of electric cars, internal combustion engine gets energy from fuel, 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 abttery can not be recharged from outside of the system.
Architecture and main components of HEV -

Components of HEV -
- Engine
- Electric motor
- Battery pack with controller and 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 - Honda Civic Hybrid, Toyots Prius Hybrid, Honda Civic Hybrid, Toyota Camry Hybrid.
3. 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 offer a choice of fuels.
- This type of electric cars is powered by a conventional fuel (such as gasoline) or an alternative fuel (such as bio - diesel) and by a rechargeable battery pack.
- The battery can be charged up with electricity by plugging into an electrical outlet or electric vehicle charging stations. (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.

Components of PHEV -
- Electric Motor
- Engine
- Inverter
- Battery
- Fuel tank
- Control module
- Battery charger(if onboard model)
Working principle of PHEV -
- PHEVs typically startup in all electric mode and operate on electricity until their battery pack is depleted.
- Some modelsshift to hybrid mode when they reach highway cruising speed, generally above 60 - 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 combustion engine or regenerative braking.
- During braking, the electric motor acts as generator, using the energy to charge the battery. The electric motor supplements the engine's power as a results smaller engines can be used, increasing the car's fuel efficiency without compromising performance.
Examples - Porsche Cayenne SE - hybrid, Chevy vott, Chrysler Pacifica, Ford C - max energi, Ford fusion Energi, Mercedes C350e, Mercedes S550e etc.
4. Fuel cell Electric Vehicle (FCEV) -
- Fuel cell electric vehicles (FCEVs), also known as fuel cell vehicles (FCVs), or zero emission vehicle, are types of electric cars that employ fuel cell technology to generate the elctricity required to run the vehicle.
- In this type of vehicles, the chemical energy of the fuel is converted directly into electric energy.

Components of FCEV -
- Electric motor
- Fuel cell stack
- Hydrogen storage tank
- Battery with converter and controller
Working principle of FCEV -
- The working principle of a fuel cell electric car is different compared to that of a plug - in electric car.
- This type of electric cars is because the FCEV generates the electricity required to run this vehicle on the vehicle itself.
Examples - Toyota Mirai, hyundai Tuscon FCev, Riversimple rasa, Honda clarity fuel cell, Hyundai Nexa.
Electric car components -
- Electric car or vehicle component and function depend on the car type.
- Here we will discuss various common main electric car components or parts or elements and their function such as traction batteries, inverters (DC-DC converters), traction motors, on-board chargers and controllers.
- The different types of electric car components determines how the car works. Electric cars (vehicles) components and functions can be explained by means of picture below.
(i) Traction battery pack -

- 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
(ii) Power inveter -

- 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.
(iii) 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.
(iv) 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
(v) Charger -

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.
(vi) Transmission - The transmission transfers mechanical power from the electric traction motor to drive the wheels.

(vii) DC - DC converter -

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.
(viii) Battery -

In an electric drive vehicle, the auxiliary battery provides electricity to power vehicle accessories.
(ix) Thermal systems -

This system maintains a proper operating temperature range of the engine, electric motor, power electronics, and other components.
(x) Charge Port -

The charge port allows the vehicle to connect to an external power supply in order to charge the traction battery pack.
Modelling of EV -
Objectives -
- Electric Vehicle with fewer components.
- To make a most simple and low run time vehicle model using individual component models.
- To checkout performance parameters speed, SOC, current etc with various drive cycles.
- To play with motor power, vehicle body (Rolling resistance, Air drag, weight) inputs.
- To know MATLAB models and their configuration to match with actual vehicle.
Block Diagram -

The electric vehicle has Vehicle body, DC motor, Power converter, Driver controller, Drive cycle and Battery.
The Simulink model for the Electric Vehicle is as shown below.

Now we will discuss each blocks used in this Simulink Model -
Drive Cycle Source -

- This block helps in inputting the drive cycle data, whether it is built in or custom made by the user.
- We also use the drive cycle data in excel sheet using this block.
- Here we used FTP75 drive cycle.
The block parameters for this drive cycle block is -

and the drive cycle plot is -

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.
- We 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 block parameters are as shown below -

Controlled PWM voltage block -

- This block is used to create the pulse width modulated (PWM) voltage.
- Electrical input ports - The block calculates the duty cycle based on the reference voltage across its ref+ and ref- ports. This modelling variant is the default.
- The value of the output voltage amplitude parameter determines amplitude of the output voltage.


- Here we considered the Averaged Simulation Mode for the simulation.
- In input scaling we considered 1V for 100% duty cycle.
- maximum output is 1V (amplitude).
H - bridge -

- This block is used to change the polarity of the voltage applied across the DC motor so as to run the motor in forward and reverse direction as per the input command.
- This block is driven by 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 vltageIn averaged mode, the PWM port voltage divided by the PWM signal amplitude parameter defines the ratio of the on - time to PWM period.
- using the ratio assumptions about the load, the block applies an average voltage to the load that achieves the correct average load current.
- The simulation mode parameter must be same for the controlled PWM voltage and H-bridge blocks.
The block parameters of H- bridge as shown



The following values are considered for H- bridge -
- output voltage amplitude = 48V
- simulation mode - Averaged
- Power supply - Internal
- Enable threshold voltage = 0.0001V
- PWM signal amplitude = 1V
- Reverse threshold voltage = 0.0001 V
- Braking threshold voltage = 0.0001 V
Gear box -

- The Gear Box block represents an ideal, nonplanetary, fixed gear ratio gear box.
- The gear ratio is determined as the ratio of the input shaft angular velocity to that of the output shaft.

We considered gear ratio =2 and the direction of rotation of shaft as same direction as input shaft.
DC motor -

- Using the power from the battery pack this motor drives the vehicle wheels.
- Some vehicles use motor generators that perform both the drive and regeneration functions.
The block parameters are as shown -


The parameter values are as follows -
- Rotor inertia = 0.01gcm2
- Field type = permanent magnet
- No - load speed = 13000 rpm
- rated speed (at rated load) = 12000 rpm
- Rated load = 5000W
- rated DC supply = 48V
Tire/Wheels -

- This block represents the longitudinal behaviour of a highway tire characterized by the tire magic formula.
- 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 the physical signal input port that applies the normal force acting on the tire.
- Connection S is a physical signal output port that reports the tire slip.
The block parameters are -


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.


Here we considered following parameters -
- Frontl Area = 2m^2
- Drag coefficient = 0.25
- Air density = 1.18 kg/m^3
- Mass = 1000 kg
Battery Model -

- The Battery block implements a generic dynamic model that represents most popular types of rechargeable batteries.
- Here we used lithium ion type battery.


And we consider the following parameter values -
- Nominal Voltage = 48V
- Rated Capacity = 50V
- Initial state of charge = 90%
- Battery response time = 30s
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.
- This block accepts a bus as input which can be created from a Bus creator or a block that defines its output using a bus object.
The following are the block parameters

Here we selected three signals as SOC(%), Curent (A) and Voltage(V). Then these signals will be shown in the scope.
Controlled Voltage Source -

- This block provides the necessary voltage that is required for the vehicle.
- 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.We can initialize the Controlled Voltage Source block with a specific AC or DC voltage. If we 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.
Controlled Current Source -

- Similar to voltage block this block produces an ideal current that is powerfull enough to maintain the specified current regardless of the voltage across it.
Now we will run the simulation for 1000 seconds and the output we get is shown in the
Vehicle Speed Scope -

- From this scope we can see two signals. The blue signal indicates the drive cycle data and the yellow signal represents the vehicle body speed.
- The longitudinal driver successfully maintians the drive cycle data, processes it and controls the vehicle's speed according to the reference speed.
- This graph overlaps each other during acceleration and deceleration.
Current Scope -

- This graph shows how the current flows from the battery to the motor .
- The variation in the current is due to the change in drive cycle.
SOC scope -

- The SOC graph shows how the state of battery varies over the drive cycle time.
- Initially the battery SOC is 90%.
- As the simulation starts the charge of the battery gets decreased and when vehicle is in braking mode there will be little rise in the graph.Which is nothing but the regenerative braking mode is in action.
- There will a fall of SOC after the simulation.
Voltage Scope -

- This graph shows how the battery voltage is utilized during running of an electric vehicle.
- It depends totally on acceleration and deceleration.
- Initially it supplies constant voltage with constant fluctuations later it decreases as speed decreases.
After running the simulation for 1000 seconds we get the vehicle speed in km/hr. that is the vehicle approximately runs ata speed of 68.41km/hr accoroding to the simulation.

- And when we convert km/hr to only km we use integrator and constant value of 1/3600 then we get the value of distance at 1000 seconds.
- So at 1000 seconds the vehicle covers the distance of 14.54 km.

Finally we get the output as we convert into km as shown below,

The link for this project is -
https://drive.google.com/file/d/16riKwcXy9VZVwQgkYeYX0sOADaQkd-H6/view?usp=sharing
Conclusion -
The above electric car model has been created with all necessary components using the SIMULINK and the model is simulated with all the proper procedure. This simulation gives the vehicle speed ouput, current flowing from the battery and the state of charge as well as the distance travelled within the simulation running time. This EV model covers the distance of 14.54km. The SOC of the battery is discharged efficiently upto 75% from full charge. This model has been attached above as a slx file.