Single ended spindle encoder (5i25+7i76)
12 Jul 2016 11:52 #77335
by Chibs
Single ended spindle encoder (5i25+7i76) was created by Chibs
Good afternoon! First time posting here & rather new to LinuxCNC (But not to Linux).
I've build my controller and everything bar the encoder seems to be working. Spindle motor turns nicely, but no feedback. Meanwhile, every time I hook up the encoder it blows up, so clearly I'm doing something wrong. Could this have anything to do with software configuration (I simply checked the single ended encoder option in PnCConf) or am I wiring it wrong?
The spindle encoder is very bare and simple: Two light barrier sensors (optocouplers) and a perforated disk. One with 100 pulses, one with 1 (Index). Now, I wired the mas follows down to 4 wires: +5VP from the 7i76 to diode #1 +, which is connected in series to diode #2 and then to ground on the 7i76. That same +5vp is connected to both the phototransitor + poles, whose negatives are connected as the signal of these to the 7i76 encoder inputs (A+ and IND+).
Cheers & sorry for the inconvenience.
I've build my controller and everything bar the encoder seems to be working. Spindle motor turns nicely, but no feedback. Meanwhile, every time I hook up the encoder it blows up, so clearly I'm doing something wrong. Could this have anything to do with software configuration (I simply checked the single ended encoder option in PnCConf) or am I wiring it wrong?
The spindle encoder is very bare and simple: Two light barrier sensors (optocouplers) and a perforated disk. One with 100 pulses, one with 1 (Index). Now, I wired the mas follows down to 4 wires: +5VP from the 7i76 to diode #1 +, which is connected in series to diode #2 and then to ground on the 7i76. That same +5vp is connected to both the phototransitor + poles, whose negatives are connected as the signal of these to the 7i76 encoder inputs (A+ and IND+).
Cheers & sorry for the inconvenience.
Please Log in or Create an account to join the conversation.
12 Jul 2016 12:00 #77336
by andypugh
Replied by andypugh on topic Single ended spindle encoder (5i25+7i76)
The LEDs almost certainly need a current-limiting resistor (which is probably why they are blowing up).
What is the current rating of the LED section of the opto-sensor?
What is the current rating of the LED section of the opto-sensor?
The following user(s) said Thank You: Chibs
Please Log in or Create an account to join the conversation.
12 Jul 2016 12:05 #77337
by Chibs
Replied by Chibs on topic Single ended spindle encoder (5i25+7i76)
Thanks for your response. The forward current is 60mA. A resistor would make a lot of sense.
Would it be okay if the resistor would be before the +5vp connects to both the LED and phototransistor? Would make it a lot easier to wire up.
Would it be okay if the resistor would be before the +5vp connects to both the LED and phototransistor? Would make it a lot easier to wire up.
Please Log in or Create an account to join the conversation.
12 Jul 2016 13:05 #77338
by andypugh
Replied by andypugh on topic Single ended spindle encoder (5i25+7i76)
What is the part number? It's hard to guess what is needed.
But: the LED-end of the resistor will be at exactly the LED forward-voltage, which will be around 1.8 volts. Not enough to count as a logic "true", so I don't think that's a good idea.
The resistor could go in the LED negative return, if that is more convenient.
But: the LED-end of the resistor will be at exactly the LED forward-voltage, which will be around 1.8 volts. Not enough to count as a logic "true", so I don't think that's a good idea.
The resistor could go in the LED negative return, if that is more convenient.
The following user(s) said Thank You: Chibs
Please Log in or Create an account to join the conversation.
12 Jul 2016 13:13 #77339
by Chibs
Replied by Chibs on topic Single ended spindle encoder (5i25+7i76)
It's two of
KTIR0221DS
. I'll have a try with 180 Ohm resistor on the negative.
Please Log in or Create an account to join the conversation.
12 Jul 2016 13:26 #77340
by andypugh
Replied by andypugh on topic Single ended spindle encoder (5i25+7i76)
You could wire +5V to pin 4 then link it to pin 1 with the resistor.
180 ohms sounds right for 5V supply. However as you are using a 7i76 you could use 24V field voltage and gain some noise immunity.
www.farnell.com/datasheets/1519843.pdf?_...269462443.1468329604
Also shows a pull-up on the output on the last page.
180 ohms sounds right for 5V supply. However as you are using a 7i76 you could use 24V field voltage and gain some noise immunity.
www.farnell.com/datasheets/1519843.pdf?_...269462443.1468329604
Also shows a pull-up on the output on the last page.
The following user(s) said Thank You: Chibs
Please Log in or Create an account to join the conversation.
12 Jul 2016 15:09 - 12 Jul 2016 15:12 #77343
by Chibs
Replied by Chibs on topic Single ended spindle encoder (5i25+7i76)
Well, I have it wired this way currently, but still no success. Diodes did not die this time, however, so that points the problem elsewhere now.
Regarding the pull-up resistor, doesn't the 7i76 have internal pull-ups for all inputs? The current scheme is;
+5vp to to the + of phototransistor 1, 170 Ohm resistor to the + of the diode, in series to the next diode and to ground, the same +5vp in parallel to the + of phototransistor 2 and the - of both phototransistors to Encoder A+ and Encoder IDX+.
I'm seeing most phototransistors being hooked up differently though, so perhaps I'm doing it wrong. Should the negative of the phototransistor go to both ground AND the encoder input?
I'm using 12v for the field voltage and the cable is grounded, short cable. I'm not super worried about noise for now.
Thank you for your time.
Regarding the pull-up resistor, doesn't the 7i76 have internal pull-ups for all inputs? The current scheme is;
+5vp to to the + of phototransistor 1, 170 Ohm resistor to the + of the diode, in series to the next diode and to ground, the same +5vp in parallel to the + of phototransistor 2 and the - of both phototransistors to Encoder A+ and Encoder IDX+.
I'm seeing most phototransistors being hooked up differently though, so perhaps I'm doing it wrong. Should the negative of the phototransistor go to both ground AND the encoder input?
I'm using 12v for the field voltage and the cable is grounded, short cable. I'm not super worried about noise for now.
Thank you for your time.
Last edit: 12 Jul 2016 15:12 by Chibs.
Please Log in or Create an account to join the conversation.
12 Jul 2016 15:53 #77345
by andypugh
Replied by andypugh on topic Single ended spindle encoder (5i25+7i76)
Sorry, I forgot that the encoder input is 5V. Ignore that suggestion.
Can you see a voltage change at the 7i76 input pin when you move the disc through the sensor?
Can you see a voltage change at the 7i76 input pin when you move the disc through the sensor?
The following user(s) said Thank You: Chibs
Please Log in or Create an account to join the conversation.
12 Jul 2016 16:03 #77346
by Chibs
Replied by Chibs on topic Single ended spindle encoder (5i25+7i76)
No, I cannot. I'm thinking the phototransistor must be improperly wired, as now with the resistors the diodes ought to work just fine (Unless wiring them in series causes some issues, but I don't see how, it's no different from two LEDs). Both diodes still respond to a diode tester on a multimeter.
I have two thoughts currently:
1: Should the phototransistor + side go to both ENC + and ground?
2: Am I wrong connecting +5VP to the + of the phototransistor and into ENC +, alternatively being ENC + into phototransistor + and the phototransistor - to ground?
I have two thoughts currently:
1: Should the phototransistor + side go to both ENC + and ground?
2: Am I wrong connecting +5VP to the + of the phototransistor and into ENC +, alternatively being ENC + into phototransistor + and the phototransistor - to ground?
Please Log in or Create an account to join the conversation.
12 Jul 2016 16:28 #77347
by andypugh
Yes, because that means that the ENC+ is always +5V
You need a resistor such that the phototransistor can pull the voltage down to < 2V with only 10mA or so of current.
Replied by andypugh on topic Single ended spindle encoder (5i25+7i76)
2: Am I wrong connecting +5VP to the + of the phototransistor and into ENC +
Yes, because that means that the ENC+ is always +5V
You need a resistor such that the phototransistor can pull the voltage down to < 2V with only 10mA or so of current.
The following user(s) said Thank You: Chibs
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.081 seconds