journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from...

8
Abstract - Stepper motors is the most useable tool applied in process control, machine tools and robotics. Especially in robotics and process control, it is necessary to control the stepper motor from a remote place. The radio frequency module is basically a PIC microcontroller based wireless communication system. The control switches are used to control the direction of stepper motors corresponding angle. The resolution of motors is 7.5 degree/step. The status of these switches is transmitted by using RF transmitter and receiver. The RF modules used in this project are KST ( Tx-01) transmitter and KST (Rx-706) receiver. The four switches are interfaced to the RF transmitter through the 16F877A PIC microcontroller. The microcontroller continuously reads the status of the switches, pass data through the RF transmitter displayed on LCD module and the transmitter transmits the data. At the receiving end, the RF receiver receives this data, gives to the microcontroller. The microcontroller reads the data and after processing, performs the corresponding action i.e., to rotate the motors clockwise and anticlockwise. 16x2 Liquid Crystal display (LCD) display is provided at the transmitter side to display the status of the stepper motors.L298N driver is . Min Chit Ko, Department of Electronics Engineering, Mandalay Technological University, (e-mail: [email protected]). Mandalay, Myanmar, 09-256169848 Kyaw Soe Lwin , Department of Electronics Engineering, Mandalay Technological University, Mandalay, Myanmar, 09- 5062554 (e-mail: [email protected]). used to drive the stepper motor. This project uses regulated 5V, 500mA power supply, and 12 V for motors driver supply. Index Terms16F877A PIC microcontroller, RF module, Stepper motor driver (L298N), Bipolar stepper motors I. INTRODUCTION . In the modern world of science and technology most of the industry is dependent on the robotics and computer related devices. One of such methods is performing a full rotation into a number of equal steps. Stepper motors are viewed as the electric motors without commutators. Commutator is a rotary electrical switch in certain types of electric motors or electric generators that periodically reverses the current direction between the rotor and the external circuit. A commutator is a common feature of direct current rotating machines.[3] In a motor all the windings are part of stator. The rotor is a permanent magnet or a tooth block of some magnetically soft material. The motor controller should handle all the commutation extremely. Audio frequencies are used to step most of the stepper motors. In such cases they spin quickly. They can be stopped and started at controlled orientations. Stepper motors are used in simple open loop control systems, suitable for the systems operating at low accelerations with static loads. A stepper over-torqued in an open loop system will result in losing all knowledge of rotor position and a re-initialization of system is required. In this project we have used RF modules in order to control the Design and construction of wireless two stepper motors control system based PIC microcontroller using RF module Min Chit Ko, Kyaw Soe Lwin

Transcript of journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from...

Page 1: journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from the Microchip Technology. The PICmicrocontroller architecture is based on RISC

Abstract - Stepper motors is the most useable tool applied in process control, machine tools and robotics. Especially in robotics and process control, it is necessary to control the

stepper motor from a remote place. The radio frequency module is basically a PIC microcontroller based wireless communication system. The control switches are used to control the direction of stepper motors corresponding angle. The resolution of motors is 7.5 degree/step. The status of these switches is transmitted by using RF transmitter and receiver. The RF modules used in this project are KST ( Tx-01) transmitter and KST (Rx-706) receiver. The four switches are interfaced to the RF transmitter through the 16F877A PIC microcontroller. The microcontroller continuously reads the status of the switches, pass data through the RF transmitter displayed on LCD module and the transmitter transmits the data. At the receiving end, the RF receiver receives this data, gives to the microcontroller. The microcontroller reads the data and after processing, performs the corresponding action i.e., to rotate the motors clockwise and anticlockwise. 16x2 Liquid Crystal display (LCD) display is provided at the transmitter side to display the status of the stepper motors.L298N driver is used to drive the stepper motor. This project uses regulated 5V, 500mA power supply, and 12 V for motors driver supply.

Index Terms—16F877A PIC microcontroller, RF module, Stepper motor driver (L298N), Bipolar stepper motors

I. INTRODUCTION

. In the modern world of science and technology most of the industry is dependent on the robotics and computer related devices. One of such methods is performing a full rotation into a number of equal steps. Stepper motors are viewed as the electric motors without commutators. Commutator is a rotary electrical switch in certain types of electric motors or electric generators that periodically reverses the current direction between the rotor and the external circuit. A commutator is a common feature of direct current rotating machines.[3] In a motor all the

.Min Chit Ko, Department of Electronics Engineering, Mandalay

Technological University, (e-mail: [email protected]). Mandalay, Myanmar, 09-256169848

Kyaw Soe Lwin , Department of Electronics Engineering, Mandalay Technological University, Mandalay, Myanmar, 09-5062554 (e-mail: [email protected]).

windings are part of stator. The rotor is a permanent magnet or a tooth block of some magnetically soft material. The motor controller should handle all the commutation extremely. Audio frequencies are used to step most of the stepper motors. In such cases they spin quickly. They can be stopped and started at controlled orientations. Stepper motors are used in simple open loop control systems, suitable for the systems operating at low accelerations with static loads. A stepper over-torqued in an open loop system will result in losing all knowledge of rotor position and a re-initialization of system is required. In this project we have used RF modules in order to control the system wirelessly from a remote area. We have designed hardware with transmitting and receiving capabilities. In order to program this hardware we have used visual basic or PIC Basic Pro language.

II. SYSTEM DESIGN

Overall block diagram of the present project is shown in Fig.1. From the block diagram it is clear that two PIC microcontrollers (16F877A) have been used, one is with transmitter side and the other is in the receiver side which may be located at 100 meters distance and connected through the RF (radio frequency) module. The system is used in four control switches. The two represent for rotation of motor A corresponding at clockwise and anticlockwise. The other represent for motor B similar to motor A. The microcontroller at the transmitter acts to encode the serial data and send to the RF transmitter.16x2 line LCD display is connected to the microcontroller to describe the status of switches on display. The other at the receiver acts to decode the serial data giving from the RF receiver. Two L298N motor drivers are interfaced with the microcontroller and two stepper motors for motor rotation.

Figure 1.System block diagram of the wireless two stepper motors control system

III. FUNCTIONAL REQUIREMENTS

Following are the main components of this project:

Design and construction of wireless two stepper motors control system based PIC microcontroller using RF

module

Min Chit Ko, Kyaw Soe Lwin

Page 2: journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from the Microchip Technology. The PICmicrocontroller architecture is based on RISC

1) RF Module2) 16F877A PIC Microcontrollers3) Stepper motors4) L298N motor drivers

1. RF module

Figure 2(a).RF transmitter ( KST-Tx01)

Figure 2(b). RF receiver (KST-Rx 706)

Features of RF module Range in open space(Standard Conditions) : 100 Meters RX Receiver Frequency : 433 MHz RX Typical Sensitivity : 105 Dbm RX Supply Current : 3.5 mA RX IF Frequency : 1MHz Low Power Consumption Easy For Application RX Operating Voltage : 5V TX Frequency Range : 433.92 MHz TX Supply Voltage : 3V ~ 6V TX Out Put Power : 4 ~ 12 Dbm

2. 16F877A PIC Microcontroller

The PIC 16F877A is the 14-bit instrction word mid-range microcontroller from the Microchip Technology. The PICmicrocontroller architecture is based on RISC (ReducedInstruction Set Computer) instruction set. The PIC 16F877A is a 40- pin device and is one of the popular microcontrollers used in complex applications.

The device offers 8192x14 fash program, 368 bytes of RAM , 256 bytes of non-volatile EEPROM memory, 33 I/O pins, multiplexed A/D converters with 10-bits resolution, PWM generator, 3 times, anologue capture and comparator circuit, USART, and internal and external interrupt facilities. The pin configuration of the PIC 16F877A is shown in Fig.3

Figure 3.PIC 16F877A

3. Stepper motor

Stepper motors operate differently from DC brush motors, which rotate when voltage is applied to their terminals. Stepper motors, on the other hand, effectively have multiple "toothed" electromagnets arranged around a central gear-shaped piece of iron. An external control circuit, such as a microcontroller, energizes the electromagnets. To make the motor shaft turn, first one electromagnet is given power, which makes the gear's teeth magnetically attracted to the electromagnet's teeth. When the gear's teeth are thus aligned to the first electromagnet, they are slightly offset from the next electromagnet. So, when the next electromagnet is turned on and the first is turned off, the gear rotates slightly to align with the next one, and from there the process is repeated. Each of those slight rotations is called a "step," with an integer number of steps making a full rotation. In that way, the motor can be turned by a precise angle.

Page 3: journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from the Microchip Technology. The PICmicrocontroller architecture is based on RISC

Figure.4 Bipolar stepper motor

Degree of rotation = Resolution x Number of pulses

Stepper motors are constant power devices. As motor speed increases, torque decreases. The torque curve may be extended by using

current limiting drivers and increasing the driving voltage.

Steppers exhibit more vibration than other motor types, as the discrete step tends to snap the rotor from one position to another.

This vibration can become very bad at some speeds and can cause the motor to lose torque.

The effect can be mitigated by accelerating quickly through the problem speeds range, physically damping the system, or using a micro-stepping driver.

Motors with a greater number of phases also exhibit smoother operation than those with fewer phases

4. Motor driver (L298N)

Figure.5(a) L298N motor driver

It is a high voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC and stepping motors. Two enable inputs are provided to Enable or disable the device independently of the input signals. The emitters of the lower transistors of each bridge are connected together and the corresponding external terminal can be used for the connection of an external sensing

resistor. An additional supply input is provided so that the logic works at a lower voltage.

Figure.5(b) L298N pins layout

5. Circuit diagram of the transmitter and receiver

Figure.6 Circuit diagram of transmitter

Figure.7 Circuit diagram of the receiver

IV. SOFTWARE IMPLEMENTATION FOR THE SYSTEM

To accomplish the system, the choosing of software is very important. All PIC microcontrollers require a program or software for their operation. This program is developed and

Page 4: journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from the Microchip Technology. The PICmicrocontroller architecture is based on RISC

tested by the programmer or users. The following software tools are normally required in a PIC microcontroller-based project development cycle:

A text editor PIC Basic Pro compilers PIC programmer device software

Micro Code Studio

Micro Code Studio is a powerful, visual Integrated Development Environment (IDE) with In Circuit Debugging (ICD) capability designed specifically for micro Engineering Labs PICBASIC and PICBASIC PRO compilers. This IDE also provides a syntax highlighted to PIC Basic or PIC Pro compilers so that the user and easily and very quickly compile programs.

.

PIC Basic Pro Language

In this project, PIC Basic and PIC Basic Pro languages are used to program PIC microcontrollers. BASIC is one of the oldest and widely known high-level programming languages. Both PIC Basic and PIC Basic Pro have been developed by Micro Engineering Labs Inc. PIC Basic is a low-cost compiler and aimed at the lower end of the market, mainly for students and programmers.

Flow Chart of the System

Figure.6 Flow Chart for the system

The system can be recognized easily by seeing the flow chart of the over all system shown in figure 2. At the start of the program, the input/output ports of the microcontroller are configured. The LCD drive mode is also set as 4-bit mode. The PIC microcontroller at transmitter side sends the serial data to the receiver via RF transmitter. The serial data input (or serial receive) is checked. If the serial data input is present, it is converted into parallel data format and received data is displayed on the LCD module. If the serial data input is not present, the program checks whether the switch is pressed or not. If the switch is not pressed, the program skips to the LCD display

section. The serial data is then converted into parallel data and displayed on the LCD module. If the .switch is pressed at one time, the motor corresponding rotates one step at 7.5 degree. If the switch is pressing, the motor continuously rotates one step at 7.5 degree until the switch is pressing. The program wait about one second to be conveniently displayed on the LCD module and the program is repeated as long as power is turned on.

V. SIMULATION RESULTS OF THE SYSTEM

The wireless stepper motor control system built based the PIC 16F877A microcontroller is simulated using Proteus software. Proteus consists of two main parts, ISIS and ARES. ARES is a layout package, which is used to create a PCB when the circuit has been designed. The schematic diagram of the main components of the wireless motor control system including the microcontroller circuit is drawn in the ISIS software and then run the simulator program. A screenshot of the ISIS schematic capture and the motor control simulation environment is shown in the following Figures.

Figure.8 The ISIS simulated screen of the wireless two stepper motor control system

Figure.9 The ISIS simulated screen of the system in data transmit and receive mode sending request “ motor A rotating clockwise”

Page 5: journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from the Microchip Technology. The PICmicrocontroller architecture is based on RISC

Figure.10 The ISIS simulated screen of the system in data transmit and receive mode sending request “ motor A rotating anticlockwise”

Figure.11 The ISIS simulated screen of the system in data transmit and receive mode sending request “ motor B rotating clockwise”

Figure.12 The ISIS simulated screen of the system in data transmit and receive mode sending request “ motor A rotating anticlockwise

VI. HARDWARE TEST

Figure.13 Hardware tesing result in data transmit and recive mode

Figure.14 Harding testing result in data transmit and receive mode sending request “motor A rotating clockwise”

Figure.14 Harding testing result in data transmit and receive mode sending request “motor A rotating anticlockwise”

Figure.14 Harding testing result in data transmit and receive mode sending request “motor B rotating clockwise”

Figure.14 Harding testing result in data transmit and receive mode sending request “motor B rotating anticlockwise”

Page 6: journal.doc · Web viewThe PIC 16F877A is the 14-bit instrction word mid-range microcontroller from the Microchip Technology. The PICmicrocontroller architecture is based on RISC

VII. CONCLUSION

In this project 16F877A PIC microcontroller and RF wireless technology has been used to position the shaft of the stepper motor at a desired angle which in turn may be used in deferent application areas. As conventional IR wireless system has short distance limitation. IR technology has been required at line of sight. RF technology can pass through many obstacles not required line of sight. That, , RF technology has been used here. It can more advance that and than other applications can be used such as robot technology, remote control systems, remote open door system, etc. Application of such control system of stepper motor in remote surveillance system is the future scope of this work.

REFERENCE

[1] Hausila Singh and Sudhansu Sharma, “Some Novel microprocessor based configurations for controlling Remotely Located stepper Motors as Actuators of control valves”, IEEE Transaction on industrial electronics, AUGUST 1991, 38(4), PP 283-287.

[2] Joao Neves Moutinho, Fernando David Mesquita, Nuno Martins and Rui Esteves Araaujo. “Progresses On The Design of a Surveillance System to Protect Forests from Fire”, IEEE Conference on Emerging Technologies and Factory Automation, 2, 16-19 Sept.2003, PP 191-194, 10.1109/ETFA.2003.1248696.

[3] D. Manojkumar, P. Mathankumar, E. Saranya and S. pavithradevi, “Mobile Controlled Robot using DTMF Technology for Industrial Application”, International Journal of Electronics Engineering Research, 2010, 2( 3), PP. 349-355.

[4] Stepping Motors and their Microprocessor controls, Takashi Kenjo, 1994