EEVblog Electronics Community Forum
Electronics => Projects, Designs, and Technical Stuff => Topic started 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?
-
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.
-
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
-
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.
-
You forgot to compare the price :-DD
-
Alps: €3,85/pc
China: €0,45/pc
There you go.
-
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.
-
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.
-
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.
-
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.
-
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
-
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.
-
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.
-
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.
-
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)
-
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.
-
Have you seen the PEC11 Series suggested filter?
[attachimg=1 width=364]
-
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.
-
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.
-
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]
-
Have you seen the PEC11 Series suggested filter?
(Attachment Link)
That's what I have always used with rotary encoders.
-
By the way : i have 100n caps, not the 10n.
-
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.
-
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.)
-
What do you mean ?, without resistor the encoder will wear out faster ?
I dont see how.
-
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.
-
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.
-
What do you think happens with the delicate contact surfaces, if they repeatedly short out a 100nF cap charged to 5V or what?
-
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 ?
-
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?
-
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
-
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.
-
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.
-
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.
-
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.
-
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.