machine#designs_in_progress: CNC: bus CNC Device BusA 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. fig.1 module with wrong address
| | | | | | | | | | | | | | | |_|_|_|_|_| | |_|_|l|_|_| | | | |
| | | | | | | | | | | | | | | | | |l| | | | | | | | | | | | | |
| | | | | | | |_|_|0|_|_|_| | | | | | | | | | | | | | | | | | |
fig 2.module with correct address
| | | | | | | | | | | | | | | |_|_|_|_|_| | |_|_|l|_|_| | | | |
| | | | | | | | | | | | | | | |L|_|R|_|j| | |L|_|_|_|j| | | | |
| | | | | | | |_|_|1|_|_|_| | | | | | | | | | | | | | | | | | |
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 |