I’m unsure how to measure the distance traveled using the new NEO brushless motor’s encoders. I know that the getting the encoder’s position returns the number of rotations in a motor, but how do I convert this into distance traveled linearly?
Measure out a known distance such as 10 feet. Drive your robot that distance a couple of times and measure the ticks from the encoder. Average your results and you should have a rough ratio of encoder ticks to real world distance. Use this ratio to approximate any other distances
You have to multiply by the circumference of the wheel you’re driving. If you’re driving a lead screw you can use the threads per inch to determine linear travel.
Wheel circumference is one factor, but you also have to consider any gear reduction between the motor and wheel.
In the real world, things aren’t perfect, so we calculate the conversion factor, but then add a fudge factor based on pushing the robot 10 feet. It’s typically +/- 3%.
I have an elevator that uses a rope and pulley system connected to a spool which the Neo brushless turns. The Neo brushless is connected to a gearbox. I know in order to calculate the distance, I have to first calculate the pulses per inch by dividing the pulses per revolution by the circumference of the spool. The distance is then calculated by dividing the number of pulses by pulses per inch, but where do I take into factor the gearbox ratio?
You divide the pules per rev by the ratio of the gearbox to get the final rotation speed number of pulses, then multiply that value by the circumference of your spool to find the total number of pules per the distance traveled of one revolution of your spool.