Detailed Simulation of Regenerative Braking of BLDC Motor for Electric Vehicles

: Reducing the use of fossil fuels is among the targets of the countries. Because they are likely to run out in the future and cause greenhouse gas emissions to the environment. One of the causes of greenhouse gas emissions is fossil fuel vehicles. The fossil-fueled vehicles can be replaced by electric vehicles. Electric vehicles have lower fuel costs due to the high efficiency of electric motors compared to internal combustion engines. The inadequacy in the batteries and the lack of charging stations require these vehicles to be used within certain distances. One of the ways to increase the distance is the regenerative braking of brushless direct current (BLDC) motors, which makes it re-usable when the vehicle is braking. This study presents a detailed simulation of the operation of a BLDC motor both as a motor and as a generator with regenerative braking by using Matlab/Simulink program. According to a simulation scenario, an energy recovery of 0.35% was achieved. Detailed Simulation of Regenerative Braking of BLDC Motor for Electric Vehicles. 4 (2): 63-72.


INTRODUCTION
Fossil fuels are used to meet the energy demand in transportation. But fossil fuels are harmful to the environment due to greenhouse gas emissions (Solmaz and Çelikten, 2012). They are also exhaustible. Recently, the use of electric vehicles has been encouraged to meet the need for transportation, and the efforts to make more efficient vehicles in this field continue with great acceleration (Hadj et al., 2018;Shaukat et al., 2018).
One of these studies is the regenerative braking used to recover wasted energy when the vehicle is braking (Qiu et al., 2018). This is called energy regeneration. It is used from electric motorcycles to cars (Nadeau et al., 2018). Energy regeneration is to make the wasted energy suitable for reuse. It aims to reduce the loss of energy as much as possible and thus contributes to the increase of energy efficiency. This is accomplished by means of regenerative systems.
The fuel costs of electric vehicles are more reasonable than conventional vehicles because electric motors have higher efficiency than internal combustion engines . However, the received distances are limited due to the insufficiency of the batteries used in electric vehicles (Pan et al., 2016;Hua et al., 2013). Charging stations for electric vehicles are too few when comparing with fuel stations. The regenerative braking without increasing the size of the batteries that supply the energy source in these vehicles is a system that can increase this distance (Kıvanç et al., 2016;Guo et al., 2009).
The ordinary disc brake system in the vehicles provides deceleration and stopping. During the braking period, the brake pads are wearied and release heat. The released heat disappears in the environment (Ahn et al., 2009). The regenerative braking system produce energy with using motor which is idled during braking time. Energy is recycled the time between starting brake and stopping vehicle.
Due to the fact that the regeneration is applied to the vehicle in motion, firstly, the motor must be driven during the simulations. One of the most common motor types used in electric vehicles is brushless direct current (BLDC) motors (Wu et al., 2005;Geraee et al., 2018). These motors have hall effect sensors and sensorless versions. In the motors with hall effect sensors, the position of the rotor is obtained logically via sensors. The semiconductor elements that control the phases in the switching circuit using the position information are switched in the appropriate sequence and the BLDC motor starts to move.
Electric motor which rotating own inertia starts working as a generator during braking and back electro-magnetic force (EMF) which is produced by motor becomes dominant. A descending voltage curve is observed for voltage because of motor slowdown in time. This curve is fixed to a value by means of a regulation circuit. The regulated value is increased from the voltage level of the battery to the higher value by a boost converter. Ultimately, it is stored the battery cells.
Studies on energy regeneration and its applicability continue. Cody et al. (2009).carried out regenerative braking on a commercial BLDC motor with independent switching method. Billah et al. (2017) applied mechanically variable load to the motor during regenerative braking. Since the battery they use is multicellular, experiments have been carried out with different voltage levels. Godfrey and Sankaranarayanan (2018) tested the switch times and recycled energy quantities by experimenting single switch, two switch, three switch and plugging switching methods. Maia et al. (2015) performed fuzzy logic modeling for an electric vehicle. Gokce and Ustun (2015) applied regenerative braking with a fuzzy logic controller on electric motorcycles. Chen et al. (2018) successfully implemented regenerative braking which operates independently for a four-wheeled vehicle. Wu et al. (2018) applied regenerative braking with a very detailed analytical study in a hybrid electric vehicle successfully. Geraee et al. (2018) used a regenerative braking of an electric vehicle using an adaptive and a modified torque control.
When these studies are taken into consideration, some of them refer to the analytics of the system and some of them emphasize to the field of application. In this proposed study, a detailed simulation study of the BLDC machine both as a motor and as a generator is given in Matlab/Simulink software in order to better understand the regenerative braking and make simulations.
In the first part of this study, after a general introduction about regenerative braking, in the second part, the materials used during the simulations are mentioned. In the third part, the methods which are planned to be used to reach the aim are explained. The evaluation of the simulation results obtained from the applied methods is also shared in the fourth section. Finally, the results are given.

BLDC motor and driver
BLDC motors are DC motors. However, the operating principles are different from ordinary DC motors. Ordinary DC motors consist of two parts called a rotor and a stator. The stator is the fixed part of the field windings. Here, a stationary magnetic having field fixed amplitude is produced. The rotating part of the motor is rotor. The commutation, which is referred to as the direction change of the current that provides the continuity of the rotation, takes place here that the brushes contact the collector. A constant DC voltage is applied to the stator and rotor.
In BLDC motors, the rotor being moveable part consist of fixed magnets (Rakesh and Narasimham, 2012). There is no brush and collector in the structure. The stator consists of phase windings and silicon steel sheets. A rotary magnetic field is obtained in the stator by switching the phase windings in sequence. Motor movement is ensured by the rotor and the stator interaction.
The BLDC motors can be divided two categories, the inner and the outer rotor. Depending on the usage of electric vehicles, inner and outer selection is made. Depending on their usage in electric vehicles, inner and outer selection is made. According to the back EMF waveform, they are named as trapezoidal or sinusoidal.
Because of the fact that there is no brush in the structure of BLDC motors, there is no heat loss due to friction. They work quieter and have a longer life than conventional DC motors. But they are more expensive. Moreover, control systems are more complex. In this study, a three-phase trapezoidal BLDC motor is used for simulations.
Hall effect sensors are used to know the position of BLDC motors. For switching operation of BLDC motors, the rotor position must be known (Nian et al., 2014). In BLDC motors, the rotor position can be determined with or without sensor (Sindhuja and Ranjitham, 2014). In case of sensorless position determination, the transition of the back EMF formed in the phases through the zero point is determined. The switching sequence is determined accordingly.
Hall effect sensors are positioned to the stator in order to find the rotor position (Elavarasi and SenthilKumar, 2014). Three hall effect sensors are sufficient for a three-phase BLDC motor. These sensors are placed in the stator with angles of 60° or 120° (Karabacak and Uysal, 2017). In this study, the position of the rotor in the BLDC motor is obtained with the help of 120° hall sensors. The inverter is the part that enables the BLDC motor to be driven. It has semiconductor switches. These switches allow fast switching. Two switches are used for each stator phase. Figure 1 shows the inverter circuit used in a threephase BLDC motor.
Battery is the most important part of electric vehicles. With this, the electrical energy is stored and the energy supply of the whole system is ensured (Suvak and Erşan, 2016). During regenerative braking, it is also the place where the energy produced is stored (Junzhi et al., 2014). To store energy into the battery, it is necessary to apply a higher voltage than its voltage (Cano et al., 2018). Such as these systems with low voltage, booster converters are used to achieve the required voltage level for storing energy.

Boost Converter
A boost converter is used to increase the DC voltage of the BLDC motor during regenerative braking. It has a coil, diode and semiconductor switch called as MOSFET. Figure  2 shows the switching positions of the boost converter structure.
The value of the back EMF induced in the BLDC motor during stopping period is not sufficient to store the battery (Jang et al., 2009;Zhou and Fang, 2013). Because the voltage of the battery is higher than the produced voltage. Therefore, the generated voltage must be increased (Bobba and Rajagopal, 2010;Long et al., 2014). However, the generated voltage is not in the form of an AC and cannot be increased by ordinary transformers. Therefore, a DC-DC boost converter is utilized to amplify the voltage.
where, Vo is the output voltage, Vi is the input voltage and D is the duty cycle in which the switch remains on position.

METHOD
This section describes the BLDC motor simulation studies. The method section is divided into two parts. Firstly, BLDC motor is simulated and then the simulation of regenerative braking BLDC motor is given.
A general block diagram of the simulated system is shown in Figure 3. The BLDC machine is operated in two modes; the first is as a motor and the second is as a generator. Energy is supplied from a battery when the electric vehicle is moved. In this situation, the electric current flows from the battery to the BLDC motor. In Figure 3, this path is indicated by a red line. In the case of electrical energy storage, in the regenerative braking mode, the electric current flows from the BLDC generator to the battery. This is shown in green in Figure 3.

BLDC simulation in Matlab/Simulink
In this study, it is aimed to drive the BLDC motor firstly.
The label values of the defined BLDC motor are 440 W, 48 V, 3000 rpm, 1.4 Nm. Permanent Magnet Synchronous Machine block was used as a BLDC motor in Matlab/Simulink. There are two types of this block. One of them wants torque data, while the other requires angular velocity data. The applied torque or angular velocity data represent the torque or angular velocity value generated on the shaft. In this study, torque data was preferred because of the simulated constant load. The energy of the BLDC motor was thought to be supplied from the battery. A universal switch was used as the switching block for driving the motor. In the universal switch block, MOSFET/Diode was selected as a switch.  The phases were switched in sequence for the BLDC motor to rotate. In order to determine this sequence, the position of the rotor must be known. The rotor position was determined by taking the hall effect signal from the bus selector block connected to the m-end of the motor block. A three-phase BLDC motor had three hall effect sensors to determine the rotor position. The corresponding MOSFETs were switched according to these data. That was achieved by processing the signals in comparison blocks. The signal was sent to the gate (G) pin of the MOSFETs. The AND blocks given in Figure 4 were used for comparison. According to Figure 4, In1 input was taken from the hall sensor. Out1 output was connected to the switching element MOSFET, namely the universal bridge block. By means of NOT logic operator during operation, it was learned which hall sensor or sensors were passive. In this way, it was provided to obtain the information where the rotor was not. The obtained signals were compared with AND blocks. The six AND blocks found that six different MOSFETs provided a transmission condition. For each rotor position, two of the AND blocks had activated MOSFET.
Simulation was run for ten seconds in the system. For the realization of regenerative braking, the signal sending to the MOSFETs and the torque data sending to the motor were cut in four seconds by means of a circuit after starting the simulation. Since the simulation progressed very slowly, a 1 second delay was added to the torque data that allows the program to accelerate. After that the motor could be stopped by its inertia.

Figure 5. Blocks used during BLDC motor drive
The switching block and data acquisition are shown for the BLDC motor in Figure 5. Here, on delay blocks represented on delay timers. The on delay block at the top was set to 4 seconds. In this way, the torque data was supplied to the motor for the first 4 seconds and the switching signal was also applied to the MOSFETs. The pulse signal was sent to the switch blocks in the 4th second. The position of the switch contacts was changed and the data flow was interrupted. The situation allowed that the BLDC motor was energized for the first 4 seconds. After 4 seconds, the run off of power of the BLDC motor caused the decelerating of its speed. It stopped with own inertia. The on delay block here was set to 1 second. The torque data was delayed for 1 second to accelerate the simulation by means of the block.
So far, after the simulation of the operated system in a healthy manner, a battery block was used instead of DC source to incorporate the battery into the simulation. During the simulation, the hall signal, the stator current, the rated speed etc. measurements were made with the help of signal taken from the m-end of the motor and scope blocks. Similarly, values from the battery block were also taken.

Simulation of regenerative braking of BLDC in Matlab/Simulink
After driving the BLDC motor and when a stopping command is given to the motor, the motor will stop after a certain time with own inertia. It will produce back EMF. A regenerative braking will also be activated during this time. The regenerative braking system will induce the back EMF. The back EMF will charge to the battery after increasing the voltage to the battery level. The regenerative braking system will regulate the generated back EMF after it is rectified. First, it will increase the voltage level above the battery voltage level. It will then charge the battery. Therefore, those data from the m-end of the motor block after the BLDC motor stops are very important. The regenerative braking will be carried out with these received data.
The time period between 0-4 was the energized BLDC motor. After 4 seconds time period was the beginning of the time that the motor was stopped by own inertia. In addition, the regenerative braking was performed after that period. When the motor decelerated, voltage was expected to be induced in phases. This voltage must be increased to a higher value than the battery voltage so that the generated energy can be stored in the battery (Long et al., 2014).
First, the back EMF obtained from the BLDC motor was fulfilled useable form during simulations. In Matlab/Simulink software, it was not possible that the back EMF measured at the m-end of the BLDC motor directly connect to the circuit elements such as resistor or coil. However, the signal taken from the bus selector could be connected to the control terminals of the blocks. Hence, these data were connected to the control ends of the controlled-voltage sources.  The negative poles of the controlled-voltage sources were short-circuited. The obtained voltage was rectified by the diodes of the MOSFETs. The resistor was put the output of universal bridge block for damping induced voltage. The value of resistor was chosen 20 Ω which neither too high not quite low. The simulation model of the method of obtaining the back EMF according to the method one is shown in Figure 6.
In another method, the used back EMF was taken from the ends of the MOSFET drive in which the BLDC motor was switched. In this case, the resistance was connected between these two ends. This is shown in Figure 7. The most important difference that distinguishes these two methods was whether the system reacts to this effect or not when the electrical load was changed.
By means of one of these methods, a regulation must be applied to the obtained back EMF before it sent to the battery. However, since there was no zener diode in the Matlab/Simulink software, the setup of the regulation circuit was not carried out here. Instead of that, the back EMF was raised a defined voltage that was over the battery voltage and then it was directly applied to the battery by means of a boost converter. The blocks forming the boost converter for regenerative breaking are given in Figure 8 in detail. The pulse generator block in the boost converter slowed down the simulation as it worked with high frequency. The switch located at the output of the boost converter was activated at 5th second in order to ensure that both the voltage on the capacitors was discharged over the resistor and the measured values were provided parasitefree. The resistance of the line was symbolized by a resistance of 1 Ω. In addition, the diodes on the boost converter line were included to prevent feedback power.
For determining the consumed, recycled and stored energies in the system, multiplexing and integral blocks were used. By measuring the voltage (V) and current (I) values taken from the battery, the instantaneous power (P) value was found by P = V × I. The consumed total energy was calculated by integrating the power by time. The recycled energy was determined by measuring the torque and angular velocity values of the BLDC motor after 4 second. The instantaneous power value was determined with torque (T) and angular velocity (w) values by means of P = T × w. The energy value was calculated by integrating this value according to time. The stored energy was found by measuring the current and voltage values from the converter output to the battery. Moreover, the stored value was calculated by integrating this value according to time. The combined final form of all the blocks of the designed system is shown in Figure 9.

RESULTS AND DISCUSSION
The energy of the BLDC motor in Matlab/Simulink was supplied by a battery. The operating voltage and battery voltage of the motor was 48 V. Two methods were specified in the method section in order to obtain the back EMF to be used during regenerative braking. The changes in time of the back EMF obtained from 20 Ω by means of both the first and the second methods are shown in Figure  10.
Although the established system for the first method worked with the data obtained from the BLDC motor, it was observed that any changes made in this system were not transferred on the BLDC motor since the system and motor were fed by different voltage sources. For example, when the value of the resistor shown in Figure 6 was changed but there was no change in the curve in the back EMF time graph of the BLDC motor. It was seen that the BLDC motor discharged the energy on the different load values at the same time. This was not possible.
The voltage obtained by the second method was worse than the first method. Nevertheless it reacted to the changes in the load. When the resistor value decreased, back EMF was damped in shorter period but it took longer time with the resistor value was chosen higher. Therefore, it was more convenient to use back EMF obtained by the second method. Besides, the back EMF curve having the fluctuations, which is shown in Figure 10b, was eliminated by means of a capacitor. That situation is illustrated in Figure 9.
With the start of the regenerative braking, the back EMF applied to boost converter input was increased to a higher level than the battery voltage. It reached the same level as the battery voltage after a certain period of time. The remaining voltage on the capacitors was discharged by closing the switch at the output of the boost converter in 5th second.
The current-time graph of the battery is demonstrated in Figure 11. In the first 4 seconds, the current direction was from the battery to the BLDC motor. It meant that energy was consumed by the battery and the graph was in the positive region. In the 4th second, the current-time graph passed to negative zone with beginning of the regenerative braking and the current direction was from the BLDC motor to the battery. It indicated that an energy was generated from the BLDC motor and stored in the battery. Moreover, that region was a regenerative braking zone. The BLDC motor back EMF operated without and with the regenerative braking are shown in Figure 12. When the regenerative braking was applied to the BLDC motor, the battery was fed as a load. Therefore, the back EMF curve in Figure 12b was narrowed in the time axis after 4th second. In the two graphs, it was seen that the measured back EMF had a phase and phase-phase voltages 20 V and 40 V, respectively, in the 4th second when the deceleration begins and the voltages decreased with time.
The simulated system was carried out with the idea that a vehicle would run on the straight way for a certain period of time and then stop it without any braking. The obtained results were according to these conditions. The storage energy in these conditions during the 10 seconds period was successfully observed. Considering that the vehicle went downhill in the real environment, it could be estimated that the recycled energy would be increased. Moreover, the amount of recovered energy would be raised if the brakes are depressed more frequently for the city to be able to stop the vehicles.
When calculating the amount of energy to be recovered by a scenario, the condition of the road is very important. Consider a business in a flat area with heavy traffic and a package service. Due to heavy traffic, the vehicle will stop at regular intervals without sudden braking. Assuming that a vehicle is stopped every 4 seconds, 0.1% energy recovery will be provided according to the information obtained from the simulation study. This ratio increases when the brake is pressed more frequently to a certain level. Ultimately, during the braking process, the energy will be further recycled.
(a) (b) Figure 12. The BLDC motor back EMF operated (a) without and (b) with the regenerative braking

CONCLUSIONS
In this study, a simulation of regenerative braking of BLDC motor that can be used in electric vehicles was carried out in Matlab/Simulink in detail. For the first 4 seconds of 10 seconds time period, the BLDC motor was powered from the battery. After 4 second, the regenerative braking was applied to the BLDC motor. During the regenerative braking, the BLDC motor was allowed to rotate with own inertia. The generated back EMF value was increased to the upper value of the battery voltage with a boost converter and the battery was charged. As a result of this process, the consumed energy by the BLDC motor was 2446 Ws, the recycled energy was 9.336 Ws and the stored energy in the battery was 8.437 Ws. In other words, 0.38% of the consumed energy in this system with the simulated scenario was recycled and 0.35% of it was stored in the battery for re-use. Regenerative braking can be applied all the electric vehicles. Lots of wasted energy will be recovered with the increasing of electric vehicles in traffic. electric bicycles with a DSP controller. 2013 1st International Future Energy Electronics Conference (IFEEC), Tainan, 641-645.