Speed Control of DC Motor using Capture/Compare/Pulse Width Modulation Module of PIC Microcontroller

DOI : 10.17577/IJERTV3IS090470

Download Full-Text PDF Cite this Publication

Text Only Version

Speed Control of DC Motor using Capture/Compare/Pulse Width Modulation Module of PIC Microcontroller

Pallavi Papalkar

Department. of Electrical Engineering Samrat Ashok Technological Institute, Vidisha

Madhya Pradesh

S. P. Phulambrikar

Department. of Electrical Engineering Samrat Ashok Technological Institute, Vidisha

Madhya Pradesh

Abstract This paper is intended to control speed of a DC motor using low cost PIC16F877A microcontroller. To achieve this, PWM technique is used, which is in-built under CCP module of PIC. A PIC based speed control scheme has been developed, in which L293D is used as an interface between motor and microcontroller. The PIC16F877A microcontroller has been programmed to vary the duty cycle of motor using PWM library of MikroC PRO simulation software. The complete simulink model has been implemented on Proteus Design Suit. Experimental setup has been developed for the proposed scheme. Experimental and simulation results are compared which shows a very close agreement between the two.. Index Terms PIC microcontrollers, CCP module, Duty cycle,

Pulse width modulation.

  1. INTRODUCTION

    DC motor plays a significant role in modern industries. There are several types of applications where the load on the DC motor varies over a speed range. These applications demands accuracy high-speed control, and good dynamic responses. Most of the home appliances, washers, dryers and compressors are good examples of speed control. In automotive, electronic steering control, engine control, fuel pump control, and electric vehicle control are good examples of these. In aerospace technology, there are a lot of applications, such as pumps, robotic arm controls, centrifuges, gyroscope controls and so on. [5]

    Whenever we think about any programmable devices then the embedded technology comes into fore front. The embedded systems is now-a-days very much popular and most of the product are developed with Microcontroller based embedded technology. The advantages of using the microcontroller is the reduction of the cost and also the use of extra hardware such as the use of timer RAM and ROM can be avoided. This technology is very fast thereby controlling of multiple parameters is possible; also the parameters are field programmable by the user.[1]

  2. PROPOSED SCHEME

    In this paper we proposed and design a speed control system of DC Motor by using CCP module of PIC microcontroller. This system would be able to control the DC motor speed at desired speed regardless the changes of load. The speed of DC motor depends on applied voltage, Armature current and applied load. For a given fixed load we can maintain a steady speed by pulse width modulation. By modulating the width of the pulse applied to the DC motor, the power applied to the motor can be increased or decreased and thereby increasing or decreasing the motor speed, output pulse width gets wider. The ability to control the speed of the DC motor using PWM is major reason that DC motor are preferred over AC motors.

  3. IMPLEMENTATION USING PIC CCP MODULE

    The proposed design has successfully been implemented on software and hardware both.

    Software implementation For software implementation of this project two software tools are required.

    • Proteus design suit

    • MikroC PRO

      Proteus is the most flexible and cost effective design solution for all simple and reasonably complex circuit designs. It is best suited for schematic design, PCB design and simulation. Proteus design suit combines the ISIS schematic capture and ARES PCB layout programs to provide a powerful, integrated and easy to use set of tools for professional PCB design. It includes an integrated shape based auto router and a basic SPICE simulation capability as standard.

      MikroC PRO for PIC is a full featured ANSI C compiler for PIC devices. It is used for compiling and debugging of C codes and developing HEX code for PIC microcontrollers. It features interactive IDE, powerful compiler with advanced , lots of hardware and software libraries and additional tools that helps the users.

      Fig 1 shows the circuit diagram for controlling the speed and direction of DC motor.

      Fig 1 Circuit design on Proteus

      PIC16F877A is the brain of this project.5V power supply is connected to pin no. 1 which is MCLR (Master clear)pin. Motor driving IC L293D is interfaced with microcontroller pin RB0 AND RB1 of port B. CCP1 pin of port C is connected to EN1 i.e. enable pin of L293D. A digital oscilloscope is also connected between two pins to see the output pulses generated by microcontroller. Two push button switches are used to increase/ decrease the speed of motor and a toggle switch is used to change the direction of rotation of DC motor. DC motor to is connected to the output pins of L293D and 12V supply is given to it to drive the motor.

      Hardware implementation Fig. 2 shows the block diagram for the experimental setup of speed control of DC motor. In input section a step down transformer is used to step down the supply voltage. This voltage is passed through a rectifier to get the DC voltage. Rectified input is given to the input terminal of voltage regulator to get the constant 5V DC voltage at the output.

      Fig 2: Block Diagram for Hardware Implementation Microcontroller is being used to control the complete system. To get the desired results microcontroller has been programmed. The HEX code of the program is burned into the microcontroller chip using a software called PIC KIT 2

      Output section contains a motor driving IC L293D. Input pins of this IC have been connected to the microcontroller where as output pins are connected to the DC motor. 12V battery is connected externally to the motor driver IC.

  4. IMPLEMENTATION OF PWM USING PIC16F877A

    CCP Module – PIC16F877A has two CCP Modules. Each module contains a 16 bit register (two 8-bit registers) and can operate in one of the three different modes, viz., 16-bit capture, 16-bit compare, or up to 10-bit Pulse Width Modulation (PWM). The details of the two modules (CCP1 and CCP2) are given as follows:

    1. CCP1 Module:

      CCP1 Module consists of two 8-bit registers, viz., CCPR1L (low byte) and CCPR1H (high byte). The CCP1CON register controls the operation of CCP1 Module.

    2. CCP2 Module:

    CCP2 Module consists of two 8 bit registers, viz., CCPR2L (Low byte) and CCPR2H (high byte). The CCP1CON register controls the operation of CCP2 Module.

    The following table indicates the timer resources for the CCP Mode.

    CCP Mode

    Timer Used

    Capture

    Timer 1

    Compare

    Timer 1

    PWM

    Timer 2

    Pulse Width Modulation – The Pulse-Width-Modulation (PWM) in microcontroller is used to control duty cycle of DC motor drive. PWM is an totally different approach to controlling the speed of a DC motor. Power is supplied to the motor in the form of square wave of constant voltage but modulating pulse-width or duty cycle. Duty cycle is defined as the percentage of one cycle during which duty cycle of a continuous train of pulses. Since the frequency is kept constant while the on time and off time is being varied, the duty cycle of PWM is determined by the pulse width. Thus the applied power increases duty cycle in PWM. The expression of duty cycle is obtained by:

    Flow Chart

    Fig 3 Waveform of PWM Signal

    Simulation Result at Very High Speed

    in S/W DSO

    H/W Result at Very High Speed on

    Laboratory DSO

    Simulation Result at High Speed in

    S/W DSO

    H/W Result at High Speed on

    Laboratory DSO

    Simulation Result at Medium Speed

    in S/W DSO

    H/W Result at Medium Speed on

    Laboratory DSO

  5. SUMMARY AND CONCLUSIONS

This paper has presented a model of speed control of DC motor using PIC microcontroller 16F877A. By varying the PWM signal from microcontroller, the speed of DC motor is controlled. The laboratory test results confirm that the model created to control the speed of DC motor is operated at different speeds by varying duty cycle of PWM signal. The proposed method for control reduces the number of components because the microcontroller can integrate in one package all the functions. Thus, the proposed technique suited for industrial applications. This project suggests a durable, accurate, reliable, and efficient way of speed control of DC motors.

REFERENCES

  1. Muhammad Ali Mazidi, Rolin D Mckinlay and Danny Causey PIC Microcontroller and Embedded Systems 2nd edition USA Pearson Education 2009

  2. Muhammad H. Rashid. Power Electronics Circuits, Devices and Applications. 3rd edition. United States of America: Prentice Hall. 2007.

  3. Rubayet Hosen & Khosru M.Salim,Design Implementation and Testing of a Three Phase BLDC Motor Controller, ICAEE 2013 Proceedings, December 2013, Dhaka ,Bangladesh

  4. S.A. Hamed, Performance Evaluation of Three Phase Variable speed DC drive systems with Uniform PWM Control, IEEE transactions on Powerelectronics,vol.12, no.2,March 1997

  5. G. K. Dubey, Fundamentals of Electrical Drives, 2nd edition ,Jan 2001

  6. Yedamale, P. Brushless DC (BLDC) Motor Fundamentals. Microchip Technology Inc. (2003).

  7. MICROCHIP. (2002). PIC16F8XA. Microchip Technology Inc.

  8. Yedamale, P. (2004). Brushless DC Motor Control Using PIC18FXX31 MCUs. Microchip Technology Inc.

[9] MICROCHIP. (2003). PIC18F2331/2431/4331/4431 Data Sheet.

Michrochip Techonology Inc.

  1. Badr Ghatasheh,DC motor bidirectional speed control using PWM, eproject, Jan 2012

  2. S. R. Bowes, M. J. Mount, Microprocessor Control of PWM Inverter, IEEE Proceedings, vol. 128, November 1981

  3. MikroElectronika,Software and Hardware Solutions for Embedded World

Leave a Reply