ISSN: 2754-4915 | Open Access

Journal of Material Sciences & Manufacturing Research

Stepper Motor Controlled by Pic 16F84 Microcontroller

Author(s): Awafung Emmanuel Adie*, Faithpraise Fina, Wilson Ibu and Paul Anyin

Abstract

Background: Most times in engineering and other fields, engines need to be transformed from one form to another, in circuits and most components we are familiar with, electrical engines, impulses, digital information and etc needs to be changed from one level to another, this is done by a motor, be it in any kind, pending on the desired function. This literature review examines various research that has been done using the PIC 16F84 microcontroller for the control of stepper motors. The PIC 16F84 is a popular choice for stepper motor control applications due to its simplicity, low cost, and ease of programmability.

This review highlights several key control techniques that have been implemented using the PIC 16F84, including full-step mode, half-step mode, closedloop control with position feedback, and speed control. The peripheral interfacing aspects are also discussed, covering the integration of stepper motor driver circuits, rotary encoders, and user interface components. The firmware development approaches for the PIC 16F84 are explored, demonstrating how researchers have programmed the microcontroller’s digital I/O, timers, and interrupts to precisely control the stepper motor windings and respond to feedback signals. While the PIC 16F84 has proven to be a capable platform for stepper motor control, the review also identifies some limitations, such as the microcontroller’s restricted resources and potential scalability challenges as the complexity of the control system increases. Suggestions for future research include exploring more advanced microcontrollers, integrating the PIC 16F84 with additional hardware, and developing more sophisticated control algorithms to enhance the performance and robustness of the stepper motor control systems.

Conclusion: The CMOS circuit stands as drive circuit between the PIC IC and the stepper motor which provides the precision in advance control methods of designs and production.

Introduction

A stepper motor is a motor that converts digital information to mechanical motion. The principles of operation of stepper motor have been known since 1920s, However their application have been a dramatic raise since with the increase use of digital computers. Stepper motors as the name implies or suggest, rotates in a district step and their position can be controlled by means of logic signals. Stepper motors have number of special features that make them particularly useful in practical applications, perhaps the most important feature is that the angel of rotation is directly proportional to the number of input impulses, furthermore the angel error per step is very small and does not accumulate. Stepper motors are also capable of starting, stopping and reversing commands and can be driven directly by digital signals. Another important feature is that it has a self-hold capability that makes it possible for the rotor to be held in stop position without the use of brakes. A wide range of rotating speed is proportional to the frequency of the pulse signal may be attained in these motors [1].

Driving a stepper motor with the peripheral interface controller (PIC) Integrated circuit (IC) requires a lot of work, these include working with signal codes in Hex and repositioning the datasheet instructions to suit your command, writing a program for the signal control and off-course executing the program base on your commands, details of these will be shown as we move on with the review [2]. The control of stepper motors using microcontrollers has been a widely researched and implemented topic in the field of mechatronics and industrial automation. The PIC 16F84 microcontroller, developed by microchip Technology, has been a popular choice for such applications due to its simplicity, versatility, and widespread availability.

Stepper motors have been widely used in various applications, such as 3D printing, CNC machines, and robotics, due to their ability to provide precise positional control [3]. The PIC 16F84 microcontroller, a popular 8-bit microcontroller from Microchip Technology, has been a common choice for implementing stepper motor control due to its simplicity, low cost, and wide availability [4]. One of the early works in this area was presented by Rashid and Haque, who described the design and implementation of a PIC 16F84-based stepper motor control system [5]. They discussed the interfacing of the stepper motor with the PIC 16F84 using an L293D motor driver IC and provided the necessary firmware algorithms for controlling the motor’s speed and direction.

Mohan et al. expanded on this concept by developing a PIC 16F84-based system for controlling a bipolar stepper motor [5,6]. They highlighted the importance of the motor driver circuit and provided a detailed analysis of the step sequence generation using the microcontroller’s timer module and I/O pins.

In a more recent work, Reddy et al. presented a PIC 16F84- based stepper motor control system with an additional feedback mechanism using an incremental encoder [7]. This approach allowed for closed-loop control and improved positioning accuracy, which is crucial in applications such as CNC machining and robotic manipulators. Furthermore, Karaka? and Çetinkaya explored the use of the PIC 16F84 microcontroller for controlling a unipolar stepper motor [8]. They compared the performance of different step sequencing algorithms and demonstrated the implementation of speed and direction control using the microcontroller’s peripherals. While the PIC 16F84 has been a popular choice for stepper motor control, the limitations of its hardware resources, such as the relatively low clock speed and limited memory, have led researchers to explore more powerful microcontroller options. For instance, Bhattacharya et al. presented a stepper motor control system using the PIC18F4550 microcontroller, which offers improved performance and additional features [9].

Stepper Motor Basics

Stepper motors are a type of brushless DC motor that can rotate in discrete steps, allowing for precise control of position and speed. They are commonly used in applications that require accurate positioning, such as robotics, CNC machines, and printers [10]. Thus, a stepper motor is an electromechanical device, which converts electrical pulses into discrete mechanical movements. The shaft or spindle of a stepper motor rotates in discrete step increments when electrical command pulses are applied to it in the proper sequence. The motors rotation has several direct relationships to these applied input pulses. The sequence or the applied pulses is directly related to the direction of motor shafts rotation. The speed of the motor shafts rotation is directly related to the frequency of the input pulses and the length of rotation is directly related to the number of input pulses applied. The PIC 16F84 is an 8-bit microcontroller that features a range of on-chip peripherals, including digital I/O, timers, and interrupts. It is known for its low cost, small footprint, and ease of programming [11]. The microcontroller’s versatility makes it a suitable choice for stepper motor control applications

Stepper Motor Types

There are three basic stepper motor types. Variable-reluctance, Permanent-magnet and Hybrid

Variable-Reluctance (VR)

This type of stepper motor has been around for a long time. lt is probably the easiest to understand from a structural point of view. Figure 1 shows a cross section of a typical V.R. stepper motor. This type of motor consists of a soft iron multi-toothed rotor and a wound stator. When the stator windings are energized with DC current the poles become magnetized. Rotation occurs when the rotor teeth are attracted to the energized stator poles.

img

Analysis

The operation of the variable reluctance stepper motor with a salient pole rotor is simpler than that of the permanent magnet (PM) type because the rotor is not magnetically polarized and therefore it’s not necessary to have bipolar current to achieve the desire rotor motion.

The current excitation sequence for VR stepper motor and the input for sa, Sb, Sc, Sd and the rotor position is given as shown in the table below.

SA

SB

SC

SD

ROTOR POSITION

1

0

0

0

00

1

1

0

0

45o

0

1

0

0

900

0

1

1

0

1350

0

0

1

0

1800

0

0

1

1

225o

0

0

0

1

2700

1

0

0

1

3150

1

0

0

0

3600

Permanent Magnet (PM)

Often referred to as a “tin can” or “can stock” motor, the permanent magnet stepper motor is a low cost and low-resolution type motor with typical step angles of 7.5° to 15°. (48-24 steps/revolution) PM motors as the name implies have permanent magnets added to the motor structure. The rotor no longer has teeth as with the VR motor. Instead, the rotor is magnetized with alternating north and south poles situated in a straight line parallel to the rotor shaft. These magnetized rotor poles provide an increased magnetic flux intensity and because of this the PM motor exhibits improved torque characteristics when compared with the VR type.

img

Stepper Motor Control Techniques

They are several control techniques that have been implemented using the PIC 16F84 microcontroller for stepper motor control:

Full-Step Mode: In this mode, the windings of the stepper motor are energized in a specific sequence to rotate the motor in full steps. Abhinav and Surendra (2015) demonstrated the implementation of full-step control using the PIC 16F84 [12].

Half-Step Mode: This mode involves energizing the windings in a different sequence to achieve smaller, half-step rotations of the stepper motor. Abhinav and Surendra also explored the half-step control algorithm in their work [12].

Closed-Loop Control: Memon et al. incorporated a rotary encoder into their PIC 16F84-based system to provide position feedback, enabling closed-loop control of the stepper motor’s position. This approach ensures accurate positioning of the motor [13].

Speed Control: In addition to position control, some studies have focused on controlling the speed of the stepper motor. Abhinav and Surendra demonstrated speed control algorithms using the PIC 16F84 microcontroller [12].

Peripheral Interfacing

The various peripheral interfaces used in the PIC 16F84-based stepper motor control systems:

Stepper Motor Driver Circuit: The PIC 16F84 microcontroller is typically interfaced with a dedicated stepper motor driver circuit, such as the L293D or ULN2003, to provide the necessary current and voltage levels for driving the stepper motor windings (Premkumar & Manikandan, 2014) [10].

Rotary Encoder: As mentioned earlier, Memon et al. used a rotary encoder to provide position feedback for closed-loop control of the stepper motor [13].

Display and User Interface: Some studies have incorporated additional peripheral devices, such as LCD displays or buttons, to provide a user interface for monitoring and controlling the stepper motor [12].

Firmware Development

Researchers have developed custom firmware for the PIC 16F84 microcontroller to implement the stepper motor control algorithms. This includes programming the microcontroller’s digital I/O, timers, and interrupts to precisely control the energization of the stepper motor windings and respond to user inputs or feedback signals [10].

Stepper Motor Control using PIC 16F84

Several researchers have explored the use of the PIC 16F84 microcontroller for controlling stepper motors. Premkumar and Manikandan presented a design for a stepper motor control system using the PIC 16F84, which included the development of the control firmware and the interface with a stepper motor driver circuit [10]. Their work demonstrated the feasibility and effectiveness of the PIC 16F84 for such applications. In another study, Abhinav and Surendra (2015) developed a PIC 16F84-based system for controlling the speed and direction of a stepper motor [12]. They implemented various control algorithms, such as full-step and half- step modes, and showcased the microcontroller’s ability to provide precise control over the stepper motor’s operation. Memon et al. presented a PIC 16F84-based system for controlling the position of a stepper motor [13]. Their design incorporated feedback from a rotary encoder to achieve closed-loop control, ensuring accurate positioning of the motor. The authors demonstrated the potential of the PIC 16F84 for applications requiring precise position control.

Advantages and Limitations

The use of the PIC 16F84 microcontroller for stepper motor control offers several advantages, such as its low cost, small size, and ease of programming. However, the microcontroller’s limited on- chip resources, such as memory and processing power, may pose challenges in more complex control applications or when dealing with high-speed or high-torque stepper motors [1]. While the PIC 16F84 has proven to be a suitable choice for stepper motor control applications, they are some limitations of the microcontroller: Limited Resources. The PIC 16F84 has relatively limited on-chip resources, such as memory and processing power, which may pose challenges in more complex control applications or when dealing with high-speed or high-torque stepper motors [1]. In Scalability, as the complexity of the control system increases, the PIC 16F84 may not be able to handle all the requirements, and researchers may need to explore more powerful microcontrollers or other control platforms.

The Cmos Circuit Stands as Drive Circuit Between the Pic Ic and the Stepper Motor

The use of a CMOS (Complementary Metal-Oxide-Semiconductor) circuit as the drive circuit between a PIC (Programmable Interface Controller) microcontroller and a stepper motor is a common approach in many stepper motor control applications. The CMOS circuit, typically in the form of a motor driver IC, plays a crucial role in interfacing the low-power control signals from the PIC microcontroller to the high-current, high-voltage requirements of the stepper motor. One of the early works in this area was presented by Rashid and Haque, who utilized the L293D motor driver IC, a widely used CMOS-based H-bridge circuit, to drive a stepper motor from a PIC 16F84 microcontroller [5].

The L293D provided the necessary current amplification and motor phase sequencing, allowing the PIC microcontroller to control the speed and direction of the stepper motor. In a similar vein, Mohan et al. employed the ULN2003A Darlington array, another CMOS-based motor driver IC, to interface a bipolar stepper motor with a PIC 16F84 microcontroller [6]. The ULN2003A provided the necessary current handling capability and the required phase sequencing logic to control the stepper motor. Karaka? and Çetinkaya further explored the use of CMOS-based driver circuits for unipolar stepper motor control with a PIC 16F84 microcontroller [8]. They compared the performance of different driver configurations, including the L293D and the ULN2003A, and discussed the trade-offs between power dissipation, output current, and control complexity. More recently, Bhattacharya et al. presented a stepper motor control system using the PIC18F4550 microcontroller and the L298N H-bridge driver IC, another CMOS- based motor driver [9]. They highlighted the importance of the driver circuit in providing the necessary current and voltage levels to the stepper motor, while the PIC microcontroller handled the step sequencing and control algorithms. The use of CMOS-based driver circuits in PIC microcontroller-based stepper motor control systems offers several advantages. CMOS technology provides high noise immunity, low power consumption, and the ability to handle the relatively high current and voltage requirements of stepper motors. Additionally, the integration of motor driver functions, such as current amplification and phase sequencing, into a single IC simplifies the interface design and reduces the overall complexity of the control system.

One of the most commonly used CMOS-based driver circuits for this application is the L293D H-bridge IC, as mentioned in the work by [5]. The L293D is a quad half-H-bridge motor driver capable of providing bidirectional current of up to 600 mA per channel.

The L293D has four half-H-bridge circuits, each of which can be used to drive one phase of a bipolar stepper motor. The inputs to the L293D are the control signals from the PIC microcontroller, which determine the direction and stepping sequence of the stepper motor.

When the PIC microcontroller sends the appropriate logic signals to the L293D inputs, the driver circuit amplifies the current and voltage to the levels required by the stepper motor coils. This allows the low-power PIC microcontroller to effectively control the high-power stepper motor.

Mohan, S., Mohan, R., & Saravanan, C. used the ULN2003A Darlington array, another CMOS-based motor driver IC, to interface a bipolar stepper motor with a PIC 16F84 microcontroller [6]. The ULN2003A provides seven Darlington-connected transistor pairs, each capable of driving loads up to 500 mA. PIC microcontroller’s output signals are directly connected to the inputs of the ULN2003A, which then amplifies the current to drive the stepper motor coils. The use of these CMOS-based driver ICs, such as the L293D and ULN2003A, simplifies the interface between the PIC microcontroller and the stepper motor, as they handle the necessary current amplification and phase sequencing. This allows the PIC microcontroller to focus on the high-level control algorithms without having to directly manage the power requirements of the stepper motor.

Future Research

Future research in this area could focus on addressing these limitations, such as: Investigating the use of more advanced PIC microcontrollers or other microcontroller families for stepper motor control applications.

Exploring the integration of the PIC 16F84 with additional hardware components, such as FPGAs or DSPs, to enhance the control system’s capabilities.

Developing more sophisticated control algorithms, such as adaptive or optimal control strategies, to improve the performance and robustness of the stepper motor control system.

By addressing these areas, researchers can further expand the capabilities and applications of the PIC 16F84-based stepper motor control systems.

Conclusion

Demonstrates the widespread use of the PIC 16F84 microcontroller for stepper motor control applications. Researchers have explored various aspects of the interface design, firmware development, and performance optimization, highlighting the versatility and cost- effectiveness of this microcontroller-based approach. However, as the demands for more sophisticated stepper motor control continue to grow, the exploration of newer and more powerful microcontroller platforms remains an active area of research and development. The review highlights the significant research and practical applications of using the PIC 16F84 microcontroller for stepper motor control. The studies also demonstrate the microcontroller’s suitability for a wide range of applications, including robotics, CNC machines, and industrial automation. While the PIC 16F84 may have limitations in certain high-performance scenarios, it remains a viable and cost-effective solution for many stepper motor control applications. The widespread use of CMOS-based motor driver circuits, such as the L293D, ULN2003A, and L298N, as the interface between PIC microcontrollers and stepper motors. These driver circuits play a crucial role in providing the necessary power amplification and control signals to the stepper motor, allowing the PIC microcontroller to effectively manage the motor’s operation [14-28].

References

  1. Bolton W (2015) Mechatronics: Electronic Control Systems in Mechanical and Electrical (6th ed) Pearson https://www.academia.edu/50094972/Mechatronics_Electronic_Control_Systems_in_Mechanical_and_Electrical_Engineering_Sixth_Edition_by_William_Bolton.
  2. Rizzon Glorgio (2004) Principles and Applications of Electrical Reuced Forth Edition New York McGraw Hill https://books.google.co.in/books/about/Principles_and_Applications_of_Electrica.html?id=hmX_5Xl4EvgC&redir_esc=y.
  3. kenjo T, Sugawara A (1994) Stepping motors and their microprocessor controls. Monographs in Electrical and Electronic Engineering 27: 1-255.
  4. Microchip Technology Inc (2001) PIC16F84A Data Sheet https://ww1.microchip.com/downloads/en/DeviceDoc/35007b.pdf.
  5. Rashid MH, Haque ME (2004) PIC 16F84 based stepper motor In Proceedings of the IASTED International Conference on Robotics and Applications 191-195.
  6. Mohan S, Mohan R, Saravanan C (2012) Microcontroller based bipolar stepper motor control. International Journal of Computer Applications 39: 35-39.
  7. Reddy VV, Babu TS, Rao KS (2015) PIC16F84A microcontroller-based stepper motor control with encoder feedback. In Proceedings of the 2015 International Conference on Control Instrumentation, Communication and Computational Technologies (ICCICCT) 810-815.
  8. Karaka? E, Çetinkaya N (2015) Design and implementation of a PIC16F84 microcontroller-based unipolar stepper motor control Advances in Electrical and Computer Engineering 15: 97-102.
  9. Bhattacharya S, Majumder S, Banerjee A (2017) PIC18F4550 microcontroller-based stepper motor control. In Proceedings of the 2017 8th Annual Industrial Automation and Electromechanical Engineering Conference (IEMECON) 49-54.
  10. Premkumar K, Manikandan BV (2014) Stepper Motor Control Using PIC Microcontroller. International Journal of Innovative Research in Electrical, Electronics, Instrumentation and Control Engineering 2: 1095-1099.
  11. Mazidi MA, Mazidi JG, McKinlay R D (2007) The 8051 Microcontroller and Embedded Using Assembly and
  12. Pearson https://www.iust.ac.ir/files/ee/pages/az/mazidi.pdf.
  13. Abhinav, Surendra M (2015) Speed and Direction Control of Stepper Motor Using PIC Microcontroller. International Journal of Innovative Research in Electrical, Electronics, Instrumentation and Control Engineering 3: 42-45.
  14. Memon AA, Memon MU, Memon SA, Memon ZA (2018) Position Control of Stepper Motor using PIC16F84A Microcontroller and Rotary Encoder. International Journal of Advanced Computer Science and Applications 9: 283-288.
  15. Bipolar Digital Integrated Circuits Data Book for Design Bolton W (2015) Mechatronics: Electronic Control Systems in Mechanical and Electrical (6th ed) Pearson https://www.academia.edu/50094972/Mechatronics_Electronic_Control_Systems_in_Mechanical_and_Electrical_Engineering_Sixth_Edition_by_William_Bolton.
  16. Bradley David (1994) Basic Engineering Power and Machine. London https://taylorfrancis.com/books/mono/10.1201/9780203742709/power-electronics-david-allan-bradley.
  17. Draper A (1991) Electrical Machines. London Longman https://books.google.co.in/books/about/Electrical_Machines.html?id=0C9qAAAAMAAJ&redir_esc=y.
  18. Edimister, Joseph  (1987)  Schaum’s  outline  Series Electric circuit. USA: McGraw Hill https://www.accessengineeringlibrary.com/binary/mheaeworks/6c65aa57e8600866/222e9f4307d2e8405a3c877a79b5cccfbeca0c1c310bad0a05f71e78ed28142e/book-summary.pdf.
  19. Bill Davies (2000) Electric Motors and Mechanical Devices: For Hobbyist and Engineers. Werd Technology https://biblio.com/book/electric-motors-mechanical-devices-hobbyists-engineers/d/1186793385.
  20. Elektor Elektuur 1996 Collections CDROM, January 1996 edition, Simple Stepper Motor Controller Hughes, Edward (1972) Electrical Technology London; Longman https://google.co.in/books/about/Electrical_Technology.html?id=snZuAAAAMAAJ&redir_esc=y.
  21. The Engineering Staff of texas instruments incorporated Semiconductor Group (1981) Interface Circuits. Texas Instrument http://www.bitsavers.org/components/ti/_dataBooks/1981_TI_The_Interface_Circuits_Data_Book_for_Design_Engineers_2ed.pdf.
  22. Lepage WR,Seely S (1952) General Network USA McGraw Hill https://www.abebooks.com/book-search/author/lepage-wilbur-samuel-seely/.
  23. Maddock RJ, Calcutt DM (1991) Electronics A Course for Engineers. USA Longman https://search.worldcat.org/title/electronics-a-course-for-engineers/oclc/712478475.
  24. James J Barbarello (1997) PC Hardware Projects. Prompt Publications, Howard W Sams and Co 2: 224.
  25. John Iovine (2003) A True Beginner’s Guide to The Popular PIC Microcontroller. McGraw Hill https://books.google.in/books/about/PIC_Microcontroller_Project_Book.html?id=EXTTnsdHH5cC&redir_esc=y.
  26. Rohit Metita, Melita VK (2006) Principles of Electronics. India S Chand and Company Cirnital https://books.google.in/books/about/Principles_of_Electronics_LPSPE.html?id=vjscEAAAQBAJ&redir_esc=y.
  27. Theraja AK, Theraja BL (2003) Electrical Technology. India Chand and Company Cirnital https://books.google.in/books/about/A_Textbook_of_Electrical_Technology.html?id=1lR701DFtaMC&redir_esc=y.
  28. Waterworth G (1988) Electronics. London Macmillan https://holycross.edu/Record/b3247755?sid=184580.
  29. Yorke R (1986) Electronic Circuit Theory. New York Pergomon https://books.google.co.in/books/about/Electric_html?id=tCfEQgAACAAJ&redir_esc=y.
View PDF