← All tools

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.

1
2
3
4
5
6
7
8
9
10

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

Separation, against what a threshold needs

Filling the bar means four standard deviations of separation, which tolerates a lighting change. Under half of it, no threshold works.

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)

The threshold is not simply 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.

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.

Save this as evidence

Collects what you entered, what came out, how it was worked out, and anything the tool flagged, with a timestamp and a version so someone else can reproduce it.

This is evidence, not a notebook entry. It deliberately does not write your problem statement, your reasoning, or your conclusion, because under RECF rules an Engineering Notebook has to be the students' own work and no tool may generate or organise its content. Take the numbers, decide what matters, and write it yourself.