Odometry Calibration
Corrects your ticks-per-inch and track width from test drives that came up short.
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.
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.
Not to scale.
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
—
To use it: Drive a known distance several times and record what the robot thought it did.
Easy to miss: Do several runs. One run tells you nothing about whether the error is consistent.
Worked example
With your numbers
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)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.