Научная статья на тему 'DESIGN OF PULSE WIDTH MODULATION BASED DC MOTOR FOR ELECTRIC VEHICLE'

DESIGN OF PULSE WIDTH MODULATION BASED DC MOTOR FOR ELECTRIC VEHICLE Текст научной статьи по специальности «Электротехника, электронная техника, информационные технологии»

CC BY
53
10
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
DC MOTOR / MICROCONTROLLER / PULSE WIDTH MODULATION

Аннотация научной статьи по электротехнике, электронной технике, информационным технологиям, автор научной работы — Abdulhamid Mohanad, Festus Towett

The aim of this paper is to design and implement a power controller based on a microcontroller to be used in controlling a DC motor driving an electric vehicle. The ease of control and excellent performance of the DC motors ensure that it is widely used in many applications. This paper is mainly concerned on DC motor speed control system by using microcontroller PIC16F877A. Pulse Width Modulation (PWM) technique is used where its signal is generated in microcontroller. The program for PWM generation is written in C Language using MIKROC software. It is programmed into the microcontroller using Pickit 2. Then the microcontroller is installed into the motor control circuit. The Microcontroller acts as the motor speed controller in this paper. Based on the result, the readings are quite reliable. Through the paper, it can be concluded that microcontroller PIC16F877A can control motor speed at desired speed efficiently by using PWM signal.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «DESIGN OF PULSE WIDTH MODULATION BASED DC MOTOR FOR ELECTRIC VEHICLE»

Power Systems and Complexes Энергетические системы и комплексы

DOI: 10.17516/1999-494X-0380 УДК 621.313.5:629.331

Design of Pulse Width Modulation Based DC Motor for Electric Vehicle

Mohanad Abdulhamida and Towett Festusb*

aAL-Hikma University Baghdad, Iraq b University of Nairobi Nairobi, Kenya

Received 18.01.2022, received in revised form 18.02.2022, accepted 04.03.2022

Abstract. The aim of this paper is to design and implement a power controller based on a microcontroller to be used in controlling a DC motor driving an electric vehicle. The ease of control and excellent performance of the DC motors ensure that it is widely used in many applications. This paper is mainly concerned on DC motor speed control system by using microcontroller PIC16F877A. Pulse Width Modulation (PWM) technique is used where its signal is generated in microcontroller. The program for PWM generation is written in C Language using MIKROC software. It is programmed into the microcontroller using Pickit 2. Then the microcontroller is installed into the motor control circuit. The Microcontroller acts as the motor speed controller in this paper. Based on the result, the readings are quite reliable. Through the paper, it can be concluded that microcontroller PIC16F877A can control motor speed at desired speed efficiently by using PWM signal.

Keywords: DC motor; microcontroller; pulse width modulation.

Citation: Abdulhamid M., Festus T. Design of pulse width modulation based dc motor for electric vehicle. J. Sib. Fed. Univ. Eng. & Technol., 2022, 15(2), 162-176. DOI: 10.17516/1999-494X-0380

© Siberian Federal University. All rights reserved

This work is licensed under a Creative Commons Attribution-Non Commercial 4.0 International License (CC BY-NC 4.0). Corresponding author E-mail address: moh1hamid@yahoo.com, researcher12018@yahoo.com

Конструкция двигателя постоянного тока на основе широтно-импульсной модуляции для электромобиля

Моханад Абдулхамида, Товетт Фестусб

аAL-Университет Хикма Ирак, Багдад бУниверситет Найроби Найроби, Кения

Аннотация. Показана разработка и реализация контроллера мощности на основе микроконтроллера, который используется для управления двигателем постоянного тока, приводящим в движение электромобиль. Простота управления и отличная производительность двигателей постоянного тока обеспечивают их широкое применение во многих областях. Эта статья в основном посвящена системе управления скоростью двигателя постоянного тока микроконтроллером PIC16F877A, в котором сигнал генерируется методом широтно-импульсной модуляции (ШИМ). Программа для создания ШИМ написана на языке Си с использованием программного обеспечения MIKROC. Микроконтроллер программируют с помощью Рюкй: 2 и затем устанавливают в схему управления двигателем. В данном случае микроконтроллер выступает в качестве регулятора скорости двигателя. Судя по результату, показания вполне надежны. Можно сделать вывод, что микроконтроллер Р1С16Р877А способен эффективно управлять скоростью двигателя на желаемом уровне с помощью ШИМ-сигнала.

Ключевые слова: двигатель постоянного тока, микроконтроллер, широтно-импульсная модуляция.

Цитирование: Моханад Абдулхамид. Конструкция двигателя постоянного тока на основе широтно-импульсной модуляции для электромобиля / Моханад Абдулхамид, Товетт Фестус // Журн. Сиб. федер. ун-та. Техника и технологии, 2022, 15(2). С. 162-176. DOI: 10.17516/1999-494Х-0380

Introduction

Electro mobility has always been an issue that has helped drive the development of vehicles. It did become less important for a while because the oil fields did not appear to be drying up, but now electro mobility is becoming increasingly significant as people become aware of the depletion of oil reserves and the need for global environmental and climate protection.

The present discussion on the CO2 emissions of passenger cars gives a new stimulus to electric traction drives. At least for city travel, the fuel consumption and consequently the CO2 emissions can be reduced by applying a concept containing electric traction. By electric traction is meant locomotion in which the driving (or tractive) force is obtained from electric motors. It is used in electric trains, tramcars, trolley buses and diesel-electric vehicles etc.

The development of internal combustion engine vehicles, especially automobiles, is one of the greatest achievements of modern technology. Automobiles have made great contributions to the growth of modern society by satisfying many of its needs for mobility in everyday life. The rapid development of the automotive industry, unlike that of any other industry, has prompted the progress of human society from a primitive one to a highly developed industrial society. However, the large number of automobiles in use around the world has caused and continues to cause serious problems for the environment and

human life. Air pollution, global warming, and the rapid depletion of the Earth's petroleum resources are now problems of paramount concern.

At present, all vehicles rely on the combustion of hydrocarbon fuels to derive the energy necessary for their propulsion. Combustion is a reaction between the fuel and the air that releases heat and combustion products. The heat is converted to mechanical power by an engine and the combustion products are released into the atmosphere. A hydrocarbon is a chemical compound with molecules made up of carbon and hydrogen atoms. Ideally, the combustion of a hydrocarbon yields only carbon dioxide and water, which do not harm the environment. But the combustion of hydrocarbon fuel in combustion engines is never ideal. Besides carbon dioxide and water, the combustion products contain a certain amount of nitrogen oxides (NO), carbon monoxides (CO), and unburned hydrocarbons (HC), all of which are toxic to human health.

Over the years, study and research of electric traction have intensified and its application be used in many different ways such as electric vehicle, electric train, electric motorcycles and electric traction elevators.

Several searches which discuss the problem of electric vehicle can be found in literatures [1-6].

2- Design methodology

In this paper, we concern majorly on controlling DC motors for electric vehicle. DC motor is an electric motor that runs on direct current (DC) electricity. The DC motors are used to providing the motive power for the electric vehicles and operate directly from rechargeable battery of 12V 7AH hence allow regenerative braking to be implemented.

While designing a DC motor, control for electric vehicle can be complex, it does become easier when broken down into its component steps. The following sections detail each component within the paper, as well as how each section is constructed and interacts with other blocks.

The two stages of this work are the hardware development and software development. The first stage i. e. the hardware development, has the following sections;

1. H-bridge

2. Display unit (LCD)

3. Input unit

4. Motor controller circuit, this includes the circuit for the PIC16F877A microcontroller and the H-bridge.

5. DC-motor and mechanical vehicle parts (wheels and gears)

6. DC power supply and charging unit

The second stage i. e. the software development, has two parts which are;

1. To develop embedded system software using the MikroC PRO for PIC16F877A microcontroller.

2. Simulating the control system using Proteus software.

2.1 Hardware development

The block diagram of the system is shown in Fig. 1

2.1.1 H-Bridge

An H-Bridge or full bridge converter is a switching configuration composed of four switches in this case MOSFETs in an arrangement that resembles an H and enables a voltage to be applied across

Fig. 1. Block diagram

a load in either direction. These circuits are often used in robotics and other applications to allow DC motors to run forwards and backwards.

By controlling which switches are closed at any given moment, the voltage across the motor can be either positive, negative, or zero, as shown in Fig. 2. A solid state H-bridge is built using four switches. When switch Q1 and Q4 are closed and switches Q2 and Q3 are open, a positive voltage will be applied across the motor. During forward free driving, Q4 is kept on so when the PWM signal is off, current can continue to flow around the bottom loop through Q3's intrinsic diode. By closing Q2 and Q3 switches and opening Q1 and Q4 switches, a reverse voltage will be applied to the load allowing reverse operation of the motor. Also during reverse free driving, Q3 is kept on so when the PWM signal is off, current can continue to flow around the bottom loop through Q4's intrinsic diode. Using nomenclature above switches, Q1 and Q2 should never be closed at the same time as this will cause a short circuit between the power supply and ground, potentially damaging the devices or draining the power supply. The same applies to switches Q3 and Q4. This condition is known as shoot-through.

For regeneration, when the motor is going backwards for example, the motor (which is now acting as a generator) is forcing current right through its armature, through Q2's diode, through the battery (thereby charging it up) and back through Q3's diode. Regenerative braking is shown in Fig. 3.

Table 1 below outlines the positions. Note that shoot-through switch positions are omitted. The switches used to implement an H-Bridge can be mechanical built from solid state transistors. Selection of the proper switches varies greatly.

2.1.2 Control system

Control theory is an interdisciplinary branch of engineering and mathematics that deals with the behavior of dynamical systems. The desired output of a system is called the reference. When one or more output variables of a system need to follow a certain reference over time, a controller manipulates the inputs to a system to obtain the desired effect on the output of the system.

If we consider an automobile cruise control, it is design to maintain the speed of the vehicle at a constant speed set by the driver. In this case the system is the vehicle. The vehicle speed is the output and the control is the vehicle throttle which influences the engine torque output. One way to implement

Fig. 2. H-Bridge

Fig. 3. Regenerative braking

Table 1. H-Bridge switches configuration

S1 S2 S3 S4 OPERATION PERFORMED

1 0 0 1 Forward Drive

0 1 1 0 Reverse Drive

0 0 0 0 Free Running

1 0 1 0 Brakes

0 1 0 1 Brakes

cruise control is by locking the throttle at the desired speed but when encounter a hill, the vehicle will slow down going up and accelerate going down. In fact, any parameter different than what was assumed at design time will translate into a proportional error in the output velocity, including exact mass of the vehicle, wind resistance, and tire pressure. This type of controller is called an open-loop controller because there is no direct connection between the output of the system (the engine torque)

and the actual conditions encountered mean the system does not and cannot compensate for unexpected forces. For the purpose of keeping the cost of the work at minimum this is the type which is going to be implemented in this design. Although, there is another type known as closed loop control system.

For a closed-loop control system, a sensor will monitor the vehicle speed and feedback the data to its computer and continuously adjusting its control input or the throttle as desired to ensure the control error to a minimum therefore maintaining the desired speed of the vehicle. Feedback on how the system is actually performing allows the controller (vehicle's on board computer) to dynamically compensate for disturbances to the system, such as changes in slope of the ground or wind speed. An ideal feedback control system cancels out all errors, effectively mitigating the effects of any forces that may or may not arise during operation and producing a response in the system that perfectly matches the user's wishes.

From research, we have found several ways to control the motor speed using electronic devices. There is voltage speed control, field speed control, resistance speed control and PWM technique. These control methods have their benefit and disadvantages respectively which are more focus to efficiency element. In our work, only PWM technique will be considered and be implemented.

2.1.3 Microcontroller

A microcontroller (sometimes abbreviated ^C, uC or MCU) is a small computer on a single integrated circuit containing a processor core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications. Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, and other systems. The microcontroller used in this design is PIC16F877A.

2.1.4 LCD display unit

A suitable display unit is required to display the gear engaged which selects the mode of operation of the driving motor and also show the speed at which the vehicle is moving. A 16x2 Liquid Crystal Display (LCD) is a low power, low cost, basic electronic display. A 16x2 LCD means it can display 16 characters per line and there are 2 such lines. In this LCD, each character is displayed in 5x7 pixel matrix. This LCD has two registers, namely, Command and Data. The command register stores the command instructions given to the LCD. A command is an instruction given to LCD to do a predefined task like initializing it, clearing its screen, setting the cursor position, controlling display etc. The data register stores the data to be displayed on the LCD. The data is the ASCII value of the character (measured distance) to be displayed on the LCD.

2.1.5 Input unit

In order to be able to select different types of operation, a suitable input is to be selected capable of communicating with the microcontroller and relaying the command from operator efficiently and fast. Several factors are considered such as the size, weight and mode of interconnection either wireless or wired. An ideal and user friendly would have been the wireless mode of connection but given the complicity of the circuit needed and the cost of implementation, 4-way DIP switch is selected instead.

2-switch is programmed to emulate function of gears in a vehicle while the third switch be the brake paddle and the fourth accelerating paddle.

2.1.6 DC motor

There are several types of DC motors that are available. In this design, DC geared motor operating at rated voltage 12V and no load speed of 200rpm is selected to be used due to its low cost and small size and also availability in the market.

2.1.7 Power supply

Signal generation begins with the power supply for the microcontroller. As a battery's stored energy depletes, its voltage is reduced. Several of the amplifiers in the control signal generation circuits rely on the rail voltages to charge and discharge capacitors which cause a controlled oscillation. Generally speaking, the correct voltage supply is of utmost importance for the proper functioning of the microcontroller system.

For a proper function of this circuit design, it is necessary to provide two stable power rails source of supply. One to power low voltage components of 5 V and another 12V to drive high voltage electronics such as IR2112 MOSFET driver and the DC motor. According to technical specifications by the manufacturer of PIC microcontroller, supply voltage should move between 2.0V to 5.0V in all versions. The solution comes in the form of a linear voltage regulator. There are other types of voltage regulation, mainly switching regulators, but their benefits are of little use in powering chips. Switching regulators are more efficient than linear regulators and they have the ability to boost voltages, but the supply voltage is well-defined and the op-amps require very little power relative to what a lead acid battery can provide. Thus, the simplest solution to the source of supply is using the voltage stabilizer LM7805 which gives stable +5V on its output. Its connection as per datasheet is shown in Fig. 4.

2.1.8 Circuit protection

MOSFETs turn OFF more slowly than they turn ON. If we attempt to turn on a high side MOSFET at the same time we are turning OFF a low-side MOSFET (or vice versa), we will wind up having both of them turned on at the same time, causing the dreaded «shoot-through» condition, which will lead to damage of the components. For this reason one of the major factor in inverter device is its ability

Fig. 4. Voltage regulator circuit

to protect itself from surges that could damage the circuitry. The IR2110 used in this design does not have built-in optoisolators hence it does not provide for «dead time» which is much needed in order to avoid short circuiting of the rail voltage. Another protection of the circuit needed is MOSFET gate protection, which employ a resistor between «gate» and «source». It prevents accidental turn on of the MOSFET by external noise usually at startup when the gate is floating. The MOSFET may sometimes turn on with a floating gate because of the internal drain to gate «Miller» capacitance. A gate to source resistor acts as a pull-down to ensure a low level for the MOSFET.

The principle of operation is that when the parasitic capacitance of the circuit comes into play. The resistor creates an RC circuit complete with its time constant. And this RC delays the time the circuit switches ON just enough to allow the complementary part of the bridge circuit to switch OFF. Typical values of this resistor are a 1 kQ, 10 kQ, or 100 kQ depending on the rail voltage of the H-bridge.

2.2 Software design

The program design for this paper is done in C language using MikroC compiler. It is easy to develop and implement PIC microcontroller like the one used in this design PIC16F877A program in C language due to its flexibility, easiness of programming and debugging. After writing the program code it is burned to the microcontroller using the Pickit 2 programmer.

The flow chart of the program is shown in Fig. 5. The code execution starts by initializing ports, LCD module and setting all analogue channels off. Next, variables used in codding are defined and interrupt function called. By using interrupt function to monitor the input from the 4-channel DIP switch, the microcontroller is able to respond to user command without affecting the normal execution of the program.

Main function which defines the start of execution code is now called and pulse width modulation modules of the microcontroller initialized. If input issued by the driver changes, the code executes a switch function where the command is compared among different cases and if any one of them matches the input condition, the code sequence in it is executed hence driving the car either forward or reverse or regenerative braking.

The interrupt function takes advantage of provided RB0 external interrupt and port B <4-7> pins interrupt capabilities. If the status of those pins change at any given time, the interrupt function will update the input variable therefore making the program able to respond to the new command from the driver immediately. Light Emitting Diodes (LEDs) with different colors are connected to port E which has three pins. These LEDs are used to indicate the status of the car, green when the car is engaged in forward drive, blue when the car is reversing and red when it's braking.

3. Results

3.1 Simulation

3.1.1 Circuit diagram

The circuit diagram is shown in Fig. 6, and its description is explained in the following section.

3.1.2 Circuit description

Simulation of the PWM DC motor control circuit is carried out using Proteus simulation software version 8.1. Various blocks of the circuit are interconnected and virtual instruments of the simulator

INITIALIZE LCD MODULE INITIALIZE MICROCONTROLLER PORTS INITIALIZE PWM1 & F.VM2 MODULES

DEFINE VARIABLES

START EXECUTING INTERRUPT

INCREASE DUTY CYCLE PRINT SPEED

START PWM1 STOP F.VTi2 SET RC1 BIT TO HIGH SET RC2 BIT TO LOW PRINT MOTOR STATUS TO

5. Flow chart

о

ад

S

used to observe and analyze results. Compiled hex file from Mikroc pro is attached to the properties of the microcontroller.

iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.

Pins 13 and 14 of the microcontroller are connected to 8MHz quartz crystal. A stable 5 volts to power the microcontroller is provided from the output of 7805 IC voltage regulator. The LEDs connected in pin 8, 9 and 10 color green, blue and red respectively with light green to indicate that the car is moving forward, blue when the car is reversing and red when braking. Also, another green LED is connected to the power supply to show when the power is switched on and go off when the power is disconnected.

Pins 37, 38, 39 and 40 of microcontroller is programmed as input ports and 4-way dip switch connected. When pin 40 is in logic low, the car will be engaged in forward drive and it can be accelerated by setting pin 37 low or decelerated by setting pin 38 low. Likewise, reverse driving can be engaged by setting pin 39 to logic low. During forward driving, pin 16 and 18 will output low state which will in turn switch off transistor Q2 and Q4, pin 23 will be high to switch on transistor Q4 and pin 17 will output a pulse width modulated signal at a frequency of 5 kHz to drive transistor Q1. To reverse the car, pin 23 and 17 will be off, pin 18 will be on and pin 16 will output a pulse width modulated signal of 5 kHz and in this way current will flow in opposite direction.

During simulation, IR2112 IC is used instead of IR2110 but there function are similar and they do operate the same way. Pins 10 and pin 12 receive logic inputs from the microcontroller to drive high side and low side MOSFET respectively. Signal from pin 12 is passed to pin 1 just as it is without being stepped up and from pin 1 is connected to low side MOSFET gate through a gate resistor. That from pin 10 is used to charge and discharge bootstrap capacitor which in turn provides the much needed high voltage to drive high side MOSFET through gate resistor.

In order to observe regenerative braking, LED is connected between 12V power rail of H-bridge and battery with its cathode connected to positive terminal of the battery. This is made possible by use of relay which is controlled by pin 25 of the microcontroller to bypass the LED during motoring state and connect to LED during regenerative state. When the performance of the circuit is analyzed for different conditions, the circuit is able to drive the car up to maximum speed.

3.2 Simulation results

The working model of the proposed PWM based DC motor control for electric vehicle using a microcontroller is successfully designed, simulated and implemented on a breadboard.

3.2.1 Power supply output

Using Proteus virtual voltmeter, the supply voltage which is very important for successful implementation of this paper is tested and analyzed. The circuit is found to generate a stable 5V dc supply from input voltage of 12V from battery as shown in Fig. 7.

3.2.2 Microcontroller output

Using virtual oscilloscope of the Proteus, the outputs of microcontroller is observed as the forward drive mode is engaged. The result is as shown in Fig. 8. Channel A which is of color blue is connected to pin 17 which is generating a PWM signal of 5 kHz and its duty cycle is observed to be varying as the speed increases. Channel B and channel C are off and Chanel D which is connected to pin 23 supposed to switch on transistor Q4 as expected.

U4 7805

Fig. 7. Voltage regulator output

Fig. 8. Forward drive microcontroller output

3.2.3 LCD display

The LCD display result is taken for different driving mode and speed as shown in Fig. 9, Fig. 10, and Fig. 11 captured from the screen display when simulation is paused. Also LED indicators are captured showing the driver which mode is engaged.

3.2.4 H-Bridge outputs

The output of the H-bridge is measured and captured for the different driving mode using virtual digital oscilloscope as shown in Fig. 12 and Fig. 13.

4. Conclusion

Applications of high performance DC motor drives in area such as electric elevators, electric vehicle, electric trains and electric motorcycles require direction and speed control to perform tasks. DC motors have direction and a speed control capability, which means that speed and direction of rotation can be changed at any time to meet new condition.

The aim of this work which is to design a PWM based DC motor control for electric vehicle using a microcontroller to control the direction and speed of a vehicle has been achieved. By reversing the

Fig. 9. Forward driving LCD display

Fig. 10. Reverse driving LCD display

polarity of DC motor contacts, the direction of a DC motor can be reversed. Also varying the PWM signal from microcontroller to the motor driver, motor speed can be controlled.

In conclusion, the overall aim of this paper was met, a fully functional electric vehicle with regenerative braking was built. The vehicle was further made user friendly by in cooperating LCD display which shows the speed of driver at which he or she is driving and also the gear engaged.

Fig. 11. Regenerative braking LCD display

Fig. 12. H-Bridge output forward mode

Fig. 13. H-Bridge output reverse mode

References

[1] Wu H., Cheng S., Cui S. A controller of brushless DC motor for electric vehicle, IEEE Transactions on Magnetics, 2005, 41, 1, 509-513.

[2] Gupta V., Deb A. Speed control of brushed DC motor for low cost electric cars, IEEE International Electric Vehicle Conference, USA, 2012.

[3] Ansari J., Sapna L., Speed control of BLDC motor for electric vehicle, International Journal of Engineering Research & Technology, 2014, 3, 5, 1666-1671.

[4] Gasbaoui B., Nasri A., Abdelkhalek O., An efficiency PI speed controller for future electric vehicle in several topology, Procedia Technology, 2016, 22, 501-508.

[5] Al-Othman A., Ahmed N., Speed control of electric vehicle, International Conference on Mechatronics, Control and Automation Engineering, USA, 2016.

[6] Li W., Li X., Wang Y., Zeng X., Yang Y., Brushless DC Motor control strategy for electric vehicles, International Journal of Performability Engineering, 2018, 14, 3, 559-566.

i Надоели баннеры? Вы всегда можете отключить рекламу.