Hi y’all, I’m Dhinak, head of programming from team 1155. First post here (yay!).
My team has been having some issues with the REV Through Bore Encoder. We’ve been attempting to use it as an absolute encoder in order to be able to adjust the angle of our hood for our shooter this year. Our team has had past experience with these encoders before, but because it was during COVID, it was minimal and most of my department doesn’t have this experience. I certainly don’t remember having this much hassle in dealing with them.
The main issue we’ve been experiencing is that the output we’re getting from the encoder has not been consistent: sometimes when we bottom out the hood we get the output as 19 degrees; other times, it’s 2 degrees. The range does appear to be consistent (roughly 25 degrees), although I would like to double check tomorrow.
We tried several things like making sure the cable has been connected properly (DIO ports, white wire) and using
reset in order to reset it to 0. However, it hasn’t been going that great (we tried calling
reset but it appeared to have no effect for some reason??).
Since we are running low on time (load-in is 2 days away!), we decided to try a little workaround: assume the hood is already at the bottom, read the current output and store it to be treated as an offset, then adjust our code to subtract this offset when reading from the encoder. However, due to unknown reasons, this didn’t work either; we just got the same results as before.
Our working theory is that initializing the encoder takes some (miniscule, but still enough to make a difference) time and since we’re reading the encoder output right after initialization, we’re reading 0 instead of the actual value, and so our offset ends up being 0. However, due to time constraints today, we weren’t able to validate our theory.
Our next steps for tomorrow are to:
- Insert a delay between initializing the encoder and reading to get the offset
- Swap out the encoder for a new one (and test the old one with a test board)
Is there anything else our team should try in order to debug this issue? For reference, we’re a Java team and have been using the
DutyCycleEncoder class and the
getDistance method. We’ve been scaling the output into degrees using
Dhinak and the rest of team 1155