The current motor/encoder test routines runs the motor at full speed for a given period of time, counts the number of encoder steps produced, and if the encoder steps count exceeds that of some value, then its a pass and if not, it’s a fail.
I’m thinking the test can be improved to provide better information. Instead of running the motor at full speed for a second or two, what if we direct the motor to perform a one or more revolutions using singleAxisMove. This would involve the PID controller and therefore, if the encoder was not functioning correctly it would eventually time out and the encoder steps would not equal what would be expected. The user could watch the sprocket (maybe mark a particular tooth) and see if it returns to where it started. If so, then the user can be pretty confident everything is correct. For people that maybe are trying to use non-stock motors/encoder combinations and finding the motor is turning more or less than expected, they could glean some information from it and maybe help them figure out what gear ratio and encoder ppr their motors are using. If it is not doing a full rotation, then their encoderSteps value is too low and if its doing more than a full rotation, their encoderSteps value is too high (correct?)
Question 1: If you are missing encoder steps, am I correct in thinking the sprocket would turn further than a single rotation?
Question 2: Is there a way to determine the PPR of an encoder by looking at it? If you can’t, then I believe the PPR would always be an integer so the user could try different integer values in their encoderSteps calculations to make it work. And if they get really close and it still doesn’t work, then maybe they need to count the teeth on the gears to verify the gear ratio is correct (as we had to do for the stock motors).