SlideShare a Scribd company logo
HARDWARE IMPLEMENTATION OF DC
MOTOR SPEED CONTROL USING ON-OFF
CONTROLLER BY VARYING REFERENCE
VOLTAGE OF PIC16F877A
MICROCONTROLLER
DEPARTMENT OF ELECTRICAL ENGINEERING
JALPAIGURI GOVT. ENGG. COLLEGE
JALPAIGURI-735102, WEST BENGAL
2
0
1
7
THE PROJECT SUBMITTED IN
THE FULFILLMENT OF THE
REQUIREMENTS FOR THE
DEGREE OF BACHELOR OF
TECHNOLOGY IN ELECTRICAL
ENGINEERING
BY
TRIDIB BOSE(13101102042)
ARPITA KUNDU(13101102057)
SUSANTA PAL(13101102089)
UNDER THE GUIDANCE OF:-
PROF. DR. G.K. PANDA
HEAD
ELECTRICAL ENGINEERING
DEPARTMENT
JALPAIGURI GOVT. ENGG. COLLEGE
WITH UNDENIABLE HELP FROM:-
MR. MOUSAM GHOSH
ASSISTANT PROFESSOR
ELECTRICAL ENGINEERING
DEPARTMENT
NIT MEGHALAYA
CONTENTS
ABSTRACT
Theory & Literature Review
Methodology
Results & Discussion
Conclusion &
Recommendation
References
ABSTRACT
DIRECT CURRENT (DC) MOTOR HAS
ALREADY BECOME AN IMPORTANT
DRIVE CONFIGURATION FOR MANY
APPLICATIONS ACROSS A WIDE
RANGE OF POWERS AND SPEEDS.
THE EASE OF CONTROL AND
EXCELLENT PERFORMANCE OF THE
DC MOTORS WILL ENSURE THAT THE
NUMBER OF APPLICATIONS USING
THEM WILL CONTINUE GROW FOR
THE FORESEEABLE FUTURE.
ABSTRACT
This project is mainly concerned on DC motor speed control system by using microcontroller PIC 16F877A.
It is a closed-loop real time control system, where the motor to be controlled is coupled to a generator (as a
tacho-generator) shaft to provide the feedback speed signal to controller. Pulse Width Modulation (PWM)
technique is used where its signal is generated in microcontroller to check the feedback.
The PWM signal will be send to motor driver to vary the voltage supply to motor to maintain at constant
speed. Through the project, it can be concluded that microcontroller PIC 16F877A can control motor speed
at desired speed although there is a variation of load.
THEORY AND
LITERATURE
REVIEW
THIS PART INCLUDES THE STUDY OF
DIFFERENT TYPES OF DC MOTORS,
SPEED MEASUREMENT OF DC
MOTOR, MODEL OF SEPARATELY
EXCITED DC MOTOR, SEVERAL
TYPES OF DC MOTOR SPEED
CONTROLLER. IT ALSO DISCUSSES
BRIEFLY ABOUT
MICROCONTROLLER, RS232 SERIAL
PORT, MPLAB IDE AND HI-LINK.
THEORY AND LITERATURE
REVIEW
Introduction to DC Motor
DC Motor Speed Controller
PWM Technique
Microcontroller
RS232 Serial Port
MPLAB IDE
WinPic800
Hi-Tech C Compiler
DC Motor
WORKING
PRINCIPAL
TYPES OF
DC MACHINE
SPEED
CONTROL
Speed Measurement of DC Motor
There are several methods which can use to measure the speed
of motor. Here, we use tachometer for speed measurement of dc
motor.
Tachometer is an instrument that measure the speed of the
motor based on the concept of back EMF induced in motor while
it is running. The EMF is voltage, appeared on the commutator
segments, caused by the rotation in the magnetic field by some
external force. The magnitude of the EMF is given by [1],
EMF=KφN ……………….[1]
Where,
K = a constant based on motor construction
φ = magnetic flux
N = speed of motor (in rpm)
The actual relationship between motor speed and EMF follows
and is derived from equation
N=(EMF)/Kφ ……………………[2]
DC motor Speed Controller
For precise speed control of servo
system, closed loop-control is normally
used.
THEORY CONTINUED…
THEORY
CONTINUED
….
PWM
TECHNIQUE
MICROCONTROLLE
R
PIC16F877A
RS232
MPLAB
IDE
WINPIC800
HI-TECH C
COMPILER
Vavg= (Ton/T)*Vin
Where, Vavg= average voltage supply to DC motor
Ton= time ON of switches
T = period of PWM
Ton/T= duty cycle
There are several controllers that can used to control the speed of the motor such as by using
thyristor, phase-locked-loop control, chopper circuit, Fuzzy Logic Controller and etc. Here, we will
discuss only at the speed control system by using PWM technique.
This on-off switching is performed by power MOSFETs. A MOSFET (Metal-Oxide-Semiconductor Field
Effect Transistor) is a device that can turn very large currents on and off under the control of a low
signal level voltage.
The average of voltage that supply to DC motor is given by,
PWM TECHNIQUE
METHODOLOGY
IN THIS PROJECT, MICROCONTROLLER WILL BE
USED AS THE CONTROLLER TO CONTROL DC
MOTOR SPEED AT DESIRED SPEED.
THE ACTUAL SPEED OF DC MOTOR WILL BE
FEEDBACK TO MICROCONTROLLER. IN
MICROCONTROLLER, IT WILL CALCULATE THE
ERROR BETWEEN THE DESIRED SPEED WITH
THE ACTUAL SPEED. THE ERROR WILL
DETERMINE DUTY CYCLE OF PULSE-WIDTH-
MODULATION (PWM) IN MICROCONTROLLER.
THEN, THE DUTY CYCLE WILL SEND TO DC
MOTOR DRIVER EITHER ACCELERATE OR
DECELERATE DC MOTOR TO MAINTAIN IT AT
DESIRED SPEED.
ALTHOUGH THE VARIATION IS CHECKED IN
OPEN LOOP USING A POT.
Hardware Implementation
 DC Motor
 Figure below shows the DC motor that will
be used in this project. It is a permanent
magnet 12V,200 RPM DC motor.
 Power Supply +5 volts:
 Most digital logic circuits and processors need
a +5 volt power supply. To use these parts we
need to build a regulated +5 volt source.
Usually we start with an unregulated power
supply ranging from 9 volts to 24 volts DC. To
make a +5 volt power supply, we use a LM7805
voltage regulator IC
Hardware Implementation
 IRF540 is an n-channel MOSFET. It has a
insulated gate.
 LM324 is a 14 pin IC consisting of 4
independent Op-amps compensated in a
single package. It is a 14 pin IC.
Hardware Implementation
 OPTOCOUPLER
MCT2E is the optocoupler.In electronics, an
opto-isolator, also called an optocoupler,
photocoupler, or optical isolator, is a
component that transfers electrical signals
between two isolated circuits by using
light.Opto-isolators prevent high voltages
from affecting the system receiving the
signal. Commercially available opto-isolators
withstand input-to-output voltages up to
10 kVand voltage transients with speeds up
to 10 kV/μs.
Hardware Implementation
Microcontroller PIC 16F877A
The microcontroller acts like the brain of the DC motor speed control system. The microcontroller
chip that has been selected for the purpose of controlling the speed of DC motor is PIC16F877A
manufactured by Microchip. This chip is selected based on several reasons:
 Its size is small and equipped with sufficient output ports without having to use a decoder
ormultiplexer.
 Its portability and low currentconsumption.
 It has PWM inside the chip itself which allow us to vary the duty cycle of DC motordrive.
 It is a very simple but powerful microcontroller. Users would only need to learn 35 single word
instructions in order to program thechip.
 It can be programmed and reprogrammed easily (up to 10,000,000 cycles) using the universal
programmer in robotics lab.
Pin name Pin no Description Application
VDD 11,32 Positive supply (+5v) Power supply to chip
VSS 12,31 Ground Reference Ground Reference
OSC1 13 For oscillator or resonator Connected to resonator
20MHz with 22pF
OSC2 14 For oscillator or resonator Connected to resonator
20MHz with 22pF
MCLR 1 Reset input Always connected to
+5V
RA0 2 Input/Output pin Input of Vout from LM324 as
speed counter
RB1 34 Input/Output pin Output to control CW/CCW of
left motor
RB2 35 Input/Output pin Output to control CW/CCW of
left motor
CCP2 16 Capture/Compare/PWM Output of duty cycle(PWM) to
control motor speed
Table: Pin connection of PIC16F877A for DC motor speed control system
Hardware Implementation
 RS232 Serial Communication:
SCI is an abbreviation for Serial Communication Interface and, as a special
subsystem of microcontroller PIC16F877A. It provides RS232 serial communication with PC
easily.
As with hardware communication, we use standard NRZ (Non Return to Zero) format
also known as 8 (9)-N-1, or 8 or 9 data bits, without parity bit and with one stop bit. Free line
is defined as the status of logic one. Start of transmission - Start Bit, has the status of logic
zero. The data bits follow the start bit (the first bit is the low significant bit), and after the bits
we place the Stop Bit of logic one.
The duration of the stop bit 'T' depends on the transmission rate and is adjusted
according to the needs of the transmission. For the transmission speed of 9600 baud,
Tis104μs.In order to connect a microcontroller to a serial port on a computer, we need to
adjust the level of the signalssocommunicatingcantakeplace.ThesignallevelonaPCis-
10Vforlogiczero and+10Vforlogic one. Since the signal level on the microcontroller is +5V for
logic one and 0V for logic zero, we need an intermediary stage that will convert the levels.
One chip specially designed for this task is MAX232. This chip receives signals from -10 to
+10V and converts them into 0 and5V.
Hardware Implementation
 RESISTORS
In this hardware implementation, we use
several resistors of values 47ohm,
330ohm, 1 Kohm, 2.2 Kohm, 5.6
Kohm, 10Kohm. We also made several
series and parallel connections of these
resistors to make different values of
resistor.
 CAPACITORS
In this hardware implementation, we use
several capacitors of values 0.1
microfarad, 1 microfarad, 10 microfarad,
47 microfarad and 22 picofarad.
Hardware Implementation
 DIODE
Here we use 1N4007 diode. Here diode is
mainly used for protection purpose.
 TRANSISTORS
CL100 is connected in the circuit in
common emitter mode o increase both
voltage and current rating and TIP127 is
connected in common collector mode to
increase the current rating further.
Hardware Implementation
 POT
A potentiometer, informally a pot, is a
three-terminal resistor with a sliding or
rotating contact that forms an adjustable
voltage divider. If only two terminals are
used, one end and the wiper, it acts as a
variable resistor or rheostat.
 TRIMPOT
A trimpot or trimmer potentiometer is a
small potentiometer which is used for
adjustment, tuning and calibration in
circuits. When they are used as a variable
resistance (wired as a rheostat) they are
called preset resistors.
Hardware Implementation
 HEAT SINK
A heat sink is a passive heat exchanger that
transfers the heat generated by an electronic or a
mechanical device to a fluid medium, often air or a
liquid coolant, where it is dissipated away from the
device, thereby allowing regulation of the device's
temperature at optimal levels. In computers, heat
sinks are used to cool central processing units or
graphics processors. Heat sinks are used with
high-power semiconductor devices such as power
transistors and optoelectronics such as lasers and
light emitting diodes (LEDs), where the heat
dissipation ability of the component itself is
insufficient to moderate its temperature.
Heat sink incorporated with MOSFET
OPERATIONAL CIRCUIT DIAGRAM
RESULT AND
DISCUSSION
THE PWM MODULE IS PROGRAMMED IN THE
MICROCONTROLLER THEN TRIGGERED WITH A
POTENTIOMETER. THE TRIGGERING IS VARIED
AND DATA COLLECTION (GENERATOR
TERMINAL VOLTAGE) IS DONE AT EACH SPEED
FOR DC MOTOR SPEED CONTROL SYSTEM TO
OBSERVE PERFORMANCE OF THE SYSTEM.
LASTLY THE MICROCONTROLLER IS
PROGRAMMED AGAIN FOR A CLOSED LOOP
FEEDBACK WHICH IN TURNS MINIMIZES THE
ERROR. A PROVISION IS MADE TO VARY THE
REFERENCE VOLTAGE OF THE
MICROCONTROLLER (D-PORT). THUS, ACTING
AS AN ON-OFF CONTROLLER.
EXPERIMENT
 Some experiments had been conducted for the project. First and foremost, an experiment is conducted to
find its feasibility in implementation of an open loop system. The PWM module is programmed in the
microcontroller then triggered with a potentiometer. The triggering is varied and data collection (generator
terminal voltage) is done at each speed for DC motor speed control system to observe performance of the
system. Lastly the microcontroller is programmed again for a closed loop feedback which in turns
minimizes the error. A provision is made to vary the reference voltage of the microcontroller (D-port).
Thus, acting as an on-off controller.
Experiment:
Determination of Voltage Supply and Motor Speed for open loop. An experiment is conducted to determine
the voltage supply and speed using digital multimeter and tachometer. The procedures and the result will be
discussed in following sections. For closed loop system, a feedback path is provided and a reference voltage
is changed.
PROCEDURE
For open loop,
The circuit was connected as Figure.
Voltage was supplied to motor and was varied.
Value of rpm at tachometer was recorded in Table(Next Slide).
For closed loop,
The initial procedure reflects that of open loop with,
A feedback loop is connected with pin 2.
3 outlet is provided for changing the reference voltage from pin 27, 28, 29 that is RD6, RD7, RD8 of port D.
The reference voltage is changed by taking RD6 as master switch and varying the logic of the remaining 2 i.e. 00, 01, 10, 11.
For 00 logic, rpm was set at 80.
For 01 logic, rpm was set at 110.
For 10 logic, rpm was set at 140.
For 11 logic, rpm was set at 170.
RESULT
For closed loop system, Microcontroller acts as
On-Off controller in the DC motor speed control
system. At each speed, the result was collected by
applying different condition that is reference
voltages.
CONCLUSION AND
RECOMMENDATION
 IN CONCLUSION, WITH THE ON-OFF CONTROLLER
AT MICROCONTROLLER PIC 16F877A, THE MOTOR
SPEED RESPONSE CAN BE MAINTAINED AT
DESIRED VALUE ALTHOUGH THERE IS A
VARIATION OF LOAD BUT CAN BE VARIED BY
CHANGING THE REFERENCE VOLTAGE OF
MICROCONTROLLER. THE OBJECTIVE OF THIS
PROJECT IS SUCCESSFULLY FULFILLED.
 MATHEMATICAL MODEL CAN BE OBTAINED FROM
THE GRAPH OF MOTOR SPEED RESPONSE. THEN,
FROM THE MATHEMATICAL MODEL, IT CAN BE
SIMULATED USING SOFTWARE SUCH AS MATLAB
TO GET THE IMPROVED MOTOR SPEED
RESPONSE BY USING CONTROLLER PACKAGES
SUCH AS PID CONTROLLER, FUZZY LOGIC
CONTROLLER AND OTHERS
CONCLUSION
 Recent developments in science and technology provide a wide range scope of applications of high
performance DC motor drives in area such as rolling mills, chemical process, electric trains, robotic
manipulators and the home electric appliances require speed controllers to perform tasks. DC motors have
speed control capabilities, which means that speed, torque and even direction of rotation can be changed at
any time to meet new condition.
 The goal of this project is to design a DC motor speed control system by using microcontroller PIC16F877A. It
is a closed-loop real time control system. The controller will maintain the speed at desired speed when there is
a variation of load. By varying the PWM signal from microcontroller (On-Off controller) to the motor driver,
motor speed can be controlled back to desired value easily.
 In conclusion, with the On-Off controller at microcontroller PIC 16F877A, the motor speed response can be
maintained at desired value although there is no variation of load but can be varied by changing the reference
voltage of microcontroller. The objective of this project is successfully fulfilled.
 Although the controller can function as we expected, but the performance is slightly sluggish where it takes
about 2 or 3 second to react properly. A delay is also provided in the coding to incorporate the effect of motor
inertia.
RECOMMENDATION
 The performance of the system is slightly sluggish. For future works, some recommendations have been
listed based on the problems in order to improve the performance.
 Mathematical model can be obtained from the graph of motor speed response. Then, from the
mathematical model, it can be simulated using software such as Matlab to get the improved motor speed
response by using controller packages such as PID controller, Fuzzy Logic Controller and others.
Besides, it will reduce the total hardware complexity and cost at the same time. We have done Fuzzy
Logic Controller in software simulation in our previous project, but its implementation is hard for a
Mamdani type FLC, thus this can be taken under consideration. Use fuzzy logic microcontroller which
combine the idea of fuzzy logic in microcontroller to obtain a DC motor speed control system with
excellent regulation and high robustness
REFERENCES
 MUHAMMAD H. RASHID. POWER ELECTRONICS
CIRCUITS, DEVICES AND APPLICATIONS.
3RDEDITION. UNITED STATES OF AMERICA:
PRENTICE HALL. 2004.
 P.C. SEN AND M. L. MACDONALD.
THYRISTORIZED DC DRIVES WITH
REGENERATIVE BRAKING AND SPEED
REVERSAL. IEEE TRANSACTIONS ON ENERGY
CONVERSION, 1978, VOL. IECI-25, NO. 4:347-
354.
 HTTP://HOMEPAGES.WHICH.NET/PAUL.HILLS/SP
EEDCONTROL/SPEEDCONTROLLERSBODY.HTM
L
 IOVINE JOHN. PIC MICROCONTROLLER
PROJECT BOOK. 2NDEDITION. MC. GRAW-HILL.
121-123;2000.
 MPLAB IDE, SIMULATOR, EDITOR USER’S GUIDE
 HTTP://WWW.MICROCHIP.COM
 HTTP://WWW.WIKIPEDIA.COM
FOR YOUR PATIENCE…

More Related Content

PDF
Analysis of Active Power Flow Control with Phase Shifting Transformer in AC T...
PPTX
Single Phase Uncontrolled Bridge Rectifier with RLE Load
PPTX
Voltage source Converters as a building block of HVDC and FACTS
PPTX
1-ф to 1-ф Cycloconverter ppt
PPT
Three phase ac voltage controllers
PPTX
Prepaid energy meter with theft detection
PPTX
SPEED GOVERNOR SYSYTEM AND ITS DERIVATIONS
Analysis of Active Power Flow Control with Phase Shifting Transformer in AC T...
Single Phase Uncontrolled Bridge Rectifier with RLE Load
Voltage source Converters as a building block of HVDC and FACTS
1-ф to 1-ф Cycloconverter ppt
Three phase ac voltage controllers
Prepaid energy meter with theft detection
SPEED GOVERNOR SYSYTEM AND ITS DERIVATIONS

What's hot (20)

PPT
Dual converters (1)
PDF
AC AC converters
PPTX
Reactive power compensation
PPT
Basics of hvdc
PDF
Chapter 6 AC-AC Converters.pdf
PPTX
Wireless power transmission deepak kumawat
PDF
Signal and systm made easy hand written notes Gate ECE
PPTX
PSOC.pptx
PPTX
Automatic water level_controller
PPTX
Relay operation principles
DOCX
Simple Automatic Water Level Controller
PDF
PPTX
Chapter 3 transmission line performance
PPTX
Switched Reluctance Motor
PPTX
Fc tcr.newpptx
PPTX
PPTX
Speed control of DC motor using pulse width modulation technique
PPTX
Timer 555
PPTX
PPT Fault Analysis
PPTX
Flying Capacitor Multi Level Inverter
Dual converters (1)
AC AC converters
Reactive power compensation
Basics of hvdc
Chapter 6 AC-AC Converters.pdf
Wireless power transmission deepak kumawat
Signal and systm made easy hand written notes Gate ECE
PSOC.pptx
Automatic water level_controller
Relay operation principles
Simple Automatic Water Level Controller
Chapter 3 transmission line performance
Switched Reluctance Motor
Fc tcr.newpptx
Speed control of DC motor using pulse width modulation technique
Timer 555
PPT Fault Analysis
Flying Capacitor Multi Level Inverter
Ad

Similar to DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY PIC16F877A MICROCONTROLLER (20)

PDF
Designing and Controlling of Motor by Interfacing RS232 with Microcontroller
PDF
Advanced Three Phase PWM Inverter Control Using Microcontroller
PPTX
Arm cortex ( lpc 2148 ) based motor speed control
PPTX
Arm cortex ( lpc 2148 ) based motor speed control
PDF
Ct36570573
DOC
03 TOTAL REPORT
PPTX
Speed control of motor
PPTX
AUTOMATIC WIRELESS POWER GRID CONTROL
PPTX
Ac motor closedloo[p
PPT
Presentation200 (1).ppt
PDF
Design and Control of HESS based PEV
PPTX
Temperature Controller
PPTX
Ac closed loop
PPT
Automatic mall elevator
PDF
Ijetae 0312 24
PDF
Cockpit White Box
PPTX
Grid synchronisation
PPTX
Speed Control of DC motor using AT89C52 IC
PDF
Design of embedded based three phase preventor and selector system for indust...
PDF
Arm Processor Based Speed Control Of BLDC Motor
Designing and Controlling of Motor by Interfacing RS232 with Microcontroller
Advanced Three Phase PWM Inverter Control Using Microcontroller
Arm cortex ( lpc 2148 ) based motor speed control
Arm cortex ( lpc 2148 ) based motor speed control
Ct36570573
03 TOTAL REPORT
Speed control of motor
AUTOMATIC WIRELESS POWER GRID CONTROL
Ac motor closedloo[p
Presentation200 (1).ppt
Design and Control of HESS based PEV
Temperature Controller
Ac closed loop
Automatic mall elevator
Ijetae 0312 24
Cockpit White Box
Grid synchronisation
Speed Control of DC motor using AT89C52 IC
Design of embedded based three phase preventor and selector system for indust...
Arm Processor Based Speed Control Of BLDC Motor
Ad

More from Tridib Bose (6)

PDF
Cracked
PDF
PDF
Unplanned rebarring
PPTX
DC Drive Speed Control using Fuzzy Logic Controller
Cracked
Unplanned rebarring
DC Drive Speed Control using Fuzzy Logic Controller

Recently uploaded (20)

PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
additive manufacturing of ss316l using mig welding
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
OOP with Java - Java Introduction (Basics)
PPT
Mechanical Engineering MATERIALS Selection
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Internet of Things (IOT) - A guide to understanding
DOCX
573137875-Attendance-Management-System-original
PDF
Arduino robotics embedded978-1-4302-3184-4.pdf
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
Welding lecture in detail for understanding
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
additive manufacturing of ss316l using mig welding
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Model Code of Practice - Construction Work - 21102022 .pdf
OOP with Java - Java Introduction (Basics)
Mechanical Engineering MATERIALS Selection
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Internet of Things (IOT) - A guide to understanding
573137875-Attendance-Management-System-original
Arduino robotics embedded978-1-4302-3184-4.pdf
CH1 Production IntroductoryConcepts.pptx
bas. eng. economics group 4 presentation 1.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Foundation to blockchain - A guide to Blockchain Tech
Embodied AI: Ushering in the Next Era of Intelligent Systems
Welding lecture in detail for understanding
Lecture Notes Electrical Wiring System Components
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx

DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY PIC16F877A MICROCONTROLLER

  • 1. HARDWARE IMPLEMENTATION OF DC MOTOR SPEED CONTROL USING ON-OFF CONTROLLER BY VARYING REFERENCE VOLTAGE OF PIC16F877A MICROCONTROLLER DEPARTMENT OF ELECTRICAL ENGINEERING JALPAIGURI GOVT. ENGG. COLLEGE JALPAIGURI-735102, WEST BENGAL 2 0 1 7
  • 2. THE PROJECT SUBMITTED IN THE FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF BACHELOR OF TECHNOLOGY IN ELECTRICAL ENGINEERING BY TRIDIB BOSE(13101102042) ARPITA KUNDU(13101102057) SUSANTA PAL(13101102089) UNDER THE GUIDANCE OF:- PROF. DR. G.K. PANDA HEAD ELECTRICAL ENGINEERING DEPARTMENT JALPAIGURI GOVT. ENGG. COLLEGE WITH UNDENIABLE HELP FROM:- MR. MOUSAM GHOSH ASSISTANT PROFESSOR ELECTRICAL ENGINEERING DEPARTMENT NIT MEGHALAYA
  • 3. CONTENTS ABSTRACT Theory & Literature Review Methodology Results & Discussion Conclusion & Recommendation References
  • 4. ABSTRACT DIRECT CURRENT (DC) MOTOR HAS ALREADY BECOME AN IMPORTANT DRIVE CONFIGURATION FOR MANY APPLICATIONS ACROSS A WIDE RANGE OF POWERS AND SPEEDS. THE EASE OF CONTROL AND EXCELLENT PERFORMANCE OF THE DC MOTORS WILL ENSURE THAT THE NUMBER OF APPLICATIONS USING THEM WILL CONTINUE GROW FOR THE FORESEEABLE FUTURE.
  • 5. ABSTRACT This project is mainly concerned on DC motor speed control system by using microcontroller PIC 16F877A. It is a closed-loop real time control system, where the motor to be controlled is coupled to a generator (as a tacho-generator) shaft to provide the feedback speed signal to controller. Pulse Width Modulation (PWM) technique is used where its signal is generated in microcontroller to check the feedback. The PWM signal will be send to motor driver to vary the voltage supply to motor to maintain at constant speed. Through the project, it can be concluded that microcontroller PIC 16F877A can control motor speed at desired speed although there is a variation of load.
  • 6. THEORY AND LITERATURE REVIEW THIS PART INCLUDES THE STUDY OF DIFFERENT TYPES OF DC MOTORS, SPEED MEASUREMENT OF DC MOTOR, MODEL OF SEPARATELY EXCITED DC MOTOR, SEVERAL TYPES OF DC MOTOR SPEED CONTROLLER. IT ALSO DISCUSSES BRIEFLY ABOUT MICROCONTROLLER, RS232 SERIAL PORT, MPLAB IDE AND HI-LINK.
  • 7. THEORY AND LITERATURE REVIEW Introduction to DC Motor DC Motor Speed Controller PWM Technique Microcontroller RS232 Serial Port MPLAB IDE WinPic800 Hi-Tech C Compiler
  • 9. Speed Measurement of DC Motor There are several methods which can use to measure the speed of motor. Here, we use tachometer for speed measurement of dc motor. Tachometer is an instrument that measure the speed of the motor based on the concept of back EMF induced in motor while it is running. The EMF is voltage, appeared on the commutator segments, caused by the rotation in the magnetic field by some external force. The magnitude of the EMF is given by [1], EMF=KφN ……………….[1] Where, K = a constant based on motor construction φ = magnetic flux N = speed of motor (in rpm) The actual relationship between motor speed and EMF follows and is derived from equation N=(EMF)/Kφ ……………………[2] DC motor Speed Controller For precise speed control of servo system, closed loop-control is normally used.
  • 11. Vavg= (Ton/T)*Vin Where, Vavg= average voltage supply to DC motor Ton= time ON of switches T = period of PWM Ton/T= duty cycle There are several controllers that can used to control the speed of the motor such as by using thyristor, phase-locked-loop control, chopper circuit, Fuzzy Logic Controller and etc. Here, we will discuss only at the speed control system by using PWM technique. This on-off switching is performed by power MOSFETs. A MOSFET (Metal-Oxide-Semiconductor Field Effect Transistor) is a device that can turn very large currents on and off under the control of a low signal level voltage. The average of voltage that supply to DC motor is given by, PWM TECHNIQUE
  • 12. METHODOLOGY IN THIS PROJECT, MICROCONTROLLER WILL BE USED AS THE CONTROLLER TO CONTROL DC MOTOR SPEED AT DESIRED SPEED. THE ACTUAL SPEED OF DC MOTOR WILL BE FEEDBACK TO MICROCONTROLLER. IN MICROCONTROLLER, IT WILL CALCULATE THE ERROR BETWEEN THE DESIRED SPEED WITH THE ACTUAL SPEED. THE ERROR WILL DETERMINE DUTY CYCLE OF PULSE-WIDTH- MODULATION (PWM) IN MICROCONTROLLER. THEN, THE DUTY CYCLE WILL SEND TO DC MOTOR DRIVER EITHER ACCELERATE OR DECELERATE DC MOTOR TO MAINTAIN IT AT DESIRED SPEED. ALTHOUGH THE VARIATION IS CHECKED IN OPEN LOOP USING A POT.
  • 13. Hardware Implementation  DC Motor  Figure below shows the DC motor that will be used in this project. It is a permanent magnet 12V,200 RPM DC motor.  Power Supply +5 volts:  Most digital logic circuits and processors need a +5 volt power supply. To use these parts we need to build a regulated +5 volt source. Usually we start with an unregulated power supply ranging from 9 volts to 24 volts DC. To make a +5 volt power supply, we use a LM7805 voltage regulator IC
  • 14. Hardware Implementation  IRF540 is an n-channel MOSFET. It has a insulated gate.  LM324 is a 14 pin IC consisting of 4 independent Op-amps compensated in a single package. It is a 14 pin IC.
  • 15. Hardware Implementation  OPTOCOUPLER MCT2E is the optocoupler.In electronics, an opto-isolator, also called an optocoupler, photocoupler, or optical isolator, is a component that transfers electrical signals between two isolated circuits by using light.Opto-isolators prevent high voltages from affecting the system receiving the signal. Commercially available opto-isolators withstand input-to-output voltages up to 10 kVand voltage transients with speeds up to 10 kV/μs.
  • 16. Hardware Implementation Microcontroller PIC 16F877A The microcontroller acts like the brain of the DC motor speed control system. The microcontroller chip that has been selected for the purpose of controlling the speed of DC motor is PIC16F877A manufactured by Microchip. This chip is selected based on several reasons:  Its size is small and equipped with sufficient output ports without having to use a decoder ormultiplexer.  Its portability and low currentconsumption.  It has PWM inside the chip itself which allow us to vary the duty cycle of DC motordrive.  It is a very simple but powerful microcontroller. Users would only need to learn 35 single word instructions in order to program thechip.  It can be programmed and reprogrammed easily (up to 10,000,000 cycles) using the universal programmer in robotics lab.
  • 17. Pin name Pin no Description Application VDD 11,32 Positive supply (+5v) Power supply to chip VSS 12,31 Ground Reference Ground Reference OSC1 13 For oscillator or resonator Connected to resonator 20MHz with 22pF OSC2 14 For oscillator or resonator Connected to resonator 20MHz with 22pF MCLR 1 Reset input Always connected to +5V RA0 2 Input/Output pin Input of Vout from LM324 as speed counter RB1 34 Input/Output pin Output to control CW/CCW of left motor RB2 35 Input/Output pin Output to control CW/CCW of left motor CCP2 16 Capture/Compare/PWM Output of duty cycle(PWM) to control motor speed Table: Pin connection of PIC16F877A for DC motor speed control system
  • 18. Hardware Implementation  RS232 Serial Communication: SCI is an abbreviation for Serial Communication Interface and, as a special subsystem of microcontroller PIC16F877A. It provides RS232 serial communication with PC easily. As with hardware communication, we use standard NRZ (Non Return to Zero) format also known as 8 (9)-N-1, or 8 or 9 data bits, without parity bit and with one stop bit. Free line is defined as the status of logic one. Start of transmission - Start Bit, has the status of logic zero. The data bits follow the start bit (the first bit is the low significant bit), and after the bits we place the Stop Bit of logic one. The duration of the stop bit 'T' depends on the transmission rate and is adjusted according to the needs of the transmission. For the transmission speed of 9600 baud, Tis104μs.In order to connect a microcontroller to a serial port on a computer, we need to adjust the level of the signalssocommunicatingcantakeplace.ThesignallevelonaPCis- 10Vforlogiczero and+10Vforlogic one. Since the signal level on the microcontroller is +5V for logic one and 0V for logic zero, we need an intermediary stage that will convert the levels. One chip specially designed for this task is MAX232. This chip receives signals from -10 to +10V and converts them into 0 and5V.
  • 19. Hardware Implementation  RESISTORS In this hardware implementation, we use several resistors of values 47ohm, 330ohm, 1 Kohm, 2.2 Kohm, 5.6 Kohm, 10Kohm. We also made several series and parallel connections of these resistors to make different values of resistor.  CAPACITORS In this hardware implementation, we use several capacitors of values 0.1 microfarad, 1 microfarad, 10 microfarad, 47 microfarad and 22 picofarad.
  • 20. Hardware Implementation  DIODE Here we use 1N4007 diode. Here diode is mainly used for protection purpose.  TRANSISTORS CL100 is connected in the circuit in common emitter mode o increase both voltage and current rating and TIP127 is connected in common collector mode to increase the current rating further.
  • 21. Hardware Implementation  POT A potentiometer, informally a pot, is a three-terminal resistor with a sliding or rotating contact that forms an adjustable voltage divider. If only two terminals are used, one end and the wiper, it acts as a variable resistor or rheostat.  TRIMPOT A trimpot or trimmer potentiometer is a small potentiometer which is used for adjustment, tuning and calibration in circuits. When they are used as a variable resistance (wired as a rheostat) they are called preset resistors.
  • 22. Hardware Implementation  HEAT SINK A heat sink is a passive heat exchanger that transfers the heat generated by an electronic or a mechanical device to a fluid medium, often air or a liquid coolant, where it is dissipated away from the device, thereby allowing regulation of the device's temperature at optimal levels. In computers, heat sinks are used to cool central processing units or graphics processors. Heat sinks are used with high-power semiconductor devices such as power transistors and optoelectronics such as lasers and light emitting diodes (LEDs), where the heat dissipation ability of the component itself is insufficient to moderate its temperature. Heat sink incorporated with MOSFET
  • 24. RESULT AND DISCUSSION THE PWM MODULE IS PROGRAMMED IN THE MICROCONTROLLER THEN TRIGGERED WITH A POTENTIOMETER. THE TRIGGERING IS VARIED AND DATA COLLECTION (GENERATOR TERMINAL VOLTAGE) IS DONE AT EACH SPEED FOR DC MOTOR SPEED CONTROL SYSTEM TO OBSERVE PERFORMANCE OF THE SYSTEM. LASTLY THE MICROCONTROLLER IS PROGRAMMED AGAIN FOR A CLOSED LOOP FEEDBACK WHICH IN TURNS MINIMIZES THE ERROR. A PROVISION IS MADE TO VARY THE REFERENCE VOLTAGE OF THE MICROCONTROLLER (D-PORT). THUS, ACTING AS AN ON-OFF CONTROLLER.
  • 25. EXPERIMENT  Some experiments had been conducted for the project. First and foremost, an experiment is conducted to find its feasibility in implementation of an open loop system. The PWM module is programmed in the microcontroller then triggered with a potentiometer. The triggering is varied and data collection (generator terminal voltage) is done at each speed for DC motor speed control system to observe performance of the system. Lastly the microcontroller is programmed again for a closed loop feedback which in turns minimizes the error. A provision is made to vary the reference voltage of the microcontroller (D-port). Thus, acting as an on-off controller. Experiment: Determination of Voltage Supply and Motor Speed for open loop. An experiment is conducted to determine the voltage supply and speed using digital multimeter and tachometer. The procedures and the result will be discussed in following sections. For closed loop system, a feedback path is provided and a reference voltage is changed.
  • 26. PROCEDURE For open loop, The circuit was connected as Figure. Voltage was supplied to motor and was varied. Value of rpm at tachometer was recorded in Table(Next Slide). For closed loop, The initial procedure reflects that of open loop with, A feedback loop is connected with pin 2. 3 outlet is provided for changing the reference voltage from pin 27, 28, 29 that is RD6, RD7, RD8 of port D. The reference voltage is changed by taking RD6 as master switch and varying the logic of the remaining 2 i.e. 00, 01, 10, 11. For 00 logic, rpm was set at 80. For 01 logic, rpm was set at 110. For 10 logic, rpm was set at 140. For 11 logic, rpm was set at 170.
  • 27. RESULT For closed loop system, Microcontroller acts as On-Off controller in the DC motor speed control system. At each speed, the result was collected by applying different condition that is reference voltages.
  • 28. CONCLUSION AND RECOMMENDATION  IN CONCLUSION, WITH THE ON-OFF CONTROLLER AT MICROCONTROLLER PIC 16F877A, THE MOTOR SPEED RESPONSE CAN BE MAINTAINED AT DESIRED VALUE ALTHOUGH THERE IS A VARIATION OF LOAD BUT CAN BE VARIED BY CHANGING THE REFERENCE VOLTAGE OF MICROCONTROLLER. THE OBJECTIVE OF THIS PROJECT IS SUCCESSFULLY FULFILLED.  MATHEMATICAL MODEL CAN BE OBTAINED FROM THE GRAPH OF MOTOR SPEED RESPONSE. THEN, FROM THE MATHEMATICAL MODEL, IT CAN BE SIMULATED USING SOFTWARE SUCH AS MATLAB TO GET THE IMPROVED MOTOR SPEED RESPONSE BY USING CONTROLLER PACKAGES SUCH AS PID CONTROLLER, FUZZY LOGIC CONTROLLER AND OTHERS
  • 29. CONCLUSION  Recent developments in science and technology provide a wide range scope of applications of high performance DC motor drives in area such as rolling mills, chemical process, electric trains, robotic manipulators and the home electric appliances require speed controllers to perform tasks. DC motors have speed control capabilities, which means that speed, torque and even direction of rotation can be changed at any time to meet new condition.  The goal of this project is to design a DC motor speed control system by using microcontroller PIC16F877A. It is a closed-loop real time control system. The controller will maintain the speed at desired speed when there is a variation of load. By varying the PWM signal from microcontroller (On-Off controller) to the motor driver, motor speed can be controlled back to desired value easily.  In conclusion, with the On-Off controller at microcontroller PIC 16F877A, the motor speed response can be maintained at desired value although there is no variation of load but can be varied by changing the reference voltage of microcontroller. The objective of this project is successfully fulfilled.  Although the controller can function as we expected, but the performance is slightly sluggish where it takes about 2 or 3 second to react properly. A delay is also provided in the coding to incorporate the effect of motor inertia.
  • 30. RECOMMENDATION  The performance of the system is slightly sluggish. For future works, some recommendations have been listed based on the problems in order to improve the performance.  Mathematical model can be obtained from the graph of motor speed response. Then, from the mathematical model, it can be simulated using software such as Matlab to get the improved motor speed response by using controller packages such as PID controller, Fuzzy Logic Controller and others. Besides, it will reduce the total hardware complexity and cost at the same time. We have done Fuzzy Logic Controller in software simulation in our previous project, but its implementation is hard for a Mamdani type FLC, thus this can be taken under consideration. Use fuzzy logic microcontroller which combine the idea of fuzzy logic in microcontroller to obtain a DC motor speed control system with excellent regulation and high robustness
  • 31. REFERENCES  MUHAMMAD H. RASHID. POWER ELECTRONICS CIRCUITS, DEVICES AND APPLICATIONS. 3RDEDITION. UNITED STATES OF AMERICA: PRENTICE HALL. 2004.  P.C. SEN AND M. L. MACDONALD. THYRISTORIZED DC DRIVES WITH REGENERATIVE BRAKING AND SPEED REVERSAL. IEEE TRANSACTIONS ON ENERGY CONVERSION, 1978, VOL. IECI-25, NO. 4:347- 354.  HTTP://HOMEPAGES.WHICH.NET/PAUL.HILLS/SP EEDCONTROL/SPEEDCONTROLLERSBODY.HTM L  IOVINE JOHN. PIC MICROCONTROLLER PROJECT BOOK. 2NDEDITION. MC. GRAW-HILL. 121-123;2000.  MPLAB IDE, SIMULATOR, EDITOR USER’S GUIDE  HTTP://WWW.MICROCHIP.COM  HTTP://WWW.WIKIPEDIA.COM