EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: BreakingOhmsLaw on May 23, 2020, 09:10:08 pm

Title: Comparing an Alps rotary encoder to chinese rip-off
Post by: BreakingOhmsLaw on May 23, 2020, 09:10:08 pm
Just a quick look at a comparison between a genuine Alps STEC11B13 versus a chinese rip-off.
Results as expected:

We'll start with just a 10k pullup:
Alps:
(https://i.ibb.co/2WS1k2g/1-Alps-naked.png) (https://ibb.co/0mKRGNh)
Won-Hung-Lo:
(https://i.ibb.co/8bGjRPs/2-Chinesium-naked.png) (https://ibb.co/sCcFDsR)
Wow...just..wow.. :palm:

Can that be cleaned with 100nF to ground?
Alps (just for comparison)
(https://i.ibb.co/Xs5Ph8V/3-Alps-100n10k.png) (https://ibb.co/NjNq8S7)
Won-Hung-Lo:
(https://i.ibb.co/jVwyhX6/4-Chinesium-100n10-K.png) (https://ibb.co/Rh632wv)
That noise is still above the "high" threshold of most MCUs. Sure, you could fix that with more parts, but jeeez, why would you want to?
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: ataradov on May 23, 2020, 10:03:02 pm
I appreciate the existence of both. Sometimes price is important and I'm willing to sacrifice some performance for that.

Also, your case seems to be extreme. There is typically some bounce, but not that much. So picking the right cheap option is also important.

That is for new designs. If you are fixing something that was not originally designed to accept the noisier version, obviously replace with the real deal.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: BreakingOhmsLaw on May 23, 2020, 10:35:38 pm
Yes, this was a random pick from FleaBay. I got a bunch of these and they are all more or less the same, with a single one that is slightly better. This batch is practically unusable and i trashed it.
I like to have a cheap option too, that's why i do these benchmarks.
Just had to post this one for its spectacular fail, can't remember having seen such bad bouncing in 25 years of engineering. That thing is practically generating RF  :-DD 
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: james_s on May 23, 2020, 10:52:44 pm
I'd be curious how they compare after both have had a few thousand cycles. I've had some good name brand encoders get really nasty with age, so it may not be a bad idea to use one of the cheap ones for development in order to get the software handling robust enough to tolerate the degredation.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: ebclr on May 23, 2020, 11:01:29 pm
You forgot to compare the price  :-DD
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: BreakingOhmsLaw on May 24, 2020, 09:43:41 am
Alps: €3,85/pc
China: €0,45/pc

There you go.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Peabody on May 24, 2020, 02:30:30 pm
I've found that taking encoders apart and cleaning them can sometimes improve their performance.  But the ones I've taken apart are all structured the same way.  There's a rotating contact that's dragged along a fixed contact during the closed period.  It's hard to see how that could possibly work as well as it does.  It seems that it should be a cam system which lifts one fixed contact away from another fixed contact, or lets it make contact.  You could still have bounce, but at least not dragging bounce.

Anyway, your scope pictures of the Alps encoder show better performance than any encoder I've seen.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: CatalinaWOW on May 24, 2020, 03:36:34 pm
Don't know what the package looks like, but if this was old equipment of any brand that I was trying to put back into service one of my attempts would be a shot of contact cleaner.  And it might be a good solution for using these things in hobby applications or possibly even short run, modest reliability requirement applications.  If the problem is just lack of contact lubrication or a poor quality dried up lube a good quality contact cleaner is not just a patch, but a repair.  If the problem is inappropriate metallurgy in the contacts or terrible surface finish on the contact ring you are right, just dump them unless you are a really strapped for cash hobby person.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: SiliconWizard on May 24, 2020, 03:46:03 pm
Won-Hung-Lo:
(https://i.ibb.co/jVwyhX6/4-Chinesium-100n10-K.png) (https://ibb.co/Rh632wv)
That noise is still above the "high" threshold of most MCUs.

Really? I can't see that from your scope capture. There is indeed some residual noise compared to the Alps one, but to me it looks significantly under the typical Hi threshold of a GPIO. Maybe there are some details I can't see from this image.

Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Doctorandus_P on May 26, 2020, 05:30:08 pm
100nF cap to GND is a very bad Idea.

It is also a common mistake lot's of people make.

Zoom in a bit on your scope, and then look at the discharge time of that capacitor, and calculate the current you draw out of the capacitor, while the switch is closing and may or may not be properly closed.

To limit the current to a safe value for the encoder, you would need to put a resistor in series of at least a few hundred Ohms to 1k.

I once had a 400MHz analog Beast of a scope which had flawlessly working optical encoders.
In my Rigol DS1052E replacement the encoders started failing when it was around 2 months old.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: BreakingOhmsLaw on May 26, 2020, 05:41:47 pm
100nF cap to GND is a very bad Idea.

It is also a common mistake lot's of people make.

Zoom in a bit on your scope, and then look at the discharge time of that capacitor, and calculate the current you draw out of the capacitor, while the switch is closing and may or may not be properly closed.

To limit the current to a safe value for the encoder, you would need to put a resistor in series of at least a few hundred Ohms to 1k.

I once had a 400MHz analog Beast of a scope which had flawlessly working optical encoders.
In my Rigol DS1052E replacement the encoders started failing when it was around 2 months old.

It's 10k + 100n

Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Doctorandus_P on May 26, 2020, 07:23:49 pm
The 100nF cap is charged through the 10k resistor, so you see a nice RC curve on the positive flank.

On the negative flanks, the capacitor is brutely shorted, and discharged in a single pixel of the scope.
Ceramic caps can supposedly deliver up to 10A when shorted.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: BreakingOhmsLaw on May 26, 2020, 07:52:50 pm
Yes, i see your point and you are right of course .
And I expect that adding caps is often the cause of fast deterioration of encoders.
That said, i expect an encoder to work out of the box as the Alps does formidably.
If you open quality encoders, you will find wipers that are separated into several contacts and sometimes even additionally staggered. All done so they don't bounce all at once, and the contact stays connected.
Cheapo encoders mostly don't have that. In fact, here is a picture of that bad example: single wiper contact as expected.
(https://i.ibb.co/hFTy6q7/IMG-20200526-214810.jpg) (https://ibb.co/hFTy6q7)

And of course, the secret sauce is in the contact material.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: mikerj on May 26, 2020, 08:25:27 pm
I once had a 400MHz analog Beast of a scope which had flawlessly working optical encoders.
In my Rigol DS1052E replacement the encoders started failing when it was around 2 months old.

Apples to oranges.  Optical encoders suffer very little in the way of wear, so provided they are sealed well enough I'd expect a long life.  Anything with wiping contacts is going to suffer wear with use.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: thm_w on May 26, 2020, 10:47:51 pm
100nF cap to GND is a very bad Idea.
It is also a common mistake lot's of people make.
Zoom in a bit on your scope, and then look at the discharge time of that capacitor, and calculate the current you draw out of the capacitor, while the switch is closing and may or may not be properly closed.
To limit the current to a safe value for the encoder, you would need to put a resistor in series of at least a few hundred Ohms to 1k.

Its not clear if OP is just testing them or has them in circuit. Anyway, discussion here for anyone else curious: https://www.eevblog.com/forum/projects/bourns-encoder-filter-is-the-extra-r-useful-in-practice-are-the-values-good/ (https://www.eevblog.com/forum/projects/bourns-encoder-filter-is-the-extra-r-useful-in-practice-are-the-values-good/) with relevant link on second page: http://www.ganssle.com/tem/tem387.html (http://www.ganssle.com/tem/tem387.html)
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Jan Audio on May 27, 2020, 03:03:46 pm
I buy the cheap one and replace with good one later.
Not going to pay price high as the alps for test projects.
Thnx for the 10K advice, i just use 100n, next project i try 10K.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: MarkF on May 27, 2020, 05:28:31 pm
Have you seen the PEC11 Series suggested filter?

[attachimg=1 width=364]
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Jan Audio on May 28, 2020, 12:48:53 pm
Are those extra resistors worth the space ?
That is 4 per encoder, gonna try 2 first.

Oh wait those are pullup-resistors, and i have those internal in the PIC, hmz.
So you need pullups disabled in the MCU for this one.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: exe on May 28, 2020, 01:11:10 pm
I had the same dilemma, and I ended up with just using cheap encoders. Motivation: it works fine, usability is not affected by this. I don't know how long they will last, will see.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: MarkF on May 28, 2020, 01:23:44 pm
Are those extra resistors worth the space ?
That is 4 per encoder, gonna try 2 first.

Oh wait those are pullup-resistors, and i have those internal in the PIC, hmz.
So you need pullups disabled in the MCU for this one.

Here is one of my PCB layouts:
I didn't crowd the parts and you could reduce the space.
All 1206 SMD.

[attachimg=1]
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: SiliconWizard on May 28, 2020, 02:07:04 pm
Have you seen the PEC11 Series suggested filter?

(Attachment Link)

That's what I have always used with rotary encoders.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Jan Audio on May 28, 2020, 02:27:55 pm
By the way : i have 100n caps, not the 10n.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: MarkF on May 28, 2020, 02:35:12 pm
By the way : i have 100n caps, not the 10n.

I believe that will be okay as long as you don't spin the encoder very fast.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Yansi on May 28, 2020, 02:37:32 pm
Are those extra resistors worth the space ?
That is 4 per encoder, gonna try 2 first.

Oh wait those are pullup-resistors, and i have those internal in the PIC, hmz.
So you need pullups disabled in the MCU for this one.

Yeas they are, as only uneducated designer connects  100nF large capas accross the contacts directly. It will wear the shit out of the contacts in no time.

Either filter completely in SW, or use a reasonable HW approach. (100nF across a finicky tiny mechanical contact is not one of them.)
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Jan Audio on May 28, 2020, 02:56:19 pm
What do you mean ?, without resistor the encoder will wear out faster ?
I dont see how.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: SiliconWizard on May 28, 2020, 03:06:13 pm
What do you mean ?, without resistor the encoder will wear out faster ?
I dont see how.

Without a series resistor to the cap, the cap will discharge directly through the contacts each time they are closed. Given the small ESR of a typical ceramic cap, that's a lot of current.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: madires on May 28, 2020, 03:06:36 pm
A few years ago I bought a bunch of the cheapest rotary encoders from China I could find as a worst case to check some firmware code. I had to tweak some minor details but I made all work without any hardware filtering. No filter caps allowed because the encoder's A and B lines may be shared with a display. Most of those encoders are ok-ish, but some create nasty glitches. The algorithm I use tracks the A and B signals and checks if they follow the Gray code. If there's any problem the last step is ignored and the algorithm starts again with the next one. When the encoder creates a glitch the user simply has to turn a little bit more until the algorithm sees the correct Gray code sequence. Anyhow, I also prefer ALPS' rotary encoders - no problems at all.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Yansi on May 28, 2020, 03:07:56 pm
What do you think happens with the delicate contact surfaces, if they repeatedly short out a 100nF cap charged to 5V or what?
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Jan Audio on May 28, 2020, 03:26:04 pm
I dont know, i.m learning, thank you all.
What i was thinking : the power goes thru, nothing else, wearing comes from the mechanical rotating i was thinking.

So suppose you have a ribbon cable, it is very thin, can it also wear from energy ?, is it not the same ?
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: BreakingOhmsLaw on May 28, 2020, 03:34:37 pm
Remember the good old day, when a proper switch had  a drop of mercury in it? Razor-sharp edges, no bouncing.
Did any company ever try to replace the mercury with Galinstan alloy?
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: MarkF on May 28, 2020, 03:37:56 pm
It's not the energy so much as the unlimited spark across the contacts.
The resistor reduces the current and the size of the spark.

Think "walking across the carpet and touching a light switch".
Does the spark hurt?   That's what your encoder says too.    :-DD
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: SiliconWizard on May 28, 2020, 03:48:30 pm
To see what happens for yourself: just charge a capacitor with a power supply. For instance to 5V. Then short it on a small piece of metal. Try different kinds of capacitors and different capacitance, and see how it sparks, and what's left at the points of impact on your piece of metal.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: Jan Audio on May 28, 2020, 04:00:36 pm
Does the alps have more metal ?
For that price it should be more then 4 times thicker.
I know that chinese will use the minimum ammount that still works.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: SiliconWizard on May 28, 2020, 04:03:39 pm
Does the alps have more metal ?
For that price it should be more then 4 times thicker.
I know that chinese will use the minimum ammount that still works.

Contact plating is probably different (thicker - different alloy), spring action too. But still, I would certainly use a comfortable series resistor (10k is typical) to avoid unnecessary wear due to sparks.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: CatalinaWOW on May 28, 2020, 11:27:43 pm
You need to think in detail about what is happening to understand how better design helps.  If it was simple erosion at the point of first contact there probably wouldn't be much difference between simple (cheap) designs and the better ones.  But when a contact bounces it generates a spark and crater in one or both contacts.  Metal from the crater is deposited nearby, possibly along with non-conductive ash from lubricants or other contaminants like flux and flux cleaner.  So the next time around there is more surface roughness and more electrical bounce.  The electrical bounce is a combination of contact opening from physical bounce of the contact and opening due to non-conductive material between the contacts.  Splitting the contact into multiple subcontacts (sometimes called fingers) reduces the probability of all elements being opened at the same time.  Often the length of each finger is made different so that they have different bounce frequencies, further reducing the chances of all fingers being off at once.

There are elements of quality control in the equation also.  To my knowledge no one has a complete theory of contact design allowing design based on that theory.  Good companies do have thousands of hours of empirical data on the best combinations of contact geometry, spring pressure, contact metallurgy and other factors that result in good performance.  Lesser suppliers usually have a design that either based on a copy of an existing design, probably without understanding tolerances and required material properties, or have a design that has limited test background and possibly wide variation in product.   In some cases they may know how to do it right, but have been forced to jettison design and process elements to achieve a price goal.
Title: Re: Comparing an Alps rotary encoder to chinese rip-off
Post by: BreakingOhmsLaw on May 29, 2020, 11:17:07 am
In cheap switches an encoders, you will find mostly just nickel-plated spring steel parts as it is the cheapest material and easy to process.
Good quality stuff will use something like a copper-beryllium alloy. That material has properties that make it ideal for this purpose: It can be bent many more times than steel without fatigue. It has better self-cleaning properties and is non-magnetic, so it does not pick up any scrapings that cause even more bouncing.
Of course the price is higher, and it is challenging in production and work safety because beryllium is very toxic.
Adding nickel, zirconium and cobalt to CuBe alloys can change the electrical and mechical properties, and major manufacturers will likely employ several metallurgists for research.
They will also do 100% automated testing, so something like that encoder from hell from my original post would never see the light of day.
Anyway, you get what you pay for - just be aware where the gremlins lurk.