Last update: April 8, 2004. This circuit is still a work in progress! I modify and update and learn a ton of new things until I get in over my head. Then I take a break, work with the stuff I've learned until I actually *understand*, then come back and do some more work on it. Credit for most of this circuit is shared between the Electronics_101 list and the CAD_CAM_EDM_DRO list. The members of which, have been very helpful, very patient, and very knowledgable (did I mention patient?). Version 0.5 used 74HC245s to buffer the parallel port signals. I decided that this was just too risky and wanted to optoisolate the PC from the stepper board. That was back in October of '03. Version 1.0 uses ULN2803 Darlington arrays to buffer the parallel port signals and drive the LEDs of TLP624 optoisolators (Thanks Dave for opto suggestion!) I chose the '2803 mostly because its the only chip I know of that fit the bill - there could be much better choices out there! Some of the concepts behind the design. Motor supply sizing: Each A3977 can handle a motor up to 2.5A. Bipolar stepper motors draw an average current 2/3 of its rating. For three bipolar motors of 2.5A each, thats 5A. Capacitor: The formula for the capacitor is (80,000 * I)/V. The lower the voltage, the larger the capacitor needs to be. At my planned 25V and (max) 5A, thats 16,000uF. Add 10% for a safety margin and the closest is 18,000uF. The cap will be rated for at least 50 volts. Older parallel port outputs can't source more than a couple of milliamps while some (not all) of the newer ones can drive (source) a number of leds. Since you can't tell ahead of time, I nixed the idea of sourcing the optoisolators directly from the parallel port outputs. I thought of letting the parallel port sink the LED currents, it should handle that current no problem. However, many newer parallel ports are only 3.3 volts and some may not be 5V tolerant. If the port pin is 3.3v and I sink the current from a 5V source - there would be (roughly) 1.7V reverse voltage and about 1mA current being sunk by the output pin when its supposed to be sourcing. Too scary for me! With that in mind, I decided to source from the parallel port and drive a darlington. The darlington's high HFE means that even with a 3.3V, 1mA source capability, I can still sink the 15mA from a 5VDC source with no danger to the parallel port pin. Only question left is whether or not I need limiting resistors on the '2803 inputs. The parallel port input pins dont require buffering. They're normally high so all I have to do is pull them to ground. Easily accomplished since I can source plenty of current for the opto LED on the controller side of the board. One danger I had to address is what happens if the board is powered and the parallel cable isn't attached? I had to make sure that motors, spindle, and auxiliaries didn't suddenly turn on with no control over them. I used PNP transistors (pulled high to be absolutely sure) to power the relays. The PNP base goes to a '2803 pin. If the cable isn't attached then the '2803 input can't be high and the output won't sink current. The PNP is held off. The next danger is the limit switches. Again, I wanted to make sure nothing untoward would happen if a switch wasn't connected to the board. All switches are to be normally closed. Power is suppled to the opto LED through the switch so if the switch is activated or disconnected (open), the input would be high and the software would know about it. The emergency stop switch had the same concern as the limit switches (and is wired the same) but also has the additional concern of "what if the software crashes!". Personally, I don't want to trust software to turn off a router running at 30,000 RPM in an emergency situation. For this reason, I added a second relay in both the stepper motor supply and spindle control circuit. The relays are normally open so neither the steppers nor the spindle can run unless the E-Stop is connected and in the closed position. I am waffling on adding relays to the two auxiliary dry contacts. All I can think of that'd be on the auxiliary relays is a lubricant pump and vacuum... Both of which I'm not too concerned about. The software will still stop them when the E-Stop is hit anyway. If they stayed on, they wouldn't hurt anything. I went with a seperate transformer/bridge for the logic supply mostly for cost. 5A transformers are pricy enough, go over that and the price rises exponentially! It also let me have a 12V unregulated supply for the relays. Possibilities: Between the Darlington and the opto LEDs, the PWM output of the step signals aren't going to be very square. I could add some 7414 schmitt trigger chips after the opto's to sharpen up the square waves but, I'm not sure its required. If this were a different type of controller where I was in direct control of the motor supply transistors, I'd definately do it. I'm thinking though that the A3977 doesn't require hospital corners on its step input signal. Please, feel free to comment, suggest, or bash the design all you like!