I am currently working on a new filament counter, but more accurate on the E38S6G5-600B-G24 optical encoder. I found that there is no interrupt handling in XOD. Digging through the library, I found amperka/pc-interrupt. But how to create an encoder model in this example does not work. I would really appreciate it if you could help me a little.
This may provide the functionality you require. The XOD library provides two encoder nodes:
- encoder: Quadrature encoder.
- encoder-optimized: Quadrature encoder with optimized interrupt routines. N.B. there is a conflict if any other code in your patch or any libraries you use require attachInterrupt().
For best performance it is important to use pins that support hardware interrupts.
More information on Paul Stoffregen’s library can be found here:
I don’t have an E38S6G5-600B-G24 optical encoder, but apparently they have a strict input voltage range:
Thank you so much for the work you’ve done. Everything worked for me. Just one node calculates the entire encoder operation. The encoder accurately counts the pulses and gives the correct result 2400 on the contrary. Now, with this solution, I will be able to assemble a high-precision filament counter. It is essential for my device to use a fast and highly accurate distance measuring device.
Filament-counter-rotary.xodball (13.9 KB)
Good to hear that the encoder library meets your needs. Thanks for sharing your project.