Line Tracker Threshold
Where to put the threshold on a reflectance sensor, from readings you took on the real field, and how often it will get the call wrong at that setting.
Inputs
Take readings with the sensor at its real mounted height, on the real field, under the lighting you will compete in. Get several on the line and several off it, moving the robot between each so you catch the variation rather than the same spot ten times.
Results
Use this threshold
—
On the line, average
—
Off the line, average
—
Separation
—SD
Gap between the two, in units of their own scatter.
Expected wrong calls
—%
At the threshold above, from the spread you measured.
Is this sensor good enough?
—
Readings used
—
Filling the bar means four standard deviations of separation, which tolerates a lighting change. Under half of it, no threshold works.
Move the threshold
Your readings, with the bell curve each group's average and spread describe. The solid line is your threshold: everything on one side is called on the line, everything on the other side off it. The shaded tails are the readings that would be called wrong. Slide the threshold and watch one tail shrink as the other grows. The dashed line is where the page suggests, which keeps both tails small together.
How this is calculated
A line tracker returns a number, not a yes or no. Turning it into a yes or no needs a threshold, and where you put that threshold decides how often the sensor is wrong. Picking it by eye from two readings is how a line follower works in the pits and fails on the field.
threshold = (on × spread_off + off × spread_on) ÷ (spread_on + spread_off) separation = |on − off| ÷ pooled spread wrong calls = Φ((threshold − on) ÷ spread_on) + Φ((off − threshold) ÷ spread_off)With your numbers
The threshold is not just halfway between the two averages. It is weighted by how much each group scatters, so it sits closer to whichever side is tighter. That is the placement that gets the fewest calls wrong when the two groups spread by different amounts, which they usually do: field tiles vary more than tape does.
Separation is the number that decides whether this works
The gap between the averages means nothing on its own. Divided by the scatter, it says how distinguishable the two really are. Below about two standard deviations the distributions overlap enough that no threshold saves you, and the answer is to fix the sensing rather than tune the number: lower the sensor, shield it from ambient light, or use a different surface.
Take the readings where it has to work
Reflectance sensors are sensitive to height, to ambient light, and to how dusty the tile is. A threshold found on a practice field at home under fluorescent light is not the threshold for a venue with sunlight through the roof. If you can only calibrate once, calibrate at the event.
Better still, take the readings again in the pits before elimination matches. It costs two minutes and it is the single most common reason an autonomous that worked in qualifications stops working later in the day.
Sources & assumptions
Every number here is yours. No sensor reading, threshold or tile reflectance is shipped with this page, because those depend on the sensor, the mounting height, the surface and the lighting in the room.
The threshold placement and the error estimate are derived, with the formulas above. The error estimate treats each group as normally distributed, which is a reasonable approximation for sensor noise and a poor one if something systematic is going on, such as a shadow falling across half the field.
- V5RC Override Game Manual v1.1 (2026-27) — checked August 2026
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
Sensor Fusion CalculatorYou are here
Line Tracker Threshold
a number carries across the next question it raises