Motor Characterization
Investigating the relationship between commanded motor effort and measured wheel rotation.
Determine the minimum motor effort required to produce movement and identify differences between the left and right motors.
Apply motor effort values of 20, 40, 60, 80, and 100 for seven seconds each while recording encoder counts. Then average the counts across all three trials and graph it.
An array of predefined effort values was used to automate testing across five operating conditions. At each effort level, the encoder counts were reset, and both motors were commanded with identical effort values for seven seconds. The resulting encoder counts were recorded, followed by a five-second rest period before the next test.
for (size_t i{0}; i < (sizeof(pairs) / sizeof(pairs[0])); i++)
{
encoders.getCountsAndResetLeft();
encoders.getCountsAndResetRight();
motors.setSpeeds(effort_array[i], effort_array[i]);
unsigned long current_time = millis();
while (((millis() - current_time) / 1000) < 7)
{
}
motors.setSpeeds(0, 0);
countPair current_pair = {
encoders.getCountsRight(),
encoders.getCountsLeft(),
effort_array[i]
};
current_time = millis();
while (((millis() - current_time) / 1000) < 5)
{
}
pairs[i] = current_pair;
}
Motor characterization demonstration at an effort of 60 (Trial 1).
The experimental results demonstrate an approximately linear relationship between motor effort and encoder counts across effort levels of 40 to 100.
The left motor consistently produced higher encoder counts than the right motor despite receiving identical effort commands. Across effort levels of 40 to 100, the average percentage difference between the two motors was approximately 4.40%.
At an effort of 20, a significantly larger percentage difference was observed, suggesting nonlinear motor behavior at low effort levels.
The consistent difference in motor response may be attributed to manufacturing tolerances, internal friction, and differences in the physical characteristics of the motors and gearboxes.
The experiment demonstrates that identical motor effort commands do not necessarily produce identical wheel speeds. Since the left wheel travels farther than the right wheel over the same duration, the Romi tends to drift to the right during forward motion.
Given the significant motor response mismatch observed at an effort of 20, an effort magnitude of 40 was selected as the minimum operating threshold for subsequent experiments. Effort magnitudes below this threshold will be treated as a practical deadband due to the reduced reliability of motor response.
This highlights a limitation of open-loop motor control, as commanding equal motor efforts does not guarantee straight-line movement. Encoder feedback can provide the measurements necessary to identify and eventually compensate for these differences.
Although encoder counts provide information about wheel rotation, they do not directly represent physical travel distance.
The next experiment, Encoder Distance, builds upon these findings by converting encoder counts into individual wheel displacements and estimating the robot's center travel distance using known wheel geometry.