How does your IR encoder actually work? #18
Replies: 2 comments
-
So there's almost zero information on this type of analog, absolute optical encoder on the web. Everything I could find is incremental stuff. BUT...my internet searching skills payed off (after many hours) and I found this!: https://ichiro-maruta.blogspot.com/2010/02/blog-post.html I'm going to replicate the setup and do a write-up in english for anyone else that's trying to figure this stuff out. |
Beta Was this translation helpful? Give feedback.
-
The optical encoder is very much inspired by how a resolver works, so you could find more info about how that works. The biggest difference with the optical version is that it is very difficult to get a perfect sin cos signal from the sensors. Non-linearities in the sensors and errors in the disc result in much more complicated curves. To handle this, my implementation relies on a large set of calibration values (2048), where each set of values represent one position. The microcontroller then searches through these to find the position that best fits the current sensor values. If you prefer python over C++ you could also have a look at the |
Beta Was this translation helpful? Give feedback.
-
Hello,
I saw this project on YouTube and think it's awesome. I'm trying to understand how you get the IR encoder working. I tried looking through your code but I'm not that familiar with C/C++ so I thought I'd just ask. This is how I think it works:
I built a small prototype using your disc dimensions, enclosed it and pointed a IR led and receiver at it. However, the readings on the IR receiver don't change much. It's not sensitive to the offset dark disc's position. I thought maybe the LED was too bright and saturating the receiver so I played around with its brightness using PWM. But that just screws up the receiver readings. I think it's catching different parts of the PWM so on some readings it's low and others it's high.
Beta Was this translation helpful? Give feedback.
All reactions