Shaft encoders return 0


#1

After rewiring optical shaft encoders for my drive, I tested the values in the ROBOTC debugger windows, but even when they were rotating, the only returned 0. I’ve had this problem before, but it was solved by switching the two wires in the ports. I did that, but there is still no change.

Please help, I have state in 3 days and need to finish auton


#2

Your encoders probably broke. Try replacing them


#3

OK, will try tomorrow when I am at school


#4

If you can, try a different encoder, maybe it broke. But you can also just use timings if you really need to make an auto fast. Just make sure that after every delay you tell the motors to stop or it will coast and be inconsistent.


#5

Timing is much less consistent with cortex, so that’s not really a good option.


#6

Just gunna give a bunch of ideas here:

Encoder/wire broken?
One/both of the ports it’s in is dead?
Make sure port and code are both the proper type (sensor side, digital/analog)
The port # in the code vs the place it’s reading from?
Make sure the driven axel is actually spinning the disk inside the encoder (axel not in enough, or hole worn out round)?

Hope you can solve this!


#7

I replaced the encoders, and one side is working again, but the other side is not working. I checked all of the things that @JADE8232 mentioned.


#8

Were both sides not working before? And now one side does?


#9

Both sides were not working before, and then only one side worked. After waiting for about thirty minutes, both sides worked again (after replacing both encoders)