I need an equation that converts a given number to centimeters to the corresponding number of encoder counts for a Pololu Zumo32U4 robot.
Thank you
I need an equation that converts a given number to centimeters to the corresponding number of encoder counts for a Pololu Zumo32U4 robot.
Thank you
Hello.
It depends on the gear ratio you are using.
The distance from the center of the motor shaft to the ground is about 1.9cm (although the track is silicone so it has some squish to it), so each rotation of the shaft should move the robot approximately 11.94cm. Using the gear ratio, and since you know the encoder has 12 counts per rotation of the motor, you can calculate the number of counts per revolution of the motor and divide that by 11.94 to get the number of counts per centimeter.
For example, the 75:1 gearmotors have an exact gear ratio of 75.81:1 and the encoder (which is on the motor shaft before the gearbox) has 12 counts per rotation, resulting in 909.72 counts per rotation of the output shaft. So, you should get approximately 76.2 counts per centimeter of movement.
For reference, you can find information about the exact gear ratio of the gearmotors on their respective product pages. For example, here are the 3 that we generally recommend for the Zumo robots:
Please note that this does not account for track slippage, which can impact your results, especially when turning.
Brandon
I have the 50:1 gear ratio robot
How many encoder counts per rotation is that? (I know that answer is probably on the website somewhere but Iām kind of on a time crunch)
The exact gear ratio of the 50:1 Micro Metal Gearmotor HP 6V with Extended Motor Shaft is 51.45:1. So, first multiply that by the 12 CPR of the encoder to get the number of counts per rotation of the output shaft:
Then, divide the result by 11.94 to get the number of counts expected per centimeter of travel:
Brandon
Got it. 1 cm = 51.71 encoder counts. This is what I was looking for.
Thank you!