All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
Module 2: Final Project ----> Design of an Electric Vehicle Problem Statement: Create a MATLAB…
Bhaswar Manna
updated on 23 Apr 2021
Module 2: Final Project ----> Design of an Electric Vehicle
Problem Statement:
Create a MATLAB model of an electric car that uses a battery and a DC motor. Choose suitable blocks from the Powertrain block set. Prepare a report about your model including the following:
Objectives:
1. System-level configurations
2. Model parameters
3. Results
4. Conclusion
Answer:
An electric car is a car that is propelled by one or more electric motors, using energy stored in rechargeable batteries. Compared to internal combustion engine (ICE) vehicles, electric cars are quieter, have no exhaust emissions, and lower emissions overall. In the United States, as of 2020, the total cost of ownership of recent EVs is cheaper than that of equivalent ICE cars, due to lower fueling and maintenance costs. Charging an electric car can be done at a variety of charging stations; these charging stations can be installed in both houses and public areas.
Several countries have established government incentives for plug-in electric vehicles, tax credits, subsidies, and other non-monetary incentives. Several countries have established a phase-out of fossil fuel vehicles, and California, which is one of the largest vehicle markets, has an executive order to ban sales of new gasoline-powered vehicles by 2035.
The Tesla Model 3, which has a maximum range of 570 km (353 miles) according to the Environmental Protection Agency EPA, has been the world's best-selling electric vehicle (EV) on an annual basis since 2018 and became the world's all-time best-selling electric car in early 2020.
As of December 2019, the global stock of pure electric passenger cars totalled 4.8 million units, representing two-thirds of all plug-in passenger cars in use. In 2019, over half (54%) of the world’s all-electric car fleet was in China. Despite rapid growth, the global stock of fully electric and plug-in hybrid cars represented about 1 out of every 200 vehicles (0.48%) on the world's roads by the end of 2019, of which pure electrics comprised 0.32%.
India is also picking up pace with the west worlds as the market is becoming is very competitive, more car manufacturers are shifting their focus on EVs, to make them more cost-effective to their customers. Some of the existing EVs in the market are Tata Neoxon EV, MG ZS EV, Hyundai Kona EV, etc. Here, I have tried to match the vehicle dynamics of the Tata Nexon EV in my project, up to a certain extent like giving it the same kerb weight, Motor design, Battery capacity, etc. Although, it is to be noted that this model does not resemble that closely to the said EV car, but just a practical approximation of how a practical car of random but near-realistic parameter values would behave.
Now, in this project, to satisfy the objectives I have presented the same by giving all the necessary ideas about every important component of an EV, and also their representation and all the needed plots and data are given. The key representations can be narrowed down to some handful of points:
Brief Discussions about EV components:
Basic Block Diagram:
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.
Typical EV Battery pack
TATA Nexon EV Battery pack
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. Also, the inverter on an electric car has a function to change the AC when regenerative braking to DC and then used to recharge the battery. The type of inverter used in some electric car models is the bi-directional inverter category.
Typical EV Power-Inverter
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 cars work.
Typical EV Motor Controller
TATA Nexon EV Power Electronics Hub
Electric Traction Motor: Since 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.
Typical EV Traction Motor
TATA Nexon EV Traction Motor
Working of a brushed DC Motor
Other Secondary Electric Car Components:
Charger: It 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:
Nexon EV Charger
Transmission: The transmission transfers mechanical power from the electric traction motor to drive the wheels. All-electric vehicles have an automatic gearbox or automatic transmission. Some also provide different driving modes which are tuned with the gearbox.
DC/DC Converter: This one of the electric car parts that convert 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.
EV DC-DC Converter
Battery: In an electric drive vehicle, the auxiliary battery provides electricity to power vehicle accessories.
Thermal System for Cooling: This system maintains a proper operating temperature range of the engine, electric motor, power electronics, and other components.
Thermal Cooling System
Charge Port: The charge port allows the vehicle to connect to an external power supply to charge the traction battery pack. It comes with a standard 230 V/ 50 Hz rating and also has an option for DC fast charging.
Nexon EV Charging Port
Representation Of The EV Model In MATLAB Simulink:
Final EV Model Unmasked
Final EV Model Masked
Individual Subsystems & Blocks:
Drive Cycle Source:
This 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.
Study, tune, and optimize vehicle control, system performance, and system robustness over multiple drive cycles.
Identify the faults within tolerances specified by standardized tests, including:
EPA dynamometer driving schedules.
Worldwide Harmonised Light Vehicle Test Procedure (WLTP) laboratory tests.
For the drive cycles, you can use :
Drive cycles from predefined sources. By default, the block includes the FTP-75 drive cycle. Additional drive cycles can be installed from a support package. The support package has drive cycles that include the gear shift schedules, for example, JC08 and CUEDC.
Workspace variables.
.mat, .xls, .xlsx, or .txt files.
Wide-open throttle (WOT) parameters, including initial and nominal reference speed, deceleration start time, and final reference speed.
However, FTP-75 Drive Cycle is considered here in the Simulink model for testing the EV car performance characteristics and named it "Customized drive cycle".
Longitudinal Driver:
This 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.
External Actions parameters can be used to create input ports for signals that can disable, hold, or override the closed-loop acceleration or deceleration commands. The block uses this priority order for the input commands: disable (highest), hold, override.
However, in this model, we have not considered any external actions to simplify the model.
The controller type is set to Proportional-integral (PI) control with tracking windup and feed-forward gains. To compare how the tuning parameters affect the output results two different sets of values are given two them and they are compared to each other and the best one is considered. Proportional Gain (Kp) is set to 5 & 13, whereas the Integral Gain (Ki) is set to 1 & 8. This tuning of the controller is done to help the vehicle follow the Drive Cycle to the greatest possible extent.
The shift type is set to none which represents 'No transmission'. Block outputs a constant gear of 1.This setting is used to minimize the number of parameters we need to generate acceleration and braking commands to track forward vehicle motion. This setting does not allow reverse vehicle motion.
Electric Motor Drive:
Controlled Voltage Source: This block represents an ideal voltage source that is powerful enough to maintain the specified voltage at its output regardless of the current flowing through the source. 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.
We have used two Controlled Voltage Source blocks. The outputs associated with the Longitudinal Driver are fed as input to each of the two Controlled Voltage Source blocks, through the physical signal input port. The Controlled Voltage Source blocks generate an output voltage proportional to the Acceleration and Deceleration signals provided by the Longitudinal Driver.
The positive terminal of the Controlled Voltage Source block provided with the Acceleration input signal is connected to the positive reference of the Controlled PWM Voltage block, whereas the negative terminal is grounded to an Electrical Reference block.
The negative terminal of the Controlled Voltage Source block provided with the Deceleration input signal is connected to the Brake port of the H-Bridge block, whereas the negative terminal is grounded to an Electrical Reference block.
Controlled PWM Voltage: This block represents a pulse-width modulated (PWM) voltage source. It creates a Pulse-Width Modulated (PWM) voltage across the PWM and REF ports. The block calculates the duty cycle based on the reference voltage across its ref+ and ref- ports. The output voltage is zero when the pulse is low and is equal to the Output voltage amplitude parameter when high.
We have set the simulation mode to 'Average' to speed up simulations. This applies the average of the demanded PWM voltage to the motor. The Averaged mode assumes that the impedance of the motor inductive term is small at the PWM frequency. The averaged model also helps in linearising the model. We can only linearize the block for inputs corresponding to a duty cycle greater than zero and less than 100 per cent. The PWM frequency was 5KHz.
H-Bridge: The H-Bridge block represents an H-bridge motor driver. The block has the following two Simulation mode options:
1. 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 asynchronous operations. 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.
2. Averaged — This mode has two Load current characteristics options:
Smoothed
Unsmoothed or Discontinuous.
In this model, the Simulation mode parameter to 'Averaged' to speed up simulations when driving the H-Bridge block with a Controlled PWM Voltage block. We must also set the Simulation mode parameter of the Controlled PWM Voltage block to Averaged mode. This applies the average of the demanded PWM voltage to the motor. The accuracy of the Averaged mode simulation results relies on the validity of our assumption about the load current.
We have set the Power Supply to be 'Internal' and set the Load Current Characteristics to be 'Smoothed'.
We have also enabled 'Regenerative Braking' so that the DC motor can function as a generator during braking and thus help in recharging the battery.
The output voltage amplitude of the H-Bridge is set to 500 V.This has to match the rated DC supply voltage of the DC motor.
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. 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 C ports represent the Motor Casing whereas the R port represents the Rotor. The C port is connected to a Mechanical Rotational Reference block whereas the R port is connected to the Gear Drive of the 'Vehicle Body' sub-system. Hence it is the Rotor coupled with the Transmission, which propels the electric car.
In this model, the 'Permanent Magnet' field type is considered and the model parameterization based on 'Rated Load and Speed'.
No-load speed is set to 7000 RPM whereas Rated speed is set to 6800 RPM.
Rated load(Mechanical Power) is set to 90 kW and the motor is energized by a 500 V DC power supply.
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. Connections + and – are electrical conserving ports through which the sensor is inserted into the circuit. The connection-I is a physical signal port that outputs the measurement result.
In this Simulink model, The + and - terminals of the block are connected with the + and - terminals of the DC motor. This block helps us in determining the current drawn by the DC motor. The physical signal generated by this block is connected to the 'Battery Module' sub-system which in turn helps us in determining the State of Charge of the battery.
Mechanical Rotational Reference: This 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. The Casing (C port) of the DC motor is connected to this block.
Electrical Reference: This block represents an electrical ground. Electrical conserving ports of all the blocks that are directly connected to the ground must be connected to an Electrical Reference block. A model with electrical elements must contain at least one Electrical Reference block. All the negative terminals of the electrical blocks used in the sub-system are connected to the Electrical Reference. Also, the Reference ports of the Controlled Voltage Source and H-Bridge blocks are connected to this block. Since we have not considered using the DC motor for the reverse motion of the electric car, we have connected the REV port of the H-bridge to the Electrical Reference.
Solver Configuration: Each physical network represented by a connected Simscape block diagram requires solver settings information for simulation. This specifies the solver parameters that our model needs before we can begin the simulation. Each topologically distinct Simscape block diagram requires exactly one Solver Configuration block to be connected to it.
Battery Module:
Battery: This block represents a simple battery model. If we select Infinite for the Battery charge capacity parameter, the block models the battery as a series internal resistance and a constant voltage source. If we 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. The coefficient beta is calculated to satisfy a user-defined data point [AH1, V1].
Regarding this model :
We have considered 'Finite' battery charge capacity. The nominal voltage is set to 700V whereas the battery capacity is set to 312 Ah.
The other battery parameters such as self-discharge, charge dynamics and battery fade have been disabled to simplify the battery sub-system.
Controlled Current Source: 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. The block has one physical signal input port and two electrical conserving ports associated with its electrical terminals.
Here, The + and - terminals of this block are connected with the + and - terminals of the Battery. The physical signal from the Current Sensor of the DC motor is fed into the input signal port of this block. Hence, the system is modelled in such a way that the current drawn by the DC motor is provided by the Battery.
State of Charge (SOC) Calculation:
Rate Transition: This block transfers data from the output of a block operating at one rate to the input of a block operating at a different rate. The block parameters are used to trade data integrity and deterministic transfer for faster response or lower memory requirements.
We have selected 'Ensure data integrity during data transfer' and 'Ensure deterministic data transfer (maximum delay)' options.
The initial conditions are set to 0 whereas the output port sample time is set to -1 which specifies that the Rate Transition block inherits the output rate from the block to which the output port is connected.
Gain: This block multiplies the input by a constant value (gain). The input and the gain can each be a scalar, vector, or matrix. We have set the gain to "100/(80*3600)" which determines the rate of discharge of the battery.
Discrete-Time Integrator: This block is used to create a purely discrete model by the accumulation of input signal.
We have set the integration method to 'Forward Euler' for this Simulink model.
The gain value is set to 1.0 which is semantically equivalent to connecting a Gain block to the input of the integrator.
The initial condition is set to 0 whereas the sample time is set to -1 to inherit the sample time from an upstream block.
Constant: This block generates a real or complex constant value signal. This block is used to provide a constant signal input.
We have considered the constant signal value to be "100" which represents the initial State of Charge (SOC) of the battery.
Sum: This block performs addition or subtraction on its inputs. We have set the block to perform subtraction to determine the amount of charge left in the battery ie SOC.
Vehicle Body:
Simple Gear: This block represents a gearbox that constrains the connected driveline axes of the base gear, B, and the follower gear, F, to co-rotate with a fixed ratio that we specify. We have an option to 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.
We have set the Gear Ratio to 15 and ensured that the output shaft rotates in the same direction as the input shaft.
We have considered a constant efficiency friction model with a 0.8 (80%) Efficiency and a Follower power threshold of 0.001W. We have not applied any Viscous losses and disabled Faults.
Inertia: This block represents an ideal mechanical rotational inertia, which was given a value of 5 kg/m^2.
The blocks have one mechanical rotational 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 a positive direction.
The Tire (Magic Formula): block models a tire with longitudinal behaviour 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 the pavement.
To increase the fidelity of the tire model, we 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 the simulation. Hence we consider ignoring tire compliance and inertia while simulating the model in real-time or while 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.
We have set the parameterization type to 'Load-dependent Magic Formula Coefficients'.
We have considered the vertical load acting on each tire to be 4000 N.
We have set the Rolling Radius to be 1 m and the Rolling Resistance option is set in default settings.
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 centre 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 centre of gravity of the vehicle body can vary over the course of simulation in response to system changes.
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.
Here, We have considered the Head Wind Speed to be 0.8 m/s and the Road Inclination to be 0 radians.
The rest of the parameters are provided with values as shown in the images below.
m/s to km/hr Sub-system:
Distance Calculation Sub-system:
Simulation Solver: The simulation solver was chosen the same as the default setting it has i.e variable step and it automatically selects the solver which fits best regarding the Simulink model being simulated. The EV model was simulated for 1400 seconds for a better understanding of its behaviour.
The Simulink model for the EV can be accessed from the following link: Final EV Model
Output Results:
Comparison Between Drive Cycle Data and Vehicle Data:
This is the most important verification tool by which it can be determined if the model is being successfully simulated or not. Also, to witness the effect and importance of tuning the PI controller in the Longitudinal Driver block are given two separate values at two different times.
*PI: KC=5 & KI=1--->
Fig-1
Fig-2
Fig-3
&
Fig-4
From Fig-1, we can see that the vehicle tries to replicate the same as the drive cycle input and it does its job well most of the times but fails at the times when the vehicle is at rest. If you look closely at Fig-2 then it can be found that it comes to rest at the very last moment and from Fig-3 it is easily seen that the vehicle did not even come to rest and later tries to catch the up speed of the drive cycle. Also, from Fig-4 we can clearly see that vehicle travels more distance than the given drive cycle as the input. We can clearly state that because this vehicle not coming to rest properly and not so good tuning parameters are to blame for this.
**PI: KC=13 & KI=8--->
Fig-5
Fig-6
Fig-7
&
Fig-8
From Fig-5, we can see that tuning is quite good that is why the vehicle's speed data line coincides with the drive cycle data and because the latter one is overlapping the former one; only one data line can be seen. But if we zoom in as we did in Fig-6, we can see the tuning is surely improved with the changed values that is why the vehicle is coming to rest very quickly most of the times as expected from its side. Now, the zoomed-in output Fig-7 can be compared with the previous Fig-3 and by doing so it can be easily found out that the vehicle is following the drive cycle quite well. Finally, from Fig-8 we can clearly see that the covered distances are the same for both the drive cycle and vehicle. So, we can say that with the second set of PI values the Objective is completed, by developing an EV model in Simulink.
Other Outputs for the best performing model:
SOC Status:
Fig-9
The State Of Charge(SOC) of the vehicle's battery after the approximately 12Kms travelling is down to 97.2% from its initial 100% charge. This gives us a rough idea that the vehicle will go 400Kms approximately at one single charge i.e from 100% to 0%.
Distance Travelled Graph:
Fig-10
This graph shows at what point of time the vehicle is travelled how much distance altogether. This helps to understand the vehicle's speed behaviour over time.
Battery Current:
Fig-11
The above figure shows the battery currents reading of the vehicle over time. By taking a look at the current reading we can tell if the vehicle is speeding up or slowing down. The current varies from +115 Amps to - 108 Amps. Here. negative current means regenerative braking.
Conclusions: The Output results proclaims that the vehicle design parameters related to the Electric Motor Drive, Vehicle Body and Battery Module have to be tweaked appropriately to ensure that the vehicle follows the drive cycle as efficiently as possible. This Model is Developed by taking some bits of information from TATA Nexon EV and the focus is concentrated on making the EV model as much practical as it can be. Two types of tuning are given here to understand the tuning effect and the best tuning parameters are chosen arbitrarily by using the trial and error method. Hence, The EV model is successfully simulated and the given objectives have been addressed in this project analysis.
References:
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
Project 2-Highway Assistant-Lane Changing Assistant
Highway Assistant-Lane Changing Assistant …
17 Sep 2021 09:42 PM IST
Project 1- Traffic Jam Assistant Feature
Problem Statement: To develop one specific requirement of Traffic Jam Assistant algorithm which would predominantly feature in the IPC algorithm. Please note that the whole Traffic Jam Assistant is a very huge algorithm & only one small part of the logic is implemented here. Idea is to familiarize me with concepts…
16 Sep 2021 09:33 PM IST
Project 1 (Mini Project on Vehicle Direction Detection
Aim Of The Project: Identifying the direction of the vehicle based on the camera input. Objective of the Project: Development of MATLAB Simulink model as per requirement. Tag the requirements to the simulink model; tagging requirement 1 & requirement 2 to their corresponding subsystems is fine. MBD compliant changes,…
11 Sep 2021 09:23 PM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.