Professional Documents
Culture Documents
A PROJECT REPORT
Submitted by
APRIL 2017
1
ANNA UNIVERSITY::CHENNAI 600 025
BONAFIDE CERTIFICATE
Certified that this project report CLOSED LOOP CONTROL OF A BLDC MOTOR TO
RUN AT ENTERED SPEED is the bonafide work of the following students.
BITTU GOSWAMI (112713105008)
N.KARTHIK RAJA (112713105022)
P.NAVEEN KUMAR (112713105034)
A.SANDEEP RAJ (112713105046)
SIGNATURE SIGNATURE
Dr.J.JasperGnanaChandran, M.E., Ph.D. Mrs. C. Subha, M.E
St. Peters college of Engineering and St. Peters college of Engineering and
2
ACKNOWLEDGEMENT
First of all, we are grateful to the Almighty God for establishing us to complete this
project.
It is our immense pleasure to express our deep sense of gratitude to our honourable
Chairperson Dr. BANUMATHI THAMBIDURAI for providing such an excellent lab
facility. We are extremely thankful to our Principal Dr.S.SELVAN, M.E.., Ph.D., for
the facilities provided to us during the project.
We owe our profound gratitude to our Project Coordinator and Project Internal
Guide Mrs. C.SUBHA, M.E for their exemplary guidance, suggestions, monitoring
and constant encouragement throughout the course. Their Blessing, motivation and
guidance which have been given by them has made us to complete our journey.
We are thankful and fortunate enough to get the constant encouragement, support and
guidance from all Staff of the Department of Electrical and Electronics Engineering
which helped us in successful completion of this project work.
Last but not the least, we are very grateful to our parents and our well-wishers for their
constant support and encouragement during the project.
3
TABLE OF CONTENTS
ABSTRACT
LIST OF TABLES
LIST OF FIGURES
LIST OF SYMBOLS
1 INTRODUCTION 11
2 BLOCK DIAGRAM 15
3 HARDWARE REQUIREMENT 16
3.1 Transformers 17
3.3 Rectifier 21
3.4 Filter 21
3.8 Optoisolator 34
3.9 MOSFET 37
3.10 DC Motor 39
3.13 PWM 45
4
4 SOFTWARE REQUIREMENTS 49
4.1 IDE 49
In Uvision2
Application in Uvision2
Inuvision2
Creating a Project
4.15 Embedded C 54
5 SCHEMATIC DIAGRAM 56
5.1 Description 57
6 CODING 67
5
7.1 Compiler 67
7 HARDWARE TESTING 95
8 RESULTS 97
9 CONCLUSION 99
10 BIBLIOGRAPHY
6
LIST OF FIGURES
3.7(a) Keypad 30
The project is designed to control the speed of a BLDC motor using closed loop
control technique. BLDC motor has various application used in industries like in
drilling, lathes, spinning, elevators, 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 enter the desired speed and the motor will run at
Based on the principle of PWM speed can be controlled. This is achieved by keeping
BLDC motor on closed loop feedback by giving RPM reference to the microcontroller
microcontroller to display the running speed. The desired speed in percentage of full
speed is fed with the help of keypad. The controller delivers desired pulse width to
automatically adjust the DC power to the motor for required speed. The above
operation is carried out by using one opto-isolator and a MOSFET for driving the
BLDC motor with IR sensing for getting the speed reference to the microcontroller.
Further the project can be enhanced to a fully-fledged fuzzy logic control of a BLDC
motor for industrial applications. It can also be developed for an intelligent cruise
INTRODUCTION
Targeting
1.4 CLASSIFICATION
Real Time Systems.
RTS is one which has to respond to events within a specified deadline.
A right answer after the dead line is a wrong answer
CHAPTER 2
BLOCK DIAGRAM
2.1 Explanation
The speed of the motor is sensed by an IR pair and is displayed on LCD and is also
fed to the microcontroller. The required speed is entered using a keypad which is
interfaced with microcontroller. The motor is interfaced to the MC through an
optocoupler & a MOSFET which drives the motor. PWM pulses are generated from
MC according to the entered speed and the motor is adjusted to that speed and
maintained at that speed.
CHAPTER 3
HARDWARE REQUIREMENTS
HARDWARE COMPONENTS:
3. Rectifier
4. Filter
5. Microcontroller (AT89S52/AT89C51)
6. LCD Display
7. Keypad
8. LM358
9. MCT2E
10. MOSFET
11. IR Led
12. Photodiode
14. BC547
15. BC557
16. 1N4007
17. LED
18. Resistor
19. Capacitor
3.1 TRANSFORMER
Transformers convert AC electricity from one voltage to another with a little loss of
power. Step-up transformers increase voltage, step-down transformers reduce voltage.
Most power supplies use a step-down transformer to reduce the dangerously high
voltage to a safer low voltage.
The input coil is called the primary and the output coil is called the secondary. There is
no electrical connection between the two coils; instead they are linked by an
alternating magnetic field created in the soft-iron core of the transformer. The two lines
in the middle of the circuit symbol represent the core. Transformers waste very little
power so the power out is (almost) equal to the power in. Note that as voltage is
stepped down and current is stepped up.
The ratio of the number of turns on each coil, called the turns ratio, determines the
ratio of the voltages. A step-down transformer has a large number of turns on its
primary (input) coil which is connected to the high voltage mains supply, and a small
number of turns on its secondary (output) coil to give a low output voltage.
TURNS RATIO = (Vp /Vs) = ( Np / Ns )
Where,
Vp = primary (input) voltage.
Vs = secondary (output) voltage
Np = number of turns on primary coil
Ns = number of turns on secondary coil
Ip = primary (input) current
Is = secondary (output) current.
If the secondary coil is attached to a load that allows current to flow, electrical power
is transmitted from the primary circuit to the secondary circuit. Ideally, the transformer
is perfectly efficient; all the incoming energy is transformed from the primary circuit
to the magnetic field and into the secondary circuit. If this condition is met, the
incoming electric power must equal the outgoing power:
If the voltage is increased, then the current is decreased by the same factor. The
impedance in one circuit is transformed by the square of the turns ratio.For example, if
an impedance Zs is attached across the terminals of the secondary coil, it appears to the
primary circuit to have an impedance of (Np/Ns)2Zs. This relationship is reciprocal, so
that the impedance Zp of the primary circuit appears to the secondary to be (Ns/Np)2Zp.
Features
Output Current up to 1A.
Output Voltages of 5, 6, 8, 9, 10, 12, 15, 18, 24V.
Thermal Overload Protection.
Short Circuit Protection.
Output Transistor Safe Operating Area Protection.
Description
The LM78XX/LM78XXA series of three-terminal positive regulators are available in
the TO-220/D-PAK package and with several fixed output voltages, making them
useful in a wide range of applications. Each type employs internal current limiting,
thermal shutdown and safe operating area protection, making it essentially
indestructible. If adequate heat sinking is provided, they can deliver over 1A output
Current. Although designed primarily as fixed voltage regulators, these devices can be
used with external components to obtain adjustable voltages and currents.
Internal Block Diagram
Fig
3.2(b):
Block
Diagram of Voltage Regulator
3.3 RECTIFIER
A rectifier is an electrical device that converts alternating current (AC), which
periodically reverses direction, to direct current (DC), current that flows in only one
direction, a process known as rectification. Rectifiers have many uses including as
components of power supplies and as detectors of radio signals. Rectifiers may be
made of state diodes, vacuum tube diodes, mercury arc valves, and other components.
The output from the transformer is fed to the rectifier. It converts A.C. into pulsating
D.C. The rectifier may be a half wave or a full wave rectifier. In this project, a bridge
rectifier is used because of its merits like good stability and full wave rectification. In
positive half cycle only two diodes (1 set of parallel diodes) will conduct, in negative
half cycle remaining two diodes will conduct and they will conduct only in forward
bias only.
3.4 FILTER
Capacitive filter is used in this project. It removes the ripples from the output of
rectifier and smoothens the D.C. Output received from this filter is constant until the
mains voltage and load is maintained constant. However, if either of the two is varied,
D.C. voltage received at this point changes. Therefore a regulator is applied at the
output stage.
The simple capacitor filter is the most basic type of power supply filter. The use of this
filter is very limited. It is sometimes used on extremely high-voltage, low-current
power supplies for cathode-ray and similar electron tubes that require very little load
current from the supply. This filter is also used in circuits where the power-supply
ripple frequency is not critical and can be relatively high. Below figure can show how
the capacitor changes and discharges.
Fig 3.4 Performance Characteristics of Voltage Regulator
Features:
Pin Description:
VCC:
Supply voltage.
GND:
Ground.
Port 0:
Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink
eight TTL inputs. When 1s are written to port 0 pins, the pins can be used as high-
impedance inputs. Port 0 can also be configured to be the multiplexed low-order
address/data bus during accesses to external program and data memory. In this mode,
P0 has internal pull-ups. Port 0 also receives the code bytes during Flash programming
and outputs the code bytes during program verification. External pull-ups are required
during program verification.
Port 1:
Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers
can sink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 1 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups.
In addition, P1.0 and P1.1 can be configured to be the timer/counter 2 external count
input (P1.0/T2) and the timer/counter 2 trigger input (P1.1/T2EX).
Port 2:
Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers
can sink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 2 pins that are
externally being pulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory
and during accesses to external data memory that uses 16-bit addresses (MOVX @
DPTR). In this application, Port 2 uses strong internal pull-ups when emitting 1s.
During accesses to external data memory that uses 8-bit addresses (MOVX @ RI),
Port 2 emits the contents of the P2 Special Function Register.
Port 3:
Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers
can sink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled
high by the internal pull-ups and can be used as inputs. As inputs, Port 3 pins that are
externally being pulled low will source current (IIL) because of the pull-ups.
RST:
Reset input. A high on this pin for two machine cycles while the oscillator is running
resets the device. This pin drives high for 98 oscillator periods after the Watchdog
times out. The DISRTO bit in SFR AUXR (address 8EH) can be used to disable this
feature. In the default state of bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG:
Address Latch Enable (ALE) is an output pulse for latching the low byte of the address
during accesses to external memory. This pin is also the program pulse input (PROG)
during Flash programming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency
and may be used for external timing or clocking purposes. Note, however, that one
ALE pulse is skipped during each access to external data memory.
PSEN:
Program Store Enable (PSEN) is the read strobe to external program memory. When
the AT89S52 is executing code from external program memory, PSEN is activated
twice each machine cycle, except that two PSEN activations are skipped during each
access to external data memory.
EA/VPP:
External Access Enable. EA must be strapped to GND in order to enable the device to
fetch code from external program memory locations starting at 0000H up to FFFFH.
Note, however, that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions. This pin also receives
the 12-volt programming enable voltage (VPP) during Flash programming.
XTAL1:
Input to the inverting oscillator amplifier and input to the internal clock operating
circuit.
XTAL2:
Output from the inverting oscillator amplifier.
Oscillator Characteristics:
XTAL1 and XTAL2 are the input and output, respectively, of an inverting
amplifier which can be configured for use as an on-chip oscillator, as shown in Figure
1. Either a quartz crystal or ceramic resonator may be used. To drive the device from
an external clock source, XTAL2 should be left unconnected while XTAL1 is driven as
shown in Figure 6.2. There are no requirements on the duty cycle of the external clock
signal, since the input to the internal clocking circuitry is through a divide-by-two flip-
flop, but minimum and maximum voltage high and low time specifications must be
observed.
Idle Mode
In idle mode, the CPU puts itself to sleep while all the on chip peripherals remain
active. The mode is invoked by software. The content of the on-chip RAM and all the
special functions registers remain unchanged during this mode. The idle mode can be
terminated by any enabled interrupt or by a hardware reset.
Description:
This is the example for the Parallel Port. This example doesn't use the Bi-directional
feature found on newer ports, thus it should work with most, if not all Parallel Ports. It
however doesn't show the use of the Status Port as an input for a 16 Character x 2 Line
LCD Module to the Parallel Port. These LCD Modules are very common these days,
and are quite simple to work with, as all the logic required running them is on board.
Pros:
No geometric distortion
LCD Background:
Frequently, an 8051 program must interact with the outside world using input and
output devices that communicate directly with a human being. One of the most
common devices attached to an 8051 is an LCD display. Some of the most common
LCDs connected to the 8051 are 16x2 and 20x2 displays. This means 16 characters per
line by 2 lines and 20 characters per line by 2 lines, respectively.
Fortunately, a very popular standard exists which allows us to communicate with the
vast majority of LCDs regardless of their manufacturer. The standard is referred to as
HD44780U, which refers to the controller chip which receives data from an external
source (in this case, the 8051) and communicates directly with the LCD.
Fig 3.6(a): LCD
The 44780 standard requires 3 control lines as well as either 4 or 8 I/O lines for the
data bus. The user may select whether the LCD is to operate with a 4-bit data bus or an
8-bit data bus. If a 4-bit data bus is used the LCD will require a total of 7 data lines (3
control lines plus the 4 lines for the data bus). If an 8-bit data bus is used the LCD will
require a total of 11 data lines (3 control lines plus the 8 lines for the data bus).
The three control lines are referred to as EN, RS, and RW.
The EN line is called "Enable." This control line is used to tell the LCD that you are
sending it data. To send data to the LCD, your program should make sure this line is
low (0) and then set the other two control lines and/or put data on the data bus. When
the other lines are completely ready, bring EN high (1) and wait for the minimum
amount of time required by the LCD datasheet (this varies from LCD to LCD), and
end by bringing it low (0) again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be treated
as a command or special instruction (such as clear screen, position cursor, etc.). When
RS is high (1), the data being sent is text data which should be displayed on the screen.
For example, to display the letter "T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the information on
the data bus is being written to the LCD. When RW is high (1), the program is
effectively querying (or reading) the LCD. Only one instruction ("Get LCD status") is
a read command. All others are write commands--so RW will almost always be low
.Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0,
DB1, DB2, DB3, DB4, DB5, DB6, and DB7.
3.7 KEYPAD
The light is proportional to the signal, so the signal is thus transferred to the
phototransistor. Optocouplers may also come in few module such as the SCR,
photodiodes, TRIAC of other semiconductor switch as an output, and incandescent
lamps, neon bulbs or other light source.
The optocoupler usually found in switch mode power supply circuit in many
electronic equipment. It is connected in between the primary and secondary section of
power supplies. The optocoupler application or function in the circuit is to:
Monitor high voltage
Output voltage sampling for regulation
System control micro for power ON/OFF
Ground isolation
If the optocoupler IC breakdown, it will cause the equipment to have low power, blink,
no power, erratic power and even power shut down once switch on the equipment.
Many technicians and engineers do not know that they can actually test the
optocoupler with their analog multimeter. Most of them thought that there is no way of
testing an IC with an analog meter.
This is the principle used in OptoTriacs and optoSCRs, which are readily available
in Integrated circuit (I.C.) form, and do not need very complex circuitry to make them
work. Simply provide a small pulse at the right time to the Light Emitting Diode in the
package. The light produced by the LED activates the light sensitive properties of the
Triac or Thyristor gate and the power is switched on. The isolation between the low
power and high power circuits in these optically connected devices is typically several
thousand volts
Collector-emitter voltage
This is the maximum voltage that can be present from the collector to the emitter of
the receiving phototransistor (when it is turned off no light) before it may break-
down.
Cree page distance
This is physically how far a spark would have to travel around the outside of the
package to get from one side to the other. If the package has contaminants on it, solder
flux, or dampness, then a lower-resistance path can be created for noise signals to
travel along.
Forward current
This is the current passing through the sending LED. Typically, an Opto-isolator will
require about 5mA to turn the output transistor on.
Forward voltage
This is the voltage that is dropped across the LED when it is turned on. Most normal
diodes drop about 0.7v, but with LEDs it is typically 1 2 volts.
Collector dark current
This is the current that can flow through the output phototransistor when it is turned
off.
Collector-emitter saturation voltage
When the output transistor is fully turned on (saturated), this is the voltage there will
be between the collector and emitter.
Isolation resistance
This is the resistance from a pin in the input side to a pin on the output side. It should
be very high.
Response time
The rise and fall times are the times that the output voltage takes to get from zero to
maximum. The rise time is very much dependent on the load resistor, since it is this
that is pulling the output up. Therefore this value is always quoted with a fixed load
resistance. Note however that the value, 100 Ohms, is much less than you are likely to
use in practice. This is another of the manufacturers attempts to make the product look
better than it is.
Cutoff frequency
This is effectively the highest frequency of square wave that can be sent through the
Opto-isolator. It is actually the frequency at which the output voltage is only swinging
half the amplitude than at DC levels (-3Db = half). It is therefore linked with the rise
and fall times.
3.9 MOSFET
BLDC motors may be described as stepper motors, with fixed permanent magnets and
possibly more poles on the rotor than the stator, or reluctance motors. The latter may
be without permanent magnets, just poles that are induced on the rotor then pulled into
alignment by timed stator windings. However, the term stepper motor tends to be used
for motors that are designed specifically to be operated in a mode where they are
frequently stopped with the rotor in a defined angular position; this page describes
more general BLDC motor principles, though there is overlap.
BLDC motors offer several advantages over brushed DC motors, including more
torque per weight and efficiency, reliability, reduced noise, longer lifetime (no brush
and commutator erosion), elimination of ionizing sparks from the commutator, more
power, and overall reduction of electromagnetic interference (EMI). With no windings
on the rotor, they are not subjected to centrifugal forces, and because the windings are
supported by the housing, they can be cooled by conduction, requiring no airflow
inside the motor for cooling. This in turn means that the motor's internals can be
entirely enclosed and protected from dirt or other foreign matter.
The maximum power that can be applied to a BLDC motor is exceptionally high,
limited almost exclusively by heat, which can weaken the magnets. (Magnets
demagnetize at high temperatures, the Curie point, and for neodymium-iron-boron
magnets this temperature is lower than for other types.) A BLDC motor's main
disadvantage is higher cost, which arises from two issues. First, BLDC motors require
complex electronic speed controllers to run. Brushed DC motors can be regulated by a
comparatively simple controller, such as a rheostat (variable resistor). However, this
reduces efficiency because power is wasted in the rheostat. Second, some practical
uses have not been well developed in the commercial sector. For example, in the Radio
Control (RC) hobby, even commercial brushless motors are often hand-wound while
brushed motors use armature coils which can be inexpensively machine-wound.
(Nevertheless, see "Applications", below.)
BLDC motors are often more efficient at converting electricity into mechanical power
than brushed DC motors. This improvement is largely due to the absence of electrical
and friction losses due to brushes. The enhanced efficiency is greatest in the no-load
and low-load region of the motor's performance curve. Under high mechanical loads,
BLDC motors and high-quality brushed motors are comparable in efficiency.
AC induction motors require induction of magnetic field in the rotor by the rotating
field of the stator; this results in the magnetic and electric fields being out of phase.
The phase difference requires greater current and current losses to achieve power.
BLDC motors are microprocessor-controlled to keep the stator current in phase with
the permanent magnets of the rotor, requiring less current for the same effect and
therefore resulting in greater efficiency.
Consumer electronics
Transport
Industrial engineering
Model engineering
3.11 IR LED
The appearance is same as a common LED. Since the human eye cannot see the
infrared radiations, it is not possible for a person to identify whether the IR LED is
working or not, unlike a common LED. To overcome this problem, the camera on a
cell phone can be used. The camera can show us the IR rays being emanated from the
IR LED in a circuit.
Features
Chip Materials
3.12 PHOTODIODE
A photodiode is a type of photo detector capable of converting light into either current
or voltage, depending upon the mode of operation. Photodiodes are similar to regular
semiconductor diodes except that they may be either exposed (to detect vacuum UV or
X-rays) or packaged with a window or optical fibre connection to allow light to reach
the sensitive part of the device. Many diodes designed for use specifically as a
photodiode will also use a PIN junction rather than the typical PN junction.
Principle of operation
A photodiode is a PN junction or PIN structure. When a photon of sufficient energy
strikes the diode, it excites an electron, thereby creating a mobile electron and a
positively charged electron hole. If the absorption occurs in the junction's depletion
region, or one diffusion length away from it, these carriers are swept from the junction
by the built-in field of the depletion region. Thus holes move toward the anode, and
electrons toward the cathode, and a photocurrent is produced.
Photovoltaic mode
When used in zero bias or photovoltaic mode, the flow of photocurrent out of the
device is restricted and a voltage builds up. The diode becomes forward biased and
"dark current" begins to flow across the junction in the direction opposite to the
photocurrent. This mode is responsible for the photovoltaic effect, which is the basis
for solar cellsin fact, a solar cell is just a large area photodiode.
Photoconductive mode
In this mode the diode is often reverse biased, dramatically reducing the response time
at the expense of increased noise. This increases the width of the depletion layer,
which decreases the junction's capacitance resulting in faster response times. The
reverse bias induces only a small amount of current (known as saturation or back
current) along its direction while the photocurrent remains virtually the same. The
photocurrent is linearly proportional to the luminance
Although this mode is faster, the photoconductive mode tends to exhibit more
electronic noise. The leakage current of a good PIN diode is so low (< 1nA) that the
JohnsonNyquist noise of the load resistance in a typical circuit often dominates.
3.13 PWM
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 switchings 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.
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, 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 is 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.
Power delivery
PWM can be used to adjust the total amount of power delivered to a load without
losses normally incurred when a power transfer is limited by resistive means. The
drawbacks are the pulsations defined by the duty cycle, switching frequency and
properties of the load. With a sufficiently high switching frequency and, when
necessary, using additional passive electronic filters the pulse train can be smoothed
and average analog waveform recovered.
High frequency PWM power control systems are easily realisable with semiconductor
switches. As has been already stated above almost no power is dissipated by the switch
in either on or off state. However, during the transitions between on and off states both
voltage and current are non-zero and thus considerable power is dissipated in the
switches. Luckily, the change of state between fully on and fully off is quite rapid
(typically less than 100 nanoseconds) relative to typical on or off times, and so the
average power dissipation is quite low compared to the power being delivered even
when high switching frequencies are used.
Modern semiconductor switches such as MOSFETs or Insulated-gate bipolar
transistors (IGBTs) are quite ideal components. Thus high efficiency controllers can be
built. Typically frequency converters used to control AC motors have efficiency that is
better than 98 %. Switching power supplies have lower efficiency due to low output
voltage levels (often even less than 2 V for microprocessors are needed) but still more
than 70-80 % efficiency can be achieved.
Variable-speed fan controllers for computers usually use PWM, as it is far more
efficient when compared to a potentiometer or rheostat. (Neither of the latter is
practical to operate electronically; they would require a small drive motor).
Light dimmers for home use employ a specific type of PWM control. Home use light
dimmers typically include electronic circuitry which suppresses current flow during
defined portions of each cycle of the AC line voltage. Adjusting the brightness of light
emitted by a light source is then merely a matter of setting at what voltage (or phase)
in the AC half cycle the dimmer begins to provide electrical current to the light source
(e.g. by using an electronic switch such as a triac). In this case the PWM duty cycle is
the ratio of the conduction time to the duration of the half AC cycle defined by the
frequency of the AC line voltage (50 Hz or 60 Hz depending on the country).
These rather simple types of dimmers can be effectively used with inert (or relatively
slow reacting) light sources such as incandescent lamps, for example, for which the
additional modulation in supplied electrical energy which is caused by the dimmer
causes only negligible additional fluctuations in the emitted light. Some other types of
light sources such as light-emitting diodes (LEDs), however, turn on and off extremely
rapidly and would perceivably flicker if supplied with low frequency drive voltages.
Perceivable flicker effects from such rapid response light sources can be reduced by
increasing the PWM frequency. If the light fluctuations are sufficiently rapid, the
human visual system can no longer resolve them and the eye perceives the time
average intensity without flicker (see flicker fusion threshold).
In electric cookers, continuously-variable power is applied to the heating elements
such as the hob or the grill using a device known as a Simmertat. This consists of a
thermal oscillator running at approximately two cycles per minute and the mechanism
varies the duty cycle according to the knob setting. The thermal time constant of the
heating elements is several minutes, so that the temperature fluctuations are too small
to matter in practice.
Applications
Telecommunications
Power delivery
Voltage regulation
Audio effects and amplification.
CHAPTER 4
SOFTWARE REQUIREMENTS
4.15 EMBEDDED C
Use of embedded processors in passenger cars, mobile phones, medical equipment,
aerospace systems and defense systems is widespread, and even everyday domestic
appliances such as dish washers, televisions, washing machines and video recorders
now include at least one such device.
CHAPTER 5
SCHEMATIC DIAGRAM
RESET
For example: A 10F capacitor and a 10k resistor would render a 100ms time to pin
number 9 from logic high to low, there after the pin number 9 remains low.
External Access (EA):
Pin no 31 of 40 pin 8051 microcontroller termed as EA is required to be connected to
5V for accessing the program form the on-chip program memory. If it is connected to
ground then the controller accesses the program from external memory. However as
we are using the internal memory it is always connected to +5V.
5.3 OPTOCOUPLER
arrow in the NPN transistor symbol is on the emitter leg and points in the direction of
the conventional current flow when the device is in forward active mode. Whenever
base is high, then current starts flowing through base and emitter and after that only
OPERATION
CONNECTIONS:
A 230v-12v step down transformer is connected to the bridge rectifier, a blocking
diode is connected at the output of bridge rectifier, a 100 mf capacitor is connected
after blocking diode, a 7805 voltage regulator is connected after 1000mf capacitor, a
10mf capacitor is connected at the output of voltage regulator, a red LED is connected
with a series resistor 330ohms. Now +5v dc is generated at the output of voltage
regulator.
The 40th pin of micro controller is connected to the +5v dc and 20 th pin of controller is
connected to the ground. A crystal oscillator is connected at 18 th and 19th pins of
controller, a push button is connected at 19 th pin of controller, a 10micro farads
capacitor is connected across the push button, a 10k resistor is connected to the 19 th pin
and grounded two 33pf capacitor are connected at the crystal pins.
Keypad is connected to port 1 of micro controller, 3 control pins of LCD are connected
to port 3.5 to 3.7 and 8 data pins of the LCD are connected to port 0. LCD 16 th pin is
GND and 2nd and 15th pins are connected to Vcc.
The anode of IR LED is connected to Vcc via 220ohms resistors, cathode is GND. The
cathode of photo diode is connected to Vcc through 1k resistor, anode is connected to a
variable resistor 1k &third pin of variable resistor is connected to base of an n-p-n
transistor, emitter is grounded and collector is connected to 12 th pin of micro controller,
being pulled up with 2.2k resistor.
The output pin of micro controller i.e. P2.0 is connected to the 2nd pin of opto isolator
&1 pin of the opto is connected to 5volt +ve via a resistor of 330 ohms. Pin 4 & 5 that
works like a switch of the optofeeds a Mosfet that is wired to operate the BLDC motor
as per the circuit.
WORKING:
While logic high during the on time duty cycle is delivered by the microcontroller to
the input of the OPTO U3, The opto led glows to bring the opto transistor pin no 5 and
6 to conduct. Now 12V supply is given at the junction point of R7 and R8 and reaches
the gate of the MOSFET Q1 via D4 for Q1 to conduct thus enabling the motor to get
supply to run. A freewheel diode is used across the motor to conduct the charge stored
in the motor during off period. During off time of the duty cycle the opto transistor
does not conduct and the charge which is stored in the gate of Q1 forces Q3 to conduct
while the motor stops. This ON and OFF the motor reduces the speed. The DC power
is available to the motor via the MOSFET as per the PWM generated by micro
controller depending upon the input given to micro controller from a keypad. As well
as the speed is displayed on a liquid crystal display. To sense the speed of BLDC motor
an IR LED in photo diode arrangement is used. The value of speed is changed in
percentage by using fuzzy logic. Fuzzy logic is something i.e. approximate but not
accurate. So a program is written in to micro controller that uses fuzzy logic due to
which we get the values almost equal to accurate values.
A 230v -12v step down transformer is used to decrease AC supply voltage to 12v, now
this ac voltage is rectified by using a full wave bridge rectifier, a blocking diode is
used before the filter capacitor to get the pulsating D.C. to get the fixed output D.C a
7805 voltage regulator is employed because micro controller fixed +5v pure DC. To
filter pulsating D.C an electrolytic capacitor of value 470 micro farads or 1000micro
farads is connected at the input of 7850. One more electrolytic capacitor is connected
at the output of 7850 to remove complete ripples if there any +5v D.C. A LED with a
series resistors is connected to indicate the power. Micro controller has to generate
PWM pulses as per error signal received from the speed sensing input to match the
keyboard input in order to run the motor at the input RPM.
A push button is connected at the 9th pin of micro controller which is known as reset a
10 micro farads electrolytic capacitor is connected across the button and a 10k resistor
is used to pull down 9th pin of micro controller. When this reset pin is pressed during
the operation, the program written in micro controller starts from beginning. A crystal
across oscillator of value 11.0592 MHz is connected across 18 th& 19th pins of micro
controller with the 33pico farads ceramic capacitors are connected for stabilising it.
Fig 5.4 Speed Sensor
To sense the speed of BLDC motor an infrared (IR) diode and photo diode are used.
When light falls on photo diode the resistance across it decreases and vice versa.
Hence photo diode is employed in a potential divider with a variable resistor. This
potential divider supplies voltage to an N-P-N transistor whose collector is connected
to micro controller input. So, the IR LED and photo diode are placed near the shaft of
BLDC motor and a white spot is made on the shaft infrared light gets reflected by
white colour and the reflected light keeps falling on photo diode, due to which the
voltage across it keeps changing thereafter the voltage at base of transistor also
changes therefore at the collector of transistor a pulse is generated which is given to
micro controller for counting the number of rotations per minute of D.C motor.
This sensed speed is displayed on LCD in rpm. To change the speed a keypad is used
as an input to the micro controller. By using this we can enter how much percentage of
speed would be required for the motor to run.
Pressing # twice the maximum running speed is stored. After which pressing * the
desired percentage of speed is entered. There after pressing # the desired speed is
saved which are displayed on the LCD. There after the on time of the pulse width
progressively goes on reducing to result the speed reduction. Speed sensors
continuously send the error signal to pin 12 of the MC to lock the running speed of the
motor at the desired speed.
Some calculations:
Choosing Capacitor for Bridge rectifier: There is some approximated formula
.Peak to peak ripple voltage =Load current in amps / (2*line frequency in hertz
* capacitance in farads). But as rule of thumb for 1 A current 1000uF is best.
Thus it is load dependent.
Series resistor with LED: When LED (red)conducts the voltage drop across it
will be 1.2V fixed so we have to limit the current of 10 to 20 mA through series
resistor, now voltage drop across series resistor will be 3.8V (5-1.2) and we have
to limit current to 10mA ,so apply Ohms law R=V/I = 3.8/0.01 = 380 330
Same with Opto-isolator MCT2E
Series resistor with IR LED: When LED conducts the voltage drop across it will
be 1.2V fixed, so we have to limit the current of 10-20mA through series resistor
for good IR strength, now voltage drop across series resistor will be 3.8V and
have to limit current 20mA so apply Ohms law R=V/I = 3.8/0.02 = 190
220
Reset Circuit at pin 9 of microcontroller: Reset circuit is a standard circuit
resistor and capacitor but we can calculate the time calculate RC time constant
R*C=10K * 10F 0.1 sec, meaning during the power on time that pin is
driven high for 0.1 sec because of capacitor charging and there after the pin goes
low for the program to get executed from the start.
Photo diode: Resistor with photo diode is variable so you have to adjust for
biasing the NPN transistor by a variable resistor till the transistor starts
conducting upon the reference to IR light falling on photo diode
Crystal is a standard circuit
BC547: Microcontroller understands only logic High and Low i.e., 5V or 0V, thats
why use one BC547 NPN transistor as it has its emitter a ground reference .So when
the IR light is reflecting on photo diode through the white patch on the fan blade its
resistance decreases meaning the voltage drop changes across the photo diode that
results voltage drop across 10k preset ( the variable resistor) increase which goes to
bias the base of NPN transistor and thus make collector point ( as the transistor
conducts) low i.e., this 0V is low logic given to microcontroller. But when IR light is
not reflecting the resistance across photo diode will be high meaning voltage across it
will be high that results voltage across 10k preset will change and this voltage is not
enough to bias the NPN transistor so collector point will be logic High meaning 5V
will go to that point to the microcontroller.
BC557: This is to discharge the in-built capacitor charge of MOSFET as explained in
the documents
Freewheeling diode: We are dealing with DC motor, motor has inductance. The
inductance property is that when a current flow through it, it stores some energy, when
motor supply is cut off this stored energy needs a path to allow flow of that energy in
the same direction as the current was flowing otherwise this energy forcefully goes to
damage the other switching component attachment to it like MOSFET.
MOSFET: Here MOSFET is used as a motor driver switch, which drives the BLDC
motor with reference to the logic coming from the microcontroller .
OPERATION PROCEDURE:
1. Press # once display shows the store Max RPM.
2. Press # again to store Max.RPM.
3. Press * to get the required RPM. Display shows % of Req_RPM:
4. Enter the required percentage using Keypad.
5. Press # to save the required RPM.
CHAPTER 6
CODING
6.1 COMPILER
1. Click on the Keil Vision Icon on Desktop
2. The following fig will appear
3. Click on the Project menu from the title bar
4. Then Click on New Project
5. Save the Project by typing suitable project name with no extension in your own
folder sited in either C:\ or D:\
6. Then Click on save button above.
7. Select the component for your project. I.e. Atmel
8. Click on the + Symbol beside of Atmel
15. Click on the file option from menu bar and select new.
16. The next screen will be as shown in next page, and just maximize it by double
clicking on its blue boarder.
21. Now select as per your file extension given while saving the file
22. Click only one time on option ADD.
23. Now Press function key F7 to compile. Any error will appear if so happen.
24. If the file contains no error, then press Control+F5 simultaneously.
25. The new window is as follows
29. Now keep Pressing function key F11 slowly and observe.
30. You are running your program successfully.
6.2 SOURCE CODE
#define LCDDATA P2
sbit RS = P3^7;
sbit RW = P3^6;
sbit en = p3^5;
sbit D0 = P0^0;
sbit D1 = P0^1;
sbit D2 = P0^2;
sbit D3 = P0^3;
//bit addresable area
{4,5,6},
{7,8,9},
{*,0,#}};
int Temp_count = 0;
CHAR Temp_buffer[5];
char shift_buf[3];
void wait();
void start_s_eeprom();
void acknowledge();
void stop_s_eeprom();
char get_byte_s_eeprom();
void delay();
void copy2_speed();
void get_speed();
void copy2_maxrpm();
void copy2_reqrpm();
void get_maxrpm();
void get_reqrpm();
void clear_eeprom();
void copy2_shift();
void get_shift();
else
void PWM_DELAY()
T2_Delay (shift);
T2_Delay(100-shift);
}
unsigned int i = 0;
for(i = 0; i<msec;i++)
}
void delay()
for (NUM=0;NUM<25000:num++);
While(*str)
LCDData(*str)
While(NUM)
Buff[i]=(NUM%10)+ 0x30;
NUM=NUM/10;
If(!i)
LCDData(0)
LCDString( );
Else
While(i--)
LCDData(Buff[i]);
LCDString( );
Void init_LCD()
LCDCMD(0x38);
/*command to shift the cursor to next position when Data is send in LCD */
LCDCMD(0x06);
LCDCMD(0xoc);
/*Return cursor home */
LCDCMD(0x02);
for(i=0;i<Time;i++)
for(j=0;j<1000;j++);
If(posi==0)
else if(posi == 1)
else if(posi == 2)
{
K_Flag = 1;
Temp = keypad[0][posi];
K_Flag = 1;
Temp = keypad[1][posi];
K_Flag = 1;
Temp = keypad[2][posi];
K_Flag = 1;
Temp = keypad[3][posi];
}
Posi++; //increment the posi
For(;*ptr!=0;ptr++)
K++;
while(*str)
For(i=k-1;I !=0;i--)
temp *= ten;
temp = 1;
k--;
Return out;
}
Void main()
Display(100);
While(1)
If(shit_flag == 1)
If(timecount_flag == 1)
If(count == 10)
RPM=((60000)/((time_count*71)+((((256*high_count)
+low_count)*1.085))));
If(RPM>MAXRPM) //compare with maximum RPM
RPM = MaxRPM;
If((RPM-RequiredRPM)<50)
RPM=RequiredRPM;
setrpm_flag=1;
else
else
If((RequiredRPM-RPM)<50)
RPM=RequiredRPM;
Setrpm_flag=1;
else
{
COUNT = 0;
TH0=0X00;
TL0=0X00;
If(K_Flag)
K_Flag=0;
Delay(50);
If(K_Flag)
K_Flag=0;
Delay(50);
if(Temp !=#)
Buff[i++]=Temp;
LCDData(Buff[i-1]);
else
Buff[i]=\0;
LCDNUM(ReqShift);
Shift=ReqShift;
RequiredRPM=((MaxRPM/100)*(ReqShift));//calculate Required
RPM
Delay(500);
delay();
RPM_Flag=0;
time_count=0;
time_flag=0;
update_flag=1;
timecount_flag=0;
setrpm_flag=0;
INT0_Flag=0;
int0_count=0;
time_count=0;
COUNT=0;
while(1)
if(timecount_flag==1)
COUNT=COUNT+1;
if(COUNT==10)
{
RPM=((60000)/((time_count*71)+((((256*high_count)
+low_count)*1.085))));//calculate the RPM
presentRPM=RPM;
COUNT=0;
LCDCMD(0xCB);
if(K_Flag)
K_Flag=0;
Delay(50);
delay();
break;
delay();
delay();
}
CHAPTER 7
HARDWARE TESTING
25% 3V 650
50% 6V 130
75% 9V 0
195
100% 12V 0
260
0
CHAPTER 9
CONCLUSION
The hardware for closed loop control of BLDC motor using microcontroller is designed. By using the
PWM technique speed of BLDC motor was controlled and it was made to run at exactly entered
speed. In future this hardware will be implemented in various fields due to its advantages over
conventional dc motor and the speed control will be observed. Change in the PWM switching
strategy with in the motor drive promises to eliminate the problem associated with torque ripple.
Another major trend in BLDC motor drive technology is integrating the BLDC motor and drive
electronics into a single package to simplify the system, minimize interconnection cabling, reduce
noise and solve motor-drive compatibility issues.
CHAPTER 10
BIBLIOGRAPHY
2. Bolton, H. R. &Ashen R.A. (1984) Influence of motor design and feed current
wave form on torque ripples in brushless dc motor. IEE Proceeding, 131(3):82-90
5 Miller, T . J. E. (1993) Switched Reluctance Motors and their Control, Oxford, UK,
Magna Phys. Publication andClarendon, 40-90