PDA

View Full Version : Coarse and fine control with a single encoder



Dozer
03-14-2013, 10:23 AM
Using Teensy boards to build flight simulator interface hardware, I normally use two encoders - one for coarse changes, one for fine changes. For example, to set a heading, I have one encoder making 4° changes and another making 0.25° changes. This allows the setting to be made rapidly and with precision. But it's expensive of space - real aircraft use things like continuous-rotation 4-pole rheostats which allow rapid changes and precision to be accomplished with a single control. I'm not sure if anything like that is cheaply available for the electronics enthusiast?

My idea is to use a single encoder, making coarse changes each time it's turned to a new detent. But if the encoder is only pushed partially, against the detent spring pressure, the sketch will apply continuous slow changes to the control.

So to change a heading selection from 30° to 44.2°, I'd click clockwise through three detents to advance by 12 degrees to 42°. Then gently 'push' the encoder clockwise to slowly and gradually advance to 44.2°ish.

Has this been done before? Encoders with stronger detent spring pressure will be easier to use with this technique obviously. I'll experiment with this tonight.

ploveday
03-14-2013, 10:46 AM
I'd be surprised if you can reliably detect (momentary) motion between detents, but keep us posted.

Alternatively, what about applying some sort of velocity-based non linearity, like mouse-acceleration say. Rotate the encoder fast, and it will make courser adjustments, where slow deliberate clicks will make smaller changes?

PaulStoffregen
03-14-2013, 11:26 AM
The Agilent oscilloscopes use that velocity-based approach. Spin slowly for fine adjust, for faster for coarse.

Dozer
03-14-2013, 12:18 PM
That's a good idea too. I'll check there isn't already an Arduino class for this, it seems like there ought to be one.

aedile
03-14-2013, 08:02 PM
Maybe an encoder with a push switch like so:
http://www.mouser.com/Search/ProductDetail.aspx?R=PEC11-4220F-S0024virtualkey65210000virtualkey652-PEC11-4220F-S24
Use a switch push to change a state. You start in coarse adjustment mode, push the switch and you are in fine adjustment mode. Push the switch again for coarse adjustment mode. I'm doing something similar in my current project, using a push switch encoder to change modes so I get double-functionality out of encoder knobs.

Dozer
03-20-2013, 05:34 AM
Ah yes, I have similar encoders. My current setup has two pushbutton encoders and a 16x2 LCD. The left encoder is coarse changes, the right encoder is fine changes, and clicking on the left or right encoder buttons (or both together) cycles through a list of different things the encoders can control. I'd forgotten, if it was a single-function encoder, I could just use the button to change sensitivity.