Previous Thread
Next Thread
Print Thread
Rate This Thread
Hop To
#4306708 - 10/27/16 04:43 AM How to get good performance out of rotary encoders?  
Joined: Oct 2016
Posts: 3
bixelplik Offline
Junior Member
bixelplik  Offline
Junior Member

Joined: Oct 2016
Posts: 3
Connecticut, USA
I have a pair of 20-detent rotary encoders wired to an Arduino teensy. The teensy reads a change in one of the channels and sends a joystick button press.

The problem is that if I spin the encoder with any kind of speed, it starts to go backwards for some of those presses, and averages out to 50 forward/50 backward.

So:

1) Why is this happening?
2) How do I fix it?

My guess it the problem could be a delay between when the encoder moves and when the arduino reads it and compares it to the last known position. Currently the program runs at 200 times a second, and I think that would be fast enough to eliminate this problem at normal speeds.

Inline advert (2nd and 3rd post)

#4306990 - 10/28/16 01:51 AM Re: How to get good performance out of rotary encoders? [Re: bixelplik]  
Joined: Sep 2006
Posts: 4,353
HitchHikingFlatlander Offline
Senior Member
HitchHikingFlatlander  Offline
Senior Member

Joined: Sep 2006
Posts: 4,353
California
The stereo knobs in my 10 year old car do this too, wonder if it has to do with the quality of the encoder itself?


I've got a bad feeling about this.....
#4307257 - 10/29/16 03:47 AM Re: How to get good performance out of rotary encoders? [Re: bixelplik]  
Joined: Oct 2016
Posts: 3
bixelplik Offline
Junior Member
bixelplik  Offline
Junior Member

Joined: Oct 2016
Posts: 3
Connecticut, USA
Only one way to find out! I've had my eye on these for a while now: https://www.propwashsim.com/node/15

#4310901 - 11/10/16 08:47 PM Re: How to get good performance out of rotary encoders? [Re: bixelplik]  
Joined: Mar 2008
Posts: 24
Wholehawg Offline
Junior Member
Wholehawg  Offline
Junior Member

Joined: Mar 2008
Posts: 24
Do you know if you are using gray scale encoder? I have several in my cockpit and I have struggled to find ones that my Gamma Ray board picks up cleanly. I found that the ones a lower number of detents seem to work the best (16 or so). And like you if I spin them too fast they don't work right. However in my case they just don't register the click.


Moderated by  RacerGT 

Quick Search
Recent Articles
Support SimHQ

If you shop on Amazon use this Amazon link to support SimHQ
.
Social


Recent Topics
Headphones
by RossUK. 04/24/24 03:48 PM
Skymaster down.
by Mr_Blastman. 04/24/24 03:28 PM
The Old Breed and the Costs of War
by wormfood. 04/24/24 01:39 PM
Actors portraying British Prime Ministers
by Tarnsman. 04/24/24 01:11 AM
Roy Cross is 100 Years Old
by F4UDash4. 04/23/24 11:22 AM
Actors portraying US Presidents
by PanzerMeyer. 04/19/24 12:19 PM
Dickey Betts was 80
by Rick_Rawlings. 04/19/24 01:11 AM
Exodus
by RedOneAlpha. 04/18/24 05:46 PM
Copyright 1997-2016, SimHQ Inc. All Rights Reserved.

Powered by UBB.threads™ PHP Forum Software 7.6.0