Final Project: Design of an Electric Vehicle
Q) 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
Ans:
Theory:
An electric vehicle is a type of vehicle that uses one or more electric motors for propulsion, relying on electricity stored in batteries or another energy storage device. Electric vehicles are designed to be more environmentally friendly than traditional internal combustion engine vehicles, as they produce little to no tailpipe emissions.
There are different types of electric vehicles:
a) Battery Electric Vehicle (BEV): A BEV is entirely powered by electricity stored in a battery. It does not have an internal combustion engine and produces zero emissions during operation.
b) Plug-in Hybrid Electric Vehicle (PHEV): A PHEV has both an electric motor and an internal combustion engine. It can operate on electric power alone for a certain range and then switch to the internal combustion engine or use both for longer distances.
c) Hybrid Electric Vehicle (HEV): While not purely electric, HEVs use a combination of an internal combustion engine and an electric motor to improve fuel efficiency and reduce emissions.
Block Diagram of Electric Vehicle:
Electric vehicles (EVs) consist of various components that work together to enable electric propulsion. The specific components can vary depending on the type of EV (Battery Electric Vehicle - BEV, Plug-in Hybrid Electric Vehicle - PHEV, etc.) and the manufacturer. Here are some key components commonly found in electric vehicles:

1) Electric motor:
Electric traction motor is the main components of electric vehicles. The motor converts the electrical energy into kinetic energy. This energy rotates the wheels. Electric motor is the main components of electric vehicle that differentiates an electric car from conventional cars. An important feature of an electric motor is the regenerative braking mechanism. This mechanism slows down the vehicle by converting its kinetic energy into another form, and storing it for future use. There are basically two types of motors DC and AC motors.
2) Battery:
Traction battery pack is also known as Electric vehicle battery (EVB). It powers the electric motors of an electric vehicle. The battery acts as an electrical storage system. It stores energy in the form DC current. The range will be higher with increasing kW of the battery. The life and operation of the battery depends on its design. The lifetime of a traction battery pack is estimated to be 200,000 miles.
3) Controller:
Power electronics controller determines the working of an electric car. It performs the regulation of electrical energy from the batteries to the electric motors. The pedal set by the driver determines the speed of the car and frequency of variation of voltage that is input to the motor. It also controls the torque produced.
4) 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.
5)
The fundamental purpose of DC/DC converters is the same regardless of the model upon which they are built.
A step-up converter transforms a low-voltage input into a high-voltage output, whereas a step-down converter does the exact reverse.
An electric vehicle’s batteries generally produce a DC voltage of several hundred volts. The voltage requirements for the electric parts within the car vary, albeit most of them operate at significantly lower voltages.
A steady voltage is provided by the traction battery pack. But the criteria for various vehicle components vary. The battery’s output power is dispersed to the necessary level by the DC-DC converter. Additionally, it supplies the power needed to recharge the backup battery.
1) Modeling of vehicle body system:

Vehicle Body:


The vehicle body is used to represent the vehicle in practical way it has the same inputs as a real-world vehicle requires like drag values, pitch, variables, wind velocity and road angles etc.
The connection ports that is Connection H is the mechanical translational conserving port associated with the horizontal motion of the vehicle body. Connections V, NF, and NR are physical signal output ports for vehicle velocity and front and rear normal wheel forces, respectively, In this ports 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.
This 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.
As it says above that the connection of the vehicle body ports which are inputs that is H is connected to the tire blocks H terminal. NR and NF to the rear wheel N and front wheel N terminals. W and beta are the optional here we connected both to the physical signal (PS) constant with the value of 0. V is the output port which gives the velocity value that is it gives the speed that a vehicle is be gone.
Tire(magic formula):


As we seen above that the tires are used in the vehicle body which is having the 2 tires each per axle which moves along with the given throttle value as left and right front and rear blocks. It is the mathematical model of the design or block of the tire which have the same parameters and effects which are designed In the model as real. The effects for the real one is applied to the tire as same.
Here the names A indicates 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. Connection S is a physical signal output port that reports the tire slip. We not consider the slip in this subsystem so we connected the S terminal to the terminate physical signal to not to generate the warnings to the not connected ports.
Simple Gear:


It is the representation for the gear box in the vehicle, it seems similar as a real gear box we can include meshing and bearing losses if we need.
It is located between the connection of the motor terminal R and A is the mechanical rotational conserving port by the gear terminals B and F respectively.
2)MOTOR AND CONTROLLER SUBSYSTEM:
This motor controller subsystem consists of a DC motor, H-Bridge, controlled PWM voltage, controlled voltage source, current sensor, electrical reference, PS-Simulink converter, and mechanical reference blocks.

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 a 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.
Averaged — This mode has two Load current characteristics options:
- Smoothed
- Unsmoothed or discontinuous
The Smoothed option assumes that the current is practically continuous due to load inductance. In this case, the H-Bridge block output is:
Vo.VPWM/APWM − IOUTRON
where:
- VO is the value of the Output voltage amplitude parameter.
- VPWM is the value of the voltage at the PWM port.
- APWM is the value of the PWM signal amplitude parameter.
- IOUT is the value of the output current.
- RON is the Bridge on the resistance parameter.
The current will be smooth if the PWM frequency is large enough. Synchronous operation where freewheeling is via a bridge arm back to the supply also helps smooth the current. For cases where the current is not smooth, or possibly discontinuous (that is, it goes to zero between PWM cycles), use the Unsmoothed or discontinuous option. For this option, you must also provide values for the Total load series resistance, Total load series inductance, and PWM frequency. During simulation, the block uses these values to calculate a more accurate value for H-bridge output voltage that achieves the same average current as would be present if simulating in PWM mode.
Set the Simulation mode parameter to Averaged to speed up simulations when driving the H-Bridge block with a Controlled PWM Voltage block. You 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 your assumption about the load current. If you specify that the current is Unsmoothed or discontinuous, then the accuracy also depends on the values you provide for load resistance and inductance being representative. This mode also makes some simplifying assumptions about the underlying equations for the case when the current is discontinuous. For typical motor and bridge parameters, accuracy should be within a few percent. To verify Averaged mode accuracy, run the simulation using the PWM mode and compare the results to those obtained from using the Averaged mode.
Braking mode is invoked when the voltage presented at the BRK port is larger than the Braking threshold voltage. Regardless of whether in PWM or Averaged mode, when in braking mode the H-bridge is modeled by a series combination of two resistances R1 and R2 where:
- R1 is the resistance of a single bridge arm, that is, half the value of the Total bridge on the resistance parameter.
- R2 is the resistance of a single bridge arm in parallel with a diode resistance, that is, R1 · Rd / ( R1 + Rd ), where Rd is the diode resistance.
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 the 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 DC motor positive terminal is connected to the current sensor negative terminal and voltage sensor positive terminal.
The negative terminal is connected to the common. the mechanical rotation terminal C is connected to the Mechanical Rotational reference block. then the R port is connected to the simple Gear.
The following figures show the properties of the DC motor. here we are taking the rated load and speed values. we are taking no losses in this model.
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 the simulation. Each topologically distinct Simscape block diagram requires exactly one Solver Configuration block to be connected to it.
solver block is connected to the common ground block.
Controlled PWM Voltage :


The controlled PWM Voltage positive reference port is connected to the positive terminal of the controlled voltage source, negative reference port is connected to the common ground terminal. The PWM port is connected to the H-Bridge PWM port, and then the REF port is connected to the common ground terminal. The Controlled PWM voltage block parameters are: PWM frequency is 50 Hz and simulation mode is Averaged. Input scaling parameters are Input voltage for 0% duty cycle is zero volts and then Input voltage for 100% duty cycle is 1v. The output voltage amplitude is 5V.
Current Sensor:

The 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 conserving electrical ports through which the sensor is inserted into the circuit. The connection I is a physical signal port that outputs current value.
Battery SubSystem:

Battery:


This block models a battery. If you select Infinite for the Battery charge capacity parameter, the block models the battery as a series of 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 of 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].
The battery-positive terminal is connected to the Rconn port, negative terminal of the battery is connected to the Lconn port of the controlled voltage source block.
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. 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.
Drive Cycle Source:


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. Study, tune, and optimize vehicle control, system performance, and system robustness over multiple drive cycles.
Result:




This 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.

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.


This plot is observed from the scope of the current sensor which is connected between the H-Bridge and DC motor.
The above 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.

Conclusion:
The MATLAB model of an electric car is created by using the Battery and DC motor. This model is Simulated and the vehicle Drive cycle, Feedback velocity, Current, Voltage, and %SOC are observed through the scopes. The difference in parameters performance is analyzed and discussed step by step with the plots. Each block’s operation and connections are explained clearly with their images. The vehicle system level configurations are explained with pictorial representation. The results are analyzed and explained clearly with their plots.