Sunteți pe pagina 1din 46

A MAJOR PROJECT REPORT ON

“Speed Control of BLDC Motor using Microcontroller”

Submitted in partial fulfilment of the requirement for the degree of

BACHELOR OF TECHNOLOGY

In

ELECTRICAL ENGINEERING

By

Narayan Suthar 141113025

Neeraj Prajapat 141113028

Dinesh Meena 141113086

Deepak Kumar 141113087

Under the guidance of

Dr. Sushma Gupta

April 2018

DEPARTMENT OF ELECTRICAL ENGINEERING

MAULANA AZAD NATIONAL INSTITUTE OF TECHNOLOGY

BHOPAL (M.P.) – 462003

i
STUDENT DECLARATION

We hereby declare that the work presented in the dissertation entitled

“Speed Control of BLDC Motor using Microcontroller”

In the partial fulfilment of the requirement for the award of the degree of Bachelor of
Technology in Electrical Engineering submitted in the department of electrical engineering,
MANIT, Bhopal is an authentic record of our own work under the guidance of Dr. Sushma
Gupta

We have not submitted the matter embodied in this dissertation for the award of any other
degree

Narayan Suthar 141113025 ( )

Neeraj Prajapat 141113028 ( )

Dinesh Meena 141113086 ( )

Deepak Kumar 141113087 ( )

CERTIFICATE

This to is certify that the above statement made by us are correct to the best of our
knowledge

Dr. Sushma Gupta (Asso. Professor)

Department of Electrical Engineering

ii
ACKNOWLEDGEMENT

All praises be to Almighty who has given us the power of understanding and quest for
searching the truth.

We take this opportunity to express our sincere gratitude towards our august guide
Dr. Sushma Gupta, Associate Professor, Department of Electrical Engineering, Maulana
Azad National Institute of Technology, Bhopal, India, for her proficient and enthusiastic
guidance, advice and encouragement, which served as the constant source of inspiration
for the completion of this project work. We offer her our deep sense of respect and profound
indebtedness for her thoughtful concerns both our academics and personal welfare.

We express our deep sense of gratitude to Dr. Narendra Singh Raghuwanshi, Director,
MANIT Bhopal, Dr. Alok Mittal, Dean (Academics), MANIT Bhopal, Dr. Savita Nema,
Head, Electrical Engineering Department for providing our all necessary support for carrying
out this work.

Our sincere thanks are due to all Professors and Associate Professors of Electrical
Engineering Department, MANIT, Bhopal for extending their moral support and technical
discussion as and when required during our project work.

Narayan Suthar 141113025

Neeraj Prajapat 141113028

Dinesh Meena 141113086

Deepak Kumar 141113087

iii
ABSTRACT

This project is controlling speed of BLDC motor and displays its speed using a sensor less

mechanism. The DC motor has various application used in industries like in drilling, lathes,

spinning, elevators and etc.

The speed control of the DC motors is very essential. This proposed system provides a very

precise and effective speed control system. The user can increase or decrease the speed as

per the requirement and the motor will run at that exact speed. The project is divided into

three stages: input, processing and output stage. The input stage consists of getting the

required reference speed through switches or The processing stage provides RPM reference

of the motor, by a shaft mounted interfaced to the microcontroller in the circuit. The

microcontroller develops PWM pulses which are varied with switches to regulate the DC

power to the motor such that the desired speed is achieved. The output stage uses a ESC

being driven by the microcontroller output.

An 8051 family microcontroller is used with a set of switches to increase or decrease the

speed of the BLDC motor. This speed is given to microcontroller which in turn displays it on

a LCD display. The above operation is carried out by using a ESC for driving the brushless

DC(BLDC) motor

iv
Table of Contents

Student’s declaration ii
Certificate ii
Acknowledgement iii
Abstract iv
List of figures vii
List of tables vii

Chapter 1 Introduction 1

Chapter 2 Project Description 3


2.1 Objective 3
2.2 Components required 3
2.3 Block diagram 5
2.4 PCB Design 6
2.5 ESC 7

2.5.1 ESC Firmware 8

9
2.6 Voltage regulator
2.7 Temperature sensor IC LM 35 10

2.8 Application of project 11

Chapter 3 Brushless DC motor 12

3.1 Construction and working principle 12

3.1.1 About BLDC motor


12
3.1.2 Construction of BLDC motor 13

3.1.3 Types of BLDC motor 15

3.2 BLDC motor Drive 17

3.2.1 Hall sensor 17

3.2.2 Back EMF (sensor less) 17

3.3 Working Principle and Operation 20

3.4 Application of BLDC motor 21

v
3.5 Speed control 22

3.5.1 PWM Technique 23

Chapter 4 Microcontroller 24

4.1 Introduction 24

4.2 Microcontroller ATmega328 25

4.2.1 Pin diagram of ATmega328 25

Chapter 5 Software Description 29

5.1 Arduino 29

5.2 Code Vison AVR 30

5.3 PCB Wizard 31

Chapter 6 Conclusion 32

Appendix 33

Arduino Program 33

Cost of project 38

Refrences 39

vi
List of Figures

Chapter 2
Figure 2.1 Block Diagram of Project 5
Figure 2.2 PCB Design 6
Figure 2.3 ESC Hardware 7
Figure 2.4 LM 7805 Pin Diagram 9
Figure 2.5 LM 35 Block Diagram 10

Chapter 3
Figure 3.1 Construction of BLDC motor 14
Figure 3.1(a) Inner rotor Design 16
Figure 3.1(b) Outer rotor design 16
Figure 3.2(a) Six stage cycles of BLDC motor 18
Figure 3.2(b) Back EMF 19
Figure 3.3 Coil arrangement of BLDC motor 20
Figure 3.4 Switching sequence 21
Figure 3.5 PWM Pulses for various duty cycles 23

Chapter 4
Figure 4.1 Pin Diagram of ATmega328 25

List of Tables

Chapter 2
Table 2.1 Component list 3

Chapter 4
Table 4.1 Description of ATmega328 26
Table 4.2 Parallel Program mode 27
Table 4.3 Series programming 28

vii
CHAPTER

I. INTRODUCTION

Permanent-magnet excited brushless DC motors are becoming increasingly attractive in a


large number of applications due to performance advantages such as reduced size and cost,
reduced torque ripples increased torque-current ratio, low noises, high efficiency, reduced
maintenance and good control characteristics over a wide range in torque–speed plan.

In general, Brushless DC motors such as fans are smaller in size and weight than AC fans
using shaded pole or Universal motors. Since these motors have the ability to work with the
available low voltage sources, it makes the brushless DC motor fans convenient for use in
electronic equipment, computers, mobile equipment, vehicles, and spindle drives for disk
memory, because of its high reliability, efficiency, and ability to reverse rapidly. Brushless dc
motors in the fractional horse power range have been used in various types of actuators in
advanced aircraft and satellite systems. Most popular brushless DC motors are mainly three
phases which are controlled and driven by full bridge transistor circuits. Together with
applying permanent magnet excitation, it is necessary to obtain additional torque
components. These components can be obtained due to a difference in magnetic
permeance in both quadrature and direct axis; Therefore, reluctance torque is developed
and torque null regions are reduced significantly in this paper, a brushless DC motor with
distributed winding and a special form of PM-rotor with special stator periphery are
described. Which develop a speed control System for a BLDC motor by closed loop control
technique. The proposed system uses a microcontroller of the ATmega328 family and a
rectified-power supply. A matrix keypad is interfaced to the microcontroller for controlling the
speed of the motor. The speed control of the BLDC motor is archived by varying the duty
cycles from the microcontroller according to the program. The microcontroller receives the
percentage of duty cycles from the keypad and delivers the desired output to switch the
motor driver so as to control the speed of the BLDC motor.

Brushless motors are more efficient as its velocity is determined by the frequency at which
current is supplied, not the voltage. As brushes are absent, the mechanical energy loss due
to friction is less which enhanced efficiency. BLDC motor can operate at high-speed under
any condition. There is no sparking and much less noise during operation. More
electromagnets could be used on the stator for more precise control. BLDC motors
accelerate and decelerate easily as they are having low rotor inertia. It is high performance
motor that provides large torque per cubic inch over a vast sped rang. BLDC motors do not
have brushes which make it more reliable, high life expectancies, and maintenance free
operation. There are no ionizing sparks from the commutator, and electromagnetic

1
interference is also get reduced. Such motors cooled by conduction and no air flow are
required for inside cooling.

2
CHAPTER 2

PROJECT DESCRIPTION

2.1 Objective

The hardware project is designed to control the BLDC motor using microcontroller BLDC

motor has various application used in industries like in drilling, lathes, spinning electric

bikes etc. The speed control of the DC motors is very essential. This proposed system

provides a very precise and effective speed control system. The user can manually

change speed and the motor will run at that exact speed. To make controller which can

take various reference input such as temperature, speed, air velocity, volume, current

etc. to change the speed of motor accordingly. To use the electronic devices with electric

motor to enhance their performance.

2.2 Components Required

Name Specification
Microcontroller AT Mega328 5V,20 MHz

ESC 20A

Voltage Regulator IC LM7805 5V

Resistor 1k ohm

LCD Display 16x2


-
Temp. Sensor IC LM35 5V,10 mV/C

BLDC motor (sensor less) 2200 KV,


0.5A No Load current @10v,
Max. current capacity 12A for 60 sec
.

LiPo Battery 7.4 V

3
Potentiometer 10 K ohm

Crystal clock 16 MHz

Table No. 2.1

4
2.3 Block Diagram

 Block Diagram Contains voltage regulator, Temperature sensor IC LM35


 AT Mega 328 and ESC
 LCD Display and BLDC Motor

Fig. 2.1 Block Diagram of Project

5
2.4 PCB Design

Fig. 2.2 PCB Design

6
2.5 ESC (Electronic speed controller)

An electronic speed control follows a speed reference signal (derived from a throttle lever,
joystick, or other manual input) and varies the switching rate of a network of field effect
transistors (FETs). By adjusting the duty cycle or switching frequency of the transistors, the
speed of the motor is changed. The rapid switching of the transistors is what causes the
motor itself to emit its characteristic high-pitched whine, especially noticeable at lower
speeds.

Different types of speed controls are required for brushed DC motors and brushless DC
motors. A brushed motor can have its speed controlled by varying the voltage on its
armature. (Industrially, motors with electromagnet field windings instead of permanent
magnets can also have their speed controlled by adjusting the strength of the motor field
current.) A brushless motor requires a different operating principle. The speed of the motor is
varied by adjusting the timing of pulses of current delivered to the several windings of the
motor.

Fig 2.3 ESC Hardware

Brushless ESC systems basically create three-phase AC power, as in a variable frequency


drive, to run brushless motors. Brushless motors are popular with radio controlled
airplane hobbyists because of their efficiency, power, longevity and light weight in

7
comparison to traditional brushed motors. Brushless AC motor controllers are much more
complicated than brushed motor controllers.

The correct phase varies with the motor rotation, which is to be taken into account by the
ESC: Usually, back EMF from the motor is used to detect this rotation, but variations exist
that use magnetic (Hall effect) or optical detectors. Computer-programmable speed controls
generally have user-specified options which allow setting low voltage cut-off limits, timing,
acceleration, braking and direction of rotation. Reversing the motor's direction may also be
accomplished by switching any two of the three leads from the ESC to the motor.

ESCs are normally rated according to maximum current, for example, 25 amperes or 25 A.
Generally, the higher the rating, the larger and heavier the ESC tends to be which is a factor
when calculating mass and balance in airplanes. Many modern ESCs support nickel metal
hydride, lithium ion polymer and lithium iron phosphate batteries with a range of input and
cut-off voltages. The type of battery and number of cells connected is an important
consideration when choosing a battery eliminator circuit (BEC), whether built into the
controller or as a stand-alone unit. A higher number of cells connected will result in a
reduced power rating and therefore a lower number of servos supported by an integrated
BEC, if it uses a linear voltage regulator. A well designed BEC using a switching regulator
should not have a similar limitation.

Electronic speed controls for model RC vehicles may incorporate a battery eliminator circuit
to regulate voltage for the receiver, removing the need for separate receiver batteries. The
regulator may be linear or switched mode. ESCs, in a broader sense, are PWM controllers
for electric motors. The ESC generally accepts a nominal 50 Hz PWM servo input signal
whose pulse width varies from 1 ms to 2 ms. When supplied with a 1 ms width pulse at 50
Hz, the ESC responds by turning off the motor attached to its output. A 1.5 ms pulse-width
input signal drives the motor at approximately half-speed. When presented with 2.0 ms input
signal, the motor runs at full speed.

2.5.1 ESC firmware


Most modern ESC contain a microcontroller interpreting the input signal and appropriately
controlling the motor using a built-in program, or firmware. In some cases, it is possible to
change the factory built-in firmware for an alternate, publicly available, open source
firmware. This is done generally to adapt the ESC to a particular application. Some ESCs
are factory built with the capability of user upgradable firmware. Others require soldering to
connect a programmer.

8
2.6 Voltage Regulator

All voltage sources cannot able to give fixed output due to fluctuations in the circuit. For getting
constant and steady output, the voltage regulators are implemented. The integrated circuits
which are used for the regulation of voltage are termed as voltage regulator ICs.

The IC 7805 is actually a member of 78xx series of voltage regulator ICs. It is a fixed linear
voltage regulator. The xx present in 78xx represents the value of the fixed output voltage that
the particular IC provides. For 7805 IC, it is +5V DC regulated power supply. This regulator IC
also adds a provision for a heat sink. The input voltage to this voltage regulator can be up to
35V, and this IC can give a constant 5V for any value of input less than or equal to 35V which is
the threshold limit.

Fig 2.4 LM7805 Pin Diagram

Pin 1-Input

The function of this pin is to give the input voltage. It should be in the range of 7V to 35V. We
apply an unregulated voltage to this pin for regulation. For 7.2V input, the PIN achieves a
maximum efficiency.

9
Pin 2-Ground

We connect the ground to this pin. For output and input, this pin is equally neutral (0V).

Pin 3-Output

This pin is used to take the regulated output.

2.7 Temperature Sensor IC LM35

LM35 is a precession Integrated Circuit Temperature sensor, whose output voltage varies,
based on the temperature around it. It is a small and cheap IC which can be used to measure
temperature anywhere between -55°C to 150°C. It can easily be interfaced with any
Microcontroller that has ADC function or any development platform like Arduino.

Power the IC by applying a regulated voltage like +5V (VS) to the input pin and connected the
ground pin to the ground of the circuit. Now, you can measure the temperate in form of voltage
as shown below.

Fig 2.5 LM35 Block Diagram

If the temperature is 0°C, then the output voltage will also be 0V. There will be rise of 0.01V
(10mV) for every degree Celsius rise in temperature. The voltage can have converted into
temperature using the below formulae.

10
2.8 Application of Project

We know that BLDC motor are used in computer’s cooling fans and laptop’s cooling fan. Our
project gives the speed of BLDC motor according to temperature. When we increase the
temperature motor speed will increase accordingly and vice versa. So in computers (specially in
laptop’s which has a chargeable battery) we can save power.

11
CHAPTER 3

BRUSH LESS DC MOTOR

3.1 Brushless DC Motor: Construction and Working Principle

Brushless DC motors (BLDC) have been a much focused area for numerous motor
manufacturers as these motors are increasingly the preferred choice in many applications,
especially in the field of motor control technology. BLDC motors are superior to brushed DC
motors in many ways, such as ability to operate at high speeds, high efficiency, and better heat
dissipation.
They are an indispensable part of modern drive technology, most commonly employed for
actuating drives, machine tools, electric propulsion, robotics, computer peripherals and also for
electrical power generation. With the development of sensor less technology besides digital
control, these motors become so effective in terms of total system cost, size and reliability.

3.1.1 About Brushless DC motor

A brushless DC motor is a permanent magnet synchronous electric motor which is driven by


direct current (DC) electricity and it accomplishes electronically controlled commutation system
(commutation is the process of producing rotational torque in the motor by changing phase
currents through it at appropriate times) instead of a mechanically commutation system. BLDC
motors are also referred as trapezoidal permanent magnet motors.
Unlike conventional brushed type DC motor, wherein the brushes make the mechanical contact
with commutator on the rotor so as to form an electric path between a DC electric source and
rotor armature windings, BLDC motor employs electrical commutation with permanent magnet
rotor and a stator with a sequence of coils. In this motor, permanent magnet (or field poles)
rotates and current carrying conductors are fixed.

12
The armature coils are switched electronically by transistors or silicon controlled rectifiers at the
correct rotor position in such a way that armature field is in space quadrature with the rotor field
poles. Hence the force acting on the rotor causes it to rotate. Hall sensors or rotary encoders
are most commonly used to sense the position of the rotor and are positioned around the stator.
The rotor position feedback from the sensor helps to determine when to switch the armature
current.

This electronic commutation arrangement eliminates the commutator arrangement and brushes
in a DC motor and hence more reliable and less noisy operation is achieved. Due to the
absence of brushes BLDC motors are capable to run at high speeds. The efficiency of BLDC
motors is typically 85 to 90 percent, whereas as brushed type DC motors are 75 to 80 percent
efficient. There are wide varieties of BLDC motors available ranging from small power range to
fractional horsepower, integral horsepower and large power ranges.

3.1.2 Construction of BLDC Motor

BLDC motors can be constructed in different physical configurations. Depending on the stator
windings, these can be configured as single-phase, two-phase, or three-phase motors.
However, three-phase BLDC motors with permanent magnet rotor are most commonly used.

The construction of this motor has many similarities of three phase induction motor as well as
conventional DC motor. This motor has stator and rotor parts as like all

13
Fig. 3.1 construction of BLDC motor

Stator of a BLDC motor made up of stacked steel laminations to carry the windings. These
windings are placed in slots which are axially cut along the inner periphery of the stator. These
windings can be arranged in either star or delta. However, most BLDC motors have three phase
star connected stator.
Each winding is constructed with numerous interconnected coils, where one or more coils are
placed in each slot. In order to form an even number of poles, each of these windings is
distributed over the stator periphery.

The stator must be chosen with the correct rating of the voltage depending on the power supply
capability. For robotics, automotive and small actuating applications, 48 V or less voltage BLDC
motors are preferred. For industrial applications and automation systems, 100 V or higher rating
motors are used.

Rotor

BLDC motor incorporates a permanent magnet in the rotor. The number of poles in the rotor can
vary from 2 to 8 pole pairs with alternate south and north poles depending on the application

14
requirement. In order to achieve maximum torque in the motor, the flux density of the material
should be high. A proper magnetic material for the rotor is needed to produce required magnetic
field density.

Ferrite magnets are inexpensive; however, they have a low flux density for a given volume.
Rare earth alloy magnets are commonly used for new designs. Some of these alloys are
Samarium Cobalt (SmCo), Neodymium (Nd), and Ferrite and Boron (NdFeB). The rotor can be
constructed with different core configurations such as the circular core with permanent magnet
on the periphery, circular core with rectangular magnets, etc.

3.1.3 Types of BLDC motor

Basically, BLDC are of two types, one is outer rotor motor and other is inner rotor motor. The
basic difference between the two are only in designing, their working principles are same.

Inner Rotor Design

In an inner rotor design, the rotor is located in the center of the motor and the stator winding
surround the rotor. As rotor is located in the core, rotor magnets does not insulate heat inside
and heat get dissipated easily. Due to this reason, inner rotor designed motor produces a large
amount of torque and validly used.

15
Fig 3.1 (a) Inner Rotor Design

Outer Rotor Design

In outer rotor design, the rotor surrounds the winding which is located in the core of the motor.
The magnets in the rotor traps the heat of the motor inside and does not allow to dissipate from
the motor. Such type of designed motor operates at lower rated current a has low clogging
torque.

Fig. 3.1(b) Outer Rotor Design

16
3.2 Brushless DC Motor Drive

The electronic controller circuit energizes appropriate motor winding by turning transistor or
other solid state switches to rotate the motor continuously. The simple BLDC motor drive
circuit consists of electronic controller, BLDC motor.
The electronic controller can be a microcontroller unit or microprocessor or DSP processor or
FPGA unit or any other controller. This controller receives these signals, processes them and
sends the control signals to the MOSFET driver circuit.

3.2.1 Hall Sensor

Hall sensor provides the information to synchronize stator armature excitation with rotor
position. Since the commutation of BLDC motor is controlled electronically, the stator windings
should be energized in sequence in order to rotate the motor. Before energizing a particular
stator winding, acknowledgment of rotor position is necessary. So the Hall Effect sensor
embedded in stator senses the rotor position.

Most BLDC motors incorporate three Hall sensors which are embedded into the stator. Each
sensor generates Low and High signals whenever the rotor poles pass near to it. The exact
commutation sequence to the stator winding can be determined based on the combination of
these three sensor’s response.

3.2.2 Back EMF (Sensor less)

The windings of an electric motor act like a generator as they cut through magnetic field lines. A
potential is generated in the windings, measured in Volts and called an electromotive force
(EMF). According to Lenz’s law, this EMF gives rise to secondary magnetic field that opposes
the original change in magnetic flux driving the motor’s rotation. In simpler terms, the EMF
resists the motor’s natural movement and is referred to as a “back” EMF. For a given motor of
fixed magnetic flux and number of windings, the magnitude of the EMF is proportional to the
angular velocity of the rotor.

Manufacturers of BLDC motors specify a parameter known as the back EMF constant that can
be used to estimate back EMF for a given speed. The potential across a winding can be

17
calculated by subtracting the back EMF value from the supply voltage. Motors are designed
such that when they are running at rated speed, the potential difference between the back EMF
and supply voltage will cause the motor to draw the rated current and deliver the rated torque.

Driving the motor beyond the rated speed increases the back EMF substantially, decreasing the
potential difference across the windings, and in turn reducing current and lowering torque.
Pushing the motor faster still would cause back EMF (plus motor losses) to exactly equal the
supply voltage - at which point the current and torque will both equal zero.

Each stage of the commutation sequence for a three-phase BLDC motor is achieved by
energizing one of the windings positively, a second negatively, and leaving the third open

Fig. 3.2(a) Six stage cycle of BLDC motor

A combination of all three zero crossing points for the coils is used to determine the coil
energizing sequence. the back EMF zero crossing point for an individual coil in a sensor less
unit of 30 degrees. Consequently, in a sensor less motor control circuit, after the zero crossing
point is detected, a 30-degree phase lag is built into the firmware before the next action in the
energizing sequence is activated.

18
Fig 3.2(b) Back EMF

Methods for detecting back EMF

The signal is sampled by an ADC and then compared with a digital value corresponding to the
zero point. There is one major disadvantage to sensor less BLDC motor control; when the motor
is stationary, no back EMF is generated, depriving the MCU of information about the stator and
rotor position. The solution is to start the motor in an open loop configuration by energizing the
coils in a pre-determined sequence. While the motor is unlikely to operate efficiently, it will start
rotating.

19
3.3 Working Principle and Operation of BLDC Motor

BLDC motor works on the principle similar to that of a conventional DC motor, i.e., the Lorentz
force law which states that whenever a current carrying conductor placed in a magnetic field it
experiences a force. As a consequence of reaction force, the magnet will experience an equal
and opposite force. In case BLDC motor, the current carrying conductor is stationary while the
permanent magnet moves.

Fig. 3.3 Coil arrangement in BLDC motor

When the stator coils are electrically switched by a supply source, it becomes electromagnet
and starts producing the uniform field in the air gap. Though the source of supply is DC,
switching makes to generate an AC voltage waveform with trapezoidal shape. Due to the force
of interaction between electromagnet stator and permanent magnet rotor, the rotor continues to
rotate.

Motor stator is excited based on different switching states. With the switching of windings as
High and Low signals, corresponding winding energized as North and South poles. The
permanent magnet rotor with North and South poles align with stator poles causing motor to
rotate.

20
Fig 3.4 Switching Sequence of coils

Here, one might get a question that how we know which stator coil should be energized and
when to do. This is because; the motor continuous rotation depends on the switching sequence
around the coils.

Based on this sensor signal from, the controller decides particular coils to energize. Hall-effect
sensors generate Low and High level signals whenever rotor poles pass near to it. These
signals determine the position of the shaft.

3.4 Applications of BLDC Motors

Brushless DC motors (BLDC) are used for a wide variety of application requirements such as
varying loads, constant loads and positioning applications in the fields of industrial control,
automotive, aviation, automation systems, health care equipments etc. Some specific
applications of BLDC motors are

 Computer hard drives and DVD/CD players

 Electric vehicles, hybrid vehicles, and electric bicycles

21
 Industrial robots, CNC machine tools, and simple belt driven systems

 Washing machines, compressors and dryers

 Fans, pumps and blowers

 Computer cooling fan

BLDC may be described as electronically commuted motor which do not have brushes. These
types of motors are highly efficient in producing large amount of torque over a vast speed range.
In brushless motors, permanent magnets rotate around a fixed armature and overcome the
problem of connecting current to the armature. Commutation with electronics has large scope of
capabilities and flexibility. They known for smooth operation, and holding torque when
stationary.

3.5 Speed Control

Pulse-width modulation (PWM) is a commonly used technique for controlling power to an


electrical device, made practical by modern electronic power switches. The average value of
voltage (and current) fed to the load is controlled by turning the switch between supply and load
on and off at a fast pace. The longer the switch is on compared to the off periods, the higher the
power supplied to the load is. The PWM switching frequency has to be much faster than what
would affect the load, which is to say the device that uses the power. Typically, switching’s have
to be done several times a minute in an electric stove, 120 Hz in a lamp dimmer, from few
kilohertz (kHz) to tens of kHz for a motor drive and well into the tens or hundreds of kHz in audio
amplifiers and computer power supplies Duty cycle is expressed in percent,100% being fully on.
The main advantage of PWM is that power loss in the switching devices is very low. When a
switch is off there being practically no current, and when it is on, there is almost no voltage drop
across the switch. Power loss, being the product of voltage and current, is thus in both cases
close to zero. PWM works also well with digital controls, which, because of their on/off nature,
can easily set the needed duty cycle. PWM has also been used in certain communication
systems where its duty cycle has been used to convey information over a communications
channel. The duly cycle determines the speed of the motor. The desired speed can be obtained
by changing the duty cycle. The PWM in microcontroller is used to control the duty cycle of DC
motor.

22
3.5.1 Pulse width Modulation:

Pulse-width modulation (PWM) is a commonly used technique for controlling power to inertial
electrical devices, made practical by modern electronic power switches.

The average value of voltage (and current) fed to the load is controlled by turning the switch
between supply and load on and off at a fast pace. The longer the switch is on compared to the
off periods, the higher the power supplied to the load is. The term duty cycle describes the
proportion of 'on' time to the regular interval or 'period' of time; a low duty cycle corresponds to
low power, because the power is off for most of the time. Duty cycle is expressed in percent,

The main advantage of PWM is that power loss in the switching devices is very low. When a
switch is off there being practically no current, and when it is on, there is almost no voltage
drop across the switch. Power loss, being the product of voltage and current, is thus in both
cases close to zero. PWM also works well with digital controls, which, because of their on/off
nature, can easily set the needed duty cycle

Fig.3.5 PWM Pulses for Various Duty Cycles

23
CHAPTER 4

MICROCONTROLLER

4.1 Introduction

The microcontroller incorporates all the features that are found in microprocessor. The

microcontroller has built in ROM, RAM, Input Output ports, Serial Port, timers, interrupts and

clock circuit. A microcontroller is an entire computer manufactured on a single chip.

Microcontrollers are usually dedicated devices embedded within an application.

For example, microcontrollers are used as engine controllers in automobiles and as exposure

and focus controllers in cameras. In order to serve these applications, they have a high

concentration of on chip facilities such as serial ports, parallel input output ports, timers,

counters, interrupt control, analog-to-digital converters, random access memory, read only

memory, etc. The I/O, memory, and on-chip peripherals of a microcontroller are selected

depending on the specifics of the target application. Since microcontrollers are powerful digital

processors, the degree of control and programmability they provide significantly enhances the

effectiveness of the application. The 8051 is the first microcontroller of the MCS-51 family

introduced by Intel Corporation at the end of the 1970s. The 8051 family with its many

enhanced members enjoys the largest market share, estimated to be about 40% among the

various microcontroller architectures. The microcontroller has on chip peripheral devices.

Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC. 8-

bit microcontroller, means it can read, write and process 8-bit data.

24
4.2 Microcontroller AT mega 328

The high-performance Microchip 8-bit AVR RISC-based microcontroller combines 32KB

ISP flash memory with read-while-write capabilities, 1KB EEPROM, 2KB SRAM, 23 general

purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with

compare modes, internal and external interrupts, serial programmable USART, a byte-

oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels

in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator,

and software selectable power saving modes. The device operates between 1.8-5.5 volts.

4.2.1 Pin Diagram Of ATmega328

Fig.4.1 Pin diagram of ATmega328

25
By executing powerful instructions in a single clock cycle, the device achieves throughputs

approaching 1 MIPS per MHz, balancing power consumption and processing speed.

CPU type 8-bit AVR

Performance 20 MIPS at 20 MHz

Flash memory 32 kB

SRAM 2 kB

EEPROM 1 kB

Pin count 28-pin PDIP, MLF, 32-pin TQFP MLF

Maximum operating frequency 20 MHz

Number of touch channels 16

Hardware QTouch Acquisition No

Maximum I/O pins 23

External interrupts 2

Table 4.1

26
Parallel program mode[2]

Programming
Pin Name I/O Function
signal

High means the MCU is ready for a new command,


RDY/BSY PD1 O
otherwise busy.

OE PD2 I Output Enable (Active low)

WR PD3 I Write Pulse (Active low)

BS1 PD4 I Byte Select 1 (“0” = Low byte, “1” = High byte)

XA0 PD5 I XTAL Action bit 0

XA1 PD6 I XTAL Action bit 1

PAGEL PD7 I Program memory and EEPROM Data Page Load

BS2 PC2 I Byte Select 2 (“0” = Low byte, “1” = 2nd High byte)

DATA PC[1:0]:PB[5:0] I/O Bi-directional data bus (Output when OE is low)

Table 4.2

Programming mode is entered when PAGEL (PD7), XA1 (PD6), XA0 (PD5), BS1 (PD4) is set to
zero. RESET pin to 0V and VCC to 0V. VCc is set to 4.5 - 5.5V. Wait 60 μs, and RESET is set to
11.5 - 12.5 V. Wait more than 310 μs. Set XA1:XA0:BS1:DATA = 100 1000 0000, pulse XTAL1

27
for at least 150 ns, pulse WR to zero. This starts the Chip Erase. Wait until RDY/BSY (PD1)
goes high. XA1:XA0:BS1:DATA = 100 0001 0000, XTAL1 pulse, pulse WR to zero. This is the
Flash write command. And so on.

Serial Programming

Symbol Pins I/O Description

MOSI PB3 I Serial data in

MISO PB4 O Serial Data out

SCK PB5 I Serial Clock

Table 4.3

Serial data to the MCU is clocked on the rising edge and data from the MCU is clocked on the
falling edge. Power is applied to VCC while RESET and SCK are set to zero. Wait for at least 20
ms and then the Programming Enable serial instruction 0xAC, 0x53, 0x00, 0x00 is sent to the
MOSI pin. The second byte (0x53) will be echoed back by the MCU.

28
CHAPTER 5

SOFTWARE DESCRIPTION

Software used in our Project are listed below:

1. Arduino

2. Code vision

3. PCB wizard

5.1 Arduino

Arduino is an open source computer hardware and software company, project, and user
community that designs and manufactures single-board microcontrollers and microcontroller kits
for building digital devices and interactive objects that can sense and control objects in the
physical and digital world. The project's products are distributed as open-source hardware and
software, which are licensed under the GNU Lesser General Public License (LGPL) or the GNU
General Public License (GPL), permitting the manufacture of Arduino boards and software
distribution by anyone. Arduino boards are available commercially in preassembled form, or as
do-it-yourself (DIY) kits.

Arduino board designs use a variety of microprocessors and controllers. The boards are
equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various
expansion boards or Breadboards (shields) and other circuits. The boards feature serial
communications interfaces, including Universal Serial Bus (USB) on some models, which are
also used for loading programs from personal computers. The microcontrollers are typically
programmed using a dialect of features from the programming languages C and C++. In
addition to using traditional compiler toolchains, the Arduino project provides an integrated
development environment (IDE) based on the Processing language project.

Most Arduino boards consist of an Atmel 8-bit AVR microcontroller (ATmega8, ATmega168,
ATmega328, ATmega1280, ATmega2560) with varying amounts of flash memory, pins, and

29
features. The 32-bit Arduino Due, based on the Atmel SAM3X8E was introduced in 2012. The
boards use single or double-row pins or female headers that facilitate connections for
programming and incorporation into other circuits. These may connect with add-on modules
termed shields. Multiple and possibly stacked shields may be individually addressable via an I²C
serial bus. Most boards include a 5 V linear regulator and a 16 MHz crystal oscillator or ceramic
resonator. Some designs, such as the LilyPad, run at 8 MHz and dispense with the onboard
voltage regulator due to specific form-factor restrictions.

Arduino microcontrollers are pre-programmed with a boot loader that simplifies uploading of
programs to the on-chip flash memory. The default bootloader of the Arduino UNO is the
optiboot bootloader Boards are loaded with program code via a serial connection to another
computer. Some serial Arduino boards contain a level shifter circuit to convert between RS-232
logic levels and transistor–transistor logic (TTL) level signals. Current Arduino boards are
programmed via Universal Serial Bus (USB), implemented using USB-to-serial adapter chips
such as the FTDI FT232. Some boards, such as later-model Uno boards, substitute the FTDI
chip with a separate AVR chip containing USB-to-serial firmware, which is reprogrammable via
its own ICSP header. Other variants, such as the Arduino Mini and the unofficial Boarduino, use
a detachable USB-to-serial adapter board or cable, Bluetooth or other methods. When used
with traditional microcontroller tools, instead of the Arduino IDE, standard AVR in-system
programming (ISP) programming is used.

5.2 Code Vision AVR

Code Vision AVR is a C cross-compiler, Integrated Development Environment and Automatic


Program Generator designed for the Atmel AVR family of microcontrollers. The program is a
native 32bit application that runs under the Windows 95, 98, NT 4, 2000 and XP operating
systems. The C cross-compiler implements nearly all the elements of the ANSI C language, as
allowed by the AVR architecture, with some features added to take advantage of specificity of
the AVR architecture and the embedded system needs. The compiled COFF object files can be
C source level debugged, with variable watching, using the Atmel AVR Studio debugger. The
Integrated Development Environment (IDE) has built-in AVR Chip In-System Programmer
software that enables the automatical transfer of the program to the microcontroller chip after

30
successful compilation/assembly. For debugging embedded systems, which employ serial
communication, the IDE has a built-in Terminal. Besides the standard C libraries, the Code
Vision AVR C compiler has dedicated libraries for:

 Alphanumeric LCD modules

 Philips I2C bus

 National Semiconductor LM75 Temperature Sensor

 Philips PCF8563, PCF8583, Dallas Semiconductor DS1302 and DS1307 Real Time Clocks

 Dallas Semiconductor 1 Wire protocol

 Dallas Semiconductor DS1820/DS18S20 Temperature Sensors

 Dallas Semiconductor DS1621 Thermometer/Thermostat

 Dallas Semiconductor DS2430 and DS2433 EEPROMs

 SPI

 Power management

 Delays

 Gray code conversion.

5.3 PCB Wizard

PCB Wizard 3 is a powerful package for designing single-sided and double-sided printed circuit
boards (PCBs).

It provides a comprehensive range of tools covering all the traditional steps in PCB production,
including schematic drawing, schematic capture, component placement, automatic routing, Bill
of Materials reporting and file generation for manufacturing.

31
CHAPTER 6

CONCLUSION

The hardware for closed loop control of BLDC motor using microcontroller is designed. By using

the PWM technique speed of the BLDC motor was controlled. The project is divided into three

stages: input, processing and output stage. The input stage consists of changing the required

speed through switches. The processing stage provides RPM reference of the motor, by a ESC

interfaced to the microcontroller in the circuit.

The microcontroller develops PWM pulses which are varied with switches to regulate the DC

power to the motor such that the desired speed is achieved. The output stage uses a ESC being

driven by the microcontroller output.

32
APPENDIX A

ARDUINO PROGRAM

#include <LiquidCrystal.h>

#include <Servo.h>

Servo ESG;

LiquidCrystal lcd(13,11,10,9,8,7);

int val,val1,i=49;

int temp=2;

int mode=0;

void setup()

pinMode(2,INPUT_PULLUP);

pinMode(4,INPUT_PULLUP);

pinMode(5,INPUT_PULLUP);

pinMode(6,INPUT_PULLUP);

lcd.begin(16,2);

Serial.begin(9600);

Serial.println("HELLO");

33
ESG.attach(3);

ESG.write(30);

lcd.print("BLDC MOTOR");

delay(3000); // pinMode(1, INPUT);

lcd.print("Mode:");

lcd.setCursor(0,1);

lcd.print("1.Manual ");

lcd.print("2.Temp");

while(1)

if(digitalRead(2)==0)

mode=1;

lcd.clear();

lcd.print("Mode: manual");

delay(200); while(digitalRead(2)==0); break;

if(digitalRead(4)==0)

34
{

mode=2;

lcd.clear();

lcd.print("Mode:temp");

delay(200); while(digitalRead(4)==0); break;

delay(1000);

void loop()

int x=analogRead(A5);

float t=x*500.0/1023;

lcd.clear();

lcd.print("Temp="); lcd.print(t); lcd.print("C");

if(mode==2)

35
val1=myMap(x,0,200,49,60);

ESG.write(val1);

if(mode==1)

if(digitalRead(5)==0) val1++;

if(digitalRead(6)==0) val1--;

if(val1<49) val1=49;

if(val1>60) val1=60;

ESG.write(val1);

if(digitalRead(2)==0)

delay(500);

if(digitalRead(2)==0) mode=1;

while(digitalRead(2)==0);

if(digitalRead(4)==0)

delay(500);

if(digitalRead(4)==0) mode=2;

while(digitalRead(4)==0);

36
lcd.setCursor(13,0); lcd.print("M"); lcd.print(mode);

lcd.setCursor(0,1);

lcd.print("Speed="); lcd.print(val1-49);

delay(500);

int myMap(int in, int in_min, int in_max, int ref_min, int ref_max)

int out;

out=in*(ref_max-ref_min);

out=out/(in_max-in_min);

out=out+ref_min;

return out;

37
Cost of Project: -

Components Cost

Microcontroller AT Mega328 chip x1 ₹ 275

ESC ₹660

BLDC motor x1 ₹780

Voltage Regulator IC 7805 ₹20

Temp. sensor IC LM35 ₹60

Battery ₹420

Cristal Clock ₹25

4 point Switches ₹20

Potentiometer ₹20

LCD ₹230

LED , Resistor ₹25

Total ₹2535

38
REFERENCES

1. Kusko, A. & Peeran, S. M. (1987) Brushless DC motor using asymmetrical field

magnetization. IEEE Transactions on Industrial Applications, 23 (2):319

2. Bolton, H. R. & Ashen R.A. (1984) Influence of motor design and feed current waveform on

torque ripples in brushless dc motor. IEE Proceeding, 131 (3): 82 –90

3. Duane, H. (2002) Brushless Permanent Magnet Motor Design. University of Maine, Orno,

USA, 2nd ed.

4. Khader, S. H. (2001) Implementation of an accurate mathematical method

formodeling electromagnetic processes of brushless DC Motor. MESM, Amman, Jordan, 31-38

5. Miller, T. J. E. (1993) Switched Reluctance Motors and their Control, Oxford, UK, Magna

Phys. Publication and Clarendon, 40-90

39

S-ar putea să vă placă și