MobiFlight Community Support

Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.

You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks! 

icon
Avatar
rycco
Posts: 1
Hello, I have been trying to implement rotary encoders into my project. I have about 20+- EC12s.

The problem i hit is that my encoders are bouncing quite a lot. (yes everything is connected/grounded properly.
They are standard EC12 20-detent encoders.

I have tried connecting about 7 of them and they all seems to be having the issue.

When I run mobiflight offline, and i do the standard text editor test.
I have assigned
Left: A
LeftFast: X
Right: B
RightFast: Y

Just by doing standard constant slow rotations, I can see the opposite direction pop up once in a while "AAAAAAAABAAAAA"

If I spin it and then suddenly stop, usually the end gets noticed as the opposite direction: "BBBBBBBBBA"

If I try to spin it longer to get to the fast action, I can still sometimes observe opposite directions being registered, both slow and fast. "AAAXAXAAXXYXXABAAA"


Has anyone else experienced bouncing ? I know that arduino sometimes bounce when using interrupts for encoders and the solution is to poll it in loop, but this can not be applied for MF as it uses its own firmare.

Any suggestions/tips?

Thank you
2020-10-09 23:32
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3969
Supporter
We know this .
Sebastian means the only way to get this perfectly would be using the interupts. But then "freedom" is missing. this will reduce the number of Devices and also the posibility to set the encoder to each Pin you like. If we change then only some pins are useable for the encoders.

About the problem.

In a longer testing Stephan, Sebastian and myself come to the point (in our testing situation) the number of wrong data is "verry" small and with a "normal" speed of turning the number is nearly zero.

A Latching switch taht bounce will occure in a missing event and a non sync situation..... But a Encoder ??? If you turn it 10 detents. Who cares about if you send 10,9 or 8 Commands ? Also who care about if 6 Commands are correctly INC and 2 were DEC by fault..... Important is if i turn right and got more INC as fault DEC then my value grow up.

To fine tune the value ( e.g. to hit exactly 220° on the heading) we figure out if you turn it slowly like 1-2 detents per second with a little delay between each detent then 100% of commands recived by the sim.

The real extreme problem with missing of >50% of commands or more faults as correct inputs only happen for us if we turn the Encoder "unrealistic" fast that never happens also in a real cockpit.

*******************
Summary: We think this situation is not perfect.... Interupts would be better but have disadvantage, too. Finaly if user take care for a "normal" speed of turning the issues are acceptable i think.
If you like..... Send us a example video.... So we can see what happen and can "define" your turning speed as "normal" or as "crazy" :P
Good Luck !
2020-10-10 15:43
Avatar
tigertfly
Posts: 1
I see the issue.

The flexibility is important part of this. But would it be possible to detect an encoder in an interrupt-capable pin, and just enable the interrupt for that encoder, so it would just work more reliably?
2020-11-20 02:01
Avatar
pizman82
Moderator
From: ETSI, Germany
Posts: 3969
Supporter
Maybe....

Please make a Official Request in Bitbucket or contact Sebastian personaly via Discord!
Good Luck !
2020-11-20 18:32
icon