thingswebuilt / osod24_firmware

0 stars 0 forks source link

If an encoder isn't working, there's no visible or logged indication that anything is wrong, #59

Open markmellors opened 4 months ago

markmellors commented 4 months ago

... except we probably travel 33% further than intended. Which, coincidentally, appears to be what the robot is doing at the moment. We should have a continuous check for encoder function, so that it gets recorded in the log. ideally with that encoder also being ignored for the rest of the run.

markmellors commented 4 months ago

printing out the encoder captures confirms this is a real issue - the front left encoder is currently intermittent

markmellors commented 4 months ago

the error_sum parameter of pimoroni's PID class is a private property, so as-is, we can't use it to monitor if there's a probem accumulating. The encoder value changes are so small and frequent that in any given update they are often zero even when the encoder is working correctly, so we can't check for an error on a cycle-by-cycle inspection. so what do we do? keep our own record of the accumulated error? fork/modify the PID class? something else?