Analog Encoder to Quadrature

MisterBill2

Joined Jan 23, 2018
18,590
In addition to needing a different comparator, to get both quadrature lines you will need both a zero-crossing detector and a peak detector for that single sine wave. Much more complex, really. Does your application really need direction information?
 

Thread Starter

metzenw

Joined Jan 3, 2021
7
MCP6562 + SN75176.
You may even find comparators with differential outputs.
I'll check those out, Thank you.

Are you in fact using one of the Heidenhain encoders, or similar type?

The encoder is off of a Fanuc Spindle motor. Below is out of a fanuc manual, showing the wave form.

View attachment 227026

It's an analog incremental encoder. its a 256 tooth (1024PPR) encoder.
Are there any markings on the actual encoder, the output almost appears to be a Heidenhain in nature.
The Fanuc part number is A290-0854-V350. That first picture is all the information I could find about the encoder. Fanuc doesn't like to share.
I've given The Brand, the Part Number, The encoder count, and a picture of what the output looks like. Do I need to tell you the color? The Smell? What information about this encoder have I not given you? I'm not trying to be a dick, but most of this thread has been off topic and repeat questions.
Also, Not a Heidenhain Encoder.

In addition to needing a different comparator, to get both quadrature lines you will need both a zero-crossing detector and a peak detector for that single sine wave. Much more complex, really. Does your application really need direction information?
Yes, I do need direction for this application as I'm controlling a motor that spins in both directions.
I found an AM26C31 Quad Differential Line Driver chip out of a spare encoder I have, which works beautifully. So that problem is solved.

**CURRENT PROGRESS**
I got my hands on a function generator to simulate the encoder. The circuit works well enough for what I'm doing. There is a lot of room for improvement, but one step at a time. I'll draw up a circuit diagram in a day or two.

The problem I have is the interference from the VFD running this motor destroys the signal, Can't even see it on the scope when the motor is running. This might kill the project as it stands. Since I'm only working with a Vpp of 500mv, building something that can handle the extreme EMI of a VFD is beyond my current skill level, and time restrain.
 

strantor

Joined Oct 3, 2010
6,798
.

The problem I have is the interference from the VFD running this motor destroys the signal, Can't even see it on the scope when the motor is running. This might kill the project as it stands. Since I'm only working with a Vpp of 500mv, building something that can handle the extreme EMI of a VFD is beyond my current skill level, and time restrain.
Are you:
1. using separate shielded cables for encoder and motor?
2. Properly grounding the shields at one end only (at the VFD)?
3. Properly grounding the motor and VFD to earth?
4. Routing the encoder and motor cables away from each other?

If this 500mV signal was sufficient for Fanuc then it should work for you too. It sounds to me like some EMI practices might not being followed.

If all that is good, then you might need to mount your device at the encoder rather than at the VFD.
 
Last edited:

Thread Starter

metzenw

Joined Jan 3, 2021
7
Are you:
1. using separate shielded cables for encoder and motor?
2. Properly grounding the shields at one end only (at the VFD)?
3. Properly grounding the motor and VFD to earth?
4. Routing the encoder and motor cables away from each other?

If this 500mV signal was sufficient for Fanuc then it should work for you too. It sounds to me like some EMI practices might not being followed.

If all that is good, then you might need to mount your device at the encoder rather than at the VFD.
Shielded encoder cable, but not motor cable. I've never seen Fanuc shield their motor cables. Mitsubishi/Mazak does on new stuff.
I played with grounding the shield of the encoder cable. EMI gets twice as worse if I ground it to either the motor or VFD. It's best when its not hooked up. Which I find weird.
Motor and VFDF are properly grounded.
I'm doing this in a benchtest environment, so the encoder cable is as far away from the VFD as possible.

For shits and giggles I Unplugged the encoder from the motor. With it at least 3 feet from the vfd/motor i still get a fair amount of EMI. This VFD is crazy noisy.

I got a line reactor, for grins and giggles im gonna test it. see if that changes anything.
 

MisterBill2

Joined Jan 23, 2018
18,590
The PWM motor signal is much stronger than the encoder signal. So the encoder signal wires and shield must not be grounded at all on the motor end, because even on the motor frame the PWM and motor noise are far greater. The input circuit for that encoder signal needs to also be isolated from ground as well,
 

MisterBill2

Joined Jan 23, 2018
18,590
I have observed that at least one company DOES seriously shield the power wires to their the drive motor. AND the drive package has a separate compartment for the noise filtering section. so filtering the power to the motor is a good idea as well. Of course, the filter chokes for the 10HP motor were bigger than the ones for smaller drives. So keeping the noise away from the motor will reduce the amount that you need to shield against.
And on another machine that used a smaller VS drive for much smaller pumps T had to electrically isolate the whole pressure transducer to get rid of the noise. That meant a non-metal coupling in the pipe to the pressure sensor, and still lots of shielding on all of the wires, both drive and sensor.
 

strantor

Joined Oct 3, 2010
6,798
Shielded encoder cable, but not motor cable. I've never seen Fanuc shield their motor cables. Mitsubishi/Mazak does on new stuff.
What Fanuc does/did is probably appropriate for the Fanuc drives/amps that they used. You're using something else. Shielded motor cables are always a good idea when working with VFDs. More than a good idea; a thumb rule. I'm fairly confident that this all or most of your issue.
 

MisterBill2

Joined Jan 23, 2018
18,590
Shielded twisted pair cable, shield grounded only at the controller box end, and making sure that the encoder output is not grounded at the motor end. One more thing, what about the encoder power connection? ALL optical encoders need power for the light source, and that power should be in a separate pair, also shielded. OR, is it a magnetic pickup encoder, not optical???
 

strantor

Joined Oct 3, 2010
6,798
https://www.google.com/url?sa=t&sou...FjAMegQIYxAB&usg=AOvVaw0gsFhQHSQsjsiaeAW5QwUM

They say to ground the motor cable shield at both ends, and signal cable at only the drive end. I have seen that guidance in other white papers as well. I have seen the suggestion to ground the motor cable only at the drive in still more whitepapers. I would suggest trying both. But the point is, you really need a shielded cable.
 

MaxHeadRoom

Joined Jul 18, 2013
28,700
Shielded twisted pair cable, shield grounded only at the controller box end, and making sure that the encoder output is not grounded at the motor end. One more thing, what about the encoder power connection? ALL optical encoders need power for the light source, and that power should be in a separate pair, also shielded. OR, is it a magnetic pickup encoder, not optical???
I have used encoders of Many Many makes over the last 5 decades and cannot remember a version that required a separate light source for the LED?
With only one exception, that was an original Farrand scale (early 60's - 70's) that used an incandescent lamp source!
I have previously posted a paper published by Siemens that extol equi-potential (ground) bonding of a machine in order to eliminate ground loops, if this is done, both ends of shielded cables can be grounded.
In the case of VFD's to motor, it occurs anyway where such as metallic flexible conduit is used from VFD to motor, thus grounding occurs at both ends.
If running individual TEW/MTW wire to motor, the 3 phases should be twisted along its length with the ground conductor ran alongside.
Max..
 
Last edited:

MisterBill2

Joined Jan 23, 2018
18,590
If the device is really an optical encoder, then it has some light source and some kind of optical sensors. And most light sources require an external power supply for the illumination. So how would that internal light source be powered, if not through a wire or two? I was not intending to imply an external light source, but somehow power gets to the internal source, if it is an optical encoder.
Magnetic encoders are different.
My point being that the power source wires must also be shielded. I was not at all suggesting a separate light source.
 
Last edited:

BobaMosfet

Joined Jul 1, 2009
2,113
I'm still learning this stuff. Making some progress.
So I got an LM2903N chip and have it wired as shown.
View attachment 228341
It appears to work, but the rise time is higher then I want at around 5us with a 15k Resistor.



View attachment 228342
I switched to a 4.7k resistor and it dropped to 2us. This I can work with.

So, my next goal is to turn it into a differential signal. I'll update with my progress on that.
How fast a pull-up resistor works is determined by how much current is passes. A lower-value resistor allows more current to flow, so pull-up response will be faster. You can calculate how much current your pull-up is continually drawing, which will give you an idea of your margin between it working, and it simply overriding.
 

MisterBill2

Joined Jan 23, 2018
18,590
You need a lower value pullup resistor to get the faster speed with that comparator. The alternative is a faster device than the 2903. At 5 volts perhaps a 5K resistor to get the faster speed.
 
Top