RL Robotics LabSearch ↗
Lesson / authored

Week 5 · Experiment: Spread and measurement uncertainty

Session 3 of 4 · Measure motion · Phase 2

Plan about 15 minutes for explanation, 30 minutes for practical work and 10–15 minutes for documentation. A longer build may continue into the next session: stop safely, commit the current state and record the next check. Desktop simulations count as software evidence; label them clearly and record physical validation separately.

Engineering challenge

Can your reported speed withstand scrutiny of the timing and distance measurements? This session focuses on spread and measurement uncertainty.

Before you start

The previous week’s recorded baseline and Week 4, Improve. For later sessions this week, retain the preceding session’s files and predictions.

Equipment: Desktop Python, editor, paper and ruler; for physical work, the configured 3pi+ 2040, clear floor mat and hardware checklist. Week 3 additionally uses the separate low-voltage LED circuit described in its procedure.

For any motion, verify the stop button, short time limit and clear floor area first. Keep the wheels raised for a new device program until its commands and stop behaviour are checked. A hazard or uncertain input is a reason to stop and document, not to force the trial to finish.

Theory and mathematics

Spread and measurement uncertainty

The mean is sum divided by sample count; the range is maximum minus minimum. Sample standard deviation estimates the spread of individual observations: square deviations from the mean, sum them, divide by n − 1 and take a square root. With fewer than two readings it is not defined. Standard deviation is not the same as uncertainty of the mean. Repetition can reduce random uncertainty in an average, but a ruler with the wrong zero stays biased. A precision-looking decimal is not evidence of accuracy.

Worked example — illustrative values

At d = 0.60 ± 0.01 m and t = 3.0 ± 0.2 s, v = 0.20 m/s. The conservative relative bound is 0.01/0.60 + 0.2/3.0 ≈ 0.083, giving roughly ±0.017 m/s. Report about 0.20 ±0.02 m/s, and say these are estimated bounds rather than a confidence interval.

Write the calculation in your notebook before running code. State which values you measured, which you assumed and which the program calculates. A correct numerical calculation cannot rescue an incorrect physical assumption.

Run and explain the model

The following is desktop Python, not a ready-to-run motor program. Download this week’s example, save it in your student repository and run python3 code/w05.py from the repository root. The same small model is reused across the week so you can learn it, build with it, test it and revise it.

# Desktop Python teaching example. Numerical inputs are illustrative.
from statistics import mean, stdev
rows = [(0.59, 3.0), (0.61, 3.1), (0.60, 2.9)]  # fictional
speeds = [distance / elapsed for distance, elapsed in rows]
print("mean_m_s", mean(speeds))
print("sample_sd_m_s", stdev(speeds))

Use your own recorded data or named test fixtures instead of the illustrative inputs. Save expected and actual values side by side. If an exception appears, read its final line, identify the input or assumption that caused it and make the smallest explained correction. Do not delete validation merely to obtain output.

Understanding the model and its limits

Each tuple stores distance and elapsed time for one trial. The list comprehension divides within each trial before calculating the mean. Averaging all distances and all times first produces a different estimator when times vary; state which question you want to answer. Sample standard deviation uses n−1 because the mean was estimated from the same observations. The example has only three fictional trials. Replace them with your complete measured batch, keep the units and reject invalid times explicitly. A spread smaller than your timing uncertainty should not be interpreted as extraordinarily precise motion.

Practical instructions

  1. Plot five trial speeds and calculate mean, range and sample standard deviation.
  2. Repeat five measurements with a second observer or a longer safe distance; change only the selected timing method.
  3. Keep robot settings fixed and label the two measurement methods.
  4. Compare spread and list which error sources repetition cannot remove.

Experiment

Compare two five-trial timing methods; examine spread and possible observer bias, retaining individual values.

Before testing, record your prediction, changed factor, measured response, fixed conditions and stopping rule. Save every attempted run, including failures, with a condition and source version. If hardware is unavailable, use an explicitly labelled synthetic/replay dataset and list the physical question it cannot answer. Do not invent completed trials.

Deliverable

Two datasets and labelled plot; distinguish mean, spread, accuracy and precision.

Save notebook/w05-s3.md, the relevant code revision, raw CSV or test-case records, and one labelled diagram/plot/table. Link the files relatively from your notebook. Use the entry template and report guide.

Completion criteria

A documented failed prediction can meet the learning criteria. A missing physical trial must remain marked untested; software success alone does not validate the robot.

Reading and video

Reflection and next step

Which assumption most affected your result? Point to one observation that supports your explanation and one alternative explanation the evidence has not ruled out. Write a specific next test with a changed factor and measurable outcome, then proceed through the week’s Learn → Build → Experiment → Improve cycle.

← Previous sessionCourse roadmapNext session →