NewEncoder icon indicating copy to clipboard operation
NewEncoder copied to clipboard

Support for type quarter pulse

Open chitz852 opened this issue 10 months ago • 2 comments

Hi, it looks like there is another type of encoder that needs 4 detents. could please add support for it ? Example Grayhill SERIES 61C encoder https://www.farnell.com/datasheets/110579.pdf grayhill_61c Btw that's the encoder on the bmw e46 radio small monochrome navigation system 65126976899.

chitz852 avatar Apr 08 '24 10:04 chitz852

Are you absolutely sure that each of the “Positions” in that diagram corresponds to a detent stop? If so, I don’t see how to debounce this with the algorithm used by NewEncoder. Image you’re sitting at “Position 2” in that diagram, and you see a rising edge on Output B. Fine, that’s one click clockwise. But, then you see Output B fall again. That could be from contact bounce or an intentional click back counter-clockwise. I don’t know how to tell the difference.

I don’t have one of these devices to test any implementation.

gfvalvo avatar Apr 08 '24 20:04 gfvalvo

Verified electrically and with the HALF_PULSE I get it working every second detent so yes. But you're right the library may be an overkill for this type. I can get its position at any given time by reading the pins, and knowing the last position I know in which direction it goes too. I assume because it's optical the "contacts" don't bounce therefore no need for the debounce logic.

~~errata: they actually bounce, says the datasheet:~~ that's for the pushbutton which is mechanical:

Contact Bounce: Less than 4 milliseconds at make and less than 10 milliseconds at break

anyway thanks for the quick reply and for the library, I will come up with something or live with every second detent, because it works well.

chitz852 avatar Apr 10 '24 08:04 chitz852

Unfortunately, this type of decoder is not supported by the State Table algorithm used by NewEncoder.

gfvalvo avatar Apr 23 '24 12:04 gfvalvo