Open markmellors opened 4 months ago
printing out the encoder captures confirms this is a real issue - the front left encoder is currently intermittent
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?
... 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.