Rover5 Encoder Count Range Creation Notes

Wheel Encoder Count Ranges

Though much data collection, I found that the relationships between the PWM values sent to the Robot's Wheels to specify their speeds and the resulting Wheel speeds (as represented by their Encoder Counts/minute) are wildly irreproducible, and differ from wheel to wheel as well.

Meaning that treating a Wheel's speed as a continuous range from 0-600 Encoder Counts/minute just isn't something that the Wheels' motors can deliver.

To address this, I collected PWM Count vs. Wheel Encoder Count Response Curves from a dozen test runs driving my Robot up and down the hallway, and segmented each Wheel's Speed Range into non-overlapping sub-ranges, called Encoder Count Ranges.

To do this, I first obtained from those test runs the the Black upper-bound line and the Cyan lower-bound line for each Wheel, as shown below.

I wrote a function that starts at the first data point on the Cyan line, and draws a vertical Purple line up to the Black upper-bound line.

To find the lower end of the next Purple line, the function moves horizontally to the right, back to the Cyan line. The point that the function lands on on the Cyan line becomes the lower end of the next Purple line.

The function continues like this, drawing a series of Purple "Steps" all the way to the end of the Plot. Each of these Steps I call an Encoder Count Range.

The usage for these Encoder Count Ranges is as follows:

When the Robot's control program commands that a Wheel rotate at a particular speed (expressed in Encoder Counts/minute), a function determines in which Encoder Count Range that speed lies.

That Encoder Count Range's PWM value is then sent to the Wheel, with the claim that the Wheel will now begin rotating at a speed "somewhere" within the chosen Encoder Count Range.

For example, to command each of the Wheels to rotate at an Encoder Count/minute "near" 100, I send each Wheel a its own unique PWM value as shown here (click on the image to open a larger view of it in a new Window):



This approach provides a general way to reliably deliver "close" to the requested Wheel speed while allowing for the variation between Wheels, as well as taking into account the unpredictable behavior exhibited by each Wheel.

Click on any of the 5 images below to open a new Window/Tab in your Browser to see greatly enlarged versions of the Purple Vertical Lines for each of the 4 wheels:



Unfortunately with this approach, very few distinct Wheel speeds are possible.

Here is a screenshot of my full Robot Control program:


The Robot Control program's various settings above allow tuning of my data collection procedure.

I.e., after sending each PWM value, I wait for an Algorithm-specific criteria to be satisfied, collect the resulting "Encoder Count" value from the Robot, then send the next PWM value.

BTW, the Red and Blue Plots above are of my original No-Load data from a year ago, collected while the Robot was sitting on a "Test Stand" with the wheels spinning freely.

The Green and Orange Plots above are my recent No-Load data.

The Black and Cyan Plots are my recent Under-Load data, collected while driving up and down my hallway.

Next Steps

To implement my first autonomous motion behavior, I've added a Compass Sensor, and am writing a Rotation function to use the Compass to spin the Robot to an actual known heading, then maintain that heading while driving straight ahead (= all 4 wheels rotating at the same speed).

After that I may add an Accelerometer, and try to use it to get the Robot to do several kinds of “Orbiting a fixed point” movements, i.e., with and without Rotation, while it’s Revolving around the fixed point, in hopes that the Accelerometer will quickly detect an inadvertent change in turning radius.

Relatedly, I have a “Steerable Head” for a Sonar Sensor, which is a bracket for the Sonar mounted on top of a Servo. With this, I’ll try implementing a Ballerina-like “spotting” behavior for the Sonar Sensor, as well as another side-looking Sonar Sensor to simplify Wall-Following.

I'll update this Page and add siblings to it as I progess and identify additional upcoming Next Steps.

Back to Main Page...