Electronic Rotary Table Divider V2.1 Construction 2006,2013 Steve Ward (steve@worldofward.com)
Legal: All documents, code, schematics, firmware etc are offered as an aid to the experienced constructor to allow them to build their own division controller. I offer no warranty either express or implied, i.e. you build and operate this device at your own risk. In building and operating this device you accept that there may be bugs or other problems both with the hardware, its associated firmware and documentation that may cause it to function in a manner that could possibly cause injury. None of the documentation, hardware design or software either in whole or part may be used for commercial purposes. Any re-distribution of this material must contain the original material in its original form; no charge may be made for its distribution.
Getting Started Decided on whether you want to build using a PCB or strip board. (If using strip board read the document 'StripboardConstruction.pdf'. The PCB is easiest however a number have been successfully built on strip board and the circuit has no special requirements that would make this difficult. The 18F452 micro-controller this project is built around are blank when purchased, so you will need some method of programming it. If you don't know anyone a number of cheap programmers are available on ebay for these chips and a suitable.hex file is provided along with these documents to allow you to do this. In order to complete this project you will also have to provide a suitable stepper motor and driver for the hardware you hope to use, along with suitable couplings. There are a myriad of cheap Chinese steppers and drivers available these days. I would recommend a Nema23 sized 200 step 1 to 2A stepper for a typical 4 to 8 rotary table and upwards from there for anything larger. The driver should accept step and direction inputs, the current output can be whatever suits the motor you're using (or higher). As a rule look for drivers that can have a supply voltage in excess of 20v, low voltages will give poor results and are often an indicator of poor drivers. For power when driving a small 6 ish table I would use a 19v laptop power supply of suitable amperage. These are cheaply available as surplus and can provide power both for the divider and the motor / controller. If using anything higher than 24v I would use a separate 12v 'wall wart' type supply for the divider and whatever is suitable for your desired motor/controller.
Controller Connections Step and Direction Outputs. These connect to the stepper motors controller. They are 5v TTL level outputs which can drive most typical controllers directly. The polarity of each is settable in the dividers setup. Active Output. Set whenever the motor is moving. Polarity can be switched in setup. Note that this can create accumulative errors with some controllers especially in micro-step mode. Since most modern controllers now have built in intelligence to allow them to reduce the holding current without any other handshaking it may be better to ignore this in most installations. Limit Inputs. The two inputs provide soft stops, one in a clockwise and one in an anticlockwise direction. These operate by pulling to ground however there is no isolation provided on board so if they are to be used in an electrically dirty environment I'd strongly suggest they are run through some isolation circuitry. Sense and Acknowledge These are provided to facilitate connecting the divider to either another divider or other equipment (PLC etc.). Acknowledge provides a open collector signal to indicate the table is moving. In program mode a special command is provided to pull this line low. Sense provides an input which can be used to instigate an action on the divider, it's activated by pulling low, holding and then releasing. This triggers the equivalent of next [>>] in normal operations. In program mode a special command is provided which waits upon a sense event. Power As designed the divider expects an input to the voltage regulator of 8-30v DC. Due to current pulled a small heatsink is advised, at the higher voltages a heatsink is a must! This supply can be provided from the same source as that connected to the controller/stepper (within the voltage constraints) or be separately provided with a suitable wall-wart type supply.
Parts List Part Number Qty Value Notes C1, C2 2 33pF C3, C4 2 100nF Decoupling spread liberally. C5 1 470uF VR1 1 10k Preset Contrast control R1, R2, R3, R4 4 10k Keypad pull downs IC1 1 18F452 Pre-programmed with firmware. IC2 1 7805 And small heatsink. 40 pin IC 1 For PIC 18F452 Socket Xtal 1 10Mhz Keypad 1 4 x 4 Matrix Farnell 1171224 (or 16 buttons ) LCD 1 4line x 20column HD44780 compatible Available for around 5 on ebay. (Aprox size 97mm x 59mm, view window 76mm x 25mm). PCB 1 Or stripboard construction. 8 Pin SIL 1 Only if using Farnell keypad. socket Connector 1 4 pin 2.54 pitch Can solder wires instead. Case 1 To suit (case I used is Farnell 775-319) Power supply 1 8 30v To suit stepper/stepper controller. If using typical 2A stepper then a 24v laptop psu is ideal. If stepper controller has own supply then any small DC wall-wart will do. Parts used for Beeper LS1 1 Passive sounder Passive sounder of the type fitted to computer motherboards. Q3 1 BC337 NPN transistor (500mA IC) R5 1 4k7 D2 1 BYV27 Any fast switch diode Parts used for sense / acknowledge D1 1 BYV27 Any fast switch diode Q1, Q2 2 BC337 NPN transistor (500mA IC) R8, R9 2 4k7 R6, R7, R10, 4 10k R11 Connector 1 5/6 pin 2.54 pitch Can solder wires instead
Notes for Parts Parts are easily available and non-critical. In general if there's room for it it'll be OK. However make sure the PIC 18F452 is a 40 pin DIP they come in various flavours. The LCD is a 20 character by 4 line (20x4) HD44780 compatible display. These are available most places, ebay being a good source (search HD44780 and look for 20x4 variants). The physical size varies, any will work but if you want it to mate neatly with the PCB take note of the size given in the list. I've used a stick on keypad from Farnell for my keypad, but in practise any set of 16 buttons wired in a 4x4 array can be used and would probably be more robust. It's good practice to provide a small heatsink for the 5v regulator (IC2). This doesn't need to be too large although as with all heatsinks the larger the better. A heatsink can be fabricated from aluminium once the device is completed. Alternatively if the device is fitted into a metal box, mounting the regulator on the box with fly leads to the PCB may be well worth considering.
Order of Construction The actual order of construction is unimportant. However as a rough guide. Fit any links. Fit socket for IC1. Fit IC2, C3, C4, C5 to provide the 5v power supply. This can be tested by applying power and checking the output of the supply is 5v. Fit the clock circuitry, Xtal, C1, C2. If the display is connected to the PCB using a flylead or plug and socket then attach the display. Fit contrast control VR1. Insert pre-programmed PIC into IC1 socket. This can be tested by applying power, splash screen should be shown. (Adjust VR1) Fit keypad pull downs R1, R2, R3, R4. Fit any sockets used for connectors. Fit beeper components. Fit sense / acknowledge components.
Faults Experience shows that nearly all problems are due to the following. Improperly programmed PIC. See 'programming' PIC section. Incorrect PIC. Supported PIC type is 18F452, double check this. Bad wiring between PIC and LCD. Test this by removing PIC and LCD (if possible). Referring to circuit diagram check with a multimeter that each pin on the PIC is connected to the correct pin on the LCD. Common faults are bad solder joints and hairline crack in PCB track. Check that none of the pins has a short circuit to any other. Common faults are solder bridges or tracks that didn't completely etch through when making the PCB. Incorrectly set contrast. (Even I've fallen for this!) Bad power. Check for 5v on the output of the 7805 (pin 3), is the LCD backlight on?? Check for 5v on the appropriate pins of IC1 - in particular check for 5v on pin 1 (this would stop the PIC from resetting on power up). As a rule if you're getting black blocks on the LCD then suspect programming and wiring. If all else fails then call for help on the thread on CNCZone