Friday, December 27, 2013

PC Based Wireless Stepper Motor control Circuit

Stepper motors find lots of applications in process control, machine tools and robotics. Especially in robotics and process control, bit is necessary to control the stepper motor from a remote place. Here you will get the transmitter and receiver circuit diagrams and Full source code for the application program.

Here we describe how to wirelessly control a stepper motor from a remote place by using RF modules. For this wireless stepper-motor control system, you need to design and develop the required hardware and software. The parallel port of the PC is used to control the direction of the stepper motor at the transmitter side. RF interface is used instead of IR to overcome all the drawbacks of the IR interface. The PC signals are transmitted from the RF transmitter and received by the RF receiver.

Working Of the Wireless Stepper Motor controller

Block Diagram : 
Figure 1.block diagram for PC-based wireless control of a stepper motor.

Fig. 1 shows the block diagram for PC-based wireless control of a stepper motor. The signals from the parallel port of the PC are interfaced to the RF transmitter through an encoder. The encoder continuously reads the status of the relay switches, passes the data to the RF transmitter and the transmiter transmits the data. At the receiving end, the RF receiver receives this data and gives it to the decoder. The decoder converts the single-bit data into four-bit data and presents to the stepper-motor driver. Now, the driver per-
forms the corresponding action, i.e., it rotates the stepper motor clockwise or anticlockwise.

Remote control: For remote control, we have used the Holtek encoder-decoder pair of HT12E and HT12D. Both of these are 18-pin DIP ICs.

Operation of Holtek HT12E and HT12D :  HT12E and HT12D are CMOS ICs with a working voltage r a n g e o f 2.4V to 12V. 

Encoder HT12E has eight address and another four address/data lines. The data set on these twelve lines (address and address/data lines) is serially transmitted when transmit-enable pin TE is taken low. The data output appears serially on DOUT pin. It is transmitted four times in succession. The data consists of differing
lengths of positive-going pulses for ‘1’ and ‘0,’ the pulse width for ‘0’ being twice the width of the pulse
for ‘1.’ The frequency of these pulses may lie between 1.5 and 7kHz depending on the resistance value between OSC1 and OSC2 pins. The internal oscillator frequency of decoder HT12D is 50 times the oscillator frequency of  encoder HT12E. The values of timing resistors connected between OSC1 and OSC2 pins of HT12E and HT12D, for the given supply voltages, can be found out from the graphs given in the datasheets of the respective chips. The resistance values used in the circuits are chosen here for approximately 3kHz frequency of the encoder (HT12E) at Vcc of 9V and 150 kHz of the decoder (HT12D) at Vcc of 5V.

The HT12D receives the data from the HT12E on its DIN pin serially. If the address part of the data received
matches the levels on A0 through A7 pins four times in succession, the valid transmission pin (VT) is taken high. The data on pins AD8 through AD11 of the HT12E appear on pins D8 through D11 of the HT12D. Thus the device acts as a receiver of 4-bit data (16 possible codes) with 8-bit addressing (256 possible channels).

Once the frequency of the pair is aligned, then on ground of any data pin of the encoder, LED1 of the decoder should glow. You can also check the transfer of data on pins AD8 through AD11, which is latched to D8 through D11 pins of the decoder once TE pin is momentarily taken low by grounding it through diodes D1 through D4.

RF transmitter and receiver:  RF transmitter and receiver modules from Alpus India, Mumbai, have been used for RF remote control. The RF transmitter TX-433 is AM/ASK type. 

Fig 4: Circuit diagram of transmitter for wireless stepper motor control : Click on image to enlarge


Transmitter: Fig. 4 shows the circuit of the transmitter for wireless stepper motor control. The receiver address to be transmitted can be set with the help of 8-way DIP switch SW1. When any of the switch contacts is open the respective pin will be at logic 1, and when any of the switch contacts is closed the respective pin will be at logic 0. The data pins are pulled high via resistors R2 through R5. When pin 2 of the parallel port goes high, transistor T1 is driven into saturation and relay RL1 energises. Pin 10 (AD8) goes low through relay RL1 contacts and a ‘0’ is sent at that data position, while other data pins repre-sent logic-1 state. The logic circuitry at the receiver-decoder end decodes the data appropriately for controlling the
stepper motor.

 
Fig 7: Circuit diagram of receiver-cum-decoder for wireless stepper motor control. : Click on image to enlarge

Receiver and decoder : Fig. 7 shows the circuit of the receiver-cum-decoder for wireless stepper motor control. Assuming that identical address is selected on the encoder and decoder, when any of the data pins of the PC’s parallel port on the transmitter side is low, the corresponding data pin of the decoder will go low. The data outputs (D8 through D11) of HT12D are fed to inverters N1 through N4, which, in turn, are connected to driver ULN2003. The low output of ULN2003 drives the stepper motor. When any data is received, valid transmission (VT) pin goes high to drive transistor T5 into saturation and LED1 lights
up.

Software to control the stepper motor

The software program for the user interface to control the stepper motor is written in ‘C’ language. The signals are generated by the outport( ) function. The speed of rotation of the stepper motor can be varied by changing the argument of the delay( ) function. Direction of rotation (clockwise or anticlockwise) depends on the switch function.When the program (WSTEPPER.C) is loaded and run, the screen shows the welcome message. Pressing any key will lead to the main screen. The main screen displays three messages. Pressing ‘c’ key rotates the stepper motor in clockwise direction, while pressing ‘a’ key rotates the stepper motor in anti-clockwise direction. The program can be terminated by pressing ‘q’ key.

Click here to download the C program for controlling stepper motor.

PARTS LIST

Semiconductors:
  • IC1   - HT12E Holtek encoder
  • IC2   - 7806, 6V regulator
  • IC3   - HT12D Holtek decoder
  • IC4   - CD40106 hex inverter
  • IC5   - ULN2003 Darlington array
  • T1-T4   - BC547 npn transistor
  • T5   - BC548 npn transistor
  • D1-D4   - 1N4148 switching diode
  • D5-D10   - 1N4007 rectifier diode
  • TX1   - TX-433 RF transmitter
  • RX1   - RX-433 RF receiver
  • LED1   - 5mm LED
Resistors (all ¼-watt, ±5% carbon):
  • R1   - 1-mega-ohm
  • R2-R5   - 10-kilo-ohm
  • R6-R9   - 1.2-kilo-ohm
  • R10   - 1-kilo-ohm
  • R11   - 47-kilo-ohm
  • R12   - 3.9-kilo-ohm
  • R13   - 470-ohm
Capacitors:
  • C1, C3   - 100µF, 16V electrolytic
  • C2   - 0.1µF ceramic disk
  • C4   - 10µF, 16V electrolytic
Miscellaneous:
  • BATT.1   - 9V battery
  • BATT.2   - 6V, 4.5Ah battery
  • S1, S2   - On/off switch
  • DIP-SW1,
  • DIP-SW2  - 8-way DIP switch  
  •   - 25-pin D-type male 
  •     connector

Courtesy : Electronics For You : www.efymag.com

Custom Search

1 comments:

David Nwonye said...

Good project..
I'd love to make improvements as to control with arduino.

Post a Comment

Related Posts with Thumbnails
 
Technology blogs & blog posts Technology blogs .CO.NR Free Domain Alitu.com - General Website Directory
Powered by Blogger