Modeling of an Electric Vehicle with MATLAB/Simulink

Conventional vehicles utilize petroleum derived fuels to provide good performance and long range. But there are some disadvantages such as low fuel economy and exhaust gas emissions causing environmental pollution. In this respect, interest in electric vehicles is increasing. In this study, the dynamic model of an electric vehicle was created with MATLAB/Simulink. The energy consumption values of the electric vehicle were determined. The effect of parameters on vehicle performance and energy consumption has been examined. As a result of tests, the vehicle consumes 15.82 kWh of energy per 100 kilometers and the vehicle has a 177 kilometers range, according to NEDC. NEDC is the new European Driving Cycle. It was put into effect in 1997. But today, its reliability is being discussed. Therefore, the WLTP (Worldwide Harmonized Light Vehicle Test Procedure) cycle was also used in the models tests. In the WLTP cycle, the vehicle consumes 17.93 kWh of energy per 100 kilometers and the vehicle has a 157 kilometers range. With regenerative braking, an energy saving of 8% was achieved in 100 kilometers.


Introduction
The first electric vehicle was produced by Thomas Parker in 1884, 25 years after the invention of lead-acid batteries. After that date, many electric vehicle models appeared. However, the development of internal combustion engine technology and the reduction in mass production costs have left electric vehicles behind.
The energy crisis that lived between 1970 and 1980 brought electric vehicles back to the forefront. But they could not reach the high speeds and long ranges of conventional vehicles. For this reason, sufficient technological development could not be achieved.
Until today, many companies have produced electric vehicles. However, the range of these vehicles is short and they cannot reach high speeds. With the development of electric motor and battery technology, longer distance vehicles have begun to be produced. The time it takes to charge the battery is very high, despite the extended range of ranges. For this reason, electric vehicles are still not at the desired level.
T. HOFMAN and C.H.DAI, the effect of different gearboxes on energy consumption has been investigated. The powertrain system has been investigated using fixed gear system, manual gearbox and CVT gearbox [1]. A. Kerem, as electric vehicle technology in the world develops, interest in electric vehicles will increase. This shows that environmental pollution will decrease and dependence on petrol will decrease [2].
O. Vatan, modeling of an electric vehicle with MATLAB/Simulink. The model has a 30 kWh battery. This vehicle in the city consumes 0.58 kWh/100km and 0.44 kWh/100km outside the city. The vehicle has a max range of 52-70 kilometers [3].
E. Schaltz, designed and modeled an electric vehicle. This vehicle consumes 148.3 Wh/km of energy. Also explains that a large part of the energy loss is caused by the auxiliary loads, the lighting system, the security systems, the comfort systems and the battery [4].

Abstract
Conventional vehicles utilize petroleum derived fuels to provide good performance and long range. But there are some disadvantages such as low fuel economy and exhaust gas emissions causing environmental pollution. In this respect, interest in electric vehicles is increasing. In this study, the dynamic model of an electric vehicle was created with MATLAB/Simulink. The energy consumption values of the electric vehicle were determined. The effect of parameters on vehicle performance and energy consumption has been examined. As a result of tests, the vehicle consumes 15.82 kWh of energy per 100 kilometers and the vehicle has a 177 kilometers range, according to NEDC. NEDC is the new European Driving Cycle. It was put into effect in 1997. But today, its reliability is being discussed. Therefore, the WLTP (Worldwide Harmonized Light Vehicle Test Procedure) cycle was also used in the models tests. In the WLTP cycle, the vehicle consumes 17.93 kWh of energy per 100 kilometers and the vehicle has a 157 kilometers range. With regenerative braking, an energy saving of 8% was achieved in 100 kilometers.
Keywords: Driving Cycles; Electric vehicle; MATLAB/Simulink; Modeling; NEDC; WLTP X. D. Xue, tried to determine the appropriate electric motor for electric vehicles. Electric motors were compared according to efficiency, cost, safety and weight criteria. The study concludes that the permanent magnet synchronous motor is the best motor type [5].
E. Baser, an electric vehicle model with two motors, an asynchronous motor and a permanent magnet synchronous motor. As a result of the work the asynchronous motor at low speeds and the synchronous motor at constant speed with high speed are more efficient [6].

Electric Motor
In electric vehicles, up to now, 4 different electric motors have been used. These electric motors;  Direct current motor,  Asynchronous motor,  Permanent magnet synchronous motor,  Switched reluctance motor.
As a result of the evaluation, permanent magnet synchronous motor is considered to be suitable for the model. For this reason, technical specifications of the MOTIVE MV255 electric motor of TM4 have been used in our model.

Vehicle Resistance Forces
During driving, resistance forces act on the vehicles. These resistance forces;  Aerodynamic Resistance,  Tire Rolling Resistance,  Gradient Resistance,  Inertia Resistance.

Aerodynamic Resistance
A force acts on objects moving in a fluid opposite to their motions.

Fig. 3. Aerodynamic Resistance
This resistance force is called aerodynamic drag resistance. The aerodynamic drag resistance is calculated as follows; The aerodynamic resistance coefficient is determined experimentally according to vehicle shape;

Tire Rolling Resistance
Due to the elastic structure of the wheel, in front of the wheel contact center, a resistance force against the rotational movement of the tire occurs. The tire rolling resistance is calculated with this equality; Tire rolling resistance coefficient (Cr) varies according to the road surface.

Gradient Resistance
The resistance of the vehicle moving on a sloping road. The gradient resistance appears due to the component of gravity. α expresses the gradient of the path in degrees.

Inertia Resistance
Newton's II. According to the law of motion, during the acceleration and deceleration of an object, an inertial force is generated in the opposite direction to this motion. This force encountered during positive and negative acceleration of the vehicle is called inertia resistance. This resistance is calculated by this formula; Total resistance force;

Powertrain System Transfer Function
The powertrain system transmits the motion obtained by the electric motor to the wheels.

Fig. 4. Vehicle Powertrain System
The transfer function of powertrain system was removed. Relation of angular acceleration, torque and moment of inertia of a shaft; ꞷ = (6) Utilizing this equation, the angular velocity of the electric motor is calculated.
Net torque is obtained by subtracting the resistance torque value from the motor torque.

Driving Cycle
Driving cycles are speed-time graphs used to calculate vehicle exhaust emissions and fuel consumption. For comparison purposes, 2 driving cycles are used. In our model, NEDC (New European Driving Cycle) and WLTP (Worldwide Harmonized Light Vehicles Test Procedure) cycles are used.

Regenerative Braking
When the moving vehicle slows down or goes downhill, the kinetic energy of the vehicle can be recovered by braking the electric motor in the generator mode. During braking, the recovery of the energy due to the opposing electromotive force is ensured. In this way, higher system efficiency and battery charge increase the range.

Electric Motor Model
After calculating the revolution of the electric motor, the output torque is obtained from the diagram. Torque and speed information are input to the efficiency diagram. From this diagram, the instant efficiency of the motor is obtained.

Vehicle Dynamic Model
The powertrain system transfer function obtained in the previous section was created in the MATLAB/Simulink program in this section. Calculation of the angular velocity of the electric motor is provided. At this point the momentary torque and efficiency of the electric motor is determined. The angular velocity of the motor is divided by the differential ratio. Then the vehicle speed is obtained by multiplying by the radius of the wheel. By taking the integral of the vehicle speed, the distance traveled by the vehicle is calculated. The derivation of the vehicle speed gives the acceleration of the vehicle.

Vehicle Resistance Forces Model
Resistance force is multiplied by the radius of the wheel to obtain resistance torque. The resulting resistance torque is sent to the vehicle dynamic model. When the vehicle is stationary, it is necessary to reset the negative forces from the formula. For this reason, by adding the "Compare to Zero" block, no resistance forces are generated when the vehicle is stationary. Fig. 9. Resistance Forces Simulink Model

PID Controller (2DOF)
The PID controller equals the vehicle speed to the cycle speed. The PID controller outputs between -1 and 1. Positions -1 to 0 indicate braking, 0 to 1 controls the gas pedal.

State of Charge Model
In the vehicle model, it is designed to calculate the amount of energy consumed following the driving cycle. The amount of energy consumed determines the charge state of the battery and the energy consumption values at 100 km. The electric motor is braked with 30% gain when running in regenerative mode.

Conclusions
According to the simulation results including NEDC and WLTP cycles, it was understood that vehicle speed and cycle speed were the same. At this point, it is concluded that the energy consumption data obtained from the model is also correct.
Simulation graphs of NEDC and WLTP cycles were created.  In electric and hybrid vehicles, the battery is recharged by utilizing the current kinetic energy of the vehicle when the driver pulls the foot from the gas pedal.
According to different driving cycles, the regenerative braking result is the energy gain provided on the table.
The first 800 seconds of the NEDC cycle was named ECE-R15. It was devised to represent city driving conditions, e.g. in Paris or Rome. It is characterized by low vehicle speed, low engine load, and low exhaust gas temperature. The EUDC (Extra Urban Driving Cycle) cycle is between 800 and 1180 seconds. It represents highway driving. The effect of vehicle mass on energy consumption is given in the table. Aerodynamic resistance, one of the greatest resistance forces that affect the vehicle, is connected by 2 variables. These are the speed of the vehicle and the coefficient of aerodynamic resistance. Aerodynamic resistance, the effect on energy consumption is seen in the table. Reflecting real driving conditions, the WLTP cycle is achieved with a consumption of 15.49 kWh per 100 kilometers and a fully charged battery with a range of 157.7 km.
Regenerative braking saved 11.73% in the ECE-R15 cycle, 5.87% in the EUDC cycle, 8.06% in the NEDC cycle and 7.47% in the WLTP cycle.
The modeled vehicle speed of 80-120 km/h, defined as flexibility in the vehicles, completes at 6.95 seconds. This shows that the driver can provide the necessary acceleration in sudden power demands and sudden acceleration demands.
One of the most important factors affecting the range in electric vehicles is the battery capacity. The increase in battery capacity will be the solution to the limited range of electric vehicles. However, at this stage, the increase in vehicle mass brought by the high battery capacity reduces the efficiency of the vehicle.
Which is largely dependent on foreign sources of petroleum in Turkey, the widespread use of electric vehicles will greatly reduce the dependence on external. In addition, the provision of electricity from renewable sources will also prevent environmental concerns.