Encoder Distance
This experiment explores how incremental motor encoder counts can be converted into physical travel distances on a differential-drive mobile robot.
Develop a method for measuring individual wheel displacement and estimating the robot's center travel distance using encoder feedback and known wheel geometry.
The experiment was conducted at three motor effort levels: 50, 70, and 90, with three trials performed at each effort level. The recorded encoder counts were converted into individual wheel displacements and used to estimate the robot's center travel distance. The calculated and measured distances were then compared using absolute error to evaluate the accuracy of the encoder-based distance estimation.
The displacement of each wheel was calculated by converting encoder counts into wheel revolutions and multiplying the result by the wheel circumference.
The robot's center travel distance was then estimated by averaging the displacement of the left and right wheels, accounting for differences in individual wheel travel.
double left_distance = (left_counts/counts_per_rev) * wheel_diameter * PI;
double right_distance = (right_counts/counts_per_rev) * wheel_diameter * PI;
Serial.print("Left distance: ");
Serial.print(left_distance);
Serial.println(" cm");
Serial.print("Right distance: ");
Serial.print(right_distance);
Serial.println(" cm");
double center_travel_distance = (right_distance + left_distance)/2.0;
Serial.print("Center distance: ");
Serial.print(center_travel_distance);
Serial.println(" cm");
Encoder distance demonstration at an effort of 90 (Trial 3).
Ran the motors for 1.5 seconds at 50, 70, and 90 effort and measured the actual distance traveled and compared it against calculated center distance.
The experimental results demonstrate that the encoder-calculated distances closely approximate the physically measured travel distances across all three motor effort levels.
As motor effort increased, both the calculated and measured distances increased, consistent with the motor response observed in the previous characterization experiment.
The mean absolute error decreased from 0.68 cm at an effort of 50 to 0.32 cm at an effort of 90. Across all nine trials, the absolute error remained below 1 cm, with an overall mean absolute error of approximately 0.45 cm.
Differences between the calculated and measured distances may be attributed to wheel slippage, variations in effective wheel diameter, measurement uncertainty, and the robot's motion during deceleration.
The experiment demonstrates that motor encoder counts can be used to estimate the Romi's physical travel distance with relatively low error under the tested conditions.
By averaging the individual wheel displacements, the robot's center travel distance can be estimated despite differences in motor response identified during the motor characterization experiment.
However, distance estimation alone does not provide information about the robot's orientation or correct deviations from its intended path. Additional calculations and control logic are therefore necessary to achieve more precise and controlled movement.
The next experiment, Differential Drive, builds upon encoder-based distance measurement by incorporating the difference between individual wheel displacements to estimate the robot's angular displacement.
These calculations will be used alongside encoder feedback to execute predefined linear distances and rotation angles, allowing the Romi to perform a sequence of controlled movements.