# Research and Engineering Methodology

*Tactiverge Academy course pack · version 1.0.0*

How to ask questions that can be answered, design fair tests, compare against honest baselines, document work so others can repeat it, and report what really happened.

**Audience:** Curious students aged 13 and over who want to run their own investigations. No lab access needed; examples use everyday materials, simulations and paper planning.

> This work is licensed under the Creative Commons Attribution 4.0 International licence (CC BY 4.0): https://creativecommons.org/licenses/by/4.0/. Attribute as: Tactiverge Academy, https://tactiverge.win.



---

# Module 1: Formulating research questions

Turning curiosity into a question that a real investigation can answer, then sharpening it with variables, hypotheses and definitions of success that are fixed in advance.

**Objectives**

- Distinguish a topic from a researchable question and refine one into the other.
- Identify independent, dependent and controlled variables in a proposed study.
- Write a testable hypothesis and a prediction that could turn out to be wrong.
- Give operational definitions for vague terms such as "improve" or "better".
- State the scope and limits of a question before collecting any data.


## 1.1 From curiosity to a researchable question

*What separates a topic from a question, the qualities of a good research question, and a careful look at one real proposed question.* (about 30 min)

### Topics are not questions

Most investigations begin with a topic that interests you: robots, bridges, batteries, plants, music. A topic is a good starting point, but you cannot *answer* a topic. "Robot arms" has no answer. Neither does "renewable energy". Research starts only when you turn a topic into a **question** — and not just any question, but one that an investigation you can actually carry out could answer.

Watch a topic sharpen step by step:

1. *Robot grippers.* — A topic.
2. *How do robot grippers hold things?* — A question, but far too broad. Whole books exist on it.
3. *Do rubber fingertips help a gripper hold objects?* — Narrower, but "help" and "objects" are vague.
4. *Does adding rubber fingertip pads to a two-finger gripper increase the weight of a smooth plastic cup it can lift before the cup slips?* — Now we know what is changed (pads or no pads), what is measured (the weight at which slipping starts), and what it applies to (a particular gripper and a particular kind of object).

Each step made the question smaller, and each step made it more useful. A narrow question you can answer well is worth far more than a grand question you can only gesture at.

### What makes a question researchable

There is no single official checklist, but good research questions tend to share these qualities:

- **Answerable by evidence.** Some observation or measurement could, in principle, settle it. "Is this robot beautiful?" is a matter of opinion; "Do people rate robot design A as friendlier than design B in a survey?" can be investigated.
- **Specific.** It says what is being changed, what is being measured and under what conditions.
- **Feasible.** You can actually do it with the time, money, equipment, skills and safety precautions available to you. A question that needs a particle accelerator is not feasible for most of us.
- **Interesting or useful.** The answer would tell you, or someone else, something worth knowing — even if the answer turns out to be "no".
- **Honest about what is unknown.** If the answer is already well established, the question may still be a great learning exercise, but it is not new research. Look first at what others have found.

### The parts of a question: variables

Most experimental questions are about a relationship between things that can vary. Naming these **variables** is the fastest way to see whether a question is clear.

- The **independent variable** is what you deliberately change. In the gripper question: pads or no pads.
- The **dependent variable** is what you measure to see the effect. In the gripper question: the weight at which the cup slips.
- **Controlled variables** are everything you hold the same, so that they cannot explain any difference you find. In the gripper question: the same gripper, the same cup, the same squeezing force, the same way of adding weight.

If you cannot name the independent and dependent variables, the question is probably not ready yet.

### Worked example: a real proposed question

Tactiverge's first planned research project, TV-01, is built around this question:

> Can inexpensive local force sensing compensate for intermittent visual information and improve cooperative robotic manipulation of unfamiliar deformable materials?

This is a **proposed** project. At the time of writing, no experiments have been run and there are no results. That makes it a useful example: we can study how the question is built without being distracted by any answer. Let us take it apart.

**"inexpensive local force sensing"** — This is the thing being added or changed: low-cost force sensors placed at the grippers ("local" means at the point of contact, rather than measured somewhere else). It is the core of the independent variable. The word "inexpensive" is also a scope limit: the question is not about expensive laboratory sensors.

**"compensate for intermittent visual information"** — This names the problem condition. "Intermittent" means vision comes and goes: an arm blocks the camera, the material folds over, the light changes. The question asks whether force sensing can cover those gaps.

**"improve cooperative robotic manipulation"** — This is the outcome. "Improve" is the most important word in the question, and also the vaguest. Improve compared with what? Measured how? A good research plan must turn it into specific, measurable quantities — you will see how in the next lesson. "Cooperative" adds that two arms work together on one object.

**"unfamiliar deformable materials"** — This sets the scope. "Deformable" means soft things like cloth, foam or cable that change shape as they are handled. "Unfamiliar" means materials the controller was not tuned on, which guards against a system that only works on the exact material it was adjusted for.

Notice how much careful thought sits behind each phrase. Notice too that the question is written so that the answer could be **no**. Perhaps inexpensive sensors are too noisy to help. Perhaps they help with some materials and not others. A question that cannot come out "no" is not really a question.

### Questions that cannot be answered — yet

Sometimes you will write a question and realize you cannot answer it with what you have. That is not failure; it is the system working. You can **narrow** the question (one material instead of many), **substitute** a feasible measurement (a simulation instead of hardware), or **break it into steps** (first, how noisy is this sensor at all?). Many real research projects start by answering a small preliminary question that makes the big one possible.

> **A proposal is not a finding.** When you describe a project that has not been carried out, say so plainly. Words like "shows", "proves" or "demonstrates" belong only to work that has produced evidence. For a proposal, use "asks", "will test" or "aims to measure". The TV-01 question above is a proposal and has no results.

#### Check your understanding

1. Which of these is a researchable question rather than a topic?
   A) Does tilting a small solar panel to face the sun directly increase its measured output at midday compared with lying flat?
   B) Solar panels
   C) The future of energy
   D) Everything about batteries

2. In "Does the length of a paper bridge affect the mass it can hold?", what is the dependent variable?
   A) The length of the bridge
   B) The mass it can hold
   C) The type of paper
   D) The person doing the test

3. In the TV-01 question, which word most needs an operational definition before any experiment?
   A) robotic
   B) local
   C) improve
   D) materials

4. Why is it important that a research question could come out "no"?
   A) So that the researcher can choose the answer they prefer
   B) Because negative answers are always more interesting
   C) Because a question whose answer is fixed in advance cannot be tested by evidence
   D) It is not important


## 1.2 Hypotheses, comparisons and defining success

*Write hypotheses that can fail, choose what to compare against, turn vague words into measurements, and fix your definition of success before you look at the data.* (about 40 min)

### From question to hypothesis

A research question asks. A **hypothesis** offers a possible answer, with a reason, that the investigation will test. For the gripper example from the last lesson:

- **Question:** Does adding rubber pads increase the weight a two-finger gripper can lift before a smooth cup slips?
- **Hypothesis:** Yes, because rubber has more friction against plastic than the bare gripper material, so the same squeeze produces a larger friction force.
- **Prediction:** With the same squeezing force, the cup will slip at a higher added weight with pads than without.

The prediction is what you will actually check. It is specific enough that the results could plainly contradict it. If the cup slips at the same weight either way, the hypothesis is in trouble — and that would be a genuine, useful finding.

Scientists often also state a **null hypothesis**: the "nothing interesting is happening" answer. Here it would be: pads make no difference to the slipping weight. Thinking about the null hypothesis keeps you honest. Your job is not to prove your idea right; it is to find out whether the evidence is strong enough to rule out "no difference".

### Compared with what? Baselines

A result means little on its own. Suppose a robot completes a task 70% of the time. Is that good? You cannot tell until you know what it achieves **without** your new idea. That reference point is called a **baseline**.

A fair comparison has three features:

1. **Same conditions.** The baseline and the new method face the same tasks, materials and difficulties. A new method tested on easy cases and a baseline tested on hard ones tells you nothing.
2. **A fair baseline.** It should be a reasonable, honest version of the existing approach — not a deliberately weakened one that your idea can easily beat.
3. **Enough repetitions.** Real systems vary from run to run. One run of each is not enough to tell a real difference from luck.

### Baselines in the TV-01 proposal

The TV-01 proposal plans to run the same cooperative tasks under three conditions: **vision only**, **force only**, and **vision combined with force**. Each single-sense condition is a baseline for the combined one. If the combined condition does not do better than vision alone during visual dropouts, the central idea is not supported. If it does better than vision alone but no better than force alone, that would suggest vision adds little in those moments. Both outcomes would be informative. Again: this is a plan, and no results exist yet.

Combining measurements from more than one kind of sensor is called **sensor fusion**. The explorer below lets you experiment with the idea in simulation: compare an estimate built from one noisy or intermittent sensor with one that combines two. Watch what happens to each when one source drops out.

> **Interactive:** Compare estimates from a single sensor with an estimate that combines two. Try interrupting one source and see how each estimate copes. This is an illustrative simulation, not data from any experiment. Try it at https://tactiverge.win/academy/lab/#fusion

### Operational definitions

Words like "better", "improve", "stable" and "successful" feel clear until you try to measure them. An **operational definition** states exactly how a vague concept will be measured in your study.

For the TV-01 task of holding a sheet taut between two arms, "improve" could be defined operationally in several ways:

- **Fewer failures:** the number of trials in which the sheet is dropped, out of a fixed number of attempts.
- **Better tension control:** the average difference between the measured tension and the target tension during the task.
- **Faster recovery:** the time taken to return to the target tension after vision returns.

Each is legitimate, and each could give a different answer. That is exactly why the choice must be written down. A good research plan names a **primary measure** — the one that decides the main question — and may list secondary measures that add detail.

### Decide success before you look

Here is one of the most important habits in research, and one of the easiest to break. **Fix your measures, your comparisons and your threshold for success before you collect data.**

Why? Because once you see results, it becomes very easy, without meaning to, to pick the measure that makes your idea look best. If failures did not drop but recovery time did, you might suddenly feel that recovery time was "the real point all along". With enough possible measures, some will look good just by chance. Deciding in advance protects you from fooling yourself.

The TV-01 proposal states that its success measures will be defined in advance and not adjusted after seeing the data. Writing down your plan before you start — and dating it — is a simple version of a practice researchers call **pre-registration**.

You can still notice interesting things you did not plan for. Report them honestly as **exploratory** observations: worth following up, but not as strong as a planned test.

### Scope and limitations

Finally, a good question says where its answer will and will not apply. The **scope** is the range of situations your study covers. **Limitations** are reasons the result might not apply more widely.

The TV-01 proposal lists several limitations of its own: its low-cost arms cannot do everything research-grade arms can; a small set of test materials cannot represent all deformable objects; and hiding camera frames in software is cleaner than real occlusion, which also changes lighting and creates partial views. Stating these up front does not weaken a project. It tells readers exactly how far to trust the conclusions, and it makes clear what the next study should test.

### A template you can use

When you plan your own investigation, try filling in:

- **Question:** Does [change] affect [measurement] in [situation]?
- **Hypothesis:** I expect [direction of effect] because [reason].
- **Null hypothesis:** [Change] makes no difference to [measurement].
- **Baseline:** I will compare against [fair existing approach], under the same conditions.
- **Primary measure:** [Exactly how it is measured, with units].
- **Success threshold:** I will consider the hypothesis supported if [specific result], decided on [date].
- **Scope and limitations:** This applies to [situation] and may not apply to [other situations] because [reason].

#### Project: Paper project: plan an investigation

Choose a question you could investigate at home with everyday, safe materials or with a computer simulation — for example, how the shape of a paper glider affects how far it flies, or how the number of folds affects how much weight a paper beam supports.

Using the template from this lesson, write a one-page research plan. Date it. Do **not** collect any data until the plan is finished.

You do not need to carry out the investigation for this project. If you later decide to, follow your plan as written and record any changes you make, with reasons.

**Deliverables**

- A dated one-page plan with question, hypothesis, null hypothesis and baseline
- An operational definition and units for your primary measure
- A success threshold stated before any data collection
- At least two limitations of your planned study

#### Check your understanding

1. What is the role of a baseline in an experiment?
   A) To make the new method look as good as possible
   B) To replace the need for repeated trials
   C) To decide the hypothesis after the results are in
   D) To provide a fair reference point, under the same conditions, against which the new method is compared

2. A team tests their new controller on easy materials and the old controller on difficult ones. What is wrong?
   A) The conditions differ, so any difference could be caused by the materials rather than the controller
   B) Nothing — different materials give more data
   C) They should only test the new controller
   D) They need more difficult materials for the new controller only

3. Which is an operational definition of "the gripper performs better"?
   A) The gripper seems more impressive
   B) The number of successful lifts out of 20 attempts, using the same object and squeeze force
   C) The gripper is newer
   D) Most people agree it is better

4. After collecting data, a researcher notices that a measure they had not planned looks impressive. What should they do?
   A) Present it as the main result, as if it had been planned
   B) Report the planned primary measure as the main result, and describe the new observation as exploratory
   C) Delete it
   D) Collect more data until the planned measure also looks good

5. Why does the TV-01 proposal compare three conditions (vision only, force only, combined)?
   A) Because its results already show that combining is best
   B) Because three is the minimum allowed by law
   C) So that the combined approach can be judged against each single-sense baseline under the same tasks
   D) To make the project take longer


## 1.3 Reading the literature effectively

*How to find out what is already known about your question: where to search, how to read a paper in passes instead of front to back, and how to keep notes you can actually use later.* (about 30 min)

### Why read before you build

Suppose you want to know whether a cheap force sensor in a gripper's fingertip helps it hold a soft sponge. You could start building at once. But others have almost certainly studied gripping soft objects already: they will have tried sensors you have not heard of, hit problems you have not imagined, and measured things in ways you could borrow. A few hours of reading can save weeks of work, or show that your exact question is already answered, so you can build on that answer instead of repeating it.

Everything that has been written about a subject is called **the literature**. Reading it with a purpose is called a **literature review**. In the last two lessons you turned a topic into a question and wrote a hypothesis. This lesson is about checking that question against what is already known.

### What counts as a source

Sources differ in how carefully they have been checked:

- **Peer-reviewed journal articles.** Other experts read the work before it was published and asked for changes. That is a useful filter, but it is not a guarantee that everything in the paper is right.
- **Conference papers.** In robotics and computer science, much important work appears at conferences, usually after a shorter peer review.
- **Preprints.** Papers shared publicly before (or without) peer review. Servers such as arXiv host a great many in physics, mathematics, computer science and robotics. Preprints are often the newest work, and they have not been checked by reviewers.
- **Theses and technical reports.** Long and detailed, often including the practical details a short paper leaves out.
- **Textbooks and review articles.** A **review** (or **survey**) paper summarises a whole area and cites the important work in it. If you can find a recent review, read it first. It is a map of the territory.
- **Datasheets, standards and documentation.** For engineering questions, the manufacturer's datasheet for a sensor is often the most direct source for its range, noise and limits.

Blogs, videos and forums are good for intuition. Treat their specific claims as leads to check, not as evidence.

> **Getting access legally.** Many papers sit behind paywalls, but free copies are often available legally. Search engines such as Google Scholar often link to an openly available version. Authors frequently post copies on their own or their university's web pages. Preprint servers are free, and public libraries can sometimes get articles for you. If none of that works, a short, polite email to the author asking for a copy often gets a reply.

### Finding sources

**Break your question into concepts.** Take the question "Can a fingertip force sensor help a two-finger gripper hold a soft object without crushing it?" It contains three concepts: *force sensing*, *gripper* and *soft object*.

**List synonyms for each concept.** Different research communities use different words for the same idea:

- force sensing: tactile sensing, touch sensing, force feedback, haptic
- gripper: end effector, robotic hand, grasping
- soft object: deformable object, compliant object, non-rigid

Combine one term from each list ("tactile sensing deformable object grasping") and try several combinations. The first search rarely finds the best sources. Notice which words keep appearing in the titles of good results, and search with those as well.

**Snowball.** Once you have one good paper, it leads to others in two directions:

- **Backward:** read its reference list. These are the earlier works it builds on.
- **Forward:** Google Scholar shows a "Cited by" link under each result. These are later works that refer to this one, and often extend or criticise it.

### Reading a paper in passes

Reading every paper from the first word to the last is slow, and most of what you find will turn out to be only partly relevant. A widely taught approach is to read in **passes**, going deeper only when a paper earns it.

**First pass (5–10 minutes): is this relevant?** Read the title, the abstract, the introduction, the section headings and the conclusion. Look at the figures and their captions. At the end you should be able to say in one sentence what the paper asks and what it claims. Then decide whether to keep reading.

**Second pass (about an hour): what did they do, and what did they find?** Read the whole paper, but skip the heaviest mathematics for now. Study the figures and the tables of results carefully, because they are often where the real evidence is. Note what you do not understand. Look up unfamiliar terms as you go.

**Third pass (only for the few papers central to your work): could I repeat this?** Work through the method in enough detail that you could explain how to reproduce it. Check the assumptions. Ask what the authors did *not* test.

### Questions to ask while reading

These questions use the ideas from the earlier lessons:

1. What exactly is the research question?
2. What was changed (the independent variable), and what was measured (the dependent variable)?
3. What was it compared against? Was the baseline fair?
4. How many trials were run, and how much did the results vary?
5. What limitations do the authors state, and are there others they do not mention?
6. Does the conclusion claim more than the evidence supports?

### Keeping notes you can use

Notes made while reading beat a folder of files you mean to read "properly" one day. Make one short note per source, with the same headings every time:

```text
Reference:   authors, year, title, where published, link
Question:    what they asked, in my words
Method:      what they changed, measured, compared; how many trials
Key result:  in my words, with numbers and conditions
Limitations: stated by authors / noticed by me
Relevance:   how it affects my question or method
Quotes:      exact words in "quotation marks", with page number
```

Two habits matter most. First, write results **in your own words, with the conditions attached**: "slip was reduced on the foam blocks they tested", not "sensors stop slipping". Second, keep exact quotations inside quotation marks with a page number, so you can never later mistake someone else's words for your own. This is one of the simplest protections against accidental plagiarism.

### From notes to synthesis

A literature review is not a list of summaries, one paper after another. After reading several sources, group your notes **by theme**: which approaches have been tried, which measures people use, where the results agree and where they conflict. The most valuable thing you can find is a **gap**: something that has not been tested, or not under the conditions you care about, such as with low-cost parts.

The TV-01 proposal shows what this looks like in practice. Its motivation argues that research platforms for deformable manipulation usually depend on expensive equipment, and that this keeps many groups out of the field. In a full proposal, a claim like that must be supported by sources found and read in exactly the way this lesson describes. The gap it points to, whether cheap force sensing can stand in when vision fails, is something the project proposes to investigate. It has produced no results yet.

### Recap

Read before you build. Search with several combinations of terms, then snowball backward and forward from good papers. Read in passes, going deep only on the papers that matter most. Take structured notes in your own words, with conditions and page numbers. Finally, group what you have learned by theme so that the gap your question fills becomes visible.

#### Check your understanding

1. You have found one paper that closely matches your question. What is the most efficient way to find more?
   A) Search again using exactly the same words
   B) Look at its reference list and at the later papers that cite it
   C) Only read papers by the same authors
   D) Stop searching, because one good paper is enough

2. What is the main goal of the first pass through a paper?
   A) To check every equation for errors
   B) To reproduce the experiment
   C) To memorise the results table
   D) To decide quickly whether the paper is relevant and what it claims

3. Which statement about preprints is accurate?
   A) They have not necessarily been peer reviewed, so specific claims deserve extra scrutiny
   B) They are always wrong and should never be read
   C) They have been checked more carefully than journal articles
   D) They cannot be cited

4. Why should you keep exact quotations in quotation marks with a page number in your notes?
   A) Because it makes your notes longer
   B) Because quotations are more reliable than summaries
   C) So that you never later mistake someone else's words for your own, and can cite them accurately
   D) Because journals require it

5. A paper reports one spectacular robot run, with no baseline and no repeated trials. How strong is this evidence?
   A) Very strong, because the result is impressive
   B) Weak, because one run with no comparison cannot show whether the result is typical or better than existing methods
   C) Strong, as long as there is a video
   D) It cannot be judged at all

#### Project: Build a small literature log

Take the question you wrote in the previous lessons, or use this one: "Do textured fingertips help a gripper hold soft objects?"

1. Break the question into two or three concepts and list at least three synonyms for each.
2. Search Google Scholar or arXiv using at least three different combinations of terms. Write down which combination worked best.
3. Choose three sources. Do a first pass on each, and keep only those that are relevant.
4. For the source most relevant to you, do a second pass and write a full note using the template from this lesson.
5. Write three or four sentences of synthesis: what do your sources agree on, and what do they leave untested?

This is a computer-and-paper activity. You do not need to understand every detail of the papers you find. Writing down what you did not understand is part of the exercise.

**Deliverables**

- A list of search terms, with the combination that worked best
- First-pass notes on three sources, each with a one-sentence summary
- One full structured note on your most relevant source
- A short synthesis paragraph naming at least one gap

**Free places to search:**

- Google Scholar: https://scholar.google.com/ — A free search engine for scholarly literature. Use the "Cited by" and "Related articles" links under each result to snowball.
- arXiv: https://arxiv.org/ — A free, open-access archive of preprints. Robotics papers appear under Computer Science › Robotics (cs.RO). Remember that preprints may not have been peer reviewed.


## 1.4 Turning questions into measurable variables

*Go from an idea you care about to a number you can record: writing full operational definitions for both what you change and what you measure, and checking that your measures are valid, reliable and precise enough.* (about 35 min)

### The gap between an idea and a number

Imagine two students test the same gripper. One reports that it "held the cup well 8 times out of 10". The other reports that it "held the cup well every time". Did they disagree about the gripper? Perhaps not. One may have counted a small wobble as a failure, while the other counted only a complete drop. Until "held the cup well" is written down as a precise measuring procedure, their numbers cannot be compared at all.

In the lesson on hypotheses you met the **operational definition**: a statement of exactly how a vague idea will be measured. This lesson goes further. You will learn to operationalise **both** sides of a question, to state the measuring procedure in full, and to check whether your measure really captures the idea you care about.

### Concepts and measures

Researchers often separate two layers:

- The **concept** (sometimes called a *construct*) is the idea you care about: "grip quality", "stability", "intermittent vision".
- The **measure** is the specific thing you record: "the added mass, in grams, at which the cup first slides 5 mm", or "the camera frames masked for 1.0 s out of every 4.0 s".

A single concept can have many possible measures, and each captures it slightly differently. Choosing one is a design decision. Write it down, with your reasons.

### A complete operational definition

A complete operational definition answers five questions:

1. **What** quantity is recorded?
2. **How** is it measured, and with which instrument?
3. **In what units**, and to what **resolution** (the smallest step you can tell apart)?
4. **When** is it measured: once at the end, continuously, or at a particular event?
5. **What counts** as each outcome, if the result is a category such as "success" or "drop"?

Here is a weak definition and a strong one for the same idea.

- *Weak:* "We will measure how well the gripper holds the cup."
- *Strong:* "The gripper closes on an empty cup at a fixed setting. Steel washers, each 10 g, are added one at a time, with 5 seconds between additions. The **slip mass** is the total mass of washers added when the cup first moves 5 mm or more relative to the fingers, judged against a pencil mark on the cup. Resolution: 10 g."

The strong version can be repeated by someone else, in another place, and they would be measuring the same thing. Notice that it also reveals a limitation: with 10 g washers, you cannot tell 212 g from 218 g. If the differences you expect between conditions are about 5 g, this measure is too coarse, and you have learned that before collecting any data.

### Operationalise the independent variable too

It is easy to define the outcome carefully and leave the *change* vague. Take the phrase "intermittent visual information" from the TV-01 question. To test it, you must decide exactly what "intermittent" means in practice. The TV-01 proposal plans to do this by masking camera frames in software on a schedule, so that the length and frequency of dropouts become controlled variables. A specific version might read:

- **Dropout length:** 0.5 s, 1.0 s or 2.0 s of masked frames.
- **Dropout frequency:** one dropout starting every 4.0 s.

These particular numbers are made up for illustration. They are not the proposal's settings, which are yet to be fixed. The point is that each level of the independent variable must be specified as precisely as the measurement.

### Types of measurement

The kind of data you collect affects what you can do with it later.

- **Categorical:** labels with no order, such as material type (cloth, foam, cable).
- **Ordinal:** ordered categories, such as a rating of "poor, fair, good". The order means something, but the gaps between categories may not be equal.
- **Counts:** whole numbers of events, such as drops out of 20 trials.
- **Continuous:** quantities on a scale, such as tension in newtons or time in seconds.

Where you can, prefer a continuous measure, or a count of clearly defined events, over a rating. "Fold error: the distance in millimetres between the fold and the marked line, measured with a ruler at both edges and the centre, then averaged" carries more information than "fold quality: good or bad", and two people are far more likely to agree on it.

### Valid, reliable and precise enough

Check every measure against three questions:

- **Validity: does it measure the concept?** "Time to finish the task" is not a valid measure of grip quality if a fast robot can finish by dropping the object halfway there.
- **Reliability: does it give the same answer when nothing has changed?** If two people score the same video and disagree half the time, the measure is unreliable. Clear rules, physical marks and automatic logging all help.
- **Resolution: can it detect the differences that matter?** As in the washer example above, a measure that is too coarse hides real differences.

Watch out especially for **proxies**: things that are easy to measure and that you hope go along with the concept. A proxy can be useful, but it can drift apart from what you care about. The number of corrective movements a robot makes might reflect how hard it is working, or it might simply reflect how its controller happens to be tuned.

### Worked example: from a log to a number

For the task of holding a sheet taut, "good tension control" could be operationalised as two measures, both calculated from a log of tension readings: the **mean absolute error** (the average distance from the target), and the **fraction of samples within a tolerance band**. The readings below are made up for illustration.

```python
# Made-up tension readings (newtons), one every 0.5 s, for illustration only.
target = 2.0
readings = [1.9, 2.1, 2.4, 2.6, 2.2, 1.7, 1.5, 1.8, 2.0, 2.1]

errors = [abs(r - target) for r in readings]
mean_abs_error = sum(errors) / len(errors)
within = sum(1 for e in errors if e <= 0.25)

print(f"Mean absolute error: {mean_abs_error:.2f} N")
print(f"Time within ±0.25 N: {within}/{len(readings)} samples")
```

Output:

```text
Mean absolute error: 0.25 N
Time within ±0.25 N: 6/10 samples
```

The two measures tell slightly different stories: the average error looks small, but the tension was outside the band for 40% of the time. This is why you choose and name the **primary measure** before collecting data. If you wait until afterwards, you will be tempted to pick whichever one looks better. Notice also the choices hidden inside the definition: the target, the band width and the sampling interval must all be written down.

### Recap

Separate the concept from the measure. Write complete operational definitions for what you change as well as for what you measure: what, how, units and resolution, when, and what counts. Prefer clear counts and continuous measures to vague ratings. Check that each measure is valid, reliable and fine enough to detect the differences you care about, and be wary of convenient proxies.

> **Definitions are fixed before the data.** Changing the definition of "success" after seeing results, for example deciding that a 6 mm slip "doesn't really count", quietly changes the experiment. If a definition turns out to be unworkable during testing, record the change, the date and the reason, and report it.

#### Check your understanding

1. Which is the most complete operational definition of "the robot dropped the object"?
   A) The object fell
   B) The robot did badly
   C) The object lost contact with both fingers and touched the table before the robot reached the end point, judged from the video
   D) The operator felt the trial had failed

2. A team measures "grip quality" by how fast the robot finishes the task. What is the main problem?
   A) The measure may not be valid: a robot could finish quickly by dropping or crushing the object
   B) Time cannot be measured accurately
   C) Speed is a categorical variable
   D) There is no problem

3. You add 10 g washers to measure slip mass, but you expect the difference between conditions to be about 4 g. What is the issue?
   A) The measure is unreliable
   B) The measure is categorical
   C) The measure is not valid
   D) The resolution is too coarse to detect the difference you expect

4. Why should the independent variable be operationalised as carefully as the dependent variable?
   A) It does not need to be; only measurements need definitions
   B) So that the change being tested is the same every time and can be reproduced by others
   C) Because the independent variable is always continuous
   D) To make the results look larger

5. Two people score the same set of trial videos and often disagree about which trials succeeded. Which property of the measure is weak?
   A) Validity
   B) Resolution
   C) Reliability
   D) Units

#### Project: Operationalise three vague words

For each of these claims, write a complete operational definition that answers the five questions from the lesson (what, how, units and resolution, when, what counts):

1. "This paper bridge is **stronger**."
2. "This paper glider flies **more steadily**."
3. "This line-following robot simulation follows the line **more accurately**."

For one of the three, write two *different* operational definitions and explain one situation in which they would disagree. Then say which one you would choose as your primary measure, and why.

This is a pencil-and-paper activity. You do not need to build or test anything.

**Deliverables**

- Three operational definitions, each answering what, how, units and resolution, when, and what counts
- Two competing definitions for one claim, with a case where they disagree
- A short justification of your chosen primary measure
- One sentence on a possible validity problem with your chosen measure

**Go further:**

- Operationalization (Wikipedia): https://en.wikipedia.org/wiki/Operationalization — An overview of how researchers turn abstract concepts into measurable indicators, with examples from several fields.


## 1.5 Feasibility and scoping a project

*Check honestly whether a question can be answered with the time, money, equipment, skills and safety precautions you actually have, and learn how to shrink a project without losing its point.* (about 30 min)

### Ambition meets the calendar

Most unfinished projects are not abandoned because the idea was bad. They run out of time, money or patience halfway through, often because the plan quietly assumed that everything would work first time. A **feasibility check** is an honest look, before you start, at whether you can actually answer your question with what you have. **Scoping** means adjusting the question until the answer is yes.

This is not about lowering your ambitions. A small study that is finished, careful and honestly reported is worth more than a grand one that never produces a result. It is also a much better foundation for the next study.

### The resources to check

Work through each of these in turn:

- **Time.** How many hours can you really spend, week by week? Include school, exams and holidays.
- **Money.** What do the parts, materials and any replacements cost?
- **Equipment and materials.** Do you have them, or can you borrow them? Will the test materials wear out or change as you use them?
- **Skills.** What do you already know how to do, and what must you learn first? Learning is a legitimate part of a project, but it takes time and should be in the plan.
- **Safety.** Can every step be done safely, with the supervision available to you? (More on this below.)
- **People and permissions.** Do you need anyone's help, agreement or participation? A survey of classmates needs their informed consent.
- **Data.** Can you actually record the measurement you defined, at the resolution you need?

### Estimating time: the trial arithmetic

Experiments take longer than people expect, mostly because of everything around each measurement. Here is a worked estimate for a hypothetical gripper study. All the numbers are made up for illustration.

- 3 conditions (for example: bare fingers, rubber pads, textured pads)
- 4 test objects
- 10 trials of each combination

```text
trials        = 3 conditions × 4 objects × 10 trials = 120 trials
time per trial = 1 min to run + 2 min to reset and record = 3 min
testing time   = 120 × 3 min = 360 min = 6 hours
```

Six hours of pure testing sounds manageable. But you also need to build and check the test rig, run a pilot, analyse the data, write up the results, and deal with things going wrong: a pad comes unstuck, a sensor gives odd readings, a file fails to save. A common rule of thumb is to multiply your first estimate by two or three. Here that turns six hours of testing into roughly 12 to 18 hours of project work around it, before writing anything up.

If that does not fit your calendar, the numbers show you where to cut. Halving the number of objects halves the testing time. Reducing the trials per combination also saves time, but the next module explains why too few trials can make the results meaningless, so cut conditions before you cut repetitions.

### Money and margins

List every item with its price, and add a **margin** for things that break, get lost or turn out to be wrong. Parts fail during testing, especially cheap ones. If one broken component would end your project, budget for a spare. The same thinking applies to materials that wear out: if the sponge you are gripping gets squashed flat after 40 trials, you need several identical sponges, bought from the same batch.

### Risks and plan B

Write down the three things most likely to stop your project, and what you would do about each. For example:

- *The sensor is too noisy to detect slipping.* Plan B: first, characterise the noise. That becomes a useful small study in its own right.
- *The hardware is not ready in time.* Plan B: test the control idea in a simulation, and state clearly that it is simulated.
- *A test material is no longer sold.* Plan B: buy enough at the start, or choose a material that is widely available.

### Ways to shrink a project without losing its point

When a question is too big, you can make it smaller in several ways:

1. **Fewer conditions.** Compare two things carefully instead of five things badly.
2. **Narrower scope.** Use one material instead of many, and say so in your limitations.
3. **A preliminary question.** Answer the question that has to come first: "How noisy is this sensor at all?" comes before "Can this sensor improve grasping?"
4. **Simulation or a cheaper stand-in.** A simulation, or a cardboard mock-up, can test the logic of an idea before you spend money on it.
5. **Staging.** Do the project in steps, where each step is useful even if the next one never happens.

The TV-01 proposal is built on staging. Its planned milestones include a single-arm prototype, used to characterise the force sensor *before* cooperation between two arms is attempted. If the sensor turned out to be unusable, the project would find out early and cheaply, and that finding would itself be worth reporting. These milestones are plans; none of the experiments has been run.

### Watch for scope creep

**Scope creep** is the slow growth of a project as new ideas get added along the way: "while I'm at it, I could also test a third material, and add a camera, and…". Each addition seems small, but together they can sink the project. Keep a separate list called "future work". Good ideas go there, not into the current plan, unless you deliberately decide to rescope, write the new plan down and recheck its feasibility.

### A one-page feasibility check

Before you commit, answer each line honestly:

```text
Question (one sentence):
Total trials and estimated testing hours (× 2–3 margin):
Hours available per week and number of weeks:
Cost, including spares and margin:
Equipment and materials I have / must get:
Skills I must learn first:
Safety: hazards, precautions, supervision needed:
Top three risks and plan B for each:
What I will cut first if time runs short:
```

If the hours needed exceed the hours available, rescope now. It is far less painful than doing it two weeks before the deadline.

### Recap

Feasibility means checking time, money, equipment, skills, safety, people and data against your plan before you start. Estimate time from the number of trials, and then add a generous margin for everything else. Shrink a project by cutting conditions, narrowing scope, answering a preliminary question, simulating, or staging the work. Protect the plan from scope creep with a "future work" list.

> **Safety is a feasibility constraint.** If a step can only be done safely with supervision, equipment or training you do not have, then that step is not feasible for you right now, however interesting it is. Rescope it. Mains electricity, large batteries, high-power motors, sharp tools and heat sources all need adult supervision and proper precautions. Low-voltage, paper and simulation approaches answer many of the same questions with much less risk.

#### Check your understanding

1. A study has 2 conditions × 5 materials × 10 trials, and each trial takes 4 minutes including reset. How much pure testing time is that?
   A) 50 minutes
   B) 200 minutes
   C) 400 minutes
   D) 100 minutes

2. Your project is running out of time. Which cut usually damages the conclusions least?
   A) Reducing every condition to a single trial
   B) Dropping the baseline condition
   C) Changing the success measure to one that is quicker to record, without noting it
   D) Testing fewer materials, and stating the narrower scope in the limitations

3. Why does the TV-01 plan include a single-arm prototype before the dual-arm stage?
   A) To characterise the force sensor early and cheaply, before the harder cooperative stage depends on it
   B) Because results from it already show the sensor works
   C) Because two arms are always unnecessary
   D) To make the project longer

4. Halfway through, you think of an exciting extra experiment. What is the best response?
   A) Add it immediately; more data is always better
   B) Write it on a "future work" list, unless you deliberately rescope and recheck feasibility
   C) Replace your original experiment with it
   D) Forget it

#### Project: Feasibility check on paper

Take the research plan you wrote in the hypotheses lesson, or invent a simple one, for example testing how the number of folds in a paper beam affects the load it supports.

Fill in the one-page feasibility check from this lesson. Do the trial arithmetic in full. If the result does not fit the time you have, rescope the plan using at least one of the five shrinking strategies, and redo the arithmetic.

This is a planning exercise on paper. If you later carry out the plan with any tools or powered equipment, do so only with adult supervision.

**Deliverables**

- A completed one-page feasibility check
- The full trial arithmetic, including a margin
- Three risks with a plan B for each
- If needed, a rescoped version of the question with the strategy you used


## 1.6 Writing a short research proposal

*Bring everything from this module together into a clear one- or two-page proposal: what each section is for, how to write about work that has not happened yet, and how to review your own draft.* (about 35 min)

### Why write a proposal at all

A **research proposal** is a short document that explains what you plan to investigate, why, and exactly how. Professional researchers write proposals to ask for funding or for access to equipment. You might write one for a science fair, a teacher or a mentor, or simply for yourself. Whoever reads it, a proposal does three useful things:

1. It forces you to think the whole project through before you spend time and money on it.
2. It lets someone else spot problems while they are still cheap to fix.
3. It becomes a dated record of what you planned, so that later you and your readers can see clearly what was decided in advance and what changed.

Everything you have learned in this module goes into it: a sharp question, a hypothesis that could fail, a fair baseline, operational definitions, a look at the literature, and a feasibility check.

### The sections of a short proposal

A one- or two-page proposal usually contains the following sections. Keep each short.

- **Title.** Specific, not catchy. "Effect of rubber fingertip pads on the slip mass of a two-finger gripper" tells the reader what to expect.
- **Question.** One sentence.
- **Background.** A paragraph on what is already known, with references, and the gap your question addresses. This is where your literature notes pay off.
- **Hypothesis and prediction.** What you expect, why, and what result would count against it. Include the null hypothesis.
- **Method.** What you will change and measure (with operational definitions), the baseline, what you will hold constant, how many trials, and in what order.
- **Analysis and success criteria.** How you will summarise the data, and what result would support or fail to support the hypothesis. Decide this now.
- **Resources and timeline.** What you need, what it costs, and when each stage will happen.
- **Risks and safety.** What could go wrong, your plan B, the hazards and precautions involved, and who will supervise.
- **Limitations and scope.** Where your answer will and will not apply.
- **Expected outputs.** What you will produce, for example a report, a dataset, or designs. State that you will report the outcome whichever way it goes.

### Worked example: the TV-01 proposal

The TV-01 project page on this site is a real proposal, and it is worth reading alongside this lesson. Its parts line up with the sections above:

- **Motivation** plays the role of background: it explains why deformable objects are hard, and why expensive equipment limits who can work on them.
- **Question:** the single central research question.
- **Methodology:** the platform, the controlled occlusion, the three conditions compared (vision only, force only, vision with force fusion), and the tasks.
- **Objectives:** what the project aims to do, including defining the evaluation protocol *before* any experiment is run.
- **Challenges** and **limitations:** what might go wrong, and how far the conclusions could be trusted.
- **Milestones:** the timeline, in stages.

Read its wording carefully. It says "asks", "is intended" and "measure whether". It never says "shows" or "found", because the project is proposed and has no results. That is exactly the tone your own proposal needs.

### A short example proposal

Here is a compact proposal for a home-scale study. The study is invented for this lesson, and any numbers in it are plans, not data.

```text
Title: Effect of rubber fingertip pads on the slip mass of a
       hand-operated two-finger gripper

Question: Do rubber fingertip pads increase the mass a smooth plastic
cup can hold, gripped by a hand-operated two-finger gripper, before
it slips?

Background: Rubber generally has a higher coefficient of friction
against plastic than hard plastic does. [Two or three cited sources
would go here.] I found no measurements for this particular low-cost
gripper.

Hypothesis: Pads will increase the slip mass, because friction force
increases with the friction coefficient at the same squeezing force.
Null hypothesis: pads make no difference to the slip mass.

Method: Independent variable: pads / no pads (baseline). Dependent
variable: slip mass, defined as the total mass of 10 g washers added,
one every 5 s, when the cup first moves 5 mm against a pencil mark.
Controlled: same cup, same gripper, closing force set by the same
rubber band, cup wiped clean before each trial. 15 trials per
condition, in a randomised order generated from a recorded seed.

Analysis: Mean and standard deviation of slip mass per condition.
The hypothesis is supported if the mean with pads is at least 30 g
higher and the ranges of the middle half of results do not overlap.

Timeline: Week 1 build and pilot (5 trials). Week 2 main trials.
Week 3 analysis and report.

Risks and safety: Pads may peel off (spares cut in advance). Hand
tools only; no power or sharp tools needed.

Limitations: One cup, one gripper, one closing force. The results
may not apply to other objects or materials.

Outputs: A short report with all raw data, including if pads make
no difference.
```

Notice how much of the work is done by the method and analysis sections. A reader could set up this experiment from the text alone, and could check afterwards whether you did what you said.

### Writing about the future

A proposal describes work that has not happened. Keep the language consistent with that:

- Use "will test", "aims to measure", "asks whether", "expects".
- Avoid "shows", "proves", "demonstrates" and "found". These words belong only to completed work with evidence behind it.
- State expected results as predictions with reasons, not as conclusions.

### Common weaknesses

When teachers and reviewers read proposals, the same problems come up again and again:

1. **The question is too broad** to answer within the time available.
2. **The method is vague.** "I will test the gripper on various objects" cannot be repeated or judged.
3. **There is no baseline**, so any result would be uninterpretable.
4. **Success is not defined**, leaving room to declare victory whatever happens.
5. **The number of trials is missing**, or is one per condition.
6. **No limitations or risks are given**, which suggests they have not been thought about.
7. **Results are claimed**, or implied, before the work is done.

### Review your own draft

Before you share it, read your draft as a sceptical stranger would. Could someone repeat your method from the text alone? Could your result come out "no", and would you know if it did? Is every vague word defined? Does the timeline match your feasibility check? Then give it to someone else and ask them what they think you are going to do. If their answer differs from your intention, your proposal is not yet clear.

### Recap

A short proposal states a question, background with sources, a hypothesis that could fail, a detailed method with operational definitions and a baseline, success criteria decided in advance, resources, a timeline, risks, safety and limitations. It is written in the future tense and claims no results. Date it, share it, and treat the feedback as part of the research.

> **Keep the dated original.** Save a dated copy of your proposal before you start collecting data, and do not overwrite it. If the plan changes, write the changes in a separate log with dates and reasons. Your final report can then say honestly what was planned, what was changed and why.

#### Check your understanding

1. Which sentence is written appropriately for a proposal?
   A) This study proves that pads improve grip.
   B) Our results demonstrate a large improvement.
   C) We found that pads double the slip mass.
   D) This study will test whether pads increase the slip mass.

2. Where in a proposal does your literature reading mainly appear?
   A) In the background section, with references, ending in the gap your question addresses
   B) In the results section
   C) Nowhere; proposals do not cite sources
   D) Only in the title

3. Why should the success criteria be written into the proposal rather than decided after the experiment?
   A) Because reviewers like long proposals
   B) So that the result is judged against a standard that was fixed before the data could influence it
   C) Because the criteria never matter
   D) So that you can change them later

4. A proposal's method says: "I will test the robot on various objects a few times." What is the main weakness?
   A) It is too detailed
   B) It uses the future tense
   C) It is too vague to be repeated or evaluated: which objects, how many trials and what measure are all missing
   D) It mentions objects

5. In the TV-01 proposal, which part plays the role of the background section?
   A) Milestones
   B) Limitations
   C) Future work
   D) Motivation

#### Project: Write your one-page proposal

Write a one- or two-page proposal for a question you could investigate safely at home or in a computer simulation. You can build on the plan, literature log and feasibility check from the earlier lessons in this module.

Use the section headings from this lesson. Then:

1. Date the proposal and save a copy that you will not edit.
2. Swap proposals with a friend, family member or teacher. Ask them to explain back to you what you plan to do, and to name the weakest section.
3. Write a short response: what you would change, and why.

You do not need to carry out the study. If you do, follow the proposal as written and log every change with its date and reason. Any hands-on work with tools or powered equipment needs adult supervision.

**Deliverables**

- A dated proposal with all the sections from this lesson
- At least one cited source in the background section
- Written success criteria and a planned number of trials
- Feedback from one reader and your response to it


---

# Module 2: Experimental design

Planning experiments that give trustworthy answers: controlling variables, repeating trials, randomizing and estimating uncertainty.

**Objectives**

- Design a fair test that changes one variable while controlling others.
- Explain why repeated trials are needed and choose a sensible number.
- Use randomization to avoid hidden biases in the order of trials.
- Estimate and report measurement uncertainty.


## 2.1 Variables and controls

*How to design a fair test: spotting confounding variables, choosing control conditions, using positive and negative controls, and knowing when to change more than one thing at once.* (about 30 min)

### Why a fair test is hard

A team adds force sensors to a robot gripper and runs 20 trials in the afternoon. The robot drops a soft block only twice. That morning, without sensors, it dropped the block seven times. Success for the sensors?

Perhaps. But in the afternoon the robot had been running for hours, so its motors were warm. The operator had also had a morning's practice at placing the block. And someone had wiped the dusty table at lunchtime. Any of these changes could explain the difference, and so could the sensors. The experiment cannot tell them apart.

In the previous module you learned to name **independent**, **dependent** and **controlled** variables. This lesson is about the hard part: making sure that the independent variable is the *only* systematic difference between the conditions you compare.

### Confounding variables

A **confounding variable** (or **confounder**) is something that changes along with your independent variable and also affects the result. In the story above, time of day, motor temperature, operator practice and table cleanliness are all confounded with the sensor condition, because every sensor trial happened in the afternoon.

Confounders are dangerous because they do not announce themselves. The result looks clean, and the explanation you were hoping for is right there. To find them, ask: **"Apart from the thing I changed, what else was different between the conditions?"** Make a list. Typical suspects in robotics experiments include:

- battery or power-supply voltage, which can fall during a session;
- temperature of motors and electronics;
- wear on materials: a sponge squashed 50 times is not the same sponge;
- lighting, which affects cameras;
- the operator's growing skill at setting up or resetting each trial;
- software versions and settings;
- the position of the object at the start of each trial.

### Three ways to deal with a confounder

1. **Hold it constant.** Use the same object, the same lighting, the same start position marked with tape, and the same software version for every trial. This is what "controlled variable" means.
2. **Spread it evenly across conditions.** Some things cannot be held constant: batteries drain and people get better with practice. You can make sure such changes affect every condition equally by mixing the order of trials. A later lesson on randomisation and blocking shows how.
3. **Measure and record it.** If you cannot control something, log it: battery voltage at the start of each trial, the room temperature, the time. Then you can check afterwards whether it relates to the results.

The worst option is the most common one: not noticing the confounder at all.

### Control conditions and controlled variables

Two similar-sounding terms mean different things:

- A **controlled variable** is a factor you *hold constant*, such as the same cup in every trial.
- A **control condition** (or control group) is a condition you *compare against*, in which the thing you are testing is absent. It is the baseline: the gripper without pads, the robot without force sensing.

A good control condition differs from the test condition in **only** the one feature you are testing. If adding sensors also meant adding 30 g of mass to the fingertips and a new cable that tugs on the wrist, the "no sensor" control should ideally carry the same mass and cable with the sensor disconnected. Then the only remaining difference is the sensing itself.

### Positive and negative controls

Two more kinds of control check that your *experiment* works, separately from your hypothesis.

- A **positive control** is a case where you *know* the effect should appear. If your measurement does not detect it, something is wrong with the setup. For a force sensor, placing a known 100 g calibration mass on it should produce the corresponding reading.
- A **negative control** is a case where you know the effect should *not* appear. With no load on the sensor, the reading should be close to zero. If it creeps upward over ten minutes, you have discovered drift before it contaminated your real data.

Running both at the start and end of each session costs a few minutes, and it can save a whole dataset.

### One factor at a time, or several?

The classic advice is to change **one thing at a time**. It is good advice for beginners, because it keeps the interpretation simple. But it can miss something important: an **interaction**, where the effect of one factor depends on another.

Suppose you test fingertip pads (on or off) on two objects (a smooth cup and a rough block). That gives four combinations, called a **2 × 2 factorial design**:

```text
                  smooth cup     rough block
pads off          condition A    condition B
pads on           condition C    condition D
```

If the pads help a lot on the smooth cup but hardly at all on the rough block, that is an interaction. Testing only the smooth cup would have made the pads look universally helpful, and testing only the rough block would have made them look useless. A factorial design tests every combination of the factors, so it can reveal interactions. The cost is more trials: each extra factor multiplies the number of combinations.

The TV-01 proposal has this structure. It plans to run three sensing conditions across several materials the controller was not tuned on, which allows the question "does force sensing help more for some materials than others?" to be asked. As always, this is a plan, and no results exist yet.

### Within or between?

If the *same* robot is tested in every condition, the design is called **within-subjects**: each robot acts as its own comparison, which removes differences between individual robots. If *different* robots, grippers or objects are used for different conditions, the design is called **between-subjects**, and any differences between those units become possible confounders. For most small robotics projects with a single platform, within-subjects is natural. Its main risk is **order effects**, which the lesson on randomisation tackles.

### Recap

A fair test makes the independent variable the only systematic difference between conditions. List possible confounders, then hold them constant, spread them evenly across conditions, or measure them. A control condition is a baseline you compare against; a controlled variable is something you hold fixed. Positive and negative controls check that the measurement itself works. Factorial designs cost more trials, but they reveal interactions that one-factor-at-a-time testing misses.

#### Check your understanding

1. All the "sensor on" trials were run after all the "sensor off" trials, as the battery slowly drained. What is the battery voltage in this experiment?
   A) The dependent variable
   B) A confounding variable, because it changed along with the condition and may affect performance
   C) A positive control
   D) Irrelevant, because it was not the thing being tested

2. Before each session, you place a known 200 g mass on a force sensor and check the reading. What is this?
   A) A negative control
   B) A confounder
   C) A positive control
   D) A between-subjects design

3. Pads greatly improve grip on smooth objects but make almost no difference on rough ones. This is an example of:
   A) An interaction between pad condition and object type
   B) A failed experiment
   C) A negative control
   D) Measurement drift

4. Adding a sensor also adds mass and a cable to the gripper. What is the best control condition?
   A) The original gripper with nothing attached
   B) A different, lighter gripper
   C) No control is needed
   D) The same gripper carrying the same mass and cable, with the sensor's readings not used

#### Project: Hunt the confounders

Read this made-up scenario. A student tests whether a new line-following program works better than the old one. On Monday they run the old program ten times on a hand-drawn track. On Friday they run the new program ten times on a freshly printed track, in a different room, after fully charging the batteries. The new program completes more laps.

1. List every possible confounder you can find. Aim for at least five.
2. For each one, say whether you would hold it constant, spread it across conditions, or measure it.
3. Redesign the experiment in a short paragraph so that the program is the only systematic difference.
4. Bonus: sketch a 2 × 2 factorial version that also tests two kinds of track.

This is a paper exercise. You do not need to build or run anything.

**Deliverables**

- A list of at least five possible confounders
- A strategy for each one: hold constant, spread across conditions, or measure
- A redesigned, fairer experiment in one paragraph
- Optional: a 2 × 2 factorial layout

**Safety (adult supervision required):** This is a paper exercise. If you later build and test a real robot with motors or batteries, do it only with adult supervision, keep fingers clear of moving parts, and follow the battery maker's charging instructions.

**Go further:**

- Confounding (Wikipedia): https://en.wikipedia.org/wiki/Confounding — A detailed article on confounding variables and how studies try to control them. Parts of it are advanced; the opening sections are the most useful.


## 2.2 Repeatability, trials and sample size

*Why one run is never enough, how the spread of repeated results tells you how much to trust an average, and a practical way to decide how many trials an experiment needs.* (about 35 min)

### The same experiment, different answers

Put a cup in a gripper, add washers until it slips, and write down the mass. Now do it again with nothing changed. You will almost certainly get a different number. The cup sits a fraction of a millimetre differently, a washer lands slightly off-centre, a speck of dust changes the friction. Real systems vary from run to run, and robots more than most.

This variation is not a nuisance to hide. It is information. It tells you how much any single result can be trusted, and whether a difference between two conditions is real or just luck. This lesson shows you how to measure it, and how to decide how many trials you need.

### Repeatability and reproducibility

- **Repeatability:** the same person, the same equipment and the same procedure, run again and again in a short time. How close are the results?
- **Reproducibility:** someone else, with their own equipment, following your written procedure. Do they get a similar answer?

Repeatability is something you can check yourself in a single session. Reproducibility depends on how well you wrote down your method, which is one reason the previous module put so much weight on operational definitions.

### Describing a set of repeated results

Here are ten made-up slip masses, in grams, for illustration only:

```text
212, 198, 225, 205, 190, 218, 230, 201, 209, 214
```

Three numbers summarise them well:

- The **mean** (average) is the best single estimate of the typical value.
- The **standard deviation** (SD) measures how spread out the individual results are. Roughly, it is the typical distance of a result from the mean.
- The **standard error of the mean** (SE) measures how uncertain the *mean itself* is. It is calculated as SD ÷ √n, where n is the number of trials.

Python's standard library can calculate all three:

```python
import statistics

# Made-up slip masses in grams, for illustration only.
slip_g = [212, 198, 225, 205, 190, 218, 230, 201, 209, 214]

n = len(slip_g)
mean = statistics.mean(slip_g)
sd = statistics.stdev(slip_g)   # sample standard deviation
se = sd / n ** 0.5              # standard error of the mean

print(f"n = {n}")
print(f"mean = {mean:.1f} g")
print(f"standard deviation = {sd:.1f} g")
print(f"standard error = {se:.1f} g")
```

Output:

```text
n = 10
mean = 210.2 g
standard deviation = 12.3 g
standard error = 3.9 g
```

Individual trials typically land about 12 g from the mean. But the mean of ten trials is much more certain than any single trial: its standard error is only about 4 g. A common rough guide is that the true mean probably lies within about two standard errors of the measured mean, here roughly 210 ± 8 g. The data-analysis module in the computational engineering pathway covers this more carefully.

### The square-root law

Because SE = SD ÷ √n, the uncertainty of a mean shrinks as you add trials, but slowly:

- 4 times as many trials halves the standard error;
- 100 times as many trials divides it by 10.

This explains why the first few repetitions are enormously valuable, and why going from 100 to 200 trials buys much less. It also tells you that **halving your uncertainty costs four times the effort**, which matters when you plan a schedule.

### Success rates are noisy too

Many robot experiments count successes: "7 out of 10 grasps succeeded". It is tempting to treat 7/10 as a precise 70%. It is not. The following simulation pretends to be a robot whose *true* success rate is exactly 70%, and runs a batch of 10 trials 1,000 times over, then the same with batches of 50 trials:

```python
import random

random.seed(1)
TRUE_RATE = 0.7   # pretend robot: succeeds 70% of the time

def run_trials(n):
    return sum(1 for _ in range(n) if random.random() < TRUE_RATE)

for n in (10, 50):
    results = [run_trials(n) / n for _ in range(1000)]
    print(f"{n} trials: observed rate ranged {min(results):.2f} to {max(results):.2f}")
```

Output:

```text
10 trials: observed rate ranged 0.20 to 1.00
50 trials: observed rate ranged 0.50 to 0.88
```

With only 10 trials, a robot that *always* has the same 70% ability sometimes scored 100% and, very rarely, as low as 20%, purely by chance. Now imagine comparing two controllers with 10 trials each, where one scores 7/10 and the other 9/10. A difference that large can easily appear by luck alone, even if the controllers are identical. With 50 trials per batch the range is much narrower, though still wide.

A handy approximation for the standard error of a success rate p measured over n trials is √(p × (1 − p) ÷ n). For p = 0.7 and n = 10, that is √(0.21 ÷ 10) ≈ 0.14, or 14 percentage points. With n = 50, it falls to about 0.065, or 6.5 points.

### What counts as a trial

Ten trials only help if they are ten **independent** attempts. Reading the same sensor ten times during one grasp is not ten trials; it is one trial measured ten times. Similarly, if you do not reset the object to its start position between attempts, each trial inherits the state left by the last one. Treating linked measurements as if they were independent is called **pseudo-replication**. It makes results look far more certain than they are. Decide what one trial is, and write down the reset procedure that starts each one fresh.

### How many trials?

There is a formal method for this, called **power analysis**, which you may meet later. A practical version works like this:

1. **Decide the smallest difference worth detecting.** If pads that add less than 20 g of slip mass would not be worth using, then 20 g is your target.
2. **Estimate the spread.** Use a small pilot run (covered in a later lesson) to estimate the standard deviation. Suppose it is about 12 g.
3. **Choose n so the uncertainty is well below the target.** You want the standard error of each condition's mean to be a fraction of the difference, say a quarter. That means SD ÷ √n ≤ 5 g, so √n ≥ 12 ÷ 5 = 2.4, and n ≥ 5.76. Round up to **6 trials** per condition, and add a few more for safety and for any trials that must be excluded. So, 8–10 trials per condition.

If the arithmetic gives a number you cannot afford, you have learned something important before starting: either reduce the variation (better fixtures, more careful resets) or accept that your study can only detect larger differences, and say so.

Finally, **decide the number of trials in advance**. Running trials until the result looks good, and then stopping, is a subtle way of fooling yourself. The lesson on pre-registration explains why.

### Recap

Repeated trials reveal variation, and variation tells you how much to trust a result. Report the mean, the standard deviation and the number of trials. The uncertainty of a mean shrinks with √n, so four times the trials halves it. Small samples of success rates are especially noisy. Make sure each trial is independent. Choose the number of trials from the smallest difference you care about and the spread you expect, and fix it before you begin.

#### Check your understanding

1. Ten trials have a standard deviation of 12 g. Roughly how many trials would you need to halve the standard error of the mean?
   A) 20
   B) 15
   C) 40
   D) 100

2. Controller A succeeds 7 times out of 10 and controller B 9 times out of 10. What is the most reasonable conclusion?
   A) B is clearly better
   B) With only 10 trials each, a difference this size could easily be due to chance; more trials are needed
   C) A is clearly better
   D) Success rates cannot be compared

3. A student records the force sensor 50 times during a single grasp and reports "50 trials". What is wrong?
   A) Nothing, more readings are always better
   B) The sensor should be read 100 times
   C) Force cannot be measured during a grasp
   D) These are 50 measurements of one trial, not 50 independent trials

4. What does the standard error of the mean tell you?
   A) How uncertain the average is, given the spread and the number of trials
   B) The largest result recorded
   C) How far each individual trial is from the mean
   D) Whether the experiment was fair

5. A pilot gives a standard deviation of 10 g, and you want each condition's standard error to be at most 2.5 g. What is the minimum number of trials per condition?
   A) 4
   B) 16
   C) 25
   D) 10

#### Project: See the square-root law for yourself

Choose one of these options.

**Option A (Python).** Modify the success-rate simulation from this lesson. Run it with n = 5, 10, 20, 50, 100 and 200 trials. For each n, print the smallest and largest observed rate, and also the standard deviation of the 1,000 observed rates (use `statistics.stdev`). Plot or tabulate the standard deviation against n. Check whether it roughly follows √(0.7 × 0.3 ÷ n).

**Option B (paper and coins).** Flip a coin 10 times and record the fraction of heads. Repeat this 10 times. Then do 10 batches of 40 flips each (or share the work with friends). Compare the spread of the fractions in the two cases.

In either case, write two or three sentences on what this means for how many trials a robot experiment needs.

**Deliverables**

- A list of observed spreads for at least four different numbers of trials
- A comparison with the formula (Option A) or between batch sizes (Option B)
- A short paragraph applying the result to choosing a number of trials

**Go further:**

- Standard error (Wikipedia): https://en.wikipedia.org/wiki/Standard_error — The definition of the standard error of the mean, why it shrinks with √n, and how it is used to form confidence intervals.


## 2.3 Randomisation, blinding and bias

*The hidden biases that creep into experiments through trial order, selection and judgement, and the simple tools that defend against them: randomisation, blocking, counterbalancing and blinding.* (about 30 min)

### Bias is not the same as dishonesty

A **bias** in an experiment is a systematic push in one direction: something that makes one condition look better or worse than it really is, again and again. Most biases come from honest people doing reasonable-seeming things. You run all the "old method" trials first because the robot is already set up that way. You choose the "good" sponge for the new method because the other one looked worn. You judge a borderline trial a success because you were really hoping it would be.

You cannot rely on good intentions to remove bias, because you usually cannot see it happening. Instead, you design the experiment so that bias has nowhere to hide. This lesson covers the main tools.

### Order effects

In a within-subjects design (one robot tested in every condition), the **order** of trials matters. Over a session:

- batteries drain and motors warm up;
- materials wear: foam compresses, cloth stretches, rubber collects dust;
- the operator gets faster and more consistent at resetting trials;
- the lighting changes as the sun moves.

If you run all 10 vision-only trials, then all 10 force-only trials, then all 10 combined trials, every one of these drifts is confounded with the condition. The last condition benefits from a practised operator, and suffers from tired materials. You cannot tell which effect won.

### Randomisation

The most powerful defence is **randomisation**: let a random process decide the order of trials. Then no drift can line up systematically with any one condition. On average, good and bad moments get shared out fairly.

"Random" must really mean random. Picking an order that *feels* random to you is not good enough, because people are bad at it. Neither is strict alternation (A, B, A, B…), which can line up with any regular pattern in the system, such as a reset procedure that is easier every second time.

### Blocking

Pure randomisation can, by bad luck, still bunch one condition at the start. **Blocking** fixes this. You divide the session into blocks, each containing every condition exactly once, and randomise the order *within* each block. Every condition then appears once early, once in the middle and once late, but the order inside each block is still unpredictable.

This short program generates a blocked, randomised schedule for three conditions in four blocks:

```python
import random

random.seed(2026)   # record the seed so the order can be reproduced
conditions = ["vision", "force", "fusion"]
blocks = 4

schedule = []
for b in range(blocks):
    block = conditions[:]        # copy the list
    random.shuffle(block)        # new random order in every block
    schedule.extend(block)

for i, c in enumerate(schedule, start=1):
    print(i, c)
```

Output:

```text
1 fusion
2 force
3 vision
4 force
5 vision
6 fusion
7 fusion
8 force
9 vision
10 vision
11 force
12 fusion
```

Two habits matter here. First, **generate the schedule before you begin**, print it, and follow it exactly, even when it is inconvenient to switch conditions. Second, **record the seed**. Anyone running the same program with seed 2026 gets the same schedule, so you can show that the order was decided in advance and was not adjusted along the way. (Different versions of Python can, in principle, produce different orders from the same seed, so also save the printed schedule itself.)

### Counterbalancing

For a small number of conditions, a fixed balanced order is an alternative. With two conditions, the sequence **A B B A** puts each condition once early and once late, so a steady drift affects both equally. Repeating the pattern (A B B A A B B A…) is called **counterbalancing**. It handles smooth, steady drifts well. Randomisation handles a wider range of hidden patterns, which is why it is usually preferred when it is practical.

### Selection bias

Bias also enters through *which* trials, objects or materials go into each condition. If you pick test materials yourself, you may, without meaning to, choose ones you expect to suit your method. Defences:

- Decide the set of test materials in advance and use all of them in every condition.
- If you must assign objects to conditions, assign them randomly.
- Never remove a trial after seeing its result unless a rule written beforehand says so. Excluding trials is covered in the next lesson.

The TV-01 proposal includes a guard of this kind in its question: it specifies *unfamiliar* materials, which the controller was not tuned on. That protects against a method that only works on the materials its designers happened to adjust it for.

### Observer bias and blinding

Whenever a person judges an outcome ("did it slip?", "was the fold neat?"), their expectations can tilt borderline calls. This is **observer bias**, and it is a close relative of **confirmation bias**, our tendency to notice evidence that agrees with what we already believe.

**Blinding** means hiding the condition from whoever might be influenced by it. In medicine, a *double-blind* trial hides the treatment from both the patient and the doctor assessing them. Robots do not have expectations, but the people running and scoring them do. Practical options:

- **Automatic measures.** Let the logged data decide: "a drop is any moment the gripper force falls below 0.2 N for more than 0.5 s". No judgement, no bias (though the threshold must be fixed in advance).
- **Blind scoring.** Record a video of every trial, rename the files with random codes, and have someone who does not know the code score them.
- **Coded conditions.** When the person running the trials does not need to know the condition, label the conditions "X" and "Y" in the software.

Full blinding is often impossible in small projects, since you can usually *see* whether the pads are on. Then say so honestly in your limitations, and rely as much as you can on automatic, pre-defined measures.

### Recap

Bias is a systematic push in one direction, and it usually comes from reasonable-looking choices. Randomise the order of trials, preferably within blocks, and record the seed and the schedule before you start. Counterbalancing (A B B A) handles steady drifts. Fix the set of test materials in advance to avoid selection bias. Use blinding, automatic measures and pre-defined thresholds against observer bias, and report honestly where blinding was not possible.

> **Follow the schedule, even when it is annoying.** A randomised schedule only protects you if you follow it. Swapping two trials "because the pads were already on" reintroduces the bias that randomisation was meant to remove. If you do have to depart from the schedule, for example because a part breaks, note it in your log with the time and the reason.

#### Check your understanding

1. A team runs all trials of method A in the morning and all trials of method B in the afternoon. What is the main risk?
   A) The experiment takes too long
   B) Method B will have more trials
   C) Anything that changes during the day, such as temperature, battery or operator skill, is confounded with the method
   D) There is no risk if the robot is the same

2. What does blocking add to simple randomisation?
   A) Each block contains every condition once, so no condition can end up bunched at the start or end by chance
   B) It removes the need to randomise
   C) It doubles the number of trials
   D) It makes the order predictable

3. Why should you record the random seed used to generate a trial order?
   A) It makes the order more random
   B) It is required by Python
   C) So that you can change the order later
   D) So the schedule can be regenerated, showing it was decided in advance

4. You will judge from video whether each fold is "neat". Which step best reduces observer bias?
   A) Watching the videos more carefully
   B) Having someone who does not know which condition each coded video belongs to score them against written criteria
   C) Scoring only the trials you remember well
   D) Scoring the new method's videos first

5. With two conditions, which order is counterbalanced against a steady drift?
   A) A A B B
   B) A B A B
   C) A B B A
   D) B B A A

#### Project: Design a bias-resistant schedule

You are planning a made-up study of two paper-glider designs, flown 12 times each indoors, measuring distance from a fixed launch line.

1. List at least four things that might drift during the session, for example your throwing technique, or the gliders getting bent.
2. Write or adapt a Python program (or use a shuffled pack of cards) to generate a blocked, randomised order of the 24 flights. Record the seed or the card order.
3. Describe how you would make the distance measurement as free from judgement as possible.
4. Say honestly what cannot be blinded in this study, and how you will report it.

You do not need to fly the gliders. If you do, fly them indoors in a clear space, away from people's faces.

**Deliverables**

- A list of at least four possible drifts during the session
- A blocked, randomised schedule of 24 flights, with its seed or card order recorded
- A judgement-free definition of the distance measurement
- A short limitations statement about blinding

**Go further:**

- Blocking (statistics) (Wikipedia): https://en.wikipedia.org/wiki/Blocking_(statistics) — How grouping similar experimental units into blocks controls nuisance variables.
- Blinded experiment (Wikipedia): https://en.wikipedia.org/wiki/Blinded_experiment — Single-, double- and triple-blind designs, and why hiding the condition reduces bias.


## 2.4 Pre-registration and decision rules

*Writing down your hypotheses, measures, sample size, exclusion rules and analysis before you collect data, so that the data cannot quietly reshape the questions they are supposed to answer.* (about 30 min)

### The problem: too many ways to win

Imagine you test a new gripper controller and record ten different measures: drops, slips, peak force, average force, completion time, recovery time, and four more. You run 20 trials per condition and then compare the conditions on each measure in turn.

Suppose the controller actually makes no difference at all. By chance alone, some measures will still come out looking better for one condition. If each measure has a 5% chance of producing a convincing-looking fluke, then the chance that **at least one** of ten does is:

```text
1 − 0.95^10 ≈ 1 − 0.60 = 0.40
```

(This assumes the measures are independent; related measures change the exact number, but not the lesson.) That is roughly a 40% chance of finding something that looks like an effect where there is none. With 20 measures it rises to about 64%. Add choices about which trials to exclude, whether to analyse each material separately, and when to stop collecting data, and almost any dataset can be made to tell a story. Researchers call this the **garden of forking paths**: every reasonable-looking choice made *after* seeing the data is a fork, and enough forks lead somewhere impressive.

You met the basic protection in the lesson on hypotheses: decide success before you look. This lesson turns that habit into a complete written document.

### What pre-registration is

**Pre-registration** means writing down the important decisions about a study, dating them, and saving or publishing them *before* collecting the data that will test the hypothesis. A complete pre-registration covers:

1. **Hypotheses**, including the direction of the expected effect.
2. **The primary measure**, with its full operational definition, plus any secondary measures.
3. **The design:** conditions, baseline, materials, randomisation.
4. **Sample size:** the number of trials, and how it was chosen.
5. **Stopping rule:** when data collection ends.
6. **Exclusion rules:** which trials, if any, will be left out, and why.
7. **The analysis plan:** exactly how the data will be summarised and compared.
8. **Decision rules:** which result will count as supporting the hypothesis, which will count against it, and which will be inconclusive.

### Decision rules in detail

**Stopping rules.** Fix the number of trials in advance, for example "15 trials per condition". The alternative, checking the results after every few trials and stopping when they look good, is called **optional stopping**. Because results fluctuate by chance, a researcher who keeps checking will eventually catch a lucky moment. It feels innocent, and it badly inflates false positives.

**Exclusion rules.** Sometimes trials genuinely need to be removed: the cable came loose, someone bumped the table. The rule must be written beforehand and based on what happened *during* the trial, never on its outcome. For example: "A trial is excluded if the log shows a communication dropout longer than 1 s, or if the operator notes a physical disturbance at the time. All excluded trials are reported, with reasons, and are replaced by extra trials at the end of the schedule." Notice that the operator writes the note *at the time*, before seeing the result.

**Success criteria.** State what result would support the hypothesis, as concretely as you can. Here is a made-up example for a hypothetical study, written in the style of a pre-registration:

> The hypothesis will be treated as supported if the fusion condition has fewer drops during dropouts than the vision-only condition, by at least 3 drops out of 20, on the primary measure. A smaller difference in either direction will be reported as inconclusive. More drops in the fusion condition will be reported as evidence against the hypothesis.

Notice the three outcomes: supported, inconclusive and against. Writing all three down in advance stops you from relabelling a disappointing result afterwards.

### Confirmatory and exploratory

Pre-registration does not forbid looking at anything else. It separates two kinds of analysis:

- **Confirmatory analysis** follows the plan and tests the pre-registered hypothesis. It carries the most weight.
- **Exploratory analysis** is everything else: interesting patterns you notice afterwards. It is valuable for generating new hypotheses, but it must be labelled as exploratory, because it has walked through the garden of forking paths.

A related bad habit is **HARKing**: Hypothesising After the Results are Known. It means presenting a pattern found by exploration as if it had been the hypothesis all along. Pre-registration makes HARKing visible, because the original hypothesis is on record.

### Deviations happen

Real experiments rarely go exactly to plan. A sensor fails, and you have to use a replacement. A material is no longer sold. That is fine. Pre-registration is not a promise that nothing will change; it is a record that lets readers see what changed. Keep a **deviations log**: the date, what changed, why, and whether the change was made before or after seeing any results. Report it in full.

### How to pre-register

At a professional level, researchers use public registries. For example, the Center for Open Science runs the OSF Registries, where a plan can be time-stamped and later made public. Some journals offer **Registered Reports**, in which the plan is peer reviewed and accepted for publication before the data are collected, so that publication does not depend on the result.

For a student project, the same idea works with simple tools:

- write the plan, date it, and save it as a PDF you do not edit afterwards;
- email it to a teacher or mentor, so there is an independent time stamp;
- or commit it to a version-control repository and push it to a hosting site, which records when it arrived. A commit that stays only on your own computer is not independent proof, because its date can be changed (the engineering-documentation module explains version control).

The TV-01 proposal includes this step among its planned milestones: an evaluation protocol with pre-registered success measures, to be written before any experiment is run. At the time of writing, that milestone is planned and has not been completed, and no experiments have taken place.

### Recap

Each choice made after seeing the data is a chance to fool yourself, and many small choices add up to a high chance of a false finding. Pre-registration fixes the hypothesis, primary measure, design, sample size, stopping rule, exclusion rules, analysis and decision rules in a dated record before the data arrive. Label anything unplanned as exploratory, avoid HARKing, and log every deviation.

> **Pre-registration protects you, too.** It can feel like extra work with no reward. But when your result comes in, a pre-registration lets you and everyone else trust it, whether it is positive or negative. It is also the clearest possible evidence that you did not adjust your methods to get the answer you wanted.

#### Check your understanding

1. A researcher checks the results after every five trials and stops as soon as the new method looks clearly better. What is this called, and why is it a problem?
   A) Blocking; it reduces bias
   B) Optional stopping; chance fluctuations make it likely to stop at a lucky moment, inflating false positives
   C) Pre-registration; it is good practice
   D) Counterbalancing; it balances drift

2. Which is an acceptable exclusion rule?
   A) Exclude any trial whose result looks unusual
   B) Exclude the worst three trials in each condition
   C) Exclude trials where the log shows a communication dropout over 1 s, as defined before data collection, and report all exclusions
   D) Exclude trials that do not support the hypothesis

3. If 10 independent measures each have a 5% chance of a fluke, roughly how likely is at least one fluke?
   A) 5%
   B) 10%
   C) 50%
   D) 40%

4. After the experiment, you notice an unexpected pattern in recovery times. How should you report it?
   A) As an exploratory observation worth testing in a future study
   B) As the main pre-registered result
   C) Not at all
   D) As proof that the method works

#### Project: Write a pre-registration

Write a one-page pre-registration for a small study you could carry out safely at home, or for the proposal you wrote at the end of the previous module. Use the eight headings from this lesson.

Make sure your decision rules include all three outcomes: what would count as support, what would count as against, and what would be inconclusive. Write at least one exclusion rule that is based on events during a trial, not on its result.

Date the document and save a copy that you will not edit. Start an empty deviations log beside it.

**Deliverables**

- A dated pre-registration covering all eight headings
- Decision rules for supported, inconclusive and against outcomes
- At least one exclusion rule and a fixed stopping rule
- An empty deviations log with columns for date, change, reason, and before or after results

**Go further:**

- Preregistration (Center for Open Science): https://www.cos.io/initiatives/prereg — An explanation of pre-registration from the organisation that runs the OSF Registries, with guidance on how to register a study plan.
- Preregistration (science) (Wikipedia): https://en.wikipedia.org/wiki/Preregistration_(science) — Background on why pre-registration developed, how it works and the debates around it.


## 2.5 Pilot experiments

*A small practice run of your procedure, done before the real experiment: what it can reveal, how to use what it tells you, and the line you must not cross between piloting and peeking.* (about 25 min)

### A rehearsal, not a result

Theatre companies rehearse before opening night, not to find out whether the audience will like the play, but to discover that the door sticks and the second scene change takes three minutes instead of one. A **pilot experiment** is the same thing for research: a small, early run of your full procedure, done to find the problems in the *experiment* before they ruin the real data.

A pilot is not a small version of the study meant to give an early answer. Its job is to answer questions such as: Does the setup work? How long does each trial really take? Can I actually record the measure I defined? This lesson explains what to look for, how to use the results, and the one important rule for keeping a pilot honest.

### What a pilot can reveal

**Practical problems with the setup.** The gripper's cable snags at one end of its travel. The camera's view of the pencil mark is blocked. The log file overwrites itself at every restart. Every one of these is much cheaper to discover in five pilot trials than halfway through sixty real ones.

**Timing.** You estimated 3 minutes per trial in your feasibility check. The pilot shows that resetting the sponge to the same shape takes 5 minutes on its own. Now you can revise the plan before committing to it.

**Whether the measure works.** Perhaps the 5 mm slip mark is impossible to judge on video, or the force sensor saturates (reaches the top of its range) well before the object slips. Either way the operational definition must change, and the pilot is the right time to change it.

**Floor and ceiling effects.** If the task is so easy that every condition succeeds every time, then no difference can show up. That is a **ceiling effect**. If it is so hard that everything fails, that is a **floor effect**. Suppose in your pilot the gripper holds the block in 5 of 5 trials in both conditions. You should then make the task harder, for example with a heavier load, a faster movement or a slipperier object, so that the experiment has room to show a difference if one exists.

**An estimate of the spread.** In the lesson on sample size you needed an estimate of the standard deviation to choose the number of trials. A pilot provides one. Here is a worked example with made-up numbers. Suppose five pilot trials give a standard deviation of about 12 g, and you want each condition's standard error to be no more than 4 g:

```text
SE = SD ÷ √n ≤ 4 g
√n ≥ 12 ÷ 4 = 3
n ≥ 9 trials per condition
```

A standard deviation from only five trials is itself quite uncertain, so add a margin: plan for 12 trials per condition, say.

**Rehearsal for you.** The first few times you run any procedure, you will be slower and less consistent. Pilot trials let that learning happen before the real data, which also reduces the order effect of an operator who improves during the session.

### The rule: pilot the procedure, not the hypothesis

Here is the line you must not cross. Use the pilot to fix the **procedure**: the setup, the timing, the measurement, the difficulty of the task. Do **not** use it to look at which condition is winning and then adjust things until your favoured condition wins.

The difference matters. "The task was too easy for *both* conditions, so I made it harder" is a legitimate pilot change. "The new method was losing, so I changed the materials until it started winning" is not. It is the garden of forking paths again, dressed up as a pilot.

Two practical habits keep you on the right side of the line:

1. **Keep pilot data out of the main analysis.** Pilot trials were run under a procedure that was still changing, so they do not belong with the final data. Report that a pilot was done, what it showed, and what was changed, but analyse only the main trials.
2. **Freeze the protocol after the pilot.** Write down every change the pilot led to, then finalise and date your pre-registration. From that moment, the procedure stays fixed, apart from logged deviations.

If you can, focus the pilot on things that do not reveal much about the hypothesis: run several trials of the *baseline* only, or just check timing and logging.

### Staging as a larger kind of pilot

Large projects often pilot their parts before the whole. The TV-01 proposal plans a single-arm prototype, to be used to characterise the force sensor before two arms are made to cooperate. Measuring a sensor's noise and drift on its own is a pilot-like step: it tests an assumption that the main experiment depends on, while the stakes are still low. It is part of the plan; no experiments have been run.

### A pilot checklist

After your pilot, answer each of these:

```text
Did every part of the setup work? What broke or snagged?
Actual time per trial, including reset:
Could the primary measure be recorded as defined? Any changes?
Any floor or ceiling effect? How will difficulty change?
Estimated standard deviation of the primary measure:
Revised number of trials per condition:
Did the data save correctly, with all fields?
List of procedure changes, with reasons:
Date protocol frozen:
```

### Recap

A pilot is a rehearsal that tests the experiment, not the hypothesis. It reveals setup problems, real timings, unworkable measures, floor and ceiling effects, and the spread you need for choosing the sample size. Change the procedure on the basis of the pilot, never in order to favour a condition. Keep pilot data out of the main analysis, record every change, and then freeze the protocol.

#### Check your understanding

1. In a pilot, both conditions succeed in every trial. What does this suggest?
   A) Both methods are perfect, so the study is finished
   B) A floor effect
   C) The new method is better
   D) A ceiling effect: the task is too easy to reveal any difference, so it should be made harder

2. Which pilot-based change is legitimate?
   A) Changing the material because the new method was losing
   B) Lengthening the reset time because resetting the sponge properly took longer than expected
   C) Dropping the baseline because it performed well
   D) Adding pilot trials where the new method won to the main data

3. A pilot estimates a standard deviation of 15 g. You want a standard error of at most 5 g per condition. What is the minimum number of trials?
   A) 9
   B) 3
   C) 15
   D) 25

4. Why are pilot trials normally kept out of the main analysis?
   A) Because pilot data are always wrong
   B) Because they take too long to analyse
   C) Because they were run under a procedure that was still changing, so they are not comparable with the final trials
   D) Because nobody is allowed to see them

#### Project: Pilot a paper experiment

Choose a simple, safe experiment: for example, how far a paper glider flies, or how many coins a folded-paper beam supports between two books.

1. Write a short procedure and an operational definition for the measure.
2. Run five pilot trials, timing each one including the reset.
3. Fill in the pilot checklist from this lesson.
4. Make at least one change to the procedure based on the pilot, and write down why.
5. Calculate the number of trials you would need for the main experiment from your pilot standard deviation, and a target standard error you choose.

Use only paper, coins, books and a ruler. No tools or power are needed.

**Deliverables**

- A written procedure and operational definition
- Records of five pilot trials, with timings
- A completed pilot checklist
- A revised procedure and a calculated number of main trials

**Go further:**

- Pilot experiment (Wikipedia): https://en.wikipedia.org/wiki/Pilot_experiment — A short overview of what pilot studies are for and how they are used before larger studies.


## 2.6 Designing a test protocol for a robot task

*A complete worked example that brings the module together: a step-by-step, repeatable test protocol for a hypothetical gripper experiment, with every number clearly labelled as illustrative.* (about 35 min)

### From design to instructions

Over this module you have learned to control variables, choose a number of trials, randomise, pre-register and pilot. A **test protocol** is where all of it becomes a set of instructions precise enough that someone else, or you a month from now, could run exactly the same experiment and log exactly the same kinds of data.

A protocol is written for a person standing next to the robot. It says what to set up, what to do, in what order, what to record, and what to do when something goes wrong. This lesson builds a complete protocol for a hypothetical experiment, one section at a time.

**Everything in this example is hypothetical.** The study, the equipment settings and all the numbers are invented to illustrate the structure. They do not describe any real experiment, and they are not the protocol for the TV-01 project, which has not yet been written.

### The hypothetical study

> Does a fingertip force sensor reduce drops when a single two-finger gripper carries a foam block between two points while camera frames are masked?

This is a single-arm, one-material simplification of the kind of question TV-01 proposes to study. It is the sort of preliminary question a project might answer before attempting anything cooperative.

### 1. Purpose, hypothesis and decision rule

```text
Hypothesis: With force feedback, the gripper drops the block less often
during masked-vision periods than without it.
Null: Force feedback makes no difference to the drop count.
Primary measure: number of drops out of 20 trials per condition.
Decision rule (pre-registered, hypothetical): supported if the
force condition has at least 4 fewer drops than vision-only;
a smaller difference in either direction is inconclusive; more
drops with force counts against the hypothesis.
```

### 2. Setup

The setup section lists everything needed to recreate the conditions:

- **Equipment:** the arm and gripper (model and build version), the controller, the camera, the force sensor, and the firmware and software versions, written as exact version numbers or commit identifiers.
- **Layout:** pick-up and drop-off positions marked with tape, 300 mm apart (hypothetical); the camera position and height measured and photographed.
- **Materials:** three identical foam blocks from the same batch, labelled F1–F3, rotated in a fixed order so that wear is spread evenly. Each block is replaced after a set number of trials (hypothetical: 40).
- **Environment:** the same room, overhead lights on, blinds closed. Room temperature recorded at the start of each session.
- **Power:** a low-voltage bench supply or battery pack; the voltage recorded at the start of each block of trials.

### 3. Conditions

Each condition is specified exactly, so that the only difference between them is the one being tested:

- **V (vision only):** the force sensor stays mounted and logged, but the controller ignores its readings.
- **VF (vision + force):** the controller uses both.
- **Masking schedule (both conditions):** camera frames masked for 1.0 s, starting every 3.0 s, generated by the same software routine (hypothetical values).

Keeping the sensor mounted in condition V is important: it means the gripper's mass and cabling are identical in both conditions, as discussed in the lesson on variables and controls.

### 4. Operational definitions

```text
Trial start: block seated against the tape mark; operator presses Start.
Trial end:   block released at drop-off, or 20 s elapsed.
Drop:        block contacts the table anywhere other than the drop-off
             zone before release, detected from the log (gripper force
             below 0.2 N for over 0.5 s while moving) and confirmed on
             video by a scorer who does not know the condition.
```

### 5. Trial procedure

Written as numbered steps, to be followed in order every time:

1. Check the schedule for the next trial number, condition and block label.
2. Set the condition in the software, using its code letter only.
3. Place the labelled block against the pick-up mark.
4. Check the workspace is clear of hands and objects, then press Start.
5. Do not touch anything until the trial ends or the emergency stop is needed.
6. Write any disturbance in the log at the time, before looking at the outcome.
7. Reset: return the arm to home, and inspect the block for damage.

### 6. Schedule and sample size

The pilot (hypothetical) gave a drop rate of roughly 40% in condition V, and showed that each trial takes about 2 minutes including reset. A plan of 20 trials per condition is chosen, giving 40 trials and about 80 minutes of testing, run as 10 blocks of 4 (V, V, VF, VF in a random order within each block, from a recorded seed). The schedule is printed before the session begins.

With 20 trials and a rate near 40%, the standard error of the drop rate is about √(0.4 × 0.6 ÷ 20) ≈ 0.11, so only a fairly large difference would be detectable. A real protocol would say that plainly in its limitations, or increase the number of trials.

### 7. Data to record

Every trial produces one row in a log, with all fields filled in. Here is a header with one made-up example row:

```text
trial,date,time,block_id,condition_code,foam_id,supply_v,drop,duration_s,excluded,notes
17,2026-03-14,10:42,5,X,F2,5.02,0,11.8,no,
```

The raw sensor logs are saved under the trial number. Nothing is deleted, including trials that are later excluded.

### 8. Exclusions, deviations and stopping

```text
Exclude a trial only if: the log shows a communication dropout over 1 s,
or a physical disturbance was noted at the time. Excluded trials are
reported and repeated at the end of the schedule.
Stop after 20 valid trials per condition. No early stopping.
Any departure from this protocol is written in the deviations log
with date, change, reason, and whether results had been seen.
```

### 9. Safety

Robot arms can pinch, swing and knock things over, even small ones. The protocol makes safety a step, not an afterthought: an emergency stop within reach and tested at the start of each session; hands out of the workspace while the arm is powered; low-voltage power only; eye protection; and an adult supervising whenever the hardware is running.

### 10. Analysis plan

Count drops per condition, and report them with the number of valid trials, the standard error, the number and reasons for any exclusions, and the deviations log. Apply the decision rule from section 1 exactly as written. Any further patterns, for example whether drops cluster at the start of masked periods, are reported as exploratory.

### Recap

A test protocol turns an experimental design into repeatable instructions. It states the purpose and decision rule; the exact setup, versions and materials; conditions that differ in only one way; operational definitions; numbered trial steps; a randomised schedule with a justified number of trials; a fixed data format; exclusion, deviation and stopping rules; safety precautions; and the analysis plan. Write it before the main trials, test it in a pilot, then freeze it.

> **Testing real robots.** If you run a protocol on real hardware, do it only with adult supervision. Use low-voltage power, keep an emergency stop or power switch within reach and test it before each session, keep hands and hair out of the workspace while the robot is powered, and wear eye protection. Start with slow speeds. Never leave a powered robot unattended.

#### Check your understanding

1. Why does the example keep the force sensor mounted in the vision-only condition?
   A) To save time on setup
   B) So that the gripper's mass and cabling are identical, and the only difference between conditions is whether force readings are used
   C) Because the sensor cannot be removed
   D) So that the vision-only condition performs worse

2. Why does the trial procedure say to note any disturbance at the time, before looking at the outcome?
   A) So that the decision to exclude a trial cannot be influenced by whether its result was good or bad
   B) To make the log longer
   C) Because disturbances are rare
   D) So that the trial can be rerun immediately

3. What is the main purpose of recording firmware and software versions in the setup section?
   A) It is a legal requirement
   B) To make the protocol look professional
   C) To decide which condition is better
   D) So that the exact conditions can be recreated later and any version change is visible

4. With 20 trials per condition and a drop rate near 40%, the standard error is about 0.11. What should the protocol do about this?
   A) Hide it, as it makes the study look weak
   B) Stop early if a difference appears
   C) State plainly that only large differences are detectable, or plan more trials
   D) Ignore it, because 20 trials is always enough

5. Are any of the numbers in this lesson's protocol real results from TV-01?
   A) Yes, the drop rates come from TV-01
   B) Yes, the pilot was run on TV-01 hardware
   C) Only the timing figures are real
   D) No; every number is hypothetical, and TV-01 is a proposed project with no results

#### Project: Write a protocol for a robot task

Write a complete test protocol for a simple robot task of your choice, using the ten sections from this lesson. Good choices that need no hardware include:

- a line-following robot in a free online simulator, comparing two controller settings;
- a simulated gripper in any free robotics simulator you can access;
- a "robot" that is a person following written instructions, for example stacking blocks blindfolded with and without spoken feedback.

Label every number that you have not measured yourself as hypothetical. Generate a randomised schedule with a recorded seed. Then swap protocols with someone else and ask them to list every place where they would not know exactly what to do.

If you choose to run your protocol on real hardware, do it only with adult supervision, using low-voltage power and an emergency stop.

**Deliverables**

- A protocol covering all ten sections
- A randomised schedule with its seed recorded
- A data-log header with one example row labelled as made-up
- A list of ambiguities found by a reader, and your fixes

**Safety (adult supervision required):** Paper and simulation versions need no special precautions. If you run the protocol on a real robot, an adult must supervise. Use only low-voltage batteries or supplies, keep an emergency stop or power switch within reach and test it first, keep hands, hair and loose clothing out of the workspace while the robot is powered, wear eye protection, and start at slow speeds.


---

# Module 3: Baseline comparisons

How to judge a new method fairly by comparing it with strong, honest baselines under identical conditions.

**Objectives**

- Explain why results are meaningless without a reference point.
- Choose a fair and reasonably strong baseline for a given problem.
- Identify common ways comparisons are made unfair, intentionally or not.
- Report differences together with their uncertainty rather than as single numbers.


## 3.1 Why every result needs a baseline

*A number on its own cannot tell you whether a change helped. Learn what a baseline is, the main kinds of baseline, and why it must be measured under the same conditions as the thing you are testing.* (about 25 min)

### A number on its own says nothing

A student team proudly reports that their new gripper picked up a test object **18 times out of 20**. Is that good?

You cannot tell yet. Consider three possible situations (all made-up for illustration):

- The old gripper, tested the same way, managed **19 out of 20**. The new gripper is slightly *worse*.
- The old gripper managed **4 out of 20**. The new gripper is a big improvement.
- *Any* gripper, even a crude one, manages **20 out of 20**, because the object is easy to hold. The test cannot tell grippers apart at all.

The same "18 out of 20" means three completely different things. What decides the meaning is the **baseline**: the result you get, under the same conditions, *without* the change you are testing, or with the approach people already use.

You met baselines briefly in the lesson on hypotheses and defining success. This module goes deeper: how to choose them, how to keep them fair, how to pull a system apart to see which piece is doing the work, which measurements to use, how to report a comparison honestly, and how to read other people's claims.

### What a baseline really answers

A single result answers the question *"How well does it do?"* A comparison answers a different and usually more important question: *"How much difference did my change make?"*

Many things influence a robot's performance besides your idea: how hard the task is, the particular object, the lighting, how charged the batteries are, how worn the parts are, the skill of the person running the test, and plain luck. If you only measure the new version, all of those are mixed into one number. A baseline run under the same conditions keeps all of those influences the same and changes only the thing you care about. Whatever difference remains can then be credited, with some confidence, to your change.

### The main kinds of baseline

Different baselines answer different questions. Good studies often use more than one.

- **The "without" baseline.** The same system with your addition removed: the gripper without its new rubber pads. It answers "does this addition help at all?"
- **The existing-method baseline.** The approach a competent person would use today, such as a carefully tuned PID controller. It answers "is my idea better than what people already do?"
- **The simple-rule baseline.** A deliberately simple strategy: "always drive at constant speed", "always predict the most common answer". These are often surprisingly hard to beat, and if your clever method cannot beat a simple rule, that is important to know.
- **The chance baseline.** What random guessing would achieve. A robot sorting objects into two bins at random gets about half right, so "52% correct" is barely better than a coin.
- **The best-case reference** (sometimes called an *upper bound*). What you would get with perfect information or ideal conditions, such as a camera that never loses sight of the object. It is not a competitor; it tells you how much room for improvement exists.

### Worked example: the trap of a high percentage

Imagine (hypothetically) a camera system that inspects parts on a production line and flags any defective ones. In this factory, 95 of every 100 parts are fine. A new detector is reported as **94% accurate**.

Now try the simplest possible rule: label *every* part "fine". It never catches a single defect, yet it is correct 95 times in 100, so it is **95% accurate**. The impressive-sounding 94% detector is less accurate than a rule that does nothing useful. Only the simple-rule baseline reveals this. (You will see better ways to measure a detector in the lesson on choosing metrics.)

> **All numbers here are made up.** Every result in this lesson is hypothetical and exists only to illustrate an idea. When you use invented numbers in your own explanations or plans, label them clearly, just as these are labelled.

### Same conditions, same time

A baseline only works if it faces exactly the same conditions as the new method. The most common way this goes wrong is the **historical baseline**: comparing today's result with a number recorded weeks ago.

Here is a made-up example. A team measured their old line-following controller in September: an average lap time of **14.0 seconds**. Today they test a new controller and get **13.2 seconds**, an apparent improvement of 0.8 seconds. But since September they have cleaned the track, replaced the wheels and switched to fresh batteries. When they re-run the *old* controller today, it averages **13.1 seconds**. The "improvement" was entirely due to the changed conditions. The new controller is no faster at all.

To avoid this:

1. **Run the baseline again**, in the same session as the new method, rather than reusing old numbers.
2. **Alternate or randomise the order** of conditions, so that neither method always runs first (when batteries are fresh) or last (when parts are warm). Randomisation is covered properly in the experimental design module.
3. **Use the same tasks, objects and success rules** for both conditions, written down before you start.

### Worked example: the baselines in a proposed study

Tactiverge's TV-01 project is a **proposed** study with no results yet. It is still a useful example of how baselines are chosen. It plans to run the same cooperative two-arm tasks under three conditions: vision only, force only, and vision combined with force.

Each baseline answers its own question:

- Comparing *combined* with *vision only* asks: does adding force sensing help when the camera loses sight of the object?
- Comparing *combined* with *force only* asks: is vision contributing anything during those moments?

A study like this could also add a best-case reference, running the tasks with vision never interrupted, to show how much the dropouts hurt in the first place. Notice that every one of these comparisons could come out against the idea. That is what makes them worth running.

### Baselines protect you from yourself

When you have worked hard on an idea, you want it to succeed. That is natural, and it is exactly why baselines matter. Without one, almost any result can be described as a success. With one, your idea has a real chance to fail, and if it survives, you and your readers can trust it far more.

### Recap

- A result means nothing without a reference point measured under the same conditions.
- Baselines answer "how much difference did the change make?"
- Common baselines: without the change, the existing method, a simple rule, chance, and a best-case reference.
- Simple rules can beat impressive-sounding numbers, so always include one.
- Re-run baselines in the same session and alternate the order; never rely on old numbers.

#### Project: Paper project: baseline hunt

Collect three claims that report a result: from an advertisement, a news article, a school project, or your own earlier work. For example: "This app helps you sleep 30 minutes longer" or "Our paper plane flew 9 metres".

For each claim, write down:

1. The result as stated.
2. Whether a baseline is given. If it is, what kind is it (without the change, existing method, simple rule, chance, best case)?
3. If no baseline is given, the baseline you would want to see, and how you would measure it under the same conditions.
4. One condition that might differ between the claimed result and a fair baseline.

This is a paper-only activity. No equipment is needed.

**Deliverables**

- Three claims, each with the stated result written out
- For each claim, the baseline given or the baseline that is missing
- For each claim, one condition that would need to be held the same
- A sentence on which claim was hardest to judge, and why

#### Check your understanding

1. A robot completes a maze in 40 seconds. What do you most need to know before deciding whether that is good?
   A) The colour of the robot
   B) The name of the person who built it
   C) How long other approaches take on the same maze under the same conditions
   D) Whether the result was filmed

2. In a factory, 95% of parts are fine. Which baseline would reveal that a "94% accurate" detector is not useful?
   A) A simple rule that labels every part as fine
   B) A best-case reference with a perfect camera
   C) The same detector tested on a different day
   D) A detector that is 99% accurate

3. A team compares their new controller tested today with the old controller's result from two months ago. What is the main problem?
   A) Two months is too short a gap
   B) Old results are always more accurate
   C) There is no problem as long as the track is the same
   D) Conditions such as batteries, wear and cleaning may have changed, so the difference may not be due to the controller

4. What is a best-case reference (upper bound) used for?
   A) To make the new method look better
   B) To show how much room for improvement exists, for example with perfect information
   C) To replace the need for any other baseline
   D) To guarantee the new method will succeed


## 3.2 Choosing fair baselines

*How baselines are made unfair, often by accident, and a practical checklist for choosing a baseline that is strong, equally tuned and tested under identical conditions.* (about 30 min)

### The easiest way to look good

Suppose you spend two weeks designing and tuning a new controller for a balancing robot. To show it works, you compare it with a standard PID controller, but you leave the PID gains at whatever values happened to be in the example code. Unsurprisingly, your carefully tuned controller wins easily.

What has the comparison shown? Mostly that **two weeks of tuning beats no tuning**. It says very little about whether your design is better than a PID controller that a competent engineer had set up properly.

A baseline that has been deliberately or carelessly weakened is called a **strawman**, after the idea of arguing against a straw figure instead of a real opponent. Strawman baselines are one of the most common reasons published "improvements" disappear when someone else tries them. Usually nobody intends to cheat. The researcher naturally spends more care on their own method than on the comparison, and the difference in care shows up as a difference in results.

This lesson is about avoiding that trap.

### Five features of a fair baseline

### 1. It is strong

The baseline should be the best reasonable version of the alternative: the approach a knowledgeable person would actually choose for this problem, set up properly. If there are several existing approaches, pick the strongest one you can reasonably run, not the weakest.

### 2. It gets equal effort

Give the baseline the same tuning budget as your method. If you try 20 different settings for your controller, try about 20 for the baseline too. Write the budget down before you start, for example: "each method gets up to 20 tuning runs on the practice track".

### 3. It uses the same information and resources

If your method uses an extra sensor, more computing power or more training data, the comparison is not only testing your idea; it is also testing the extra resources. That can be perfectly legitimate, but only if you say so. Sometimes the extra resource *is* the question. The proposed TV-01 study, for example, compares vision only with vision plus force sensing precisely because it asks whether the extra sensor helps. What matters is that the reader knows exactly what differs between conditions.

### 4. It is tested, and tuned, under the same conditions

Both methods must face the same tasks, objects, order effects and success rules. There is also a subtler requirement: **do not tune on the test**. If you adjust your method while looking at the test results, it will be shaped to those particular tests and look better there than it would anywhere else. Keep a set of *practice* tasks for tuning, and a separate set of *test* tasks used only for the final comparison. Treat both methods the same way. The proposed TV-01 study's use of materials the controller was not tuned on reflects the same idea.

### 5. It is implemented correctly

A baseline with a bug is a strawman by accident. Check that it behaves sensibly: does it perform roughly as expected on simple cases? If you are comparing with a method someone else has published, try to reproduce a result they reported before trusting your version.

> **A weak baseline is a quiet way to mislead.** Every number from a strawman comparison may be real, yet the conclusion is false. Treat the baseline with the same care you give your own method, and describe in your report exactly how each one was set up and tuned.

### Include a simple baseline too

Alongside the strongest existing method, it is good practice to include a **simple** baseline: a straightforward rule that anyone could implement in an afternoon. Simple baselines do two jobs. They check that the task is not so easy that anything works, and they show how much your extra complexity is really buying. If a fancy filter beats a plain moving average by only a tiny margin, the plain average may be the better engineering choice, because it is easier to understand, test and maintain.

### Worked example: a slip detector

This example uses **made-up numbers** for illustration only.

A team builds a slip detector for a robot gripper. It watches force readings and tries to notice when a held object starts sliding, so the gripper can squeeze harder. Their method combines several signals. The simple baseline is a threshold rule: "if the force drops by more than a set amount within a tenth of a second, report a slip".

**First comparison (unfair).** The team tunes their own method for a week on practice objects. For the threshold rule, they pick a number that seemed sensible and never adjust it. On 50 test slips:

- New method: caught 45 of 50 slips (90%).
- Threshold rule: caught 30 of 50 slips (60%).

This looks like a huge win.

**Second comparison (fair).** A teammate points out that the threshold was never tuned. They give the threshold rule the same tuning budget on the same practice objects, then run both on the same 50 test slips:

- New method: caught 45 of 50 slips (90%).
- Tuned threshold rule: caught 43 of 50 slips (86%).

The conclusion changes from "a huge improvement" to "a small improvement, possibly within the range of luck, from a much more complicated method". That second conclusion is less exciting and far more useful. It tells the team, and anyone reading their report, what the extra complexity actually buys. (The lesson on reporting comparisons shows how to judge whether a gap like 45 against 43 is bigger than luck.)

### When you cannot make a fair comparison

Sometimes a perfectly fair baseline is out of reach. The best existing method may need equipment you do not have, or its details may not be published. That is fine, as long as you are honest about it. State which baseline you used, why you could not use a stronger one, and what that means for your conclusions. "Our method beat a simple threshold rule; we could not compare it with commercial systems" is a perfectly respectable sentence.

### A fairness checklist

Before running a comparison, check:

- Is the baseline the strongest reasonable alternative I can run?
- Have I included a simple baseline as well?
- Does each method get the same tuning budget, written down in advance?
- Is tuning done on practice tasks, separate from the test tasks?
- Do both methods face the same tasks, objects, order and success rules?
- Is every difference in information or resources stated clearly?
- Have I checked that the baseline works correctly?
- Would the person who invented the baseline consider my version a fair representation?

### Recap

- A strawman baseline makes any method look good and tells you very little.
- Fair baselines are strong, equally tuned, use stated resources, are tested under the same conditions and are implemented correctly.
- Tune on practice tasks and test on separate tasks, for every method.
- Include a simple baseline to see what your complexity really buys.
- When a fair comparison is impossible, say so and limit your claims.

#### Check your understanding

1. A researcher tunes their new method carefully but uses the baseline's default settings. What has the comparison mainly shown?
   A) That the new method is definitely better
   B) Mostly that tuning helps, not that the new design is better
   C) That the baseline has a bug
   D) Nothing can be learned from any comparison

2. Why should tuning be done on practice tasks that are separate from the test tasks?
   A) Practice tasks are always easier
   B) It saves time
   C) Test tasks should be kept secret from other researchers
   D) A method adjusted while looking at the test results will look better on those tests than it would elsewhere

3. Your method uses an extra sensor that the baseline does not. What should you do?
   A) State clearly that the methods differ in this way, and consider whether the extra sensor is itself what is being tested
   B) Hide the difference, since it would weaken the result
   C) Remove the sensor from the description of your method
   D) Give the baseline a random extra sensor

4. After fair tuning, a complex method beats a simple threshold rule by 90% to 86%. What is the most honest summary?
   A) The complex method is far superior
   B) The simple rule is better
   C) The complex method gives a small improvement that may be within the range of luck, at the cost of more complexity
   D) The comparison is useless and should not be reported

5. You cannot run the strongest existing method because it needs equipment you do not have. What is the right approach?
   A) Claim your method beats it anyway
   B) Use the strongest baseline you can, and state clearly what you could not compare against and why
   C) Do not run any comparison
   D) Copy its published numbers and compare them with your own results from different conditions


## 3.3 Ablation studies

*When a system with several improvements beats its baseline, which part is doing the work? Ablation studies answer that by removing components one at a time, and reveal when parts interact.* (about 30 min)

### Which part is doing the work?

Real engineering improvements rarely come one at a time. A team improving a gripper might add rubber fingertip pads, a force sensor that controls how hard it squeezes, *and* a slower lifting motion, all in the same week. The new gripper beats the old one. Good news, but now a practical question appears: **which of those changes made the difference?**

This matters for several reasons. If one change does nearly all the work, you might drop the others and save cost, power or complexity. If one change actually makes things slightly worse, you want to know. And if you write a report claiming "force sensing improves grip", you had better be sure it was the force sensing and not the pads.

The standard tool for answering this is an **ablation study**. "Ablation" means removal; the word comes from medicine and biology, where it refers to removing tissue, and engineers and computer scientists borrowed it. In an ablation study you take the full system and **remove one component at a time**, measuring how much performance drops each time. A big drop means that component was doing important work. No drop means it may not be needed.

### Worked example: a three-part gripper upgrade

All numbers here are **made-up for illustration**.

The full system has three additions over the original gripper:

- **A:** rubber fingertip pads
- **B:** force feedback that adjusts the squeeze
- **C:** a slower lifting motion

The team runs 40 lift attempts for each configuration, on the same set of objects, with the order of configurations mixed up:

- Original gripper (no additions): 22 of 40 successful lifts
- Full system (A + B + C): 36 of 40
- Full system without A (no pads): 33 of 40
- Full system without B (no force feedback): 25 of 40
- Full system without C (normal lifting speed): 35 of 40

### Reading the results

Compare each ablated version with the full system:

- Removing **B** costs 11 successes (36 down to 25). Force feedback is clearly doing most of the work.
- Removing **A** costs 3 successes. The pads may help a little.
- Removing **C** costs 1 success. With only 40 attempts per configuration, a difference of one could easily be luck. There is no good evidence that slow lifting helps.

The honest summary is something like: "Force feedback accounts for most of the improvement. The pads may contribute a small amount. We found no clear benefit from the slower lift, which also makes each task take longer." That is far more useful than "our upgraded gripper works better".

### The drops do not have to add up

Notice something odd. The full system beats the original by 14 successes (36 against 22). The three drops add up to 3 + 11 + 1 = 15. They do not match, and in general they will not. That is a clue that the parts are not completely independent of each other, which leads to the most important subtlety of ablation studies.

### Interactions: when parts depend on each other

Components can **interact**:

- **Overlap.** Two parts may do the same job. Imagine two different slip detectors in one system. Remove either one, and the other covers for it, so each ablation shows almost no drop. You might wrongly conclude neither matters, when actually *at least one* is essential.
- **Teamwork.** Two parts may only help together. Rubber pads might be useful only when force feedback stops the gripper squeezing so hard that the pads are crushed flat. Remove either, and the other's benefit vanishes too.
- **Dependency.** Some parts cannot exist without others. A filter that smooths the force signal means nothing once the force sensor is removed. Plan your ablations around what can sensibly be removed on its own.

When you suspect interactions, test combinations, not just single removals.

### Two directions, and how many runs you need

There are two common designs:

- **Leave-one-out:** start from the full system and remove one part at a time (as above). It shows what each part contributes *given all the others*.
- **Add-one-in:** start from the baseline and add one part at a time. It shows what each part does *on its own*.

Running both gives a fuller picture. The cost grows with the number of components. With k components, a leave-one-out study needs the full system plus k ablated versions: k + 1 configurations. Testing *every* combination needs 2 × 2 × … × 2 = 2ᵏ configurations, because each component is either in or out:

- 3 components: leave-one-out needs 4 configurations; every combination needs 2³ = 8.
- 5 components: leave-one-out needs 6; every combination needs 2⁵ = 32.

Every configuration needs enough repeated trials to separate real differences from luck, so the full set of combinations quickly becomes expensive. A common compromise is leave-one-out for every component, plus full combinations only for the pairs you suspect interact.

### Running an ablation fairly

All the rules of fair baselines apply to every configuration:

- **Same conditions:** same objects, tasks and success rules for every version.
- **Mixed order:** do not run the full system first and the ablations last, when batteries are flatter and parts more worn.
- **No hidden retuning:** if you retune the full system, treat ablated versions the same way, or state clearly that you did not.
- **Decide in advance** which ablations you will run and report them all, including the ones where removing a part made things *better*.

### A proposed study as an ablation

The proposed TV-01 study's three conditions (vision only, force only, and vision with force) can be read as a small ablation of the combined system: "vision only" removes force sensing, and "force only" removes vision. Because the study has not been run, there are no results to interpret. But the design shows the logic: each removal tests whether that sense is pulling its weight.

### Recap

- An ablation study removes one component at a time to see how much each contributes.
- A large drop means the component matters; a drop smaller than run-to-run variation is not evidence of a benefit.
- Components can overlap, work only together, or depend on each other, so single removals can mislead.
- Leave-one-out needs k + 1 configurations; testing every combination needs 2ᵏ.
- Run every configuration under the same conditions, in mixed order, and report every result.

#### Project: Paper project: plan an ablation of a paper glider

Design (and, if you like, run) an ablation study on a paper glider with three modifications:

- **A:** small upturned winglets folded at the wing tips
- **B:** a paper clip on the nose
- **C:** slightly bent-up flaps at the back edge of the wings

Plan first, on paper:

1. List the configurations for a leave-one-out study, including the full glider and a plain glider with no modifications.
2. Decide your measure (for example, distance from the throw line to where the glider first touches the floor) and how you will measure it.
3. Decide how many throws per configuration, and how you will mix up the order of configurations.
4. Write down which pair of modifications you think might interact, and why.

If you carry it out, throw gently in an open indoor space, away from people and fragile objects, and use fresh sheets of the same paper for each glider so that wear does not become a hidden variable. Report every throw, not only the best.

**Deliverables**

- A list of every configuration you will test
- Your measure, number of throws and order plan, written before any throws
- A prediction of which modification matters most, and one possible interaction
- If carried out: all results listed by configuration, with a short honest interpretation

#### Check your understanding

1. What is the main purpose of an ablation study?
   A) To find out how much each component of a system contributes, by removing components one at a time
   B) To make a system run faster
   C) To compare a method with a historical baseline
   D) To test a system only on easy tasks

2. Removing one component lowers success from 36 to 35 out of 40. What is the best interpretation?
   A) The component is essential
   B) The component makes the system worse
   C) The difference is small enough to be luck, so there is no clear evidence the component helps
   D) The experiment must have failed

3. A system has two slip detectors that do the same job. Removing either one alone causes almost no drop. What might be happening?
   A) Neither detector does anything useful
   B) The two detectors overlap, so each covers for the other; removing both might cause a large drop
   C) The ablation study proves both should be removed
   D) The test was too hard

4. How many configurations are needed to test every combination of 4 components, each either in or out?
   A) 4
   B) 5
   C) 8
   D) 16

**Go further:**

- Ablation (artificial intelligence) — Wikipedia: https://en.wikipedia.org/wiki/Ablation_(artificial_intelligence) — A short overview of how the term is used in machine learning research, where ablation studies are routine.


## 3.4 Choosing metrics that match the question

*The measurement you choose can decide which method wins. Learn to match metrics to the real goal, see when averages, accuracy and proxies mislead, and fix primary and secondary metrics in advance.* (about 30 min)

### The metric can decide the winner

Two controllers hold a cloth sheet taut between two robot arms. The goal is to keep the tension close to a target. You measure the tension error (how far the tension is from the target, in newtons) over five trials. These numbers are **made-up for illustration**:

- **Controller A:** 0.4, 0.3, 0.5, 0.4, 2.4 N
- **Controller B:** 0.9, 1.0, 0.9, 1.1, 1.1 N

Which is better?

- By **average** error, A wins: its errors add up to 4.0 N, so its mean is 0.8 N. B's add up to 5.0 N, a mean of 1.0 N.
- By **median** (the middle value when sorted), A wins more clearly: 0.4 N against 1.0 N.
- By **worst case**, B wins easily: its largest error is 1.1 N, while A once reached 2.4 N.

Now suppose the cloth tears if the error ever exceeds 2 N. Then A tore the cloth once in five trials and B never did. For that task, B is the better controller, even though A has the lower average.

Neither metric is "correct" in general. The right one depends on what you actually care about. That is the subject of this lesson: a **metric** is the specific, measurable quantity you use to judge performance, and it must match the question.

### Start from the real goal

Before choosing a metric, ask: *if this robot were doing a real job, what would its user care about?*

- A delivery robot's user cares whether parcels arrive on time and intact, not how elegant its path is.
- A gripper on a production line is judged by how rarely it drops parts, and perhaps how fast it works.
- A battery-powered rover cares about distance covered per charge.
- For anything near people, the worst case may matter more than the average.

Then turn that goal into an **operational definition**, as you learned in the hypotheses lesson: exactly what is counted or measured, in what units, under which conditions.

### Common kinds of metric

- **Success rate:** the fraction of trials that succeed. Simple and meaningful, but only if "success" is defined precisely in advance. Does a lift count if the object wobbles? If it slips but is not dropped?
- **Time:** to complete a task, or to recover after a disturbance.
- **Error:** how far an outcome is from its target, such as position error in millimetres or tension error in newtons.
- **Energy or power:** important for anything battery powered.
- **Smoothness, wear, cost, noise:** secondary qualities that may matter to real users.

### Watch out: signed errors cancel

Suppose a robot arm misses its target position by +2, −1, +3 and −2 mm (made-up values; positive means too far right). The average *signed* error is (2 − 1 + 3 − 2) ÷ 4 = 0.5 mm, which sounds excellent. But the arm is actually missing by about 2 mm each time; the positive and negative errors cancel out. The **mean absolute error** ignores the sign: (2 + 1 + 3 + 2) ÷ 4 = 2 mm. That is the honest measure of how far off the arm typically is. The signed average is still useful for a different question: whether the arm is *biased* in one direction.

### Averages, medians and worst cases

- The **mean** uses every value, but one extreme trial can drag it a long way.
- The **median** shows the typical trial and ignores extremes, which is good when an odd trial is an accident, and bad when the odd trial is exactly the failure you care about.
- The **maximum** (worst case), or the fraction of trials beyond a safety limit, matters when a single failure is serious.

Reporting more than one, decided in advance, often gives the clearest picture.

### When accuracy misleads: rare events

In the first lesson of this module, you saw a made-up factory where 95% of parts are fine, so a rule that labels everything "fine" scores 95% accuracy while catching no defects at all. When one outcome is rare, **accuracy** (the fraction of all decisions that are right) is a poor metric. Two better ones are:

- **Precision:** of the parts the detector *flagged* as defective, what fraction really were?
- **Recall:** of the parts that really *were* defective, what fraction did the detector catch?

### Worked example

A made-up batch has 1,000 parts, of which 50 are defective. A detector flags 60 parts, and 40 of those are truly defective.

- Precision = 40 ÷ 60 ≈ 0.67, so about 67% of its alarms are real.
- Recall = 40 ÷ 50 = 0.80, so it catches 80% of the defects.
- It wrongly flags 60 − 40 = 20 good parts. Of the 950 good parts, it correctly passes 950 − 20 = 930. Its accuracy is (40 + 930) ÷ 1,000 = 97%.

That 97% sounds only slightly better than the do-nothing rule's 95%, yet the detector catches 40 defects that the rule would miss entirely. Precision and recall show its real value, and its real weaknesses: it misses 10 defects and raises 20 false alarms. Which of those matters more depends on the job. Missing a defect in an aircraft part is far worse than a false alarm.

### Proxies and Goodhart's law

Sometimes the thing you care about is hard to measure, so you measure something easier that usually goes along with it. This is a **proxy**. For example, "the gripper closed on the object" is easier to detect than "the object stayed held throughout the lift", but they are not the same thing.

Proxies become dangerous when you start optimising them. An idea known as **Goodhart's law** says, roughly, that once a measure becomes a target, it stops being a good measure. If you tune a line-following robot purely to minimise lap time, it may learn to cut corners off the line. Its lap time improves, but it is no longer following the line, which was the point. Whenever you push hard on one number, check that the real goal is improving too.

### Primary and secondary metrics

A good plan names:

- **One primary metric**, which decides the main question. It is chosen before any data is collected and is not changed afterwards.
- **A few secondary metrics**, which catch trade-offs. A controller that halves failures but doubles energy use or task time is a different proposition from one that halves failures for free.

Write down each metric's exact definition, units and how it will be calculated. If you later notice that a different metric tells an interesting story, report it as exploratory, as you learned in the lesson on hypotheses.

### Recap

- The metric you choose can decide which method "wins", so choose it from the real goal.
- Define success and error precisely, with units, before collecting data.
- Signed errors can cancel; use mean absolute error to measure size.
- Mean, median and worst case answer different questions.
- For rare events, accuracy misleads; use precision and recall.
- Proxies can be gamed. Fix one primary metric in advance and add secondary metrics for trade-offs.

#### Check your understanding

1. A cloth tears whenever tension error exceeds 2 N. Which metric best matches that concern?
   A) The mean error
   B) The median error
   C) The number of trials
   D) The largest error, or the fraction of trials above 2 N

2. A robot's position errors are +3, −3, +3 and −3 mm. What is the mean absolute error?
   A) 0 mm
   B) 3 mm
   C) 6 mm
   D) 12 mm

3. A detector flags 20 parts as defective, and 15 of them really are. What is its precision?
   A) 75%
   B) 15%
   C) 20%
   D) It cannot be calculated without the total number of parts

4. A team tunes a line-follower only to reduce lap time, and it starts cutting corners off the line. What is this an example of?
   A) A fair baseline
   B) An ablation study
   C) A proxy being optimised until it no longer reflects the real goal
   D) Measurement uncertainty

5. Why should the primary metric be fixed before collecting data?
   A) So that you can switch to whichever metric looks best afterwards
   B) Because choosing after seeing results makes it easy to pick, even unintentionally, the metric that flatters your method
   C) Because secondary metrics are not allowed
   D) Because metrics cannot be calculated after data is collected

**Go further:**

- Goodhart's law — Wikipedia: https://en.wikipedia.org/wiki/Goodhart%27s_law — The origin of the idea and examples of measures that stopped working once they became targets.


## 3.5 Reporting comparisons with uncertainty

*Two averages are not a comparison until you know how much they could vary. Learn to report spread, standard error and the uncertainty of a difference, with a worked Python example and a rough rule for success rates.* (about 35 min)

### Two averages are not the whole story

A team tests a new line-following controller against their old one, ten laps each. The new controller's average lap is 12.16 seconds; the old one's is 12.62 seconds. The new one is 0.46 seconds faster. Done?

Not yet. Every lap is slightly different: tiny wheel slips, small differences in starting position, sensor noise. If the team ran another ten laps of each, the averages would come out a little different. So the real question is: **is a 0.46-second gap bigger than the wobble you would expect from luck alone?** Answering it means reporting **uncertainty**, not just averages.

This lesson builds a simple, honest toolkit. If you have taken the data analysis module in the computational engineering pathway, some of this will be familiar; here the focus is on comparisons.

### Step 1: spread within each condition

The **standard deviation** (SD) measures how far individual trials typically sit from their average. A small SD means the trials were consistent; a large one means they varied a lot. For a sample of trials, it is calculated by:

1. finding the mean;
2. subtracting the mean from each value and squaring the result;
3. adding those squares and dividing by n − 1 (one less than the number of trials);
4. taking the square root.

Dividing by n − 1 instead of n is the usual choice for a sample. It slightly corrects for the fact that a sample's own mean sits closer to its values than the true mean would.

### Step 2: uncertainty in each average

The SD describes individual laps. But we want to know how uncertain the *average* is. That is the **standard error of the mean** (SE):

```text
SE = SD ÷ √n
```

More trials make the average more trustworthy, but only slowly: because of the square root, you need **four times** as many trials to halve the standard error.

### Step 3: uncertainty in the difference

When you subtract one average from another, both uncertainties carry over. For two independent sets of trials, the standard error of the difference is:

```text
SE_diff = √(SE₁² + SE₂²)
```

A useful rough rule: the true difference probably lies within about **2 × SE_diff** of the measured difference. This gives an approximate **95% interval**, a range that would capture the true difference in about 95% of repeated experiments like this one. The rule is rough. With small samples, statisticians use a slightly larger multiplier (from what is called the t distribution), and it assumes trials are independent of one another.

### Worked example in Python

The lap times below are **made-up for illustration**. This code uses only Python's standard library.

```python
import math
import statistics

# Made-up lap times in seconds, for illustration only.
baseline = [12.4, 12.9, 12.1, 13.0, 12.6, 12.8, 12.3, 12.7, 12.5, 12.9]
new      = [11.9, 12.5, 12.2, 11.6, 12.8, 12.0, 11.8, 12.4, 12.1, 12.3]

def summarise(name, data):
    n = len(data)
    mean = statistics.mean(data)
    sd = statistics.stdev(data)       # sample standard deviation
    se = sd / math.sqrt(n)            # standard error of the mean
    print(f"{name}: n={n} mean={mean:.2f} s  sd={sd:.2f} s  se={se:.2f} s")
    return mean, se

m_b, se_b = summarise("baseline", baseline)
m_n, se_n = summarise("new     ", new)

diff = m_b - m_n                      # positive = new is faster
se_diff = math.sqrt(se_b**2 + se_n**2)
print(f"difference = {diff:.2f} s, rough 95% range {diff - 2*se_diff:.2f} to {diff + 2*se_diff:.2f} s")
```

Output:

```text
baseline: n=10 mean=12.62 s  sd=0.29 s  se=0.09 s
new     : n=10 mean=12.16 s  sd=0.36 s  se=0.11 s
difference = 0.46 s, rough 95% range 0.17 to 0.75 s
```

### Interpreting it

The rough range runs from 0.17 to 0.75 seconds. It does not include zero, so a difference this large is unlikely to be luck alone: the new controller does seem faster on this track. But the range is wide. The true improvement might be as small as about 0.2 seconds or as large as about 0.7. An honest report says exactly that, rather than "the new controller is 0.46 seconds faster".

If the range *had* included zero, the right conclusion would be "**no clear difference** was found with ten laps each", not "there is no difference". Absence of evidence is not evidence of absence; more trials might reveal a small real effect.

### Success rates have uncertainty too

Many robot tests count successes out of a number of attempts. For a success rate p measured over n attempts, a rough standard error is:

```text
SE = √( p × (1 − p) ÷ n )
```

### Worked example

Made-up results: a new gripper succeeds in 36 of 40 lifts (p = 0.90), and the baseline in 30 of 40 (p = 0.75). The new gripper looks 15 percentage points better.

- New: SE = √(0.90 × 0.10 ÷ 40) = √0.00225 ≈ 0.047, about 4.7 percentage points.
- Baseline: SE = √(0.75 × 0.25 ÷ 40) = √0.0046875 ≈ 0.068, about 6.8 points.
- Difference: SE_diff = √(0.047² + 0.068²) ≈ 0.083, about 8.3 points.
- Rough 95% range: 15 ± 2 × 8.3, which is about −2 to +32 points.

The range includes zero. A 15-point gap looks large, yet with only 40 attempts each, it could still be partly or wholly luck. The honest conclusion is "promising, but not yet clear; more trials are needed". This rough rule also works poorly when success rates are very close to 0% or 100%, or when n is small; for those cases, statisticians use more careful methods.

### Error bars: always say what they show

Graphs often show averages with **error bars**. The trouble is that error bars can show the SD, the SE or a 95% interval, and these differ greatly in size. An SD bar is about √n times longer than an SE bar for the same data. So always state in the caption what your bars represent and how many trials each average is based on. Also note that whether two error bars overlap is not, on its own, a reliable test of a difference; calculate the uncertainty of the difference itself, as above.

Better still, show **every individual trial** as a dot alongside the averages. Readers can then see the spread, any odd trials and how many trials there were, all at once.

### What a good comparison report includes

- The number of trials in each condition.
- The mean (and median, if useful) for each condition.
- The spread (SD) for each condition.
- The difference and its uncertainty, for example an approximate 95% interval.
- All trials, or a link to the raw data, with any exclusions explained by a rule decided in advance.
- The conditions of the test and its limitations.

A good sentence might read: "Across 10 laps each, the new controller averaged 12.16 s (SD 0.36 s) and the baseline 12.62 s (SD 0.29 s). The new controller was 0.46 s faster, with an approximate 95% interval of 0.17 to 0.75 s. Tests used one track and one battery type." (All values made-up.)

### Recap

- Averages vary from run to run, so every comparison needs its uncertainty.
- SD describes spread; SE = SD ÷ √n describes uncertainty in an average.
- The uncertainty of a difference is √(SE₁² + SE₂²); about 2 × that gives a rough 95% range.
- If the range includes zero, report "no clear difference", not "no difference".
- Success rates over few trials are surprisingly uncertain.
- Label error bars, state n and show individual trials.

#### Check your understanding

1. How many times as many trials do you need to halve the standard error of an average?
   A) Twice as many
   B) Three times as many
   C) Four times as many
   D) Ten times as many

2. Two averages each have a standard error of 3 units. What is the standard error of their difference, roughly?
   A) About 4.2 units
   B) 6 units
   C) 0 units
   D) 3 units

3. A difference's rough 95% range is −0.1 to 0.9 seconds. What is the most honest conclusion?
   A) The new method is definitely faster
   B) There is definitely no difference
   C) The new method is definitely slower
   D) No clear difference was found; the true difference could be zero

4. A graph shows averages with error bars but no caption explaining them. Why is that a problem?
   A) Error bars should never be used
   B) The bars could show SD, SE or a 95% interval, which differ greatly in size, so the reader cannot judge the uncertainty
   C) Error bars are only for success rates
   D) Captions are only needed in published papers

5. A gripper succeeds 36/40 times and a baseline 30/40 times. Why is it too early to say the gripper is clearly better?
   A) Because 36 is not a round number
   B) Because the baseline should have had more trials than the gripper
   C) Because with 40 attempts each, the uncertainty of the 15-point difference is large enough that zero cannot be ruled out
   D) Because success rates have no uncertainty

**Go further:**

- Standard error — Wikipedia: https://en.wikipedia.org/wiki/Standard_error — A fuller treatment of standard error and how it is used to build confidence intervals.


## 3.6 Reading comparison claims critically

*A set of practical questions for judging any claim that something is better, faster or safer, including how relative numbers and demo videos can mislead, and how to stay fair while being sceptical.* (about 30 min)

### Claims are everywhere

"Our new robot vacuum cleans 50% better." "This algorithm is twice as fast." "Breakthrough gripper handles any object." You will meet claims like these in advertisements, news stories, research papers, competition entries and your classmates' projects. Most are made in good faith. Some are careless, and a few are designed to mislead.

Everything in this module so far has been about making your own comparisons fair. This lesson turns it around: how to **read** someone else's comparison and decide how much to trust it. The same questions also make an excellent final check on your own work before you share it.

### Seven questions to ask any comparison claim

1. **Better at what?** Which metric? Is it the one that matters for the real job, or an easy proxy? Was success defined precisely?
2. **Compared with what?** Is there a baseline at all? Is it strong and fairly tuned, or a strawman? Was it run at the same time, or taken from old results?
3. **Under what conditions?** Were both methods tested on the same tasks? Are those tasks representative of real use, or a carefully chosen easy case?
4. **How many trials, and how much variation?** Is there any uncertainty reported? Could the difference be luck?
5. **Was the plan fixed in advance?** Were the metric and analysis decided before the data, or could they have been chosen afterwards from many possibilities?
6. **Is everything shown?** Are failed runs reported? Were some trials excluded, and why?
7. **Who says so, and why?** Does the person making the claim benefit from it? Has anyone independent repeated the result?

You will rarely get full answers to all seven. But noticing which ones are *missing* tells you a great deal.

### Relative numbers can mislead

"50% fewer drops" sounds impressive. But consider two made-up situations:

- Drops fell from **4 per 100 attempts to 2 per 100**.
- Drops fell from **40 per 100 to 20 per 100**.

Both are "50% fewer", yet in the first case the old system was already good and the change saves only 2 drops per 100, while the second is a large practical change. A **relative** change (a percentage of the old value) can make a small **absolute** change (the actual difference) sound big. Ask for both.

A related trap is mixing up **percent** and **percentage points**. If a success rate rises from 80% to 90% (made-up numbers):

- It rose by **10 percentage points** (90 − 80).
- It rose by **12.5 percent** in relative terms (10 ÷ 80).
- The failure rate fell from 20% to 10%, so failures **halved**.

All three descriptions are true, and they sound very different. A careful reader asks which one is being used, and a careful writer says.

### Demo videos show possibility, not reliability

A video of a robot folding a shirt shows that it folded a shirt **at least once**. It does not show how many attempts it took, how many failed, whether the shirt was specially placed, or whether a person was helping out of shot. Demo videos are valuable; they show what is possible. But treat them as a single best-case example, not as a measure of performance. The natural question is always: *how often does this work?*

### Worked example: critiquing a claim

Here is a **made-up** project summary:

> "Our SmartGrip uses advanced force sensing and is 40% more reliable than ordinary grippers. In testing it successfully lifted the test object 14 times!"

Working through the questions:

- **Better at what?** "Reliable" is not defined. Is it lifts without dropping? Lifts on the first attempt?
- **Compared with what?** "Ordinary grippers" is vague. Which one? Was it tested in the same session, with the same object?
- **Conditions?** Only "the test object" is mentioned, so we know it was one object. We do not know whether it was easy to grip.
- **Trials and variation?** "14 times" out of how many attempts? If 14 of 14, that is one thing; if 14 of 30, quite another. No uncertainty is given.
- **Plan in advance?** We cannot tell.
- **Everything shown?** No failed attempts are mentioned.
- **Who says so?** The team that built it, which is normal, but no one independent has checked.

We cannot conclude SmartGrip is bad. We can conclude that **the claim does not yet support "40% more reliable"**. A fair response is to ask for the missing information, not to dismiss the team's work.

### Critical, not cynical

Being critical does not mean assuming everyone is wrong. A small, honest study with clear limitations can be very valuable. The goal is to match your confidence to the evidence: strong claims need strong evidence, and modest claims supported by careful work deserve respect.

Two habits keep you fair:

- **Apply the same questions to claims you like** as to claims you dislike. It is easy to scrutinise a result you disagree with and wave through one you hoped for.
- **Apply them to your own work** before anyone else does.

Finally, watch for proposals described as results. A planned study, such as Tactiverge's proposed TV-01 project, has no findings yet. Anyone citing a proposal as evidence that something works is making an error, however promising the idea.

### Recap

- Ask: better at what, compared with what, under what conditions, how many trials, planned in advance, everything shown, and who says so?
- Missing answers tell you how much to trust a claim.
- Ask for absolute as well as relative changes, and check percent against percentage points.
- A demo video shows something happened at least once, not how often.
- Be critical, not cynical, and apply the same standard to claims you like and to your own work.

#### Project: Paper project: critique a real claim

Find one real claim that something is better, faster, safer or more effective. It could come from an advertisement, a product page, a news article or a science-fair poster.

1. Write the claim out exactly, with where you found it.
2. Answer each of the seven questions from this lesson as far as the claim allows. Write "not stated" where information is missing.
3. Rewrite the claim as a more honest sentence that matches only what the evidence supports.
4. List the two pieces of extra information that would most change how much you trust the claim.

Keep your critique polite and fair. The goal is to judge the evidence, not the people.

**Deliverables**

- The original claim and its source
- Answers (or "not stated") for all seven questions
- A rewritten, evidence-matched version of the claim
- The two most important missing pieces of information

#### Check your understanding

1. A product claims "60% fewer failures". Which follow-up question is most useful?
   A) What colour is the product?
   B) What were the actual failure rates before and after, and under what conditions?
   C) Is 60% a round number?
   D) Was the claim printed in bold?

2. A success rate rises from 50% to 60%. Which description is correct?
   A) It rose by 10 percent
   B) It doubled
   C) It rose by 60 percentage points
   D) It rose by 10 percentage points, which is 20% in relative terms

3. A video shows a robot successfully stacking five cups. What does it reliably tell you?
   A) That the robot succeeds every time
   B) That the robot is better than all other robots
   C) That the robot stacked the cups at least once, under the conditions shown
   D) Nothing at all

4. What is the best way to stay fair when reading claims critically?
   A) Apply the same questions to claims you like as to claims you dislike, and to your own work
   B) Assume every claim is false
   C) Only question claims made by companies
   D) Trust any claim that includes numbers


---

# Module 4: Engineering documentation

Writing down what you did, why, and what happened, so that others — including your future self — can understand, check and repeat it.

**Objectives**

- Keep a dated engineering notebook that records decisions, data and mistakes.
- Write a clear technical report with method, results and limitations sections.
- Produce a bill of materials and assembly notes that someone else could follow.
- Use version control concepts to track changes to designs and code.


## 4.1 Why document

*Documentation is how engineering work survives beyond the moment it was done. This lesson looks at who reads it — future you, teammates and strangers — and what they need from it.* (about 20 min)

### The robot nobody could rebuild

Imagine a small team that builds a robot arm for a competition. It works well. Six months later they want to build a second one for a new event. The person who wired it has moved to another school. The control code is on a laptop that was wiped. Someone remembers that the elbow bracket "had to be thicker", but not how thick, or why. The team spends weeks rediscovering things they already knew.

Nothing in that story is unusual. Engineering knowledge is fragile. It lives in people's heads, on scraps of paper and in files called `final2.py`, and it disappears faster than anyone expects. **Documentation** is the deliberate act of writing it down, in a form other people can find and use, so that the work outlives the moment it was done.

### Who documentation is for

It helps to picture real readers. There are usually four.

- **Future you.** The person most likely to read your notes is you, in three months, having forgotten almost everything. Future you will not remember which sensor was the noisy one, what the numbers in a spreadsheet column mean, or why you abandoned the first design. Write for that person as if they were a clever stranger.
- **Teammates.** People working with you need to know what you changed, what you tried and what state things are in, without interrupting you every hour.
- **People who check or repeat your work.** A teacher, a judge, a reviewer, or another student who wants to reproduce your result. They need enough detail to do exactly what you did and see whether they get the same answer.
- **People who use or maintain the thing.** Someone who wants to build your design, fix it when it breaks or adapt it for a new purpose.

Each reader asks slightly different questions, which is why engineers keep several kinds of documentation rather than one big document. This module covers the main ones: the **notebook** (what happened, as it happened), the **README** (what this project is and how to use it), the **bill of materials** (exactly what it is made of), **version control** (how the files changed over time) and the **technical report** (what you found, argued carefully).

### Record the *why*, not only the *what*

The most valuable thing to document is usually not a fact you could rediscover by measuring, but a **decision and its reason**.

Consider two notes about the same change:

- *"Bracket now 5 mm."*
- *"Changed elbow bracket from 3 mm to 5 mm thick. The 3 mm version flexed visibly when the arm was fully extended with the heaviest test load, and the gripper tip drooped. 5 mm fixed the droop in a quick test. 4 mm not tried yet."*

The first tells you what the design is. The second tells you what problem the design solves, what evidence supported it and what has not been checked. Now picture a later teammate who wants to save weight. With the first note, they might quietly go back to 3 mm and reintroduce the droop. With the second, they know exactly what to test before changing it — and they can see that 4 mm is an open question worth trying.

Decisions that are not written down tend to get reversed by accident. Writing down the reason turns a mystery into something people can reason about.

### Documentation is evidence

In research, documentation does a second job: it is the **evidence** that the work happened as described. A dated notebook entry made during an experiment is far more trustworthy than a summary written from memory a week later. If someone questions a result, the record is how you show what you actually measured — including the trials that went wrong.

This links directly to scientific integrity. Honest documentation makes it hard to fool yourself: when every run is written down at the time, you cannot quietly forget the inconvenient ones.

### What good documentation looks like

Good documentation, whatever its form, tends to be:

1. **Written at the time.** Memory edits and tidies. Notes made in the moment preserve details you did not know would matter.
2. **Dated.** A note without a date cannot be placed in the story. A clear format like 2026-03-14 sorts correctly and cannot be confused between countries that write day and month in different orders.
3. **Specific.** "M3 × 10 mm screw", not "small screw". "Measured with a kitchen scale, resolution 1 g", not "weighed it".
4. **Findable.** A brilliant note in a random file is almost as bad as no note. Keep documents in predictable places with clear names.
5. **Honest.** Mistakes, failures, surprises and uncertainty belong in the record.
6. **Kept up to date** — or clearly marked when it is not. Out-of-date instructions that look current are worse than none.

### "I'll write it up later"

The most common reason documentation goes missing is not laziness; it is the belief that you will do it properly at the end. By the end, the details have gone. A better habit is **little and often**: a few lines at the end of every work session saying what you did, what you found and what you plan next. Five minutes a day is far cheaper than five days of rediscovery.

Another common objection is "it's only a small project". Small projects are where habits form. Students who document small projects well find large projects much easier, because the habit is already there.

### Recap

- Documentation keeps engineering knowledge alive after the moment it was created.
- Its readers are future you, teammates, people checking or repeating the work, and people using or maintaining it.
- Record decisions **and their reasons**, so they are not reversed by accident.
- In research, documentation is evidence; honest, dated records protect against fooling yourself.
- Good documentation is timely, dated, specific, findable, honest and current. Write a little, often.

> **Unwritten trials still happened.** If you ran a test and did not write it down, you cannot honestly report it later, and you cannot honestly leave it out either — because you no longer know what it showed. Recording every trial at the time is the simplest way to make sure your final report tells the whole story.

#### Project: Paper project: a documentation audit

Pick something you made or worked on at least a month ago: a school project, a piece of code, a model, an essay with calculations, even a recipe you adapted.

Without looking at the original files first, write down from memory: what it was for, the main decisions you made and why, and how you would make it again. Then look at whatever records exist and compare.

Finally, write the short note you *wish* you had left for yourself — no more than half a page — covering what it is, the key decisions with reasons, and what you would check before changing anything.

**Deliverables**

- A list of details you had forgotten or remembered wrongly
- A list of the records you found, and which were most useful
- A half-page note to future you, dated, including at least two decisions with their reasons

#### Check your understanding

1. Who is usually the most frequent reader of your project notes?
   A) A professional reviewer
   B) You, some months later, having forgotten the details
   C) Nobody — notes are rarely read
   D) The manufacturer of your components

2. Which note is most useful to a teammate who wants to make a part lighter?
   A) "Bracket now 5 mm."
   B) "Bracket changed, works better."
   C) "Bracket is fine, don't touch."
   D) "Bracket changed from 3 mm to 5 mm because 3 mm flexed and the tip drooped under the heaviest load; 4 mm not tested."

3. Why is a date like 2026-03-14 a good format for notes?
   A) It sorts in time order and cannot be confused between day-first and month-first conventions
   B) It is required by law
   C) It uses fewer characters than any other format
   D) Computers cannot read any other format

4. What is the main problem with "I'll write it all up properly at the end"?
   A) Reports written at the end are always too long
   B) Teachers do not accept reports written at the end
   C) By the end, many details and failed attempts have been forgotten or tidied away by memory
   D) It is impossible to write anything at the end of a project


## 4.2 Lab notebooks and engineering logs

*How to keep a dated, honest record of what you planned, did, measured and thought — on paper or digitally — with a complete example entry.* (about 25 min)

### The record made at the time

A **lab notebook** (in engineering often called an **engineering log** or **design notebook**) is a running, dated record of your work, written as it happens. It is not a polished report. It is the raw story: what you planned, what you actually did, what you measured, what went wrong and what you were thinking.

Why does this matter for a robot or any engineering project? Because most of the useful knowledge in a project is produced in small moments: the sensor that read high when the lamp was on, the screw that kept loosening, the gain value that made the arm shake. Those moments are easy to forget and hard to rediscover. The notebook catches them.

### Paper or digital?

Both work. What matters is that you use one consistently.

- **A bound paper notebook** with numbered pages is hard to edit invisibly, which makes it good evidence. It is quick for sketches and works anywhere. Write in pen.
- **A digital log** — a plain text file, a document or a notebook app — is searchable, easy to back up and can link directly to data files and code. Its weakness is that it is easy to edit without leaving a trace, so be disciplined: add new entries rather than rewriting old ones, and keep the file under version control if you can (you will meet version control later in this module).

Many engineers combine them: a paper notebook at the bench, with references to the digital files where the full data lives.

### The rules that make a notebook trustworthy

1. **Date every entry**, and start a new entry each session. Year-month-day format avoids ambiguity.
2. **Write as you go**, not afterwards. Record measurements the moment you take them, directly into the notebook — not on a scrap of paper to copy later.
3. **Never erase or tear out.** If something is wrong, strike it through with a single line so it stays readable, and write the correction and the reason next to it.
4. **Record raw data, with units.** Write down what the instrument showed, not a value you have already adjusted. Calculations come afterwards, shown clearly.
5. **Say how you measured.** Which instrument, what resolution, what setup. "Stopwatch on a phone, started and stopped by hand" tells a reader how much to trust the numbers.
6. **Record failures and surprises.** A dropped sample or an odd reading is information.
7. **Write down your thinking.** Guesses, hypotheses and plans — including ones that turn out to be wrong — show why you did what you did.
8. **Point to other files.** If data is saved on a computer, write the exact file name in the entry.
9. **Number pages and keep an index** at the front, so you can find entries later.

In some companies and research labs, notebook pages are also signed and dated by the author, and sometimes by a witness, because the notebook may be used as a formal record of when an idea or result was produced. For your own projects, consistent dating is the important part.

### Anatomy of an entry

A useful entry usually has these parts:

- **Date and title.**
- **Goal:** what you plan to do today and why.
- **Setup:** materials, instruments, conditions, any changes from last time.
- **Procedure and observations:** what you did, in order, with raw data.
- **Analysis:** simple calculations, clearly separated from the raw data.
- **Problems and surprises.**
- **Next steps.**

### A worked example entry

Here is an example entry from a hypothetical student experiment with paper helicopters (a strip of paper with two folded rotor blades that spins as it falls). **All numbers are made up for illustration.**

```text
2026-03-14  (Sat)   Page 12
Paper helicopter: does rotor length change fall time?

GOAL
Compare fall time for 7 cm vs 9 cm rotor blades. Planned 5 drops each
(plan written p.11, 2026-03-12). Everything else kept the same.

SETUP
- Paper: printer paper, 80 g/m2, same pack for all models
- Body 3 cm x 8 cm, one paper clip on the bottom
- Drop height 2.00 m, measured with tape measure from floor to the
  bottom of the helicopter at release
- Timing: phone stopwatch, started at release, stopped at landing.
  Same person (me) for all drops. Indoors, window closed.

RAW DATA (fall time, seconds)
Model A, 7 cm rotor:  1.84  1.91  1.79  1.88  1.86
Model B, 9 cm rotor:  2.21  2.30  2.18  2.26  2.25
  3rd drop of B: ~~2.05~~ hit the edge of the table on the way
  down, not a fair drop. Struck out. Re-dropped; 2.18 is the re-drop.

ANALYSIS
Mean A = 9.28 / 5 = 1.856 s  (range 1.79 to 1.91)
Mean B = 11.20 / 5 = 2.240 s (range 2.18 to 2.30)
Ranges do not overlap. Hand timing probably +/- 0.1 s or worse,
so the difference (~0.4 s) looks bigger than the timing error.

PROBLEMS / SURPRISES
- Model B sometimes drifted sideways ~30 cm. A did not. Why?
- Reaction time is the weakest part of the method.

NEXT
- Film drops with phone and time from video frames instead?
- Try 8 cm rotor to see if the trend is smooth.
- Data also typed into heli_2026-03-14.csv
```

Notice what this entry does well. The plan existed before the data (and the page where it was written is referenced). The setup says exactly how things were measured. The bad drop is not erased: it is struck out, kept readable, and the reason is given, so a reader can see the decision and judge it. Raw data and analysis are separate. The writer is honest about the weakest part of the method. And the next steps turn the surprise into a new question.

In a real paper notebook you would draw the strike-through as a single line through the number. The tildes in the example above stand in for that line.

### Engineering logs for building, not just testing

On a build project — a robot, a bridge, a program — the log also records design decisions, changes and debugging. A good debugging entry says what the symptom was, what you suspected, what you tried, and what actually fixed it. These entries are gold the next time something similar breaks.

A short daily summary at the end of each session is a good minimum: *done today, found today, open questions, next*. Even on days when nothing works, write it down. "Spent two hours; still not working; ruled out the cable and the power settings" saves future you from ruling them out again.

### Recap

- A notebook is the raw, dated record of work, written at the time.
- Paper is hard to alter invisibly; digital is searchable. Use one consistently and link between them.
- Date every entry, record raw data with units and method, never erase, and strike through mistakes with a reason.
- Separate raw data from analysis, and always record failures, surprises and next steps.

> **Raw means raw.** If your scale reads 0.004 kg with nothing on it, write down the reading *and* the zero offset. Do not subtract it in your head and write only the result. A reader — or future you — can always repeat a calculation, but can never recover a measurement that was adjusted before it was recorded.

#### Project: Paper project: keep a notebook for one small experiment

Choose a small, safe experiment you can do at a desk with paper and a timer or ruler — for example, the paper helicopter above, or how far a paper ball rolls down a book ramp at different heights.

Before you start, write a dated plan entry: question, what you will change, what you will keep the same, how you will measure, and how many trials. Then run the experiment and record everything in the notebook as you go, using the entry structure from this lesson. Include at least one sketch of your setup.

**Deliverables**

- A dated plan entry written before any data was collected
- At least one experiment entry with setup, raw data with units, and analysis kept separate
- Any mistakes struck through with a single line and a reason
- A problems-and-surprises section and a next-steps section

#### Check your understanding

1. You realise a measurement you recorded an hour ago was misread. What should you do in a paper notebook?
   A) Rub it out and write the correct value
   B) Tear out the page and copy the rest neatly
   C) Leave it and say nothing
   D) Strike it through with a single line so it stays readable, and write the correction with the reason

2. Why should measurements go straight into the notebook rather than onto scrap paper first?
   A) Copying introduces errors and the scrap may be lost, so the notebook is no longer the original record
   B) Scrap paper is not allowed in labs
   C) Notebooks are faster to write in
   D) It makes the notebook look busier

3. In the example entry, why does the writer separate RAW DATA from ANALYSIS?
   A) Because analysis is optional
   B) So a reader can see exactly what was measured and check or redo the calculations independently
   C) Because raw data is less important
   D) To make the entry longer

4. Which setup note is most useful?
   A) "Timed the drops."
   B) "Timing was accurate."
   C) "Phone stopwatch, started at release and stopped at landing by hand, same person for all drops."
   D) "Used a good timer."

5. Nothing worked during today's two-hour session. What should the log say?
   A) Nothing — there is nothing to record
   B) What you tried, what you ruled out, and what you plan to try next
   C) Only that the session happened
   D) A guess at what the result would have been


## 4.3 README files and project documentation

*What a README must tell a newcomer, a skeleton you can copy, and the other documents that help someone build, use and maintain a project.* (about 25 min)

### The front door of a project

Open almost any software or hardware project shared online and the first thing you see is a file called **README** (often `README.md`, where `.md` means it is written in Markdown, a simple text format). As the name suggests, it is the file you should read first.

A README is the front door of a project. Someone who has never seen your work — including future you — lands there and needs to answer a few questions quickly: *What is this? Does it work? Can I use it? How?* If the README does not answer those, most people leave, or waste hours guessing.

Where a notebook records the history of your work, a README describes its **current state**. It should always be true *now*.

### What a README should answer

1. **What is it?** One or two sentences, in plain words. What does the project do, and for whom?
2. **What state is it in?** Working prototype? Half-finished? Tested on one track only? Honest status saves people from relying on something that is not ready.
3. **What do I need?** Software versions, hardware, materials. Point to the bill of materials if there is one.
4. **How do I build, install or run it?** Exact steps, in order, with commands someone can copy.
5. **How do I use it?** A minimal example of it doing its job.
6. **What is in this folder?** A short guide to the files and directories.
7. **What are the known limitations and problems?**
8. **Who made it, what did they build on, and can I reuse it?** Credits, acknowledgements and the licence.

### A README skeleton you can copy

Here is a skeleton for a hypothetical project. The project, its numbers and its details are made up for illustration; replace them with yours.

```markdown
# Line-follower simulation

A Python simulation of a two-wheeled robot that follows a black line
using two downward-facing light sensors. Written as a learning project.

### Status

Working prototype. Tested on the oval and figure-eight tracks in
tracks/. Fails on corners tighter than about 10 cm radius (see
Known limitations). Last checked 2026-03-20.

### Requirements

- Python 3.10 or newer
- No extra libraries (standard library only)

### Quick start

    git clone <repository-url>
    cd line-follower-sim
    python3 simulate.py tracks/oval.txt

You should see the robot's position printed every 0.1 s and a final
line saying "Lap complete".

### Files

- simulate.py      main program
- controller.py    the steering rule (proportional control)
- tracks/          example tracks as text files
- notebook.md      dated design log
- docs/decisions.md  why the main design choices were made

### Known limitations

- Sensor noise is modelled as uniform random noise, which is simpler
  than real sensors.
- Wheel slip is not modelled.

### Credits and licence

Track file format adapted from <source>, used under its licence.
This project is released under the MIT License; see LICENSE.
```

A few things to notice. The **status** section is specific and dated. The **quick start** includes what you should see when it works, so a newcomer can tell success from failure. The **limitations** are stated plainly rather than hidden. The placeholders in angle brackets (like the repository URL) are things you would fill in. In real Markdown, the indented commands under *Quick start* would usually be put in a fenced code block of their own; they are indented here only because this example is itself inside a code block.

### Writing instructions people can actually follow

The hardest part of a README is the instructions, because you already know how everything works and cannot easily see the gaps. Some habits help:

- **Number the steps** and put them in the order they must be done.
- **Make commands copyable**: exactly as typed, in a code block, no hidden steps.
- **State versions.** "Python 3.10 or newer" is useful; "Python" is not.
- **Say what success looks like** after important steps.
- **Test it on someone else.** Give the README to a friend who has never seen the project, watch them follow it without help, and note every place they get stuck. Each one is a fix. This is the single most effective way to improve documentation.
- **Keep it current.** When you change how the project is run, change the README in the same session.

### Beyond the README

A README should be short enough to read in a few minutes. Larger projects add other documents, linked from the README:

- **A design-decision log** (often `docs/decisions.md`): one short entry per important decision, saying what was decided, the options considered, the reason and the date. This keeps the *why* from the previous lessons alive in a place everyone can find.
- **A changelog** (`CHANGELOG.md`): a dated list of notable changes between versions, written for users.
- **A licence file** (`LICENSE`): the terms under which others may reuse your work.
- **Build or assembly guides** for hardware: step-by-step instructions with diagrams, referring to the bill of materials by item number.
- **Diagrams**: a block diagram of the system, a wiring or connection diagram, drawings of parts. Each should have a date or version.
- **Test procedures and results**: how to check the project still works.

A sensible folder layout makes all of this findable:

```text
line-follower-sim/
  README.md
  LICENSE
  CHANGELOG.md
  simulate.py
  controller.py
  tracks/
  docs/
    decisions.md
    block-diagram.png
  data/
    raw/
    processed/
```

Keeping `data/raw/` separate from `data/processed/` is a small habit with a big payoff: raw data is never overwritten, and anyone can rerun your processing to check it.

### Recap

- The README is the front door: what it is, its status, requirements, how to run and use it, files, limitations, credits and licence.
- It describes the project as it is *now*; keep it current.
- Make instructions numbered, copyable and versioned, and say what success looks like.
- Test your README on someone who has never seen the project.
- Link to deeper documents: decisions, changelog, licence, assembly guides, diagrams and tests.

> **An honest status line.** "Works" is a claim. "Tested on two tracks; fails on tight corners" is a description. The second is more useful *and* more honest, and it protects you: nobody can say you overstated what your project does.

#### Project: Software project: write and test a README

Choose a project you have made — a program, a spreadsheet model, a paper model with instructions, or the notebook experiment from the previous lesson. Write a README for it using the skeleton in this lesson, with an honest, dated status section.

Then ask someone who has never seen the project to follow the README without any help from you. Sit quietly and note every point where they hesitate, misunderstand or get stuck. Revise the README to fix each one.

**Deliverables**

- A README covering what, status, requirements, steps, files, limitations and credits
- A list of every point where your tester got stuck
- A revised README with those problems fixed

#### Check your understanding

1. What is the main difference between a README and a lab notebook?
   A) A README is always longer
   B) A notebook is written for users; a README is private
   C) A README describes the current state of the project; a notebook records its history as it happened
   D) There is no difference

2. Which requirement line is most helpful?
   A) "Python 3.10 or newer, standard library only"
   B) "Python"
   C) "A computer"
   D) "The usual tools"

3. What is the most effective way to find gaps in your README's instructions?
   A) Read it again yourself
   B) Make it longer
   C) Add more headings
   D) Watch someone who has never seen the project follow it without help

4. Where is the best place to record why a major design choice was made, so the whole team can find it?
   A) Only in your head
   B) In a design-decision log linked from the README
   C) In the file name
   D) In the licence file


## 4.4 Bills of materials and reproducibility

*How to list exactly what a design is made of so someone else can build the same thing, with a worked example BOM and the details that make it reproducible.* (about 25 min)

### "It works on mine"

Two students build the same gripper from the same drawings. One grips well; the other's fingers slip and its motor stalls. After a week of puzzling, they discover that one used screws of a slightly different length, a softer fingertip material and a motor that looked identical but had less torque. The drawings were the same. The *materials* were not.

A design is only reproducible if you know precisely what it is made of. The document that records this is the **bill of materials**, or **BOM**: a structured list of every part, material and quantity needed to build one unit of a design.

### What goes in a BOM

A useful BOM has one row per distinct part and, at minimum, these columns:

- **Item number:** a simple label (1, 2, 3…) that assembly instructions and drawings can refer to.
- **Quantity** per assembled unit.
- **Description:** what the part is, in plain words.
- **Specification:** exactly enough detail that someone could buy or make the same thing. This is the column that makes or breaks reproducibility.
- **Source:** where it comes from — bought, made in-house from a drawing, or included with another part.
- **Unit cost** and **line cost** (quantity × unit cost), if cost matters.
- **Notes:** substitutes that are known to work, things to watch out for.

Professional BOMs often add a manufacturer part number, a supplier part number, and for electronics a **reference designator** — the label on the circuit diagram such as R1 for the first resistor or C3 for the third capacitor — so each row can be matched to a place on the board.

### Specifications: say exactly what you mean

Compare these descriptions of the same part:

- *"Screw"*
- *"Small screw"*
- *"M3 × 10 mm socket head cap screw, stainless steel"*

Only the last one can be reproduced. In the metric system, **M3** means a nominal thread diameter of 3 mm, and the **10 mm** is the length. "Socket head" says what tool drives it. "Stainless steel" says what it is made of. Similar care applies to everything: a sheet material needs its thickness and type, a printed part needs its file name and version, an electronic part needs its key ratings.

When you cannot give a unique product, give the **properties that matter**. If the design depends on a motor producing a certain torque, write the required torque in the specification, not just "small motor". Then anyone substituting a different part can check whether it meets the requirement.

### A worked example BOM

BOMs are usually kept as spreadsheets, and the simplest portable format is **CSV** (comma-separated values): plain text, one row per line, columns separated by commas. Any spreadsheet program can open it, and version control can track changes to it line by line.

Here is a BOM for a **hypothetical** two-finger gripper. The design, part choices and prices are all made up for illustration; real prices vary widely.

```csv
item,qty,description,specification,source,unit_cost,line_cost,notes
1,1,Base plate,PLA printed part per base_plate_v3.step,make,0.80,0.80,material cost only
2,2,Finger,PLA printed part per finger_v5.step,make,0.40,0.80,print with flat face down
3,2,Fingertip pad,silicone sheet 2 mm thick cut to 15 x 25 mm,buy,0.25,0.50,softer pads grip better on smooth objects
4,1,Gripper actuator,micro servo 5 V with metal gears; at least the torque given in docs/sizing.md,buy,4.50,4.50,check torque before substituting
5,4,Machine screw,M3 x 10 mm socket head cap screw stainless,buy,0.10,0.40,
6,4,Hex nut,M3 stainless,buy,0.05,0.20,
7,1,Actuator horn,supplied with item 4,included,0.00,0.00,
```

The **total cost** is the sum of the line costs:

```text
0.80 + 0.80 + 0.50 + 4.50 + 0.40 + 0.20 + 0.00 = 7.20  (made-up currency units)
```

Check one line yourself: item 5 is 4 screws at 0.10 each, so its line cost is 4 × 0.10 = 0.40.

Notice several details. Printed parts point to a **specific file and version** (`finger_v5.step`), so nobody accidentally prints an old finger. The actuator row says what property matters and where the requirement is written. Item 7 appears even though it costs nothing, because an assembler needs to know it exists. And the notes column passes on hard-won knowledge.

### Levels: assemblies inside assemblies

Bigger designs are built from sub-assemblies. A robot arm might consist of a base, two joint modules and a gripper, and each of those has its own parts. Engineers handle this with a **multi-level (indented) BOM**: the top level lists the sub-assemblies, and each sub-assembly has its own BOM. In plain text, a level number is a simple way to show this:

```text
level,item,qty,description
0,A,1,Robot arm (complete)
1,A1,1,Base assembly
1,A2,2,Joint module
2,A2.1,1,Joint housing
2,A2.2,1,Joint actuator
1,A3,1,Gripper assembly (see gripper BOM above)
```

Quantities multiply down the levels: two joint modules, each with one actuator, means two joint actuators in total.

### Reproducibility is more than parts

A BOM tells you *what*. To rebuild the same thing, people also need:

- **Versions of everything.** The BOM itself should have a version and date, and should match a specific version of the drawings and code.
- **Software dependencies.** Code has a BOM too: the libraries it uses and their exact versions. In Python, a `requirements.txt` file listing lines such as `numpy==1.26.4` pins an exact version, so the program behaves the same on another computer.
- **Process details.** How parts are made matters: print settings, cutting method, the order of assembly, how tight to make the screws.
- **Known substitutions.** If you tried an alternative part and it failed, say so — that saves the next builder a week.

### Recap

- A BOM lists every part, with quantity, specification, source and cost, for one unit of a design.
- Specifications must be exact, or state the properties that matter so substitutes can be checked.
- CSV is a simple, portable, version-controllable BOM format.
- Large designs use multi-level BOMs; quantities multiply down the levels.
- Reproducibility also needs versions, software dependencies, process details and known substitutions.

> **Keep the BOM in sync.** The most common BOM failure is not a missing column; it is a BOM that no longer matches the design. Whenever you change a part, update the BOM in the same session, bump its version, and note the change in your log.

#### Project: Paper project: write a BOM for an everyday object

Choose a simple object you can examine without taking it apart or using tools — a stapler, a clipboard, a ring binder, a wooden ruler, or a paper or cardboard model you built yourself.

Write a CSV bill of materials for it with the columns from this lesson. Where you cannot know an exact specification, describe the properties that matter (size, material, thickness) and mark the row as estimated. Estimate made-up unit costs and calculate the total, showing your working.

Finally, swap BOMs with a friend: can they picture every part from your specifications alone?

**Deliverables**

- A CSV BOM with item, qty, description, specification, source, unit_cost, line_cost and notes
- A total cost with the line-cost working shown, labelled as estimated
- A note of any specifications your friend found unclear, and your fixes

#### Check your understanding

1. Which BOM specification would let someone else buy the same part?
   A) "Screw"
   B) "M3 × 10 mm socket head cap screw, stainless steel"
   C) "Small silver screw"
   D) "Same as last time"

2. A BOM row lists 6 parts at 0.15 each. What is the line cost?
   A) 0.15
   B) 0.60
   C) 0.90
   D) 6.15

3. Why should a printed part's BOM row name a specific file version, such as finger_v5.step?
   A) So nobody accidentally makes the part from an older or newer drawing that does not fit
   B) Because file names must be in the BOM by law
   C) To make the BOM look more technical
   D) Version numbers are not useful in a BOM

4. An arm has 3 joint modules, and each module contains 2 bearings. How many bearings does one arm need?
   A) 2
   B) 3
   C) 5
   D) 6

5. You can't find the exact actuator used in a design. What should a good BOM have told you?
   A) The colour of the actuator
   B) The property that matters, such as the required torque, so you can check a substitute
   C) Nothing — exact parts are always available
   D) The name of the person who bought it


## 4.5 Version control concepts (git)

*How version control records every change to a project as a dated, described snapshot, and how commits, history, diffs and branches work in git.* (about 30 min)

### The folder of "final" files

Most people have seen a folder like this:

```text
controller.py
controller_old.py
controller_v2.py
controller_v2_fixed.py
controller_FINAL.py
controller_FINAL_really.py
```

Which one is the version that worked at the competition? What changed between v2 and v2_fixed? Nobody knows. Now imagine three teammates each emailing their own copies around. This is the problem **version control** solves.

A **version control system** keeps a complete, organised history of a project's files. Instead of copies with hopeful names, you have one set of files plus a record of every saved change: what changed, who changed it, when, and — if you write a good message — why. The most widely used version control system is **git**, which is free and open-source. This lesson covers the concepts, with git commands as examples.

### Repositories and commits

A **repository** (or *repo*) is a project folder whose history git is tracking. Git keeps that history in a hidden `.git` folder inside it.

The basic unit of history is the **commit**: a snapshot of the tracked files at a moment you choose, together with a short message, the author and the date. Think of a commit as a notebook entry for your files. Each commit gets a unique identifier (a long string of letters and numbers, usually shortened to the first seven characters, like `1c88edf`).

Making a commit is a two-step process:

1. **Stage** the changes you want to include with `git add`. This lets you choose exactly what goes into a snapshot.
2. **Commit** them with `git commit`, adding a message.

Here is a short session in a new, hypothetical project. Lines starting with `$` are what you type; the rest is git's output (your identifiers will differ).

```bash
$ git init -b main
Initialized empty Git repository in /home/sam/paper-bridge/.git/
$ git status --short
?? README.md
$ git add README.md
$ git commit -m "Add README with project goal"
[main (root-commit) 1c88edf] Add README with project goal
 1 file changed, 1 insertion(+)
 create mode 100644 README.md
$ git add measure.py
$ git commit -m "Add first measurement script"
[main 82f52b1] Add first measurement script
 1 file changed, 1 insertion(+)
 create mode 100644 measure.py
$ git log --oneline
82f52b1 Add first measurement script
1c88edf Add README with project goal
```

`git init -b main` creates the repository and names its main line of history `main` (the `-b` option needs git 2.28 or newer). `git status` shows what has changed since the last commit; `??` means a file git is not yet tracking. `git log --oneline` lists the history, newest first.

Before your first commit, git needs to know who you are. You set this once with `git config --global user.name "Your Name"` and `git config --global user.email "you@example.com"`. The name and email are stored in every commit, so think about what you want to be public if you later share the repository online.

### Seeing what changed: diffs

A **diff** shows exactly which lines changed. Before committing, `git diff` shows changes you have not staged yet, and `git diff --staged` shows what is staged and about to be committed:

```bash
$ git diff
diff --git a/measure.py b/measure.py
index 5587912..7819e6a 100644
--- a/measure.py
+++ b/measure.py
@@ -1 +1,2 @@
 load_g = 0
+width_mm = 60
```

A line beginning with `+` was added; a line beginning with `-` was removed. Reading your own diff before every commit is an excellent habit: it catches stray debugging lines and accidental edits.

### Writing good commit messages

The message is the *why* of the change. A common convention is a short summary line in the imperative mood, as if giving an instruction to the code:

- Weak: *"stuff"*, *"fixed it"*, *"update"*
- Strong: *"Lower steering gain from 0.8 to 0.5 to stop oscillation on the oval track"*

A good test: could a teammate understand what changed and why from the message alone, without opening the files? Small commits, each doing one thing, are far easier to understand and undo than one giant commit at the end of the week.

### Going back in time

Because every commit is kept, you can recover earlier work:

- `git restore measure.py` throws away your unstaged changes to that file and returns it to the last committed version (or to the staged version, if you have already used `git add` on it). Be careful: those discarded changes are gone.
- `git restore --source=1c88edf measure.py` brings back the file as it was in an earlier commit.
- `git show 1c88edf` displays a past commit and its changes.
- `git log -- measure.py` shows only the commits that touched that file.

### Branches: safe experiments

A **branch** is an independent line of development. Suppose your project works and you want to try a risky idea. Instead of endangering the working version, you create a branch, experiment there, and only bring the changes back if they work:

```bash
$ git switch -c try-wider-deck
Switched to a new branch 'try-wider-deck'
$ git commit -am "Try a 60 mm wide deck"
[try-wider-deck acade0b] Try a 60 mm wide deck
 1 file changed, 1 insertion(+)
$ git switch main
Switched to branch 'main'
$ git merge try-wider-deck
Updating 82f52b1..acade0b
Fast-forward
 measure.py | 1 +
 1 file changed, 1 insertion(+)
```

`git switch -c` creates a new branch and moves to it (`git switch` needs git 2.23 or newer; older guides use `git checkout -b`). `git commit -am` stages every change to files git already tracks and commits them in one step; it does not include brand-new files, which still need `git add`. `git merge` brings the experiment's commits into `main`. If the idea fails, you simply switch back to `main` and the working version is untouched. When two branches changed the same lines differently, git reports a **merge conflict** and asks you to decide which version to keep.

### Remotes and collaboration

So far everything lives on one computer. A **remote** is a copy of the repository somewhere else, often on a hosting service. `git clone` copies a repository, `git push` sends your commits to a remote, and `git pull` fetches and merges other people's commits. This is how teams share one history instead of emailing files around.

### What to track, and what not to

Version control works best with **text files**: code, Markdown documentation, CSV data and BOMs, plain-text notebooks. Git can store any file, including CAD models and images, but for binary files it cannot show a meaningful line-by-line diff, and very large files make repositories slow.

Some things should **never** be committed: passwords, access keys and other secrets, and files that can be regenerated automatically. List them in a file called `.gitignore` so git ignores them:

```text
# .gitignore
__pycache__/
secrets.txt
```

Once a secret is committed and shared, removing it from history is difficult. Treat it as exposed and change it.

### Recap

- Version control replaces piles of copies with one history of dated, described snapshots called commits.
- Stage with `git add`, snapshot with `git commit`, inspect with `git status`, `git diff` and `git log`.
- Write commit messages that explain why; keep commits small.
- Branches let you experiment safely; merging brings successful work back.
- Remotes share history; `.gitignore` keeps secrets and generated files out.

> **A repository on one laptop is not a backup.** Git's history lives inside the project folder. If that computer is lost or the folder is deleted, the history goes with it. Push to a remote, or copy the whole folder to another drive, regularly.

#### Project: Software project: give a small project a history

Install git (free, from the official site) and create a new repository for a small project — the README from the earlier lesson, a short Python script, or a CSV of your notebook data.

Make at least five small commits, each with a clear message explaining why. Create a branch, try a change there, and either merge it or abandon it. Read `git diff` before every commit. Finally, run `git log --oneline` and copy the output into your notebook.

**Deliverables**

- A repository with at least five commits, each with a descriptive message
- One branch that was either merged or deliberately abandoned, with a note saying which and why
- A .gitignore file listing at least one thing that should not be tracked
- The output of git log --oneline copied into your notebook

#### Check your understanding

1. What is a commit in git?
   A) A backup copy stored automatically every minute
   B) A snapshot of the tracked files at a moment you choose, with a message, author and date
   C) A file that lists what to ignore
   D) A copy of the repository on another computer

2. Which commit message is most useful?
   A) "update"
   B) "fixed it"
   C) "Lower steering gain from 0.8 to 0.5 to stop oscillation on the oval track"
   D) "changes"

3. Why would you create a branch before trying a risky change?
   A) So the working version on main stays untouched while you experiment
   B) Because git refuses to commit without a branch name
   C) To delete the project history
   D) Branches make the code run faster

4. In a git diff, what does a line starting with + mean?
   A) The line was removed
   B) The line has an error
   C) The line is a comment
   D) The line was added

5. You accidentally committed a file containing a password and pushed it. What is the right response?
   A) Delete the file in a new commit; the problem is solved
   B) Treat the password as exposed and change it, then remove the file and add it to .gitignore
   C) Rename the file
   D) Nothing, because nobody reads old commits

**Go further:**

- Pro Git (free online book): https://git-scm.com/book/en/v2 — The official, free book on git. Chapters 1 to 3 cover everything in this lesson in more depth.


## 4.6 Writing a technical report

*The standard structure of a technical report, what belongs in each section, and how to write results and limitations clearly and honestly.* (about 30 min)

### From notebook to report

Your notebook records everything, in the order it happened, including dead ends. That is exactly right for a notebook and exactly wrong for most readers. A teacher, a judge, a teammate or a future builder wants to know: *What did you ask? What did you do? What did you find? How far can I trust it?* A **technical report** answers those questions in a predictable structure, so readers can find what they need quickly.

Reports matter for a robot project as much as for a science experiment. A report on a gripper test is how a team decides whether to adopt a new fingertip design, and how someone a year later finds out why it was chosen.

### The standard structure

Most technical reports follow a version of this structure. Each section has a job.

1. **Title.** Specific and informative. *"Effect of rotor length on the fall time of paper helicopters"* beats *"My helicopter project"*.
2. **Summary (abstract).** A short paragraph that stands alone: the question, the method in a sentence, the main result with numbers, and the main limitation. Many readers read only this, so it must be accurate.
3. **Introduction.** Why the question matters, what is already known, and the precise question or hypothesis.
4. **Method.** What you did, in enough detail that someone else could repeat it: materials, setup, procedure, number of trials, how you measured, how you analysed the data. Refer to the bill of materials and code rather than repeating them.
5. **Results.** What happened, with numbers, uncertainty and figures — *without* interpretation. Report all trials, including excluded ones and why they were excluded.
6. **Discussion.** What the results mean, whether they support the hypothesis, how they compare with expectations, and the **limitations**: what could have affected the result, and where the conclusions do not apply.
7. **Conclusion.** The answer to the question, in a few sentences, no stronger than the evidence allows, plus the most useful next step.
8. **References and acknowledgements.** Sources you used and people who helped.
9. **Appendices.** Raw data, full BOM, code listings, extra figures — useful material that would interrupt the main text.

### Results versus discussion

The most important line in the structure is between **results** and **discussion**. Results say *what was observed*. Discussion says *what you think it means*. Keeping them apart lets a reader examine your evidence before hearing your interpretation, and decide for themselves whether they agree.

- Results: *"Mean fall time was 1.86 s for the 7 cm rotor and 2.24 s for the 9 cm rotor (5 drops each; ranges 1.79–1.91 s and 2.18–2.30 s)."*
- Discussion: *"Longer rotors appear to increase fall time, plausibly because they sweep a larger area and produce more drag. With only two rotor lengths, we cannot say whether the relationship is smooth."*

### An example outline

Here is a compact outline of a short report on a **hypothetical** paper-bridge test. All numbers are made up for illustration.

```text
Title: Does folding a paper beam into a channel increase the load it
       holds across a 20 cm gap?

Summary
  We compared flat and channel-folded beams made from one sheet of
  80 g/m2 paper spanning a 20 cm gap (5 beams each). Channel beams
  held a mean of 412 g before collapse (range 360-455 g); flat beams
  held a mean of 38 g (range 30-45 g). Only one paper type and one
  span were tested.

1 Introduction   why beam shape matters; question and hypothesis
2 Method         materials (see BOM, Appendix A); support setup;
                 adding coins one at a time; definition of "collapse";
                 trial order randomised; plan dated 2026-04-02
3 Results        all 10 beams; table of loads; one extra beam tore
                 before loading, was replaced, and is reported
4 Discussion     why folding helps (stiffness from shape); limits:
                 one paper, one span, coins add load in steps of
                 a few grams
5 Conclusion     channel folding greatly increased the load held in
                 this test; next: try other fold shapes
References
Appendix A  BOM     Appendix B  raw data     Appendix C  photos
```

You can check the summary's numbers against the made-up raw data: channel beams of 360, 395, 410, 440 and 455 g sum to 2,060 g, and 2,060 ÷ 5 = 412 g.

Notice that the summary includes real numbers, the sample size and the main limitation. A summary that says only "folding made the beam much stronger" hides everything a reader needs to judge the claim.

### Writing clearly

- **Be specific.** "Much stronger" means little; "a mean of 412 g compared with 38 g" means a lot.
- **Give uncertainty.** Report the number of trials and the spread (a range or a standard deviation), not just an average.
- **Match words to evidence.** Use "suggests" or "in this test" for limited evidence. Save "shows" for clear results, and avoid "proves" for experiments almost entirely.
- **Use figures and tables well.** Every figure or table needs a number, a caption that says what it shows, labelled axes or columns, and units. Refer to each one in the text.
- **Prefer short sentences** and define every abbreviation the first time you use it.
- **Write for a reader who was not there.** If a step depends on something you only know from being in the room, write it down.

### A practical writing order

You do not have to write sections in the order they appear. Many engineers write in this order:

1. **Method** first, while the details are fresh — it is mostly copied and tidied from your notebook.
2. **Results** next, with figures.
3. **Discussion** and **conclusion**.
4. **Introduction**.
5. **Summary** last, because you cannot summarise what you have not written yet.

Then leave it for a day and reread it. Check every number against the raw data. Ask someone else to read it and tell you, in their own words, what you found. If their answer does not match what you meant, the report needs work.

### Recap

- A report reorganises your notebook into a predictable structure for readers.
- Sections: title, summary, introduction, method, results, discussion (with limitations), conclusion, references, appendices.
- Keep results (what happened) separate from discussion (what it means).
- Be specific, report uncertainty and sample size, and match your words to your evidence.
- Write method and results first and the summary last; check every number.

> **Limitations are not a weakness.** A limitations section is where you tell readers how far to trust your conclusions. Leaving it out does not make a study stronger; it makes readers apply the result where it does not belong. Report excluded trials, unexpected results and negative findings in full.

#### Project: Paper project: write a two-page report

Using the notebook experiment from earlier in this module (or any small, safe experiment you have recorded), write a technical report of no more than two pages plus appendices.

Use the standard structure. Write the method and results first, and the summary last. Put all raw data in an appendix. Include at least one labelled figure or table with units and a caption. Then ask someone to read only your summary and tell you what you found; revise until their answer matches yours.

**Deliverables**

- A report with title, summary, introduction, method, results, discussion, conclusion and references
- A results section that reports every trial, including any excluded ones and why
- A discussion section with at least two limitations
- Raw data in an appendix, and one labelled figure or table with units

#### Check your understanding

1. Which sentence belongs in the results section rather than the discussion?
   A) "Longer rotors probably fall slower because of extra drag."
   B) "Mean fall time was 2.24 s for the 9 cm rotor (5 drops, range 2.18–2.30 s)."
   C) "These findings could help design better parachutes."
   D) "Our method had several limitations."

2. What should a good summary (abstract) contain?
   A) Only the title repeated in different words
   B) A list of the equipment used
   C) The question, the method briefly, the main result with numbers, and the main limitation
   D) Only the conclusion, without numbers

3. Why is the summary often written last?
   A) You cannot accurately summarise a report you have not finished writing
   B) It is the least important section
   C) Teachers read it last
   D) It must be shorter than all other sections

4. Your test of 5 beams found folded beams held more load. Which conclusion matches the evidence best?
   A) "Folding proves paper beams are always stronger."
   B) "Folding has no effect."
   C) "All beams should be folded."
   D) "In this test of one paper type and one span, folded beams held considerably more load."

5. What is the purpose of the method section?
   A) To explain why the topic is interesting
   B) To give enough detail that someone else could repeat the work
   C) To list the results
   D) To thank the people who helped


---

# Module 5: Scientific integrity

The principles that make research trustworthy: honest data, honest reporting, fair credit and responsibility for the effects of your work.

**Objectives**

- Define fabrication, falsification and plagiarism and explain why each is serious.
- Recognize subtler questionable practices such as selective reporting and moving the goalposts.
- Report uncertainty, negative results and limitations accurately.
- Give appropriate credit for ideas, code, data and help, including from tools.
- Explain how to correct a mistake after work has been shared.


## 5.1 Honest data and honest reporting

*Why trust is the foundation of research, the serious forms of misconduct, the quieter habits that mislead, and how to report results you did not hope for.* (about 30 min)

### Research runs on trust

No one can personally check every experiment they rely on. An engineer designing a bridge uses material strengths measured by other people. A student uses a formula derived by someone long ago. Research works as a shared, growing body of knowledge only because people can, by and large, trust that reported results really happened as described. **Scientific integrity** is the set of habits that keeps that trust deserved.

Integrity is not only about avoiding dramatic fraud. It is mostly about small, everyday choices — what you write in your notebook, which results you show, how you describe uncertainty — made honestly when no one is watching.

### The three serious forms of misconduct

Research institutions commonly define three kinds of serious misconduct. The United States Office of Research Integrity, for example, uses this framework, and similar definitions are used widely elsewhere.

- **Fabrication** is making up data or results. Writing down measurements for trials that were never run is fabrication.
- **Falsification** is manipulating materials, equipment or processes, or changing or leaving out data, so that the record does not accurately represent what happened. Quietly changing a 7.2 to an 8.2 because it "should" have been higher is falsification. So is deleting the runs that did not fit, without saying so.
- **Plagiarism** is presenting someone else's ideas, words, results or work as your own without appropriate credit.

These are serious because they do not just harm one project. Other people build on false results, waste time and money trying to reproduce them, and — in engineering — may design real things that fail.

### The quieter problems

Most people would never invent data. The more common dangers are subtler, and they often happen without anyone intending to deceive.

**Selective reporting.** You run a test ten times and show only the three best runs. Every number you show is real, yet the overall picture is false. The fix is simple: report all runs, or clearly state which were excluded and why, with the reason decided by a rule rather than by whether you liked the result.

**Moving the goalposts.** You planned to measure one thing, it did not work out, so you switch to another measure that looks better and present it as the plan. You met this in the lesson on formulating research questions: the protection is deciding your measures in advance and labelling anything else as exploratory.

**Overstating.** "Our robot can fold laundry" when it folded one towel, once, under ideal lighting. Words like *always*, *proves* and *solves* should be used rarely and carefully. Describe what you actually observed, under what conditions, how many times.

**Hiding uncertainty.** Every measurement has uncertainty. Writing "the bracket holds 4.27 kg" when your measurements ranged from 3.6 to 4.9 kg hides the information a reader most needs. Report the spread, the number of trials, and how you measured.

**Leaving out limitations.** Every study has limits. Not mentioning them invites readers to apply your result where it does not belong.

### Negative results are results

Suppose you test whether rubber pads improve a gripper's hold, and they make no measurable difference. It is tempting to see this as a failed project and quietly move on. It is not a failure. You have learned something real, and anyone who later has the same idea can benefit from your finding instead of repeating your work.

When negative results go unreported across many projects, the overall record becomes biased: the published picture shows only the attempts that worked, making ideas look more reliable than they are. Reporting what did not work is one of the most valuable contributions a careful researcher can make. The TV-01 proposal, for example, includes publishing negative results among its stated objectives.

### Your notebook is your evidence

The simplest integrity tool is an honest, dated record made **at the time**. A good engineering or lab notebook includes:

- the date, and what you planned to do;
- what you actually did, including changes from the plan;
- raw measurements, written down as they are taken, not tidied up later;
- mistakes and surprises — a dropped sample, a loose wire, a sensor that read oddly;
- your thinking at the time, including wrong guesses.

Do not erase mistakes. Cross them out with a single line so they remain readable, and note why. A notebook full of honest crossings-out is far more trustworthy than a perfectly neat one, because it shows the work as it really happened.

### Worked scenario

Amira is testing paper bridges. She planned ten trials. Trial 4 collapsed early because she knocked the table. Trial 9 gave a result far higher than the others, and she is not sure why.

An honest report would include all ten results; note that trial 4 was disturbed and explain whether it is included in the average (and give the average both ways if it matters); report trial 9 as it was, say it is unexplained, and suggest repeating the test; state the range of results, not just the average; and describe the limitations, such as using only one type of paper.

What she should *not* do is drop trial 9 because it "looks wrong", or include it without comment because it raises the average. Either choice, made silently, would misrepresent what happened.

> **When in doubt, disclose.** If you are unsure whether something should be mentioned — an excluded trial, a changed plan, a calibration problem — mention it. Disclosure costs a sentence. Being discovered to have hidden something costs your readers' trust.

#### Check your understanding

1. A student records results for three trials that were never actually run, because they ran out of time. This is:
   A) Plagiarism
   B) Selective reporting
   C) An acceptable estimate
   D) Fabrication

2. A team ran twelve trials, then reported only the five most successful without mentioning the others. Which problem is this?
   A) Selective reporting
   B) Plagiarism
   C) Pre-registration
   D) Operational definition

3. An experiment shows no difference between the new method and the baseline. What is the best course of action?
   A) Report it clearly as a negative result, with its conditions and limitations
   B) Do not report it, because nothing happened
   C) Change the measure until a difference appears
   D) Report that the new method is better

4. What is the best way to correct a mistake in a paper engineering notebook?
   A) Tear out the page
   B) Use correction fluid so the page looks clean
   C) Rewrite the whole notebook neatly at the end
   D) Cross it out with a single line so it stays readable, and note the reason

**Go further:**

- ORI Introduction to the Responsible Conduct of Research: https://ori.hhs.gov/education/products/RCRintro/ — A free introduction from the US Office of Research Integrity covering data management, authorship, mentoring and misconduct. Written for university researchers, but clear and readable.


## 5.2 Credit, collaboration and responsibility

*Giving fair credit for ideas, code and help; working honestly in teams; and taking responsibility for safety, people and mistakes.* (about 30 min)

### Nobody works alone

Even a project you do by yourself rests on other people's work: the textbook that taught you a formula, the open-source library that reads your sensor, the friend who suggested a better way to hold the camera. Integrity includes being honest about all of that. This lesson covers three areas: **credit**, **collaboration** and **responsibility**.

### Giving credit

The principle is simple: **make it clear which parts are yours and which are not.** Readers deserve to know where ideas came from, and the people whose work you used deserve recognition.

**Ideas and facts.** When you use an idea, result or explanation from a specific source, cite it — say where it came from, in enough detail that a reader could find it. Widely known textbook facts, such as Ohm's law, usually do not need a citation in a school report, but a specific measured value, a diagram or an unusual claim does.

**Words.** If you use someone else's exact words, put them in quotation marks and cite them. If you rewrite an idea in your own words, still cite the source: paraphrasing changes the words, not who had the idea. Copying a paragraph and changing a few words is still plagiarism.

**Code.** Engineers reuse code constantly, and that is a good thing — but it comes with obligations. Note in a comment where reused code came from. Check its **licence**: open-source licences give you permission to use code under certain conditions, often including keeping the original copyright notice. "I found it online" is not permission.

**Data and images.** Datasets, photographs and diagrams belong to someone. Credit them, and check that you are allowed to use them.

**Tools.** If software did a meaningful part of the work — for example, an automated tool generated code or text, or a program fitted your data — say so and describe how you checked its output. You remain responsible for everything you submit, including parts a tool produced.

**Help.** Acknowledge people who helped: the teacher who lent equipment, the friend who proof-read your report, the online forum that answered your question.

### Collaborating honestly

Team projects raise their own questions.

**Who gets credit?** A common principle is that everyone named as an author should have made a real contribution to the work and be able to explain and stand behind it. People who helped in smaller ways belong in the acknowledgements. Agree on this early, before the project ends, when it is easier to be fair.

**Disagreements about data.** If a teammate wants to drop results that do not fit, or describe the project as more successful than it was, raise it. You might say: "I'm not comfortable leaving those runs out unless we explain why — can we report them and add a note?" Framing it as a shared goal — a report everyone can be proud of — usually works better than an accusation.

**Shared records.** Keep shared data and code somewhere everyone can see, with a history of changes. It reduces mistakes and makes it obvious who did what.

### Responsibility for people and safety

Engineering work affects the physical world and the people in it. Integrity includes taking that seriously.

**Safety.** Any experiment involving tools, motors, batteries, heat, mains electricity or soldering must be planned with safety in mind, and for students it requires adult supervision. Lithium batteries can catch fire if damaged or short-circuited; motors can pinch fingers; soldering irons are hot enough to cause serious burns. Reporting a near-miss honestly helps others avoid it.

**People in your study.** If your project involves other people — a survey, a usability test of a device, photographs — they must agree to take part, understand what they are agreeing to, and be able to stop at any time. For anyone under 18, a parent or guardian should also agree. Keep personal information private and collect only what you need.

**Conflicts of interest.** If you have a reason to want a particular result — you designed the method being tested, or a sponsor would benefit — say so. It does not make your work invalid, but readers deserve to know.

**Thinking about uses.** Ask how your work might be used, and by whom. Most student projects are harmless, but the habit of asking is part of being a responsible engineer.

### When you find a mistake after sharing

Everyone makes mistakes, including experienced researchers. What matters is what you do next. If you discover an error in work you have already shared:

1. Check carefully that it really is an error, and how much it changes.
2. Tell the people who received the work, promptly and plainly.
3. Publish a correction that says what was wrong, what the correct result is, and whether the conclusions change.
4. Keep the original visible where possible, with the correction attached, rather than silently replacing it.

Correcting your own mistake openly is not embarrassing. It is one of the clearest signs of a trustworthy researcher.

### Worked scenario

Jonah and Lee built a line-following robot simulation for a school showcase. Lee wrote most of the control code; Jonah adapted a path-drawing function from an open-source project and wrote the report. Two days before the deadline, Jonah notices the robot only works on the single track they tested.

An honest write-up would list both names with a sentence on who did what; credit the open-source project in the code and the report, following its licence; state clearly that the robot was tested on one track, and describe this as a limitation; and avoid claims like "our robot follows any line". If they have time, testing more tracks would be better still — and if the results are worse, those go in the report too.

> **Hands-on work needs supervision.** Activities in this academy are designed to work on paper or in simulation. If you choose to build something physical — especially with batteries, motors, mains power, soldering irons or cutting tools — do it only with adult supervision, in a suitable space, with appropriate protective equipment such as safety glasses, and following the manufacturer's instructions for every tool and component.

#### Check your understanding

1. You rewrite a paragraph from a website entirely in your own words. Do you need to cite it?
   A) No, because the words are now yours
   B) Only if you copied more than half the words
   C) Yes, because the idea still came from that source
   D) Only if the website asks you to

2. You want to use code from an open-source project. What should you do first?
   A) Remove the original author's name so the code looks consistent
   B) Check its licence and follow its conditions, and note where it came from
   C) Nothing — anything online is free to use
   D) Rewrite the variable names so it counts as your own

3. Your project includes a short survey of classmates. Which practice is required?
   A) Collect as much personal information as possible
   B) Publish every participant's name with their answers
   C) Only survey people who will give the answer you want
   D) Participants agree to take part, understand what is involved, can stop at any time, and their information is kept private

4. After sharing a report, you find a calculation error that changes one result. What is the best response?
   A) Promptly publish a clear correction explaining what changed and whether the conclusions change
   B) Silently replace the report with a fixed version
   C) Say nothing unless someone notices
   D) Delete the report entirely


## 5.3 Recognising p-hacking, cherry-picking and the garden of forking paths

*How honest people produce false discoveries from real data by trying many analyses, stopping at the right moment or showing only the best examples, and the practical defences that prevent it.* (about 35 min)

### Fooling yourself with real data

In the lesson on honest data and reporting, you met selective reporting and moving the goalposts. Those are easy to recognise once named. This lesson looks underneath them at the **mechanism**: why trying several things and keeping the one that worked produces false discoveries, even when every number is real and nobody intends to deceive.

This matters for robotics and engineering just as much as for medicine or psychology. A team that tries ten ways of scoring its robot and reports the one where it beat the baseline may genuinely believe it has found an improvement. Other people may then spend months building on an effect that was never there.

### Luck can look like a discovery

Imagine testing whether a new controller improves a robot's lap time, when in truth it makes no difference at all. Because every lap varies a little, the two averages will almost never be exactly equal. Sometimes, by pure chance, the new controller will look noticeably faster.

Researchers often measure "how surprising would this be by luck alone?" with a number called a **p-value**. Roughly: *if there were really no effect, how often would we see a difference at least this large just from random variation?* A small p-value means the result would be rare by luck alone.

A common convention treats p below 0.05 (1 in 20) as "statistically significant". Two points are easy to misunderstand:

- p < 0.05 does **not** mean there is a 95% chance your idea is right. It is a statement about how surprising the data would be if there were no effect.
- The convention means that when there is **no real effect**, about **1 test in 20** will still come out "significant" by chance. That is the false alarm rate you accept by using the threshold.

One false alarm in 20 sounds acceptable. The trouble starts when you run more than one test.

### Many tries, guaranteed "success"

Suppose a team measures 20 different things about their robot (lap time, energy, smoothness, top speed, error on each corner and so on) and the new controller truly changes none of them. Treating the 20 checks as independent, the chance that **at least one** looks significant by luck is:

```text
1 − 0.95²⁰ ≈ 1 − 0.36 = 0.64
```

About a 64% chance. More often than not, the team will "discover" an effect that does not exist. If they then report only that measure, every number they show is real, and the conclusion is still false.

You can check this with a quick simulation, using only Python's standard library:

```python
import random

random.seed(1)
STUDIES = 10000
MEASURES = 20       # number of things checked per study
FALSE_ALARM = 0.05  # chance one check looks "significant" by luck alone

lucky = 0
for _ in range(STUDIES):
    hits = sum(1 for _ in range(MEASURES) if random.random() < FALSE_ALARM)
    if hits >= 1:
        lucky += 1

print(f"Studies with at least one 'significant' result: {lucky / STUDIES:.1%}")
print(f"Exact value: {1 - (1 - FALSE_ALARM) ** MEASURES:.1%}")
```

Output:

```text
Studies with at least one 'significant' result: 63.3%
Exact value: 64.2%
```

The simulated 63.3% is close to the exact 64.2%; the small gap is the randomness of the simulation itself. Try changing MEASURES to 5 or 50 and see how quickly false discoveries become likely.

### What p-hacking looks like

**P-hacking** is the name for trying analyses until one crosses the significance threshold, then reporting that one as if it were the plan. It takes many forms, and most feel reasonable at the time:

- **Many outcomes, one reported.** Measuring lots of things and presenting the one that worked.
- **Many analyses, one reported.** Trying the average with and without outliers, with different filters, or over different time windows, and keeping the version that looks best.
- **Optional stopping.** Checking the result after every few trials and stopping as soon as it looks good. Because random results wander up and down, if you keep checking, you will often catch a lucky moment.
- **Slicing into subgroups.** "It didn't work overall, but it worked on blue cloth on Tuesdays." With enough slices, some will look impressive by chance.
- **Adjusting exclusions.** Deciding which trials count as "faulty" after seeing whether they help or hurt.
- **Shifting the threshold for success** after the results are in.

### The garden of forking paths

You do not need to deliberately try twenty analyses for this problem to appear. Statisticians Andrew Gelman and Eric Loken popularised a phrase for a subtler version: the **garden of forking paths**.

Every analysis involves choices: which trials to include, how to define success, whether to split results by material, how to handle a sensor glitch. If you make those choices *after* looking at the data, each one is a fork in the path, and the path you take is quietly steered by what the data happened to show. You may run only one analysis, but it is one chosen from many you *would* have run had the data looked different. The result is the same as p-hacking: an analysis shaped to fit the luck in this particular data set.

### Cherry-picking

**Cherry-picking** is choosing which *examples* to show, rather than which analysis to run. Common forms:

- The demo video that shows the best of 50 attempts without saying so.
- The "typical result" graph that is actually the cleanest run.
- A time window chosen because the effect looks strongest there.
- Quoting only the sources that agree with you.

Showing a striking example is fine. Presenting a chosen example as typical is not. Say "best of 50 attempts" or "a representative run, chosen at random", and mean it.

> **Exploring is fine; disguising exploration is not.** Looking at data from many angles is how new ideas are found. The problem is presenting the result of a search as if it were a planned test. Label exploratory findings clearly, report how many things you looked at, and treat them as ideas to test next time rather than as conclusions.

### Defences that work

1. **Decide in advance.** Write down your primary measure, analysis, number of trials, exclusion rules and success threshold before collecting data, and date it. This is pre-registration, covered in the experimental design module. It closes most forking paths before you reach them.
2. **Fix the number of trials.** Decide when you will stop before you start, and stick to it.
3. **Report everything you tried.** "We measured 12 outcomes; one showed a clear difference" tells the reader exactly how much weight to give that one.
4. **Correct for many tests.** A simple method is the **Bonferroni correction**: divide the threshold by the number of tests. With 20 tests, use 0.05 ÷ 20 = 0.0025 for each. It is cautious, but easy to apply and easy to explain.
5. **Separate exploring from confirming.** Use one set of trials to look for patterns and a fresh set to test the most promising one.
6. **Replicate.** A real effect shows up again in new data. A lucky one usually does not.
7. **Show all the runs.** Plots with every trial as a dot, and demo videos with honest captions, make cherry-picking visible.

### Worked scenario

This scenario and its numbers are **made-up for illustration**.

Priya compares a new path planner for a small simulated cleaning robot with the existing planner. She planned to compare *area cleaned in 10 minutes* and found no clear difference. Curious, she then checked nine other measures: battery used, number of collisions, time spent on carpet, and so on. One of them, battery used on carpet, came out "significant".

An honest report states the planned result first: no clear difference in area cleaned. It then says that ten measures were examined in total, that one (battery use on carpet) showed a difference, and that with ten measures, one false alarm is not surprising. It describes this as an exploratory observation and proposes a new, pre-registered test of carpet battery use. What Priya should not do is write "the new planner saves battery on carpet" as if that had been the question all along.

### Recap

- With no real effect, about 1 in 20 tests will look significant at the 0.05 threshold by chance.
- Running many tests and keeping the best makes false discoveries likely: 20 tests give about a 64% chance of at least one.
- P-hacking includes many outcomes, many analyses, optional stopping, subgroup slicing and post-hoc exclusions.
- The garden of forking paths: choices made after seeing data shape the analysis to fit luck, even without deliberate searching.
- Cherry-picking presents chosen examples as typical.
- Defences: decide in advance, fix the number of trials, report everything, correct for many tests, separate exploring from confirming, and replicate.

#### Check your understanding

1. What does a p-value below 0.05 mean?
   A) There is a 95% chance the hypothesis is true
   B) The effect is large and important
   C) A difference at least this large would happen less than 5% of the time by luck alone if there were no real effect
   D) The experiment cannot have any errors

2. A researcher checks the result after every trial and stops as soon as it looks significant. What is this called?
   A) Pre-registration
   B) Optional stopping, a form of p-hacking
   C) Replication
   D) A Bonferroni correction

3. Using a Bonferroni correction with a 0.05 threshold and 10 tests, what threshold should each test use?
   A) 0.05
   B) 0.5
   C) 0.01
   D) 0.005

4. What is the "garden of forking paths"?
   A) Analysis choices made after seeing the data, which quietly shape the analysis to fit chance patterns even if only one analysis is run
   B) A type of robot path planning algorithm
   C) Running every analysis you can think of and reporting all of them
   D) Deciding the analysis before collecting data

5. A team shows the best of 50 attempts in their demo video. What is the honest way to present it?
   A) Present it as a typical result
   B) Do not show any video
   C) Label it clearly, for example "best of 50 attempts", and report the overall success rate
   D) Show it but remove the other 49 attempts from the data

**Go further:**

- Data dredging — Wikipedia: https://en.wikipedia.org/wiki/Data_dredging — An overview of p-hacking and data dredging, with examples of how false patterns are found.
- Multiple comparisons problem — Wikipedia: https://en.wikipedia.org/wiki/Multiple_comparisons_problem — Why running many tests raises the chance of false positives, and the corrections statisticians use.


## 5.4 Using AI tools responsibly in research and engineering

*What AI chatbots and coding assistants are good at, how they fail, and five practical rules: verify every output, disclose your use, follow your school's rules, protect private data, and keep doing your own thinking.* (about 30 min)

### A powerful tool that can be confidently wrong

AI tools such as chatbots, coding assistants and image generators are now part of how many people study, write and build things. Used well, they can explain an idea in a new way, help you find a bug or suggest approaches you had not considered. Used carelessly, they can fill your project with errors that look completely convincing.

The lesson on credit and collaboration said that if a tool did a meaningful part of your work, you should say so, and that **you remain responsible for everything you submit**. This lesson turns that principle into practical habits. It is not about whether AI tools are good or bad. It is about using them in a way that keeps your work trustworthy and keeps you learning.

### What these tools are good at

Tools built on large language models generate text (or code) that is likely to follow from what you typed, based on patterns learned from very large amounts of existing text. That makes them genuinely useful for:

- **Explaining** a concept in different words, or at a different level, until it clicks.
- **Brainstorming** possible causes of a problem, or ideas for an experiment.
- **Drafting** code for a common task, which you then read, test and understand.
- **Suggesting** what might be wrong with code that does not work.
- **Checking** your writing for unclear sentences, spelling and grammar.

### How they fail

Producing likely-sounding text is not the same as checking facts. Common failures include:

- **Confident errors.** Wrong answers are often written in the same calm, fluent style as right ones. Fluency is not evidence.
- **Invented references.** A tool may produce a citation, with authors, a title and a year, for a paper that does not exist.
- **Arithmetic and unit mistakes**, especially in multi-step calculations.
- **Code that runs but is subtly wrong**, for example handling an edge case badly, using the wrong formula, or mixing up units.
- **Out-of-date information**, such as a function that has since changed, or a part that is no longer made.
- **Inconsistency.** Asking the same question twice can give different answers.
- **Bias** inherited from the text the tool learned from.

None of this makes the tools useless. It means their output is a **draft to be checked**, never a source to be trusted on its own.

### Rule 1: verify everything you keep

Match the check to the kind of output:

- **Code:** read every line until you understand it. Run it. Test it on cases where you already know the right answer, including awkward ones such as an empty list or a negative number.
- **Facts and explanations:** confirm them in a reliable source: a textbook, official documentation, or a teacher.
- **References:** find each one yourself and read at least the relevant part. If you cannot find it, it does not go in your work.
- **Calculations:** redo them yourself, by hand or in your own code, and check the units.

There is one firm line. **Never use an AI tool to produce data, measurements or results** for an experiment you did not run, or to "fill in" missing values. That is fabrication, exactly as if you had typed the numbers in yourself. The same applies to images: a generated picture must never be presented as a photograph or a real result.

### Rule 2: disclose how you used it

Tell readers which tools you used, what for, and how you checked the output. It costs a sentence or two. For example:

> "I used an AI chatbot to explain the difference between sample and population standard deviation, and an AI coding assistant to draft the plotting function in analysis.py. I tested the function against values calculated by hand. All data, results and conclusions are my own."

Be specific. "I used AI" says too little; readers need to know which parts it touched.

### Rule 3: follow the rules where you are

Rules about AI tools differ between schools, teachers, competitions, science fairs and journals, and they change over time. Something allowed in one class may be treated as cheating in another. Before you start:

- Check your school's or competition's policy. If none exists or it is unclear, ask your teacher or organiser, and keep a note of their answer.
- Check the tool's own terms. Many AI services set a minimum age, and some require a parent's or guardian's permission for younger users.
- When rules are strict, follow them even if a friend's school is more relaxed.

> **Before you paste, pause.** Text you type into an online AI tool is sent to the company that runs it, and depending on the service and its settings, may be stored or used to improve the tool. Before pasting anything, ask: would I be comfortable if this were seen by people outside my project? If not, do not paste it.

### Rule 4: protect private data

Never paste these into an AI tool:

- **Personal information** about yourself or anyone else: names, addresses, photos of people, school records.
- **Data from people in your study**, such as survey answers, even if they seem harmless. Participants agreed to take part in your project, not to have their answers sent to a company.
- **Passwords, access keys and tokens**, including keys found in your own code. Remove them before asking for help with a program.
- **Other people's unpublished work**, including a teammate's code or a partner organisation's data, unless they have agreed.

If you need help with data, make a small made-up example with the same shape (the same columns and kinds of values) and use that instead.

### Rule 5: keep doing your own thinking

If a tool does the thinking, you do not learn, and you cannot defend or fix your work later. A good test: **could you explain every part of what you submit, without the tool, to someone who asks?** If not, you are not finished.

Ways to use AI tools that build your understanding rather than replace it:

- Ask for an explanation, then close the chat and try the problem yourself.
- Ask for hints, not answers.
- Write your own attempt first, then ask the tool to critique it.
- When it suggests code, retype it and annotate each line in your own words.

### Worked scenario

Sam is analysing paper-bridge test results for a science-fair project. His school allows AI tools as long as their use is disclosed.

He asks a chatbot to write a Python function that calculates the mean and spread of his results. The code runs, but Sam tests it on five numbers he has already worked out by hand and finds the spread is slightly too small. The function divided by n instead of n − 1, giving the population standard deviation rather than the sample standard deviation he needs. He fixes it and adds a test.

He also asks for "three papers about paper bridge strength". One title looks perfect, but when he searches for it he cannot find it anywhere. He leaves it out and finds a real source through his library instead.

His final report includes a short disclosure statement. He never pasted his classmates' names, which appeared in his notebook as helpers, into the tool. At the fair, a judge asks him to explain how the spread is calculated. Because he checked and fixed the code himself, he can.

### Recap

- AI tools are useful for explaining, brainstorming, drafting and checking, but can be confidently wrong and can invent references.
- Verify every output you keep: test code, check facts and calculations, find every reference.
- Never use AI to generate data or results, or present generated images as real.
- Disclose which tools you used, for what, and how you checked.
- Follow your school's, competition's and the tool's own rules; ask when unsure.
- Never paste personal data, participants' data, passwords or others' work.
- You must be able to explain everything you submit.

#### Check your understanding

1. An AI tool gives you a citation that looks perfect, but you cannot find the paper anywhere. What should you do?
   A) Include it anyway, since the tool is usually right
   B) Leave it out; a reference you cannot find and read does not belong in your work
   C) Change the year and include it
   D) Ask the tool if it is sure, and include it if it says yes

2. You ran 8 of 10 planned trials. Which use of an AI tool would be fabrication?
   A) Asking it to explain how to calculate an average
   B) Asking it to check your report's spelling
   C) Asking it to suggest how to present a graph
   D) Asking it to generate plausible values for the 2 missing trials

3. Which of these is safe to paste into an online AI tool when asking for help?
   A) A small made-up example with the same columns as your real data
   B) Your survey participants' names and answers
   C) Your code including its access key
   D) A teammate's unpublished code, without asking them

4. Your friend's school allows AI tools for projects, but your teacher has said not to use them for this one. What should you do?
   A) Use them, since another school allows it
   B) Use them but do not mention it
   C) Follow your teacher's rule for this project, and ask if anything is unclear
   D) Use them only for the conclusion


## 5.5 Safety and ethics in robotics research

*Robots move with force in the real world, so mistakes are physical. Learn robot-specific hazards, how to carry out a simple risk assessment using the hierarchy of controls, and the wider ethical questions robotics raises.* (about 35 min)

### Mistakes you can feel

In most software, a bug produces a wrong number or a crash. In a robot, a bug can produce **motion**: an arm swinging the wrong way, a gripper squeezing too hard, a wheeled robot driving off a table. Robots apply force to the real world, so their mistakes can hurt people, break equipment or damage the very objects they are meant to handle.

The lesson on credit, collaboration and responsibility introduced the basics: hands-on work needs adult supervision, people in your study must give informed consent, and you should think about how your work might be used. This lesson goes further. It shows how to think about robot safety **systematically**, before anything is switched on, and looks at ethical questions that go beyond physical safety.

### Hazards that are particular to robots

- **Unexpected motion.** Robots can move when you do not expect them to: when power is first applied, when a program starts, after a software bug, or when an emergency stop is released and the robot resumes where it left off.
- **Pinch and crush points.** Anywhere two parts close together, such as gripper fingers, joints folding or a link passing near a fixed frame, can trap fingers.
- **Impact.** A fast-moving arm carries energy, even if it is small.
- **Stored energy.** Springs, raised loads that can fall under gravity, and charged batteries all hold energy that can be released suddenly, sometimes after the power is switched off.
- **Electrical and heat hazards.** Damaged or short-circuited batteries can overheat or catch fire. Motors and their drivers get warm. Activities in this academy stay low-voltage, and mains electricity is never part of them.
- **Entanglement.** Loose hair, sleeves, jewellery and cables can be caught by rotating parts.
- **Control errors.** A sign error in a feedback loop can make a controller push the wrong way harder and harder, driving a joint to its limit at full speed. Ask anyone who has tuned a controller.

### Thinking it through: a simple risk assessment

A **risk assessment** is a structured way of asking "what could go wrong, and what will we do about it?" before starting. A simple version has five steps:

1. **List the hazards.** Go through the robot and the activity, using the list above as prompts.
2. **Decide who could be harmed, and how.** The operator, bystanders, someone walking past.
3. **Estimate the risk.** Consider how *likely* harm is and how *severe* it would be. A simple approach scores each from 1 (low) to 3 (high) and multiplies them, so the most serious risks (likely and severe) stand out. This is one common approach, not the only one.
4. **Choose controls** to reduce each significant risk, using the hierarchy below.
5. **Record it and review it** whenever the robot or the activity changes.

### The hierarchy of controls

Safety professionals rank ways of reducing risk from most to least effective:

1. **Elimination:** remove the hazard entirely. Can the test be done in simulation instead?
2. **Substitution:** replace it with something less hazardous. A smaller, slower, lighter robot; a low-voltage supply; a foam test object instead of a glass one.
3. **Engineering controls:** physical or built-in protection. Guards and barriers, speed and force limits set in the controller, mechanical end stops, and an **emergency stop** that cuts power to the actuators directly rather than relying on software.
4. **Administrative controls:** rules and procedures. A marked keep-clear zone, a checklist before powering up, only one person operating at a time, saying "arm live" before power is applied.
5. **Personal protective equipment (PPE):** safety glasses, tied-back hair, no loose sleeves.

Start at the top. PPE is important, but it is the last line of defence because it relies on people using it correctly every time.

### Collaborative robots

Industrial robots traditionally work behind fences, because they are fast and strong. **Collaborative robots** ("cobots") are designed to work near people, typically by limiting their speed and force and stopping when they detect unexpected contact. International standards cover this: ISO 10218 addresses the safety of industrial robots, and ISO/TS 15066 gives guidance specifically for collaborative operation. An important point from that world applies to student projects too: a robot being "collaborative" does not make an application safe on its own. A safe cobot holding a sharp tool is not a safe system. **Safety belongs to the whole application**, including the task, the tool and the people around it.

### Safe testing habits

- Test new code in **simulation** first whenever possible.
- On first runs, use **low speed and low force limits**, with hands and faces well clear.
- Change **one thing at a time**, so that if something goes wrong, you know what caused it.
- Make sure the robot's **safe state**, the thing it does when anything fails, really is safe: for example, stopping and holding still rather than going limp and dropping a load.
- **Log near misses**, as the earlier lesson suggested. A near miss is a free lesson about an accident that did not happen.

> **Paper and simulation first.** Everything in this lesson can be done on paper. If you go on to build or test a real robot, do it only with adult supervision, in a suitable space, with low-voltage power, an emergency stop within reach, appropriate protective equipment such as safety glasses, and following the manufacturer's instructions for every component.

### Ethics beyond physical safety

Safety asks "could this hurt someone right now?" Ethics asks wider questions about how robotics research affects people and society. Some that arise even in student projects:

- **Privacy.** Robots often carry cameras and microphones. Recording people who have not agreed to it, or keeping recordings longer than needed, is a real harm. Point cameras at the workspace, not at people, and delete what you do not need.
- **Honesty about capability.** Overclaiming what a robot can do is not only a reporting problem. People tend to trust automated systems more than they should (sometimes called **automation bias**), so exaggerated claims can lead someone to rely on a robot in a situation it cannot handle.
- **Accountability.** When an autonomous system causes harm, "the robot did it" is not an answer. The people who designed, tested and deployed it are responsible. Keeping records of tests and decisions is part of accepting that responsibility.
- **Misuse and dual use.** Technology built for one purpose can be used for another. A tracking system for a delivery robot could also be used to follow people. Ask who might use your work and for what.
- **Fairness and access.** Who benefits from a robot, and who is left out? A system tested only on certain people, objects or environments may work worse for others.
- **Wider effects.** Robots change work, use energy and resources, and become electronic waste. These questions do not have simple answers, but responsible engineers ask them.

### Worked example: assessing a proposed platform

Tactiverge's TV-01 project is a **proposed** two-arm platform: two small arms built from servos, facing each other, with a camera overhead and force sensors at the grippers. Nothing has been built or tested, and the following is an illustrative risk assessment of the kind such a project would need, not a record of one.

- **Pinch points** between gripper fingers, and between the two arms where their workspaces overlap. Controls: force limits on the grippers; software limits keeping the arms from colliding; keep hands out of the shared workspace while powered.
- **Unexpected motion** at power-up or after an emergency stop. Controls: arms start in a known resting position; motion only starts after a deliberate command; the emergency stop cuts servo power directly.
- **Battery or power-supply faults.** Controls: low-voltage supply with appropriate protection; no damaged batteries; never left charging unattended.
- **Camera privacy.** Controls: the camera points down at the workspace only; recordings are kept only as needed for analysis.
- **Overclaiming.** Controls: any report says clearly which tasks and materials were tested and that results do not generalise beyond them, as the proposal's own stated limitations already do.

### Recap

- Robot mistakes are physical: think about safety before anything moves.
- Robot hazards include unexpected motion, pinch points, impact, stored energy, electrical faults, entanglement and control errors.
- A risk assessment lists hazards, who could be harmed, likelihood and severity, and controls, and is reviewed when things change.
- Use the hierarchy of controls: elimination, substitution, engineering controls, administrative controls, then PPE.
- Safety belongs to the whole application, not just the robot.
- Ethics covers privacy, honesty, accountability, misuse, fairness and wider effects.

#### Project: Paper project: a risk assessment

Choose a small robot you might build one day, or a robot from a video or a kit description. For example: a desktop robot arm with a gripper, or a small wheeled robot that drives around a classroom floor.

On paper, carry out a five-step risk assessment:

1. List at least six hazards, using the categories in this lesson.
2. For each, note who could be harmed and how.
3. Score likelihood and severity from 1 to 3 and multiply them.
4. For the three highest scores, choose controls from as high up the hierarchy of controls as you can, and explain your choice.
5. Write two ethical questions your robot raises (for example, about a camera it carries) and how you would address them.

This is a paper-only activity. Do not build or power anything for this project.

**Deliverables**

- A list of at least six hazards with who could be harmed
- Likelihood, severity and risk scores for each hazard
- Controls for the three highest risks, labelled by level in the hierarchy
- Two ethical questions and your proposed responses

**Safety (adult supervision required):** This project is paper-only and must not involve building or powering a robot. If you later build any robot with motors, servos or batteries, do so only with adult supervision, low-voltage power, an accessible emergency stop and appropriate protective equipment such as safety glasses.

#### Check your understanding

1. Which control is highest (most effective) in the hierarchy of controls?
   A) Wearing safety glasses
   B) A sign saying "keep clear"
   C) A guard around the robot
   D) Doing the test in simulation so the hazard is removed

2. Why should an emergency stop cut power to the actuators directly rather than only sending a software command?
   A) Because the emergency may be caused by a software fault, so a software-only stop might not work
   B) Because software commands are always slower
   C) Because it is cheaper
   D) Because it makes the robot restart faster

3. A collaborative robot designed to limit force is used to hold a sharp blade near people. What is the key safety point?
   A) The application is safe because the robot is collaborative
   B) Collaborative robots never need risk assessments
   C) Safety belongs to the whole application, including the tool and task, so a risk assessment is still needed
   D) Only the blade manufacturer is responsible

4. A team's robot camera records everyone who walks past the lab. Which ethical issue does this raise most directly?
   A) Dual use
   B) Privacy
   C) Stored energy
   D) Automation bias

5. Why can exaggerating what a robot can do be a safety problem, not just a reporting problem?
   A) People tend to over-trust automated systems, so they may rely on the robot where it cannot cope
   B) Exaggeration makes robots move faster
   C) It is only a reporting problem
   D) Because it uses more battery

**Go further:**

- Hierarchy of hazard controls — Wikipedia: https://en.wikipedia.org/wiki/Hierarchy_of_hazard_controls — A fuller explanation of each level of the hierarchy, with examples from many industries.
- Cobot — Wikipedia: https://en.wikipedia.org/wiki/Cobot — An overview of collaborative robots, including the safety standards that apply to them.


## 5.6 Open science and licensing (code, hardware, data)

*Why sharing methods, code, designs and data makes research stronger, why public is not the same as open, and a general summary of common licences: MIT, Apache-2.0, GPL, Creative Commons and CERN-OHL.* (about 35 min)

### Sharing so others can check and build

Earlier lessons kept returning to one idea: research is trustworthy when other people can check it. **Open science** takes that seriously by sharing not just conclusions but the materials behind them: methods, code, hardware designs, raw data and, where possible, the papers themselves, freely available to read.

Sharing these things has practical benefits:

- **Checking.** Others can rerun your analysis and find mistakes, including ones you would want to know about.
- **Repeating.** Someone with your design files and protocol can rebuild your experiment and see whether the result holds.
- **Building.** Others can start from your work instead of from scratch.
- **Access.** Students and researchers without large budgets can take part.

The proposed TV-01 project, for example, states an intention to release its hardware designs, firmware, evaluation protocol and raw logs under open licences, so that its experiments can be repeated and challenged. That is a stated plan for a project that has not yet produced results.

But sharing raises a practical question: what are other people actually *allowed* to do with what you share? That is what licences are for.

> **This is not legal advice.** This lesson gives a general, simplified summary of how common licences work, to help you understand the ideas. It is not legal advice. Copyright law differs between countries, and the exact terms of each licence are in its full text. For anything important, such as a commercial product or a dispute, read the full licence and ask someone qualified.

### Public is not the same as open

In most countries, when you write code, text or a design file, you automatically own the **copyright** in it. You do not need to register anything. Copyright means that, by default, other people do not have permission to copy, modify or share your work.

So a project posted publicly online with **no licence** is visible, but others have no clear permission to reuse it. Many people do not realise this. "I found it on the internet" is not permission, as the credit lesson noted.

A **licence** is the creator's statement granting permissions to everyone, usually with some conditions. Choosing a licence is how you turn "public" into "open".

### Licences for software

Software licences are often grouped into two families.

### Permissive licences

Permissive licences let people do almost anything with the code, including using it in closed, commercial products, as long as they meet a few simple conditions.

- **MIT License.** Very short and widely used. Anyone may use, copy, modify, merge, publish, distribute, sublicense and sell the software. The main condition is that the copyright notice and the licence text must be included in all copies or substantial portions of the software. The software comes with no warranty.
- **Apache License 2.0 (Apache-2.0).** Also permissive, but longer and more detailed. Its conditions include keeping copyright and licence notices, including a copy of the licence, and stating significant changes you made to files. It also includes an **explicit patent licence** from contributors, which protects users from being sued by those contributors over patents covering their contributions. That patent licence ends for anyone who sues claiming the software infringes their patent.

### Copyleft licences

**Copyleft** licences also allow use, modification and sharing, but add a key condition: if you distribute the software or a modified version of it, you must make the source code available **under the same licence**. The aim is that improvements stay open.

- **GNU General Public License (GPL).** The best-known copyleft licence, with versions 2 and 3 in wide use. If you distribute a program that includes GPL code, you generally have to release the source of the whole program under the GPL. If you modify GPL code only for your own private use and never distribute it, the sharing requirement does not apply.

### Licences have to fit together

When you combine code under different licences, their conditions must be compatible. For example, the Free Software Foundation considers Apache-2.0 compatible with GPL version 3, but not with GPL version 2. Before mixing code from different sources, check each licence, and choose a licence for your own project that respects them all.

### Licences for writing, images and data

**Creative Commons** licences are designed for creative works and other content: text, images, videos, documentation and often data.

- **CC BY 4.0** (Attribution) lets anyone share and adapt the work, including commercially, as long as they give appropriate credit, provide a link to the licence and indicate whether they made changes.
- Other variants add conditions: **SA** (ShareAlike) requires adaptations to use the same licence, a copyleft idea; **NC** (NonCommercial) forbids commercial use; **ND** (NoDerivatives) forbids sharing modified versions.
- **CC0** is not a licence with conditions but a way of giving up your rights as far as the law allows, placing the work as close to the public domain as possible. It is popular for data sets because it removes doubt about reuse.

Creative Commons itself recommends **against** using its licences (other than CC0) for software, because they were not written with software in mind. Use a software licence for code and a Creative Commons licence for documentation and media.

For **data**, the legal picture varies: in many places plain facts cannot be copyrighted, but collections of data may have some protection, and the rules differ between countries. Putting a clear licence such as CC0 or CC BY on a data set removes the uncertainty for people who want to reuse it.

### Licences for hardware

Hardware is trickier, because a physical object is not the same as the files that describe it. Open hardware licences mainly work through rights in the **design files and documentation**: schematics, circuit board layouts, CAD models and assembly instructions.

The **CERN Open Hardware Licence (CERN-OHL)**, created at CERN, is widely used for this. Version 2, released in 2020, comes in three variants:

- **CERN-OHL-P:** permissive, similar in spirit to MIT or Apache-2.0.
- **CERN-OHL-W:** weakly reciprocal: changes to the licensed design must be shared, but it can be combined with other designs that are not.
- **CERN-OHL-S:** strongly reciprocal: designs that incorporate it must be shared under the same licence, similar in spirit to the GPL.

Some open hardware projects instead use a Creative Commons licence such as CC BY-SA for their design files and documentation. Note that licences do not cover everything: an invention's working principle may be covered by a patent, or by no protection at all, and that is separate from the licence on your files.

### Choosing licences for your own project

Ask yourself:

1. **Do I want others to be able to use my work in closed or commercial products?** If yes, a permissive licence (MIT, Apache-2.0, CERN-OHL-P, CC BY) fits. If you want improvements to stay open, consider a copyleft or reciprocal licence (GPL, CERN-OHL-S or -W, CC BY-SA).
2. **What does my project contain?** Code, documentation, hardware designs and data may each need a different licence. It is normal for one project to use several, for example MIT for firmware, CERN-OHL for the circuit board and CC BY for the documentation.
3. **What licences apply to things I reused?** Your choice must be compatible with them, and you must keep their notices.

Then make it obvious:

- Put the licence text in a file named LICENSE at the top of your project.
- Say in the README which licence covers which parts.
- Keep the copyright and licence notices of anything you reused.
- If you are under 18 or working through a school, check with a teacher or parent before publishing, as the school may have its own rules.

### Sharing data well

Releasing data is only useful if others can understand it. A widely used set of guidelines, the **FAIR principles**, says shared data should be **Findable**, **Accessible**, **Interoperable** (in formats other tools can read) and **Reusable** (with enough documentation and a clear licence). In practice, for a student project:

- Use plain, common formats such as CSV.
- Include a short README: what each column means, its units, how and when the data was collected, and anything unusual.
- Share the raw data, not only the cleaned version, and explain how one became the other.
- **Remove personal information** before sharing anything.

### When not to share everything

Open is a good default, not an absolute rule. Do not share personal data about participants, information that could seriously help someone cause harm, or material that belongs to someone else without their permission. Explaining clearly what you have shared, what you have not, and why, is itself part of open science.

### Recap

- Open science shares methods, code, designs and data so others can check, repeat and build on work.
- Copyright applies automatically; public work with no licence is not open.
- Permissive licences (MIT, Apache-2.0) allow almost any use with notices kept; Apache-2.0 adds an explicit patent licence.
- Copyleft licences (GPL) require distributed modified versions to share their source under the same licence.
- Creative Commons licences are for content and data, not software; CC BY requires credit, a licence link and noting changes.
- CERN-OHL version 2 covers hardware designs in permissive (P), weakly reciprocal (W) and strongly reciprocal (S) variants.
- Licence each part of a project clearly, respect the licences of what you reuse, and share data with documentation. This summary is not legal advice.

#### Project: Paper project: license a project

Imagine you are about to publish a small robotics project online. It contains:

- Python code you wrote, plus one function adapted from an MIT-licensed project;
- a circuit diagram and a CAD model of a bracket;
- a written guide with photos you took;
- a CSV file of your test results.

On paper:

1. Choose a licence for each part, and explain your choice in one or two sentences.
2. Write what you must do to respect the MIT licence of the adapted function.
3. Draft the "Licence" section of the project's README.
4. Draft a short README for the CSV file: columns, units, how the data was collected, and its licence.

You do not need to publish anything. Remember that this exercise is for learning and is not legal advice.

**Deliverables**

- A chosen licence for each of the four parts, with reasons
- The steps needed to respect the MIT-licensed function
- A draft Licence section for the README
- A draft data README describing columns, units and collection method

#### Check your understanding

1. A project's code is posted publicly online with no licence. What can others safely assume?
   A) They have no clear permission to copy, modify or share it, because copyright applies by default
   B) It is in the public domain
   C) It is under the MIT License
   D) They may use it freely as long as they credit the author

2. What is the main condition of the MIT License?
   A) The software may not be sold
   B) All modified versions must be released as source code
   C) The copyright notice and licence text must be included in all copies or substantial portions
   D) Only non-commercial use is allowed

3. You modify a GPL-licensed program and distribute it to others. What does the GPL generally require?
   A) Nothing, as long as you credit the author
   B) That you make the source code available under the GPL
   C) That you pay the original authors
   D) That you switch to the MIT License

4. Which is the best choice for licensing a project's software code?
   A) CC BY-NC, because it is the most popular Creative Commons licence
   B) No licence, so that people ask permission
   C) CC BY-ND, so that the code cannot be changed
   D) A software licence such as MIT, Apache-2.0 or GPL, since Creative Commons recommends against its licences for software

5. Which CERN-OHL version 2 variant is strongly reciprocal, similar in spirit to the GPL?
   A) CERN-OHL-P
   B) CERN-OHL-W
   C) CERN-OHL-S
   D) CERN-OHL-C

**Go further:**

- Choose a License: licences overview: https://choosealicense.com/licenses/ — A plain-language comparison of common software licences, showing their permissions, conditions and limitations.
- Creative Commons Attribution 4.0 (CC BY 4.0) deed: https://creativecommons.org/licenses/by/4.0/ — The official human-readable summary of CC BY 4.0, with a link to the full legal text.
- CERN Open Hardware Licence — Wikipedia: https://en.wikipedia.org/wiki/CERN_Open_Hardware_Licence — Background on the CERN-OHL and its three version 2 variants.
- Various licenses and comments about them — GNU Project: https://www.gnu.org/licenses/license-list.html — The Free Software Foundation's notes on many licences, including which are compatible with the GPL.
- FAIR data — Wikipedia: https://en.wikipedia.org/wiki/FAIR_data — An overview of the Findable, Accessible, Interoperable and Reusable principles for sharing data.
