Odd encoder/counter anomaly

Thread Starter

strantor

Joined Oct 3, 2010
6,798
Yesterday I was troubleshooting an issue with a Durant counter and a rotary encoder. The encoder was coupled to an acme screw and the counter was used to indicate linear position of the apparatus that moves along the ball screw. The machine hadn't been ran in over a year, and it was unknown whether it had ever worked with the Durant counter that was installed. The counter looked newer than the machine.

The issue was that it was very inconsistent. You tell it to go 10", and it might go 10", or it might go 8", or 16." I scoped the encoder signal, and this is what I saw:

Encoder channel A, bite taken out of one side:


Encoder channel B, bite taken out of the other side:


Both encoder channels:


So with the bites taken out of the channels, the counter has very little margin of error to resolve direction, and I suspect that while travelling in one direction, it may have been counting up sometimes and down sometimes.

I disconnected the encoder channels from the counter and scoped them again, and I had nice, clean square waves. So I deduced that the problem was with the counter. I theorized that for whatever reason, the counter's input impedance was too low, and was pulling down the edges of the square waves. I added 2KΩ pull-up resistors at the counter terminals (in parallel with the existing 2KΩ pullup resistors internal to the encoder) and then the waves looked better, but only slightly better, and that was "enough" to make it work.

Does my theory sound right? Could too low of input impedance cause this? My theory doesn't explain why only the corners of the waves are bitten off, and not the whole top of the wave chopped off.

Supporting information: It is believed that the Durant counter is a refurbished unit, and it is unknown when/by whom it was installed or refurbished. It is possible that it may have input circuitry bandaids that we don't know about.
 

Attachments

MaxHeadRoom

Joined Jul 18, 2013
28,686
What is the make type of encoder, it would be nice to find out the nature of the output, either push-pull or open collector usually for non-differential (RS420) types.
Something appears amiss in the wave form shape.
If you scope them without connected to the counter and you get a full 5v waveform, then it most likely is not going to be open collector?
In any case it appears it does not like something in the counter?
Max.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,798
What is the make type of encoder, it would be nice to find out the nature of the output, either push-pull or open collector usually for non-differential (RS420) types.
Something appears amiss in the wave form shape.
If you scope them without connected to the counter and you get a full 5v waveform, then it most likely is not going to be open collector?
In any case it appears it does not like something in the counter?
Max.
The encoder had no dataplate. I tested to verify type, by measuring resistance between +V of the encoder and the encoder channel, and got 2KΩ on each channel. So to me, that says it's open collector, with 2KΩ pull-up resistors.
 

ErnieM

Joined Apr 24, 2011
8,377
I wish your third oscillograph had the waves separated vertically so I could be sure which was which... looks to me the signal is low when just one output is high, when both are high you get the stronger signal.

Since this only happens when the counter is connected it sounds like a loading issue to me. The signal may be powering the counter, at least the input section. When one is high that one supplies all the current, both on they share and you get a "better" voltage out. That's basically what you said with "too low of input impedance."

Do you have the specs of the encoder and the counter? How much current can one supply and the other need?

Could be one is broke, could be all you need are lower resistors to make things right.

Also, you could add some simple transistor inverters to square things up. Someone check me here, but I thin a simple inverter for each would work as long as you swap A & B (to get the correct direction).
 

Thread Starter

strantor

Joined Oct 3, 2010
6,798
I wish your third oscillograph had the waves separated vertically so I could be sure which was which... looks to me the signal is low when just one output is high, when both are high you get the stronger signal.

Since this only happens when the counter is connected it sounds like a loading issue to me. The signal may be powering the counter, at least the input section. When one is high that one supplies all the current, both on they share and you get a "better" voltage out. That's basically what you said with "too low of input impedance."

Do you have the specs of the encoder and the counter? How much current can one supply and the other need?

Could be one is broke, could be all you need are lower resistors to make things right.

Also, you could add some simple transistor inverters to square things up. Someone check me here, but I thin a simple inverter for each would work as long as you swap A & B (to get the correct direction).
I don't have specs. The encoder didn't have a dataplate, and I can't find the manual for the outdated counter online. There was a counter manual on the job site, and it showed a diagram of the counter connected to an encoder, with 2k-ohm pullup resistors inside the encoder. I measured the encoder pullup resistors to be 2K-ohm. So IMO it was connected exactly per the instructions and met the criteria and should have worked without issue.

I'm no longer at the job site, and it was working when I left. This is more a matter of curiosity than a call for help. But I appreciate the suggestion; I will keep the transistors in mind, and if I get called back out there, I will try it out. fingers crossed; I hope my pullup resistors keep it going for a good while. I DID explain to the customer that it was a band-aid, and that he might want to order another refurbished counter to keep as a spare in case this one fails.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,798
Or a couple of Schmitt triggers, although it should not really come to that?
A photo of the encoder I might recognize it?
Max.
I didn't take a pic, but it is the generic 2"X2"X2" ("box") encoder (ex.), sold under several brand names, with very wide range of specs. I have seen them branded Red Lion, Accucoder, Danaher, Carotron, et. al.
 

Sensacell

Joined Jun 19, 2012
3,447
Looks like a short between phase A and B?

Output drivers fighting over the output levels?

That would account for the wave shape, and the fact that it's clean when the encoder is tested in isolation.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,798
Looks like a short between phase A and B?

Output drivers fighting over the output levels?

That would account for the wave shape, and the fact that it's clean when the encoder is tested in isolation.
On first consideration of this, it seems to me that if the 2 channels were shorted together, we would see both channels come on at the same time; the bite taken out of one channel would be imposed onto the other channel. But it isn't; it's just gone. But not knowing what kind of input circuitry is in the counter, I can't say that with any certainty. Maybe channels could be shorted together somewhere in there, in such a way that it doesn't affect the actual signal in such a way to indicate a short.
 

THE_RB

Joined Feb 11, 2008
5,438
The two encoder sensors will be open-drain pull-down (when illuminated).

So their HI level is determined by 3 things;
1. pullup resistor to encoder power +supply
2. ability of encoder +supply to supply current
3. load

So it could be that the encoder + supply is quite wimpy (or is overcurrent protected) and cannot supply enough current for one open-drain output to be fully ON (LO) without dropping the +supply voltage.

You can test this easily by checking the encoder +supply voltage as you turn the encoder. (The +supply voltage is the rail where your pullup resistors attach, it may be separate in some way from the +supply to the two encoder LEDs).

Using lower value pullup resistors will probably not fix this! You need to reduce the loading caused by your counter, and/or increase the ability of the encoder +supply to source current.
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
The two encoder sensors will be open-drain pull-down (when illuminated).

So their HI level is determined by 3 things;
1. pullup resistor to encoder power +supply
2. ability of encoder +supply to supply current
3. load
.
Output can be one of approx three, there are three typical outputs used, RS420 (differential), Push-Pull and Open collector, also 5vTTL and 24vdc.
The sensor itself is hardly ever used direct, and would consist of two sine waves, and is squared up internally by schmitt trigger etc.

Looking at the waveforms again, isn't the amplitude correct when both waveforms are high or the time they coincide?

Max.
 

Thread Starter

strantor

Joined Oct 3, 2010
6,798
Output can be one of approx three, there are three typical outputs used, RS420 (differential), Push-Pull and Open collector, also 5vTTL and 24vdc.
In my experience, open collector 12-24V encoders have been BY FAR the most common (~95%). I've never seen an RS420 encoder, only once maybe have I seen 5VTTL. I have never seen a PNP with pull-down either (that I know of).

The sensor itself is hardly ever used direct, and would consist of two sine waves, and is squared up internally by schmitt trigger etc.
Why sine waves? An LED shines through a rotating slotted disk onto a phototransistor; why would that create a sine wave?

Looking at the waveforms again, isn't the amplitude correct when both waveforms are high or the time they coincide?

Max.
Yes.
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
In my experience, open collector 12-24V encoders have been BY FAR the most common (~95%). I've never seen an RS420 encoder, only once maybe have I seen 5VTTL. I have never seen a PNP with pull-down either (that I know of).


Why sine waves? An LED shines through a rotating slotted disk onto a phototransistor; why would that create a sine wave?


Yes.
In the field of servo's and CNC control, 5v RS420 5v differential and single ended push pull, all 5v is most certainly the most common.

With an inductor sensor or Photo cell, the field or the light intensity gradually intensifies as the sensor approaches the target or window, reaches a peak and then decreases as the sensor moves out of the window.
In the case of a quadrature encoder this results in two sine wave 90° apart, these sine waves are often used to increase the resolution in low res encoders by using the arc-tangent function extracted from the two sine waves, the likes of Heidenhain encoder use this predominantly with their encoders in the subsequent electronics.
Max.
 
Last edited:

Thread Starter

strantor

Joined Oct 3, 2010
6,798
In the field of servo's and CNC control, 5v RS420 5v differential and single ended push pull, all 5v is most certainly the most common.

With an inductor sensor or Photo cell, the field or the light intensity gradually intensifies as the sensor approaches the target or window, reaches a peak and then decreases as the sensor moves out of the window.
In the case of a quadrature encoder this results in two sine wave 90° apart, these sine waves are often used to increase the resolution in low res encoders by using the arc-tangent function extracted from the two sine waves, the likes of Heidenhain encoder use this predominantly with their encoders in the subsequent electronics.
Max.
Huh, that makes sense. Thanks for the explanation. I figured a square wave came right out of the phototransistor. I've got a mechanically broken encoder at home; maybe I'll dissect it and get some hands-on learning on how they work.

I don't play with servos & CNC very much. Don't they usually use absolute encoders?
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
Huh, that makes sense. Thanks for the explanation. I figured a square wave came right out of the phototransistor. I've got a mechanically broken encoder at home; maybe I'll dissect it and get some hands-on learning on how they work.

I don't play with servos & CNC very much. Don't they usually use absolute encoders?
Absolute encoders tend to be used in Robots or robotic applications, the rest tend to be quadrature, Resolvers are also used in the same way as the sine wave optical type.
If the broken encoder still has the reading head in place, if you look at the disk in the right light, you may be able to see the shutter effect for 'enlarging' the window!!
Max.
 

THE_RB

Joined Feb 11, 2008
5,438
Open collector outputs are the most common type on quadrature encoders, as found on the ends of motors. They output a "squarewave" just fine at lower speeds, the wave will only get sine-like at higher RPMs (an encoder with more "lines" will get sine-like at a low RPM than an encoder with less lines).

A quick look inside the encoder device will show if it is a common open-collector type or if there is a circuit with a schmidt IC.

The symptoms and waveforms you posted match exactly to a simple open-collector encoder type where the +rail supplying the pullup resistors is not able to supply enough current and drops the voltage a bit. :)
 

MaxHeadRoom

Joined Jul 18, 2013
28,686
I have worked in the servo motor and CNC field in system design and service for over 35yrs and I would have to say in my personal experience the vast majority is some method of Differential i.e. two (complementary) channels for each pulse, such as RS420 driver etc, this would be followed by push-pull types.
Some encoder manufactures made nothing else but differential of some kind.
One of the worlds largest now is Heidenhain for encoders and scales and have taken over Accurite, Baush and Lomb and Renco to name a few.
I have never seen a Heidenhain single ended or open collector encoder.


The technology of encoder detection is little known, it is impossible for a photo cell to distinguish a 5 micron per division scale or encoder, or even a 500 line encoder of a small diameter.
An old technique is employed using the Moiré effect, this effectively increases the shutter size by approximately half the height of the etched scale.
A piece of scale is placed in front of the reading head at a slight angle in order to create this effect.
The reading head outputs a sine wave at all rpm's.
Early in my career I took a course from Ferranti-Packard, part of which involved quadrature technology as they were one of the pioneers in the field.
Max.
 

Attachments

Last edited:
Top