Para Port - 4N25 - Stepper Driver?

Thread Starter

Pedrejo

Joined Apr 25, 2011
2
Hi All,

I'm working on a CNC project and am having trouble with 4N25 optocoupler. This circuit works fine if I connect my parallel port directly to the A4988 breakout board, but either doesn't work at all or, if I touch the floating resistor from pin 6 of the 4N25, is very sporadic and jerky. Sorry for the crazy schematic. I'm using an '04 Thinkpad to run EMC2.

Any suggestions for improvements would be greatly appreciated. What is the risk to my parallel port if I just connect the step/dir output directly, without isolation?

Thanks, Pedrejo
 

Attachments

shortbus

Joined Sep 30, 2009
10,045
In your schematic you show the input to the opto connected to both an Ardino and a computer? You can't use both at the same time. You show no connection to the 'enable' pin of the A4988 it needs to be tied either high or low (+5V or 0V) which ever you want to do.. You should get the data sheet and application notes for the A4988 and read them and make sure you have done every thing they call for.

On another note will the 4n25 switch fast enough for the speed you want to move the axis? I also don't think you should have any connection to the base of the opto transistor. A "floating resistor" will act like an antenna for stray signals from the motor wiring.
 
Last edited:

Thread Starter

Pedrejo

Joined Apr 25, 2011
2
Thanks for the reply.

In your schematic you show the input to the opto connected to both an Ardino and a computer? You can't use both at the same time. You show no connection to the 'enable' pin of the A4988 it needs to be tied either high or low (+5V or 0V) which ever you want to do.. You should get the data sheet and application notes for the A4988 and read them and make sure you have done every thing they call for.
The +5V input through the LED side of the opto was one of the schematics I saw. I should have mentioned that I also tried using the output from the port through a 330 Ohm resistor to pin 1 with pin2 to ground with the same results. But I was assuming a +5V output. Now that I know the output is +3V, I should maybe try a 180 Ohm resistor? Could that be the entire cause?

The emitter side (on the left) has a Vf of around 1.2v @10mA. Calculate your current limiting resistor R1 as:
Rlimit = (Vsupply - 1.2v)/10mA
So, if your V1 is either 5v or 0v, then:
Rlimit = (5v-1.2v)/10mA = 3.8/0.01 = 380 Ohms. Use the closest standard value, or use resistors in series or parallel to get 380 Ohms.
I'm not sure if I'm reading it right, but it looks like the schematic for the break out board shows the enable pin pulled down with a 100k resistor.

http://www.pololu.com/picture/0J3359.600.png

On another note will the 4n25 switch fast enough for the speed you want to move the axis? I also don't think you should have any connection to the base of the opto transistor. A "floating resistor" will act like an antenna for stray signals from the motor wiring.
With nothing connected to the base, I get zero movement. My stepper will follow the axis movement very roughly if I connect a 100k resistor to the base and hold the other end between my fingers.
 

shortbus

Joined Sep 30, 2009
10,045
Most breakout boards for CNC use a HCPL2631 or something similar. It will switch faster and provides a gain in the circuit, this allows the faster switching. The 4n25 and similar are fairly slow.

You haven't supplied any information about your stepper motor or motor power supply. Steppers don't like to, especially when coupled to the axis screw, go from a dead stop to near full speed, with out a 'ramp up' to that speed. Most steppers in CNC will need more than the 1 or 2 Amps this driver will give.

Please show a schematic of all your connections and the specs on the motor and power supply. And the speed and step size you are using.
 

CDRIVE

Joined Jul 1, 2008
2,219
With nothing connected to the base, I get zero movement. My stepper will follow the axis movement very roughly if I connect a 100k resistor to the base and hold the other end between my fingers.
This is what I would expect from a transistor that is forward biased but not in saturation. When you touch the 100k the base will be injected with hum. The positive going part of the hum will forward bias the transistor further.

Laptops don't typically come equipped with par ports any longer. Is this a real port or a USB/Parallel Port converter?
 
Top