Comparing an Alps rotary encoder to chinese rip-off - Page 1
Forum section: electronics / projects

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: May 23, 2020, 09:10:08 pm
content: 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:Won-Hung-Lo:Wow...just..wow..Can that be cleaned with 100nF to ground?Alps (just for comparison)Won-Hung-Lo: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?

author: ataradov
author_rank: Super Contributor
timestamp: May 23, 2020, 10:03:02 pm
content: 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.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: May 23, 2020, 10:35:38 pm
content: 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

author: james_s
author_rank: Super Contributor
timestamp: May 23, 2020, 10:52:44 pm
content: 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.

author: ebclr
author_rank: Super Contributor
timestamp: May 23, 2020, 11:01:29 pm
content: You forgot to compare the price

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: May 24, 2020, 09:43:41 am
content: Alps: €3,85/pcChina: €0,45/pcThere you go.

author: Peabody
author_rank: Super Contributor
timestamp: May 24, 2020, 02:30:30 pm
content: 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.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: May 24, 2020, 03:36:34 pm
content: 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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 24, 2020, 03:46:03 pm
content: Quote from: BreakingOhmsLaw on May 23, 2020, 09:10:08 pmReally? 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.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 26, 2020, 05:30:08 pm
content: 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.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: May 26, 2020, 05:41:47 pm
content: Quote from: Doctorandus_P on May 26, 2020, 05:30:08 pmIt's 10k + 100n

author: Doctorandus_P
author_rank: Super Contributor
timestamp: May 26, 2020, 07:23:49 pm
content: 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.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: May 26, 2020, 07:52:50 pm
content: 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.And of course, the secret sauce is in the contact material.

author: mikerj
author_rank: Super Contributor
timestamp: May 26, 2020, 08:25:27 pm
content: Quote from: Doctorandus_P on May 26, 2020, 05:30:08 pmApples 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.

author: thm_w
author_rank: Super Contributor
timestamp: May 26, 2020, 10:47:51 pm
content: Quote from: Doctorandus_P on May 26, 2020, 05:30:08 pmIts 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/with relevant link on second page:http://www.ganssle.com/tem/tem387.html

author: Jan Audio
author_rank: Frequent Contributor
timestamp: May 27, 2020, 03:03:46 pm
content: 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.

author: MarkF
author_rank: Super Contributor
timestamp: May 27, 2020, 05:28:31 pm
content: Have you seen the PEC11 Series suggested filter?

author: Jan Audio
author_rank: Frequent Contributor
timestamp: May 28, 2020, 12:48:53 pm
content: 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.

author: exe
author_rank: Unknown
timestamp: May 28, 2020, 01:11:10 pm
content: 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.

author: MarkF
author_rank: Super Contributor
timestamp: May 28, 2020, 01:23:44 pm
content: Quote from: Jan Audio on May 28, 2020, 12:48:53 pmHere is one of my PCB layouts:I didn't crowd the parts and you could reduce the space.All 1206 SMD.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 28, 2020, 02:07:04 pm
content: Quote from: MarkF on May 27, 2020, 05:28:31 pmThat's what I have always used with rotary encoders.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: May 28, 2020, 02:27:55 pm
content: By the way : i have 100n caps, not the 10n.

author: MarkF
author_rank: Super Contributor
timestamp: May 28, 2020, 02:35:12 pm
content: Quote from: Jan Audio on May 28, 2020, 02:27:55 pmI believe that will be okay as long as you don't spin the encoder very fast.

author: Yansi
author_rank: Super Contributor
timestamp: May 28, 2020, 02:37:32 pm
content: Quote from: Jan Audio on May 28, 2020, 12:48:53 pmYeas 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.)

author: Jan Audio
author_rank: Frequent Contributor
timestamp: May 28, 2020, 02:56:19 pm
content: What do you mean ?, without resistor the encoder will wear out faster ?I dont see how.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 28, 2020, 03:06:13 pm
content: Quote from: Jan Audio on May 28, 2020, 02:56:19 pmWithout 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.

author: madires
author_rank: Super Contributor
timestamp: May 28, 2020, 03:06:36 pm
content: 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.

author: Yansi
author_rank: Super Contributor
timestamp: May 28, 2020, 03:07:56 pm
content: What do you think happens with the delicate contact surfaces, if they repeatedly short out a 100nF cap charged to 5V or what?

author: Jan Audio
author_rank: Frequent Contributor
timestamp: May 28, 2020, 03:26:04 pm
content: 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 ?

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: May 28, 2020, 03:34:37 pm
content: 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?

author: MarkF
author_rank: Super Contributor
timestamp: May 28, 2020, 03:37:56 pm
content: 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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 28, 2020, 03:48:30 pm
content: 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.

author: Jan Audio
author_rank: Frequent Contributor
timestamp: May 28, 2020, 04:00:36 pm
content: 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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: May 28, 2020, 04:03:39 pm
content: Quote from: Jan Audio on May 28, 2020, 04:00:36 pmContact 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.

author: CatalinaWOW
author_rank: Super Contributor
timestamp: May 28, 2020, 11:27:43 pm
content: 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.

author: BreakingOhmsLaw
author_rank: Frequent Contributor
timestamp: May 29, 2020, 11:17:07 am
content: 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.