Odometry Calibration
Drive a known distance, measure what the robot really did, and correct the numbers. The companion to Odometry Ticks per Inch, which gives you the theoretical starting point.
Inputs
Straight line trials
Command a long straight drive and measure how far the robot actually moved. Longer runs are better: the measurement error is fixed, so it matters less over 96 inches than over 24.
From Odometry Ticks per Inch, or whatever your code uses now.
Rotation trials
Command several full turns in place and measure the true angle turned. Two full rotations makes a small error easy to see.
What your code believes the wheel spacing is.
Results
Corrected ticks per inch
—
Corrected track width
—in
Distance error
—%
Rotation error
—%
Repeatability, straight
—%
Spread between trials.
Repeatability, turning
—%
Is calibration worth it?
—
Trials used
—
Drive a square with these errors
A two-tile square, four straights and four right turns. The dashed square is where the program thinks the robot went; the solid path is where your own trials say it really goes, with your measured distance and turn errors applied every time. Small errors do not stay small: each turn points the next straight slightly wrong, and by the end the robot is nowhere near where it started.
How this is calculated
Theoretical ticks per inch comes from wheel diameter and gearing. It is always slightly wrong, because wheels compress under load, wear down over a season, and are not exactly the diameter printed on them.
corrected ticks per inch = current × (commanded ÷ measured)If you asked for 96 inches and got 94.5, the robot traveled less than it thought, so each tick is worth slightly less distance than assumed and the ticks-per-inch figure has to go up.
Turning calibrates a different thing
A robot that under-rotates is usually not miscounting ticks. It is working from the wrong track width, because the effective pivot spacing is not the distance between wheel centers. Wheels have width, they scrub, and the real pivot sits slightly outside where you measured.
corrected track width = current × (measured ÷ commanded)With your numbers
Turning short means the robot thinks it is turning further than it is, so the width it assumes is too large and must come down. Calibrate distance first: the turn correction assumes the wheels already measure distance correctly.
Use several full rotations
Measuring one 90 degree turn to the nearest degree is a 1% measurement. Commanding two full rotations and measuring the same absolute error is a 0.14% measurement. The error you are hunting is small, so give yourself room to see it.
Then check it, and check it again later
Run the calibrated numbers back through a fresh trial. If it is still off, you have a repeatability problem rather than a scale problem. And redo this when wheels are replaced or visibly worn, because the whole reason the theoretical number is wrong is that real wheels change.
Sources & assumptions
No VEX data is used. Every figure comes from your own trials, so nothing here goes stale between seasons.
Assumes distance error scales linearly, which holds for wheel size error and not for slip. Assumes rotation error comes from track width alone, which is the usual cause but not the only one: a dragging wheel or an uneven surface will look identical here.
Save this run, and compare
Keeps what is on screen so you can change something and see both sides of the change. Saved in this browser only, never uploaded.
Make a notebook page
Turns this calculation into a dated engineering notebook page: the setup, data, results, figures, working and sources, numbered and cited. You add the goal, the decision and the reflection in your own words, plus photos and sketches. Print it, paste it into Google Docs, or download a Word file or slides.
Where this goes next
Explore further on the full mapWhere the answers on this page can be used, and which tools could have given you the numbers it asks for.
Comes after
Odometry Ticks per Inchfills in your encoder counts herePID Error Analyzergives you your position errorSensor Fusion Calculatorgives you your position errorOdometry Error Simulatorgives you your position errorTracking Wheel SetupYou are here
Odometry Calibration Calculator
Where your answer goes
Sensor Fusion Calculatoruse your wheels' measured error to weigh them against other sensorsuses your position error againOdometry Ticks per Inchredo the ticks for each turn using the corrected track widthbrings your track width with itTrack Width & Turning Geometrysee your true turn rate using the track width the robot really hasbrings your track width with itTracking Wheel Setupfind which wheel measurement is worth taking againa number carries across the next question it raises