09-06-2018, 11:40 PM
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
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