Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Rotary encoder guru ?
#4
Here's some info that might help :-)

https://www.mouser.com/ProductDetail/ALP...3GPQ%3D%3D
https://www.cui.com/blog/what-is-encoder...pr-and-lpr
https://www.linearmotiontips.com/how-to-...esolution/

moOde's rotary encoder driver and settings were designed around an ALPS 24 PPR encoder.

If you are trying to achieve 0 - 360 deg encoder rotation ~= 0 - 100 moOde volume knob then try adjusting the encoder params as below. When you change the params SET the encoder OFF then ON.

Heres the (i) help text from Audio Config screen.

- DELAY = Number of ms delay for each iteration of the volume update loop (default=100).
- ACCEL = Threshold (diff betw last/current enc pos) to determine whether to use 1 step or STEP steps (default=2).
- STEP = Number of steps to use when knob turns at fast rate (default=3).
- PIN-A/B = WiringPi pin numbers (default=pin 4,5 [GPIO 23,24]).

Heres the default

100 2 3 4 5

The DELAY determines how often the driver checks the value of two variables, currentPos and lastPos, that indicate which direction, clockwise or counter clockwise, the encoder has been rotated. The difference between these two values also indicates whether the encoder movement was fast or slow indicating greater or lesser rotation. A low DELAY setting will increase the likelihood that the difference between currentPos and lasPos will = 1 and thus not provide any information on how fast/far the encoder has been rotated.

The ACCEL threshold is compared against the difference between currentPos and lastPos to determine whether to adjust volume by 1 step or by STEP steps. This allows slow movements of the encoder to steadily adjust volume by 1 step while fast movements adjust the volume by STEP steps.

Ok, so at least with my ALPS encoder, heres how to get greater change in moOde volume knob for a given encoder movement.

1. Turn ACCEL threshold off by setting it to 1 and then increase the STEP value. This will result in the volume knob always going up or down by STEP. Whats lost is the ability to slowely go up/down by 1 step.

2. Leave ACCEL threshold set to 2 and increase the STEP value. This results in somewhat of a balance between slow = 1 step and fast = STEP steps.

3. Set DELAY = 10 (ms), turn ACCEL threashold off by setting it to 1, set STEP to 2 or higher. Having a lower delay can sometimes produce smoother knob movement.

Experiment!

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Messages In This Thread
Rotary encoder guru ? - by DRONE7 - 09-06-2018, 06:43 AM
RE: Rotary encoder guru ? - by AnnaBlume - 09-06-2018, 09:50 AM
RE: Rotary encoder guru ? - by AnnaBlume - 09-06-2018, 01:13 PM
RE: Rotary encoder guru ? - by Tim Curtis - 09-06-2018, 11:40 PM
RE: Rotary encoder guru ? - by Tim Curtis - 09-07-2018, 01:13 AM
RE: Rotary encoder guru ? - by DRONE7 - 09-07-2018, 03:18 AM
RE: Rotary encoder guru ? - by Tim Curtis - 09-07-2018, 03:42 AM
RE: Rotary encoder guru ? - by fedormil - 09-14-2018, 03:29 AM
RE: Rotary encoder guru ? - by Tim Curtis - 09-14-2018, 04:35 PM
RE: Rotary encoder guru ? - by fedormil - 09-14-2018, 07:01 PM
RE: Rotary encoder guru ? - by Zootalaws - 09-12-2020, 11:43 PM
RE: Rotary encoder guru ? - by Johnathan W. - 02-27-2024, 04:51 PM
RE: Rotary encoder guru ? - by v12nut - 03-03-2024, 12:06 PM
RE: Rotary encoder guru ? - by the_bertrum - 03-04-2024, 09:31 AM
RE: Rotary encoder guru ? - by Johnathan W. - 03-05-2024, 05:09 AM
RE: Rotary encoder guru ? - by the_bertrum - 03-05-2024, 07:51 AM
RE: Rotary encoder guru ? - by steve4star - 03-05-2024, 08:03 AM

Forum Jump: