machine#designs_in_progress: CNC: bus
Notice:
this project is crap crap crap and has been deprecated and probably will get deleted soon. It's largely been replaced by the iskewb architecture.

CNC Device Bus  

A Bus picks up information at the bus station and drops it off at a bus stop. But really it looks more like a road.

The circuit described below should in theory allow you to control up to 16 devices (steppers, servos, encoders) while using only one parallel port. We'll see how it performs in the end.

I saw this circuit somewhere on the internet once. It's gone now, but the idea remains.

Take one parallel port. There are 8 data out pins, 4 data in pins. (check this) Re-wire the wires coming off your data cable so that it makes sense, i.e. pins 1-4 are data pins. These pins could be for stepper motor step sequences, step/direction pulses, blinking LED's, coolant/spindle/tool change, whatever. They go to the inputs of a latch, whose outputs are connected to some type of output device. (darlington array, LED's, etc) Pins 5-8 are address pins. They are used to select (in binary) a number from 0 to 15. This is accomplished by going through a logical comparator with inputs set by a mini DIP switch or soldered in. The output pin of the comparator goes to the reset pin on the latch.

In operation, the computer outputs the data along with the right address to get data (step sequences etc) to where it's supposed to go (motor #5).

Example time: The computer puts out "1100" on the data lines, and "0101" on the address lines (that's number 5 in decimal) but the module address is set to 1001. (that's 9 in decimal.) See fig 1.
The comparator rejects it and the latch retains its previous values.

fig.1 module with wrong address
The comparator returns zero (false) and the latch retains its previous values.
Please forgive my pathetic ascii art.

BusComparatorLatchOutputBus
X

| | | | | | | | | | | | | | | |_|_|_|_|_| | |_|_|l|_|_| | | | |

*1--1---------l-x-l--l-T-l---*
*2--1---------l-x-l--l-T-l---*
*3--0---------l-x-l--l-T-l---*
*4--0---------l-x-l--l-T-l---*
L_R_jL___j

| | | | | | | | | | | | | | | | | |l| | | | | | | | | | | | | |

/-------/

| | | | | | | |_|_|0|_|_|_| | | | | | | | | | | | | | | | | | |

*5--0-l-?1-l-----------------*
*6--1-l-?0-l-----------------*
*7--0-l-?0-l-----------------*
*8--1-l-?1-l-----------------*
L____l

fig 2.module with correct address
The comparator returns 1 causing latch to reset. Latch assumes values on data lines (lines 1-4).

BusComparatorLatchOutputBus
12

| | | | | | | | | | | | | | | |_|_|_|_|_| | |_|_|l|_|_| | | | |

*1--1---------l-1-l--l-T-l---*
*2--1---------l-1-l--l-T-l---*
*3--0---------l-0-l--l-T-l---*
*4--0---------l-0-l--l-T-l---*

| | | | | | | | | | | | | | | |L|_|R|_|j| | |L|_|_|_|j| | | | |

l
/-------/

| | | | | | | |_|_|1|_|_|_| | | | | | | | | | | | | | | | | | |

*5--S0-l-?0-l-----------------*
*6--S1-l-?1-l-----------------*
*7--S0-l-?0-l-----------------*
*8--S1-l-?1-l-----------------*
L____j

Now, make 16 of those puppies and set all the address switches to unique values. 16 is the maximum because we have 4 address lines and 2*2*2*2=16. You can string them along a ribbon cable like on a SCSI bus, or you can run cables to each board. They could all be on the same board, for all I care. I prefer modular construction because of its flexibility and robustness. You can swap out a module if it gets busted, or if you have some neat idea and want to prototype it on your already functional system without spending $$$ on bunches of chips. When you want to step motor 1, output 0001 to the address ports and your step sequence to the data lines. Or, if you want to get tricky, you can add another latch pointing the other direction and selectively get data inputs, allowing for another 16*4=64 bits of input data, all on one parallel port!!!

If you don't have enough speed, you can drop the number of modules down to increase the amount of time per module. Anyone know the maximum reliable output rate of a parallel port? (probably varies depending on date, type of computer)

I hope you like this idea as much as I do. I will post a circuit when I develop one that works (probably never knowing my luck with electronics) or you can develop one yourself and post the circuit diagram here for everyone else to see.

by fenn


Front page   Diff Backup Reload   List of pages Search Recent changes   Help   RSS of recent changes
Last-modified: Sat, 24 Feb 2007 13:54:45 GMT (1417d)
The Gingery Machines wiki is published under the
Creative Commons Attribution-Share Alike 2.5 License Creative Commons License