Design of an Electric Vehicle
Create a MATLAB model of an electric car that uses a battery and a DC motor. Choose suitable blocks from Powertrain block set. Prepare a report about your model including the following:
Aim: Create a MATLAB model of an electric car that uses a battery and a DC motor
introduction:
Electric vehicles have low running costs as they have fewer moving parts for maintenance and are 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 a s they have 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 has, for example, caused fires or explosions in the Tesla Model S, although efforts have been made to improve the safety of these batteries.
What are the inner parts of an EV?
EVs have 90% fewer moving parts than an ICE (Internal Combustion Engine) car. Here's a breakdown of the parts that keep an EV moving:
- Electric Engine/Motor - Provides power to rotate the wheels. It can be DC/AC type, however, AC motors are more common.
- Inverter - Converts the electric current in the form of Direct Current (DC) into Alternating Current (AC)
- Drivetrain - EVs have a single-speed transmission that sends power from the motor to the wheels.
- Batteries - Store the electricity required to run an EV. The higher the kW of the battery, the higher the range.
- Charging - Plug into an outlet or EV charging point to charge your battery.
Working principle of EV:
When the pedal of the car is pressed, then:
- The 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)
- An 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.

Objectives:
- System-level configurations
- Model parameters
- Results
- Conclusion
Explanation :
- Making a Model of an EV with a Dc motor And Battery which is a rear-wheel-Drive Vehicle by using Matlab & Simulink tool.
- Block Diagram of powertrain components in electric vehicles.
Blocks used to make EV model :
- Drive Cycle Source
- Longitudinal Driver
- Controlled Voltage Source
- Controlled PWMVoltage
- H- Bridge
- Current Sensor
- DC Motor
- Simple Gear
- 4 Tyres
- Vehicle Body
- Battery
- Controlled Current Source
- Bus Selector
Model Design Of Electrical Vehicle :

Process :
Drive Cycle Source :

- Determining The Drive Cycle for the engine to run for given time
- Two Drive are,
- FTP75and Wide Open Throttle (WOT)
- Where the time for running the drive cycle is 2747 sec.
Longitudinal Drive :

- A parametric longitudinal speed tracking controller for generating normalized acceleration and braking commands based on reference and feedback velocities.
- Use the external actions to input signals that can disable, hold, or override the closed-loop commands determined by the block.
- The block uses this priority for the input commands: disable, hold, override.
Controller Sub-block :
Controlled Voltage Source :

- The Controlled Voltage Source 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.
Controlled PWM Voltage :

- Where the block is used to create a pulse-width modulated voltage across through PWM and REf ports. Then output voltage is zero when the pulse is low and is equal to the output voltage ampiltude parameter with high.
- The duty cycle is set by input value. Right-click block and select Simscape -> Block choices to which between electrical +ref/-ref ports and PS input u to specify input value.
- The Time zero, the pulse is initialized as high unless duty cycle is set to zero or pulse delay time is grater than zero.
- The Simulation mode can be set to PWM or Averaged. In PWM mode, the output is a PWM signal. In Averaged mode, the output is constant with a value equal to averaged PWM signal.
H - Bridge :
- 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.
- If the REV port voltage is greater than the Reverse threshold voltage, then the output voltage polarity is reversed. If the BRK port voltage is greater than the Braking threshold voltage, then the output terminals are short circuited via one bridge arm in series with the parallel combination of a second bridge arm and a freewheeling diode.
- Voltages at ports PWM, REV and BRK are defined relative to the REF port.
- If exposing the power supply connections, the block only supports PWM mode.
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. Connection I is a physical signal port that outputs current value.
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.
Vehicle Body :
Gear Box :

- Represents a fixed-ratio gear or gear box. No inertia or compliance is modeled in this block. You can optionally include gear meshing, backlash, 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.
4 - Tyre :

- Represents the longitudinal behavior of a highway tire characterized by the tire Magic Formula.
- The block is built from Tire-Road Interaction (Magic Formula) and Simscape Foundation Library Wheel and Axle blocks. Optionally, the effects of tire inertia, stiffness, and damping can be included.
- 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.
- Optionally expose physical signal port M by setting Parameterize by to Physical signal Magic Formula coefficients.
- Physical signal port M accepts a four element vector corresponding to the B, C, D, and E Magic Formula coefficients.
Vehicle Body :

- Represents a two-axle vehicle body in longitudinal motion. The block accounts for body mass, aerodynamic drag, road incline, and weight distribution between axles due to acceleration and road profile.
- The vehicle can have the same or a different number of wheels on each axle. Optionally include pitch and suspension dynamics or additional variable mass and inertia.
- The vehicle does not move vertically relative to the ground.
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.
- If variable mass is modeled, the physical signal input ports CG and M are exposed. CG accepts a two- element vector representing the x and y distance offsets from vehicle CG to additional load mass CG.
- M represents the additional mass. If both variable mass and pitch dynamics are included, the physical signal port J accepts the inertia of the additional mass about its own CG.
Battery :
- Implements a generic battery model for most popular battery types. Temperature and aging (due to cycling) effects can be specified for Lithium-Ion battery type.
- Norminal Voltage is 500 V for our condition and Rated capacity is 50 Ah.
Controlled Current Source :

- Converts the Simulink input signal into an equivalent current source. The generated current is driven by the input signal of the block.
- You can initialize your circuit with a specific AC or DC current. If you want to start the simulation in steady-state, the block input must be connected to a signal starting as a sinusoidal or DC waveform corresponding to the initial values.
Bus Selector :

- This block accepts a bus as input which can be created from a Bus Creator, Bus Selector or a block that defines its output using a bus object.
- The left listbox shows the elements in the input bus. Use the Select button to select the output elements. The right Listbox shows the selections.
- Use the Up, Down, or Remove button to reorder the selections. Check 'Output as virtual bus' to output a single bus.
Result:
Drive cycle Vs Velocity :

- When the velocity and the drive cycle data can equally merged and the vehicle can controlled with respect the drive cycle FTP-75
SOC (%) :

- When the vehicle changes its displacement the percentage of the batter getting drained gradually
Voltage (V) :

- If the voltage is gradually supplied with the required time and speed.
Conclusion :
- If the vehicle is designed for the same specifications as the matlab there would be some changes in the results depending on the surroundings and driver usage.
- Various parameters can be changed for better efficiency and improvement of the vehicle like Battery, mass of the vehicle, tyres, motor specifications, etc
- From the model we have achieved the distance of almost 5kms and the discharge is also likely slower in discharge rate and it has only discharge 0.5%, we can say that the vehicle is efficient.