Projects, Operation, and Teaching¶
Summary¶
This chapter brings the book together. You will plan capstone projects such as a desk assistant or a color-sorting arm, follow startup and shutdown procedures, maintain the hardware, and plan classroom and makerspace use. After this chapter, you will be able to complete, document, and operate an agent-controlled arm project.
Concepts Covered¶
This chapter covers the following 23 concepts from the learning graph:
| Concept | Concept Impact Score |
|---|---|
| Monitoring | 4 |
| Classroom Use | 4 |
| Desk Assistant Project | 3 |
| Chat-Controlled Arm | 3 |
| Maintenance Schedule | 3 |
| Capstone Project | 2 |
| Color Sorting Project | 1 |
| Data Collection Station | 1 |
| Project Documentation | 1 |
| Startup Procedure | 1 |
| Shutdown Procedure | 1 |
| Servo Replacement | 1 |
| Wear and Lubrication | 1 |
| Script vs Policy vs Agent | 1 |
| Makerspace Use | 1 |
| Lab Schedule | 1 |
| Assessment Rubric | 1 |
| Group Parts Ordering | 1 |
| Bimanual Setup | 1 |
| Mobile Manipulation | 1 |
| Larger Arms | 1 |
| Open-Source Contribution | 1 |
| Responsible Robotics | 1 |
Prerequisites¶
This chapter builds on concepts from:
- Chapter 1: Setting Up Python for Robotics
- Chapter 2: Anatomy of a Robot Arm
- Chapter 3: Electricity, Power, and Safety Basics
- Chapter 5: Actuators and Sensors
- Chapter 6: Sourcing Parts and Planning a Budget
- Chapter 8: Building and Calibrating the SO-ARM100
- Chapter 9: Building the reBot-DevArm and Choosing a Platform
- Chapter 11: Moving the Arm: Trajectories, Grippers, and Teleoperation
- Chapter 13: Logging, Testing, Simulation, and ROS 2
- Chapter 14: Cameras, Perception, and Learning from Demonstration
- Chapter 15: AI Agents, Tools, and OpenClaw Skills
- Chapter 16: Agent Planning, Vision, and Interfaces
- Chapter 17: Safety Layers and Evaluation for Agent-Controlled Arms
We Made It to the Last Hands-On Chapter!
You have wired me, built me, taught me to move, to see and to take advice from an agent, and walled me in with safety layers. Now let's put all of it to work on one real project, and learn how to keep me running and how to share me with a class. Let's move it!
The chapters so far each taught one skill. A project needs all of them at once, and it needs three more things that are not in any single chapter: a way of choosing a goal small enough to finish, a routine for running the arm every day without surprises, and the habits of a team that shares equipment. Those are the subjects here.
The chapter has four parts. The first is about choosing: what a capstone project is, which kind of program fits which job, and four projects to pick from. The second is about operating: starting up, shutting down, watching the arm while it works, and looking after it as it wears. The third is about teaching: how a class, a makerspace or a club can share arms, order parts and grade work. The fourth looks outward: more arms, bigger arms, contributing back to the open-source projects that made this possible, and the questions that a person who builds robots should ask. The lab builds a color-sorting capstone on the fake arm, with every procedure of the chapter as running, tested code.
Choosing a Project¶
The Capstone Project¶
A capstone project is a project that you finish end to end, using what you have learned, and that someone else can run without you. It is different from an exercise in three ways. It has a goal that you chose, a way to tell whether it worked, and a record of how to run it. The most common way for a capstone to fail is that the goal is too big, so the useful skill is scoping: cutting a project down until it fits the time that you have. A good capstone fits on a card with five lines.
| Line | Question | Example for the lab project |
|---|---|---|
| Task | What does the arm do, in one sentence? | Put each red, green or blue block in the bin of its color. |
| Success test | What number says it worked? | All blocks in the right bins in 10 of 10 runs. |
| Safety story | Which layers hold if the program is wrong? | Safety layer, workspace limits, E-stop in reach, monitor. |
| Budget | What does it cost, and what is spare? | The parts list of Chapter 6, plus a spare servo. |
| Done when | What do you hand over? | Working code, tests, a one-page PROJECT.md, and a demonstration. |
Cut a project by removing a dimension, one at a time: one arm instead of two, three colors instead of ten, flat blocks on a taped square instead of a messy table, a fake arm first and the real arm second. A project that works in a small form can grow. A big one that almost works cannot be handed in.
Script vs Policy vs Agent¶
Chapters 11, 14 and 15 gave you three different ways of deciding what the arm does next, and script vs policy vs agent is the choice among them. Choosing well saves weeks. The test is simple: use the simplest kind that does the job.
| Script | Learned policy | Agent | |
|---|---|---|---|
| Who decides each move? | Code that a person wrote | A model trained on demonstrations | A language model choosing tools |
| Where did the knowledge come from? | The programmer | Recorded demonstrations (Chapter 14) | The model's training, and the tool descriptions (Chapter 15) |
| Handles a task nobody planned? | No | Only if it looks like the demonstrations | Often, if the tools allow it |
| Predictable? | Completely | Mostly | Least, so it needs the safety layers of Chapter 17 |
| Good for | Fixed jobs, tests, demos | Skills that are hard to write down, like folding cloth | Requests in plain language, and plans that change |
A script is not a poor choice. If the blocks are always in the same place, a script is shorter, faster and easier to test than anything else. The trouble is change. The lab shows it with numbers: a script that has the blocks' positions written into it grasps all three blocks when they are where it expects them, and misses all three by 14 to 22 millimeters when a student nudges them by hand. A program that looks with a camera, finds the blocks by hue, and converts pixels to table coordinates with the markers of Chapter 14 is still a script in the sense that code decides every step, and it copes, with an error of under half a millimeter. A learned policy would be the choice if the task could not be written down, and an agent the choice if a person is to talk to the arm. Most good projects use a script for the motions, vision for the facts, and an agent only at the top, for the words.
Add a Smarter Part Only When the Simpler One Fails
A script that works beats a policy that mostly works, and a policy that works beats an agent that sometimes surprises you. Move up a step only when you can name the thing the simpler step cannot do, and when you do, bring the safety layers with you.
Diagram: Script Policy Agent Sorter¶
Run the Script Policy Agent Sorter MicroSim fullscreen
Script Policy Agent Sorter
Type: microsim
sim-id: script-policy-agent-sorter
Library: p5.js
Status: Specified
Bloom Level: Analyze
Bloom Verb: differentiate
Learning Objective: The learner will differentiate eight situations as a script, a learned policy or an agent, with at least 7 of 8 correct on the first attempt.
Prerequisites: script, learned policy, agent, demonstrations, tools (all defined in the section "Script vs Policy vs Agent" above this block and in Chapters 11, 14 and 15).
Evidence of Mastery: For each of eight situations the learner chooses one of three kinds and commits. A choice is correct when it matches the Kind column in Content. Mastery is 7 of 8 correct on the first attempt. Reading the comparison table in Explore mode is exploration, not evidence.
Misconceptions: (1) A camera makes a program an agent. (A program with a camera is still a script when code decides every step.) (2) Anything with a neural network is an agent. (A policy maps what it sees straight to actions and does not choose tools.) (3) An agent is always better. (It is less predictable, so it is used only where the job needs words or changing plans.)
Instructional Rationale: An Analyze-level differentiate objective asks the learner to separate things that look alike. The three kinds differ in who decides each move, so the learner must look at the decision maker and not at the hardware.
Content:
The three kinds: "Script" (code that a person wrote decides every step), "Learned policy" (a model trained on demonstrations turns what it sees into the next action), "Agent" (a language model chooses which tools to call, in a loop). Eight situations in this fixed order:
| # | Situation | Kind | Why (shown as feedback) |
|---|---|---|---|
| 1 | Every morning the arm moves through the same five poses to warm up. | Script | A person wrote the five poses, and nothing is decided at run time. |
| 2 | A model trained on fifty recorded demonstrations folds a towel. | Learned policy | The knowledge came from demonstrations, and the model maps what it sees to actions. |
| 3 | A student types "put the red block in the left bin" and a language model picks the tools to call. | Agent | A language model chooses tools in response to words. |
| 4 | The arm plays back a recorded motion exactly the same way every time. | Script | Playback is fixed steps, and it decides nothing. |
| 5 | A network reads the camera picture and the joint angles and outputs the next joint targets at every tick. | Learned policy | It maps observations to actions, and it was trained from demonstrations. |
| 6 | A language model reads a scene description, writes a plan, calls the move and gripper tools, and asks a person when a grasp fails twice. | Agent | The model plans and chooses tools, and handles a failure. |
| 7 | A program finds blocks by hue, converts them to table coordinates, and runs a fixed pick-and-place for each. | Script | A camera supplies facts, but code decides every step. |
| 8 | A person asks "is the gripper open?" and a language model calls the status tool and answers. | Agent | The model chose a tool to answer a question in words. |
Provenance: The three kinds follow Chapters 11, 14 and 15 of this book. The situations are illustrative and written for this sim.
Rules: Each situation has exactly one correct kind. The deciding question is who decides the next move: fixed code, a trained model, or a language model choosing tools.
Learner Activity:
- In Explore mode the learner reads the three kinds and the deciding question.
- The learner switches to the eight situations. Situation 1 is shown.
- The learner chooses a kind and commits.
- The sim shows whether the choice was correct and the Why text, then moves on. After situation 8 it shows the score.
Feedback: Eight situations, fixed order, one attempt each. Correct: "Correct:
Starting State: Explore mode with the three kinds listed and the prompt "Who decides the next move?" ready for the first situation.
Chapter Anchors: The chapter says that a program with a camera is still a script when code decides every step, that a script with the blocks' positions written in misses by 14 to 22 millimeters when the blocks are moved, and that most projects use a script for motion, vision for facts and an agent only for words. The sim has eight situations and mastery is 7 of 8.
Four Project Ideas¶
Each project below is made from parts that you already have. The table gives the shape of each, and the paragraphs say what is hard about it.
| Project | The task | Built from | The hard part |
|---|---|---|---|
| Color sorting | Put blocks in bins by color | Vision (14), planner (16), safety layer (17) | Finding blocks when they move, and gripping them |
| Desk assistant | Hand over, hold or point at small things on a desk, on request | Agent and skill (15), tools (16), roles (17) | Staying safe near a person |
| Chat-controlled arm | Control the arm from a chat window | Tool server (16), safety layer (17) | Trust: who may send commands, and with what role |
| Data collection station | Record clean demonstrations for a policy | Teleoperation (11), logging (13), dataset (14) | Consistency: the same setup every time |
A color sorting project is the one that the lab builds. A camera above the table finds red, green and blue blocks by hue, maps them to table coordinates, and the arm puts each in the bin of its color. It is a good first capstone because success is countable (blocks in the right bins), the failures are visible, and each part, from the camera to the safety layer, has been built in an earlier chapter.
A desk assistant project is an arm that helps a person at a desk: it holds a phone at a good angle, passes a pen, or points a light. Its difficulty is that the person is in the workspace. The safety story has to be strong: low speeds, a small and taped workspace, a physical E-stop that the person can reach, a confirmation step for anything fast, and the reader role whenever the agent reads anything from outside. A desk assistant is the project in which the chapter on safety layers earns its place.
A chat-controlled arm is an arm that takes its orders from a chat window, which is a tool server of Chapter 16 with a person on the other end. The first design question is who may send commands: a window that anyone in a group can write to is a source of untrusted input. Give each user a role, log every command with the name of the sender, and make sure that approve_next_risky_call is a person's button, not a chat command.
A data collection station is a fixed setup for recording demonstrations with the leader arm, for training a policy as in Chapter 14. The aim is consistency, since a policy learns from what it is shown. Fix the camera, mark the object's start positions on the table, light the table the same way, and record a log of every episode with a note on whether it was good. Throw away the bad demonstrations as soon as you know they are bad, because a policy copies mistakes as faithfully as skills.
Operating the Arm¶
Startup and Shutdown Procedures¶
The startup procedure is the list of things done, in a fixed order, before an arm is allowed to move. The reason for a fixed order is that each step makes the next one safe. You cannot check the servos before power is on, and you must not clear a stop before the servos have been checked. The lab's startup function does it in four steps and stops at the first one that fails.
- Power. Does the supply cover the motors, with margin? (The power budget of Chapter 3.)
- Servos. Does every servo answer, is it cool, and is it inside its calibrated range? (The pre-flight check of Chapter 8.)
- A person checks the table and the E-stop. Is the table clear, and is a hand near the stop? This step cannot be automated, which is why it is a question put to a person.
- A person clears the stop, and the arm goes home. The stop that ended the last session stays in force until a person clears it, and no tool can.
The shutdown procedure reverses it. The arm goes to its home pose, the folded pose of the configuration file, and then torque is cut, so that it is already parked when it goes limp. The one rule is that torque is never cut while the gripper holds something, because the object would fall and an arm without torque sags. The lab's shutdown function refuses to cut torque in that case and asks for a person to take the object first.
Make the Hard-to-Forget Step a Question
Pilots and nurses use checklists because the step that gets skipped is always the boring one. Write your startup so that the program asks about the table and the E-stop and will not go on without a yes, and write your shutdown so that it checks the gripper for you.
Diagram: Startup Order Sequencer¶
Run the Startup Order Sequencer MicroSim fullscreen
Startup Order Sequencer
Type: microsim
sim-id: startup-order-sequencer
Library: p5.js
Status: Specified
Bloom Level: Analyze
Bloom Verb: organize
Learning Objective: The learner will organize the four startup steps and the three shutdown steps of the chapter into their correct order, choosing the next step in each of eight rounds, with at least 7 of 8 correct on the first attempt.
Prerequisites: startup procedure, shutdown procedure, stop, home pose, pre-flight check (all defined in the section "Startup and Shutdown Procedures" above this block and in Chapters 3 and 8).
Evidence of Mastery: In each of eight rounds the learner chooses one of three steps as the next one and commits. A choice is correct when it matches the Next Step column in Content. Mastery is 7 of 8 correct on the first attempt. Reading the full procedure in Explore mode is exploration, not evidence.
Misconceptions: (1) The stop can be cleared first so that the checks can move the arm. (The checks come first, and the stop is cleared after them.) (2) The agent can clear the stop. (Only a person can.) (3) Torque is cut first and the arm is parked afterwards. (A parked arm has little left to fall, and an arm that is not parked sags.)
Instructional Rationale: An Analyze-level organize objective asks the learner to put parts into a structure. Choosing the next step, again and again, makes the learner think about what each step makes safe for the following one.
Content:
The full procedure, shown in Explore mode: Startup steps 1 to 4, then Shutdown steps 5 to 7. Eight rounds in this fixed order. In each round the steps already done are shown, and the learner picks the next one from three choices.
| Round | Steps done so far | Next Step | The two wrong choices | Why (shown as feedback) |
|---|---|---|---|---|
| 1 | none | Check that the supply covers the motors | Clear the stop; Go to the home pose | Nothing else is safe until power is known to be right. |
| 2 | Power checked | Check that every servo answers, is cool and is in range | Clear the stop; Cut torque | The servos are checked before any stop is cleared. |
| 3 | Power, servos | A person confirms the table is clear and the E-stop is in reach | Go to the home pose; Cut torque | A person must look before the arm may move. |
| 4 | Power, servos, table | A person clears the stop | Cut torque; Take the object from the gripper | The arm can move only after a person clears the stop. |
| 5 | Startup done, the arm is working | Check that the gripper holds nothing | Cut torque; Clear the stop | Torque is never cut while the gripper holds something. |
| 6 | Gripper empty | Go to the home pose | Cut torque; Check the servos | The arm is parked before torque is cut. |
| 7 | Arm at home | Cut torque | Check the power supply; Clear the stop | Torque is cut last, with the arm parked. |
| 8 | Torque cut | Leave the arm stopped until a person clears it | Let the agent clear the stop; Move the arm to test it | A stop stays in force until a person clears it. |
Provenance: The steps are those of the chapter's startup and shutdown functions. The wrong choices are written for this sim.
Rules: Each round has exactly one correct next step. A step is wrong if it comes in the wrong place, or if it is something that only a person may do and the choice gives it to the agent.
Learner Activity:
- In Explore mode the learner reads the seven steps in order.
- The learner switches to the eight rounds. Round 1 is shown.
- The learner chooses the next step and commits.
- The sim shows whether the choice was correct and the Why text, then moves on. After round 8 it shows the score.
Feedback: Eight rounds, fixed order, one attempt each. Correct: "Correct:
Starting State: Explore mode with the seven steps listed in order and the prompt "What comes next?" ready for round 1.
Chapter Anchors: The chapter's startup has four steps (power, servos, a person checks the table and the E-stop, a person clears the stop and the arm goes home), and its shutdown parks the arm, then cuts torque, and refuses while the gripper holds something. The sim has eight rounds and mastery is 7 of 8.
Monitoring¶
Monitoring is watching the arm while it works, so that a problem is noticed before it becomes a failure. A person watching is the best monitor, and software can add a second pair of eyes that never gets bored. Three things are worth watching.
- Temperature. A servo that is working hard gets hot, and a hot servo can shut itself down or wear faster. The pre-flight check of Chapter 8 refuses to start with a servo at 60 °C or more, which stays well below the 70 °C cut-off of the STS3215 that the book's sources give. The lab's
Monitorwarns at 50 °C and stops the arm at 60 °C. - Refusals. A run of refused calls (Chapter 17) means that the agent and the layers disagree. The monitor warns when more than 30 percent of the last 10 calls were refused.
- Counts. Calls, refusals and moves per run, kept over time, show a slow change that no single run shows.
The temperatures in the lab come from a toy model: each degree that a joint turns warms it by 0.004 °C, and an idle arm cools by 0.8 °C a minute. These numbers are made up to show the idea, and they are not measurements of any servo. On a real arm the monitor reads each servo's Present_Temperature register, as the pre-flight check already does, and the thresholds should come from the arm's data sheet. The lab shows what monitoring does: in the demonstration the elbow warms from 25 °C to a warning at 50.2 °C after about ten rounds of sorting, the monitor stops the arm at 60.2 °C in the 13th, and after 20 minutes of rest the hottest joint is still at 44.2 °C, so a person who sees the arm restart at once would be asking too much of it.
Maintenance, Wear and Lubrication¶
A maintenance schedule is a list of things to check or do, each with an interval, so that wear is found by looking and not by failing. Intervals are measured in hours of use and not in calendar days, because an arm that sits on a shelf does not wear. The lab's schedule is data: each task is a name, an interval and a line on how to do it.
| Task | Every | How |
|---|---|---|
| Check screws and connectors | 10 h | Look and press: nothing loose, no cable half out |
| Inspect cables | 10 h | Look for chafing and kinks where the cable bends |
| Check calibration drift | 25 h | Hold the arm in the middle pose and run the drift check of Chapter 8 |
| Inspect printed parts | 25 h | Look for cracks and stretched holes near the servos |
| Check servo play | 50 h | Wiggle each joint with torque off |
| Full recalibration | 100 h | Run the calibration routine again and compare with the saved file |
These intervals are examples to start from. They are not figures from a manufacturer. Neither the SO-ARM100 repository's README nor any source used for this book gives a maintenance interval, so a class should start with numbers like these, keep a log, and change them as it learns how its own arms wear. A task is due when the hours since it was last done reach its interval, and the lab marks a task soon at 80 percent of the interval, so that it can be planned.
Wear and lubrication is a place to be honest about what is not known. Wear shows itself as play (a joint that moves a little before the servo moves it), noise, jitter, drift in the calibration and heat. Lubrication is a different matter. No grease or oil guidance for the STS3215 was found from its maker, and the sources that were found disagree even on what the gears are made of (retailer listings say steel in some places and copper in others, and say that the horn is plastic). Adding grease by guess can harm plastic parts and attract dust, so the rule is: do not lubricate a servo unless its maker says how, and ask the seller or the maker if the gearbox needs attention. A servo with worn gears is cheap to replace, which brings us to the next topic.
The printed parts wear in a different way. PLA softens as it warms, with a glass transition that sources put at around 60 °C, and a part that carries a steady load can slowly creep. Both points come from secondary sources, one of them weakly sourced, so treat the numbers as a caution and not as a specification. The practical rules are easy to follow: do not leave an arm in a hot car or in direct sun, do not leave it holding a load for days, and look at the printed parts near the shoulder and the elbow, where the loads are highest, as part of the schedule.
Do Not Grease What the Maker Did Not Say to Grease
No lubrication guidance was found for these servos, so adding grease is a guess, and a wrong guess can swell plastic or gum up a gearbox. Look, listen and measure, and replace a servo that has gone bad. That is cheap, and it is what the spare is for.
Servo replacement uses the skills of Chapter 8, in order. Keep the spare from the budget of Chapter 6, and take care to use the same gear-ratio variant for the joint: the book's parts list uses the 1/345 ratio (C001) for most joints, 1/191 (C044) and 1/147 (C046) for others. Then: switch the power off, remove the old servo, connect the new one alone to the controller board, set its ID to the old one's, fit it, reconnect the bus, run the pre-flight check, check the calibration, and test at low speed. A replaced servo changes the arm's zero, so the calibration step is not optional. Write the replacement in the log, with the date and the hours of use.
Diagram: Maintenance Due Calculator¶
Run the Maintenance Due Calculator MicroSim fullscreen
Maintenance Due Calculator
Type: microsim
sim-id: maintenance-due-calculator
Library: p5.js
Status: Specified
Bloom Level: Apply
Bloom Verb: calculate
Learning Objective: The learner will calculate the hours left before a maintenance task is due, the percent of its interval used, and the weeks until it is due, to within 0.1 of the unit shown, in six problems, with at least 5 of 6 correct on the first attempt.
Prerequisites: maintenance schedule, interval, hours of use, due and soon states (all defined in the section "Maintenance, Wear and Lubrication" above this block).
Evidence of Mastery: For each of six problems the learner types a number in the unit shown and commits. An answer is correct when it is within 0.1 of the Correct column in Content. Mastery is 5 of 6 correct on the first attempt. Changing the hours in Explore mode is exploration, not evidence.
Misconceptions: (1) The interval is counted in calendar days. (It is counted in hours of use.) (2) Hours left is the interval minus the hours now. (It is the interval minus the hours since the task was last done.) (3) An overdue task has zero hours left. (The number goes below zero.)
Instructional Rationale: An Apply-level calculate objective needs repeated use of the same few formulas on new numbers with an immediate check. The problems mix the three formulas so that the learner has to choose the right one.
Content:
Explore mode shows the six tasks with their intervals, and two sliders for the hours of use now and the hours at which the task was last done, with the resulting state. Formulas: hours since = hours now - last done; hours left = interval - hours since (below zero when overdue); percent used = 100 x hours since / interval; weeks = hours left / hours per week. A task is "soon" at 80 percent used and "due" at 100 percent.
| Quantity | Min | Max | Step | Default | Unit |
|---|---|---|---|---|---|
| Hours of use now | 0 | 200 | 1 | 42 | hours |
| Last done at | 0 | 200 | 1 | 30 | hours |
| Interval | 10 | 100 | 5 | 10 | hours |
Six problems in this fixed order:
| # | Problem | Unit asked | Correct | Why (shown as feedback) |
|---|---|---|---|---|
| 1 | Inspect cables (every 10 h) was last done at 34 h, and the arm is now at 41 h. How many hours are left before it is due? | hours | 3.0 | Hours since = 41 - 34 = 7, and 10 - 7 = 3.0 hours left. |
| 2 | Check calibration drift (every 25 h) was last done at 10 h, and the arm is now at 38 h. How many hours are left? (Use a negative number if it is overdue.) | hours | -3.0 | Hours since = 28, and 25 - 28 = -3.0, so it is 3 hours overdue. |
| 3 | Check servo play (every 50 h) was last done at 0 h, and the arm is now at 42 h. What percent of the interval is used? | percent | 84.0 | 100 x 42 / 50 = 84.0 percent, which is past the 80 percent mark, so it is "soon". |
| 4 | Full recalibration (every 100 h) was last done at 60 h, and the arm is now at 130 h. How many hours are left? | hours | 30.0 | Hours since = 70, and 100 - 70 = 30.0 hours left. |
| 5 | A class uses an arm for 6 hours a week, and "Check screws and connectors" (every 10 h) was just done. In how many weeks is it due? | weeks | 1.7 | 10 / 6 = 1.67, which rounds to 1.7 weeks. |
| 6 | Inspect printed parts (every 25 h) was last done 9.5 hours ago. What percent of the interval is used? | percent | 38.0 | 100 x 9.5 / 25 = 38.0 percent. |
Provenance: The tasks and intervals are the chapter's example schedule, which is not from a manufacturer. The problems are illustrative and written for this sim.
Rules: hours since = hours now - last done. hours left = interval - hours since. percent used = 100 x hours since / interval. weeks = hours left / hours per week. An answer is correct when |typed - correct| <= 0.1.
Learner Activity:
- In Explore mode the learner moves the two sliders and watches the hours left, the percent used and the state.
- The learner switches to the six problems. Problem 1 is shown.
- The learner types a number and presses Check to commit.
- The sim shows whether the answer was correct, the working and the Why text, then moves on. After problem 6 it shows the score.
Feedback: Six problems, fixed order, one attempt each. Correct: "Correct:
Starting State: Explore mode with 42 hours of use now, last done at 30 hours, and an interval of 10 hours, showing 12 hours since and a state of due.
Chapter Anchors: The chapter's schedule has intervals of 10, 10, 25, 25, 50 and 100 hours, marks a task soon at 80 percent of its interval, and says the intervals are examples and not a manufacturer's figures. The sim has six problems and mastery is 5 of 6.
Project Documentation¶
Project documentation is what lets someone else run your project, and that someone is often you in three months. It is not a long document. A one-page PROJECT.md that answers six questions is enough: what it does, what it cost, how to start it, what happened on the last run, what maintenance is due, and how it was tested. The safest way to keep it true is to generate it from measurements, which is what the lab's project_report function does: the numbers for the last run, the hottest joint, the hours since each maintenance task and the test result all come from the program and not from memory. A document written by hand goes stale; a document written by the program is as new as the last run. Keep a photograph of the build, a wiring diagram, the calibration file and the audit log of a good run next to it.
Teaching With Arms¶
Classroom Use and Lab Schedule¶
Classroom use means sharing a small number of arms among many learners, and the main problem is that an arm can be used by only one group at a time. Three habits make it work. Work on the fake arm first. Every lab in this book runs without hardware, so a group can write and test its code at any desk, and book the real arm only for the final runs. Pair up roles. One person drives, one watches the table and holds the E-stop, and they swap. Keep the rules short and on the wall: the startup list, the stop rule, and who may touch the power switch.
A lab schedule turns the book into weeks. The plan below is an example for a class of six teams that shares two arms, and the weeks can be stretched or cut to fit. The parts are ordered and printed first, because they take the longest to arrive.
| Week | Work | Chapters |
|---|---|---|
| 1 | Set up Python, read the vocabulary, and order the parts | 1, 2, 6 |
| 2 | Electricity and safety; print the parts | 3, 7 |
| 3 | Build and calibrate the arms | 8 (or 9) |
| 4 | Talk to the arm in Python; move it | 10, 11 |
| 5 | Kinematics, logging and tests | 12, 13 |
| 6 | Cameras and learning | 14 |
| 7 | Agents, tools and safety layers | 15, 16, 17 |
| 8 | Capstone work and arm time | 18 |
| 9 | Demonstrations and assessment | 18 |
With two arms and six teams, give each team a booked slot (for example 30 minutes) for the real arm, and let the monitor and the maintenance log decide when an arm must rest. The maintenance schedule is also a teaching tool: assign the checks to teams in turn, and the hours of use will be logged by people who care.
Makerspace Use¶
Makerspace use is the case where the arms live in a shared workshop with open hours and visitors, and it adds three concerns to the classroom ones. Sign in, so that you know who used the arm last and what state it was left in. Mark the workspace with tape and put the E-stop in a place that anyone can reach, because a visitor has not read this book. Keep the printer and the arm apart: a makerspace's 3D printers, soldering irons and hand tools are used under the space's own rules, and Chapters 3 and 7 are a minimum and not a replacement for them. If the arm is left powered and unattended in a space with visitors, it is a hazard. The shutdown procedure above, ending in a stopped arm that only a person can restart, is the simplest rule: the arm is stopped when nobody is next to it.
Group Parts Ordering¶
Group parts ordering is placing one order for the whole class, and it is mostly arithmetic. Use the budget code of Chapter 6. The cost per team is the project's delivered figure of Chapter 6 plus the spare: the kit cost $332.04 delivered, with about $20 or more for printed parts and $13.89 for a spare servo, for a total of about $364. The table shows what that means for a class.
| Teams | Per team | Class total |
|---|---|---|
| 4 | about $364 | about $1,456 |
| 6 | about $364 | about $2,184 |
| 8 | about $364 | about $2,912 |
Three decisions save trouble. Decide how many spares before ordering, since a second shipment can take weeks (a spare servo per team, or a shared box of them). Print once for the whole class, since a printer can run through the night and a team's parts are small. And ask the seller about shipping for a bulk order: the kit's delivered price was 28 percent above its sticker price, and whether a single large order lowers that is not something that the sources used here can say. Whatever you order, keep the invoice, because a receipt is evidence for the next class.
Assessment Rubric¶
An assessment rubric says in advance what a good project looks like, and how many points each part earns. It is fairest when it grades what the book has taught, and when learners can see it before they start. The rubric below is an example for the capstone, scored out of 20, and a class should change the criteria and the weights to match its goals.
| Criterion | 4 points | 3 points | 2 points | 1 point |
|---|---|---|---|---|
| Works | Meets its success test every time | Meets it most of the time | Meets it once | Does not run |
| Safety | Layers, limits, E-stop and a stated safety story | Layers and limits, but the story is thin | One safety measure | None, or the agent is the only one |
| Testing | pytest tests, an evaluation and a replay | pytest tests | Some checks by hand | Untested |
| Documentation | A PROJECT.md that someone else could follow |
Mostly complete | Partial | Missing |
| Reflection | Names what failed, what changed, and what is still not known | Names what failed | Lists what was done | None |
The most useful row is the last. A team that writes down honestly what did not work and what it does not know has learned more than a team whose demonstration happened to go well, and the rubric should say so.
Beyond One Arm¶
Bimanual Setup, Mobile Manipulation, and Larger Arms¶
A bimanual setup uses two arms working together, for tasks that a person does with two hands, such as holding a bottle with one and unscrewing its cap with the other. The ACT paper of Chapter 14 was about exactly this: its hardware, ALOHA, was a pair of arms. A second arm doubles the cost and the wiring, and it changes the software, since the two arms need a shared clock, a shared table and a rule for who moves into the middle. The practical path is to master one arm first and add the second only when a task needs it.
Mobile manipulation puts the arm on a moving base, so that it can work in more than one place. The SO-ARM100 repository lists, among its optional add-ons, a project called XLeRobot: a mobile robot with two SO101 arms on a LeKiwi base, with a battery and cameras, which the README gives a total cost of $660 and which has its own documentation. That figure is the README's own claim and was not checked here. What changes with a mobile base is the problem of where the arm is: the table is no longer at a fixed place, so the calibration of Chapter 14 has to be redone, or replaced with a camera on the arm.
Larger arms carry more and reach farther, at a price. Chapter 9's comparison gave the reBot B601-DM a payload of 1.5 kg and a reach of 767 mm, and the B601-RS 2.5 kg and 754 mm, against about 0.5 kg for the SO-ARM101 as sellers list it. Moving up in size is not only a matter of cost: the energy in a heavier, faster arm is higher, the supply is 24 V or 48 V instead of 5 V, and the safety work of Chapter 3 and of this chapter gets more serious, not less. Scale the safety measures to the arm. For a larger arm, expect the E-stop and the supervision to matter more than any software layer.
Open-Source Contribution¶
This book stands on open-source projects: the SO-ARM100 and reBot repositories, LeRobot, OpenClaw and others. Open-source contribution is giving something back, and it is a fine capstone for a learner who has found a mistake or a missing piece. A contribution need not be code: a fixed typo in the documentation, a corrected part number, a clearer calibration note or a photograph of a build step helps the next builder.
The GitHub flow for a contribution has five steps. Fork the project to make your own copy, clone it, make a branch for your change, commit and push, and open a pull request.
git clone https://github.com/YOUR-USERNAME/PROJECT
cd PROJECT
git checkout -b fix-calibration-typo
git add .
git commit -m "Fix a typo in the calibration section"
git push
Then use the Contribute button on your fork to open the pull request. Each project has its own rules, and you should read them first. LeRobot's contributing guide, for one, asks you to add the main repository as a second remote called upstream, to work on a branch and not on main, to rebase on upstream/main, to run its tests and its pre-commit hooks, and to use the issue and pull-request templates. It also asks you to look at someone else's open pull request before asking for attention to yours. The SO-ARM100 repository is licensed under Apache 2.0, and its README has no contribution guidance, so open an issue first and ask. LeRobot also has an AI policy, which fits this book: it asks you to say when a substantial part of a submission was made by an AI, to stay accountable for what you submit, to edit away filler, and to check AI output yourself. Follow it, and follow the same rule in your own work.
Responsible Robotics¶
Responsible robotics is the habit of asking, before and after building, who the robot affects and what could go wrong. For a desktop arm the questions are small and real.
- Safety of the people near it. Chapters 3 and 17: layers, limits, a reachable E-stop, supervision, and no claim that your arm meets an industrial standard. The standards named in Chapter 17 are context and not a certificate.
- Privacy. A camera over a classroom desk sees people. Point it at the table and not at faces, say what it records and where it is stored, and get permission before recording learners or keeping their images in a dataset.
- Honesty about results. Report the success rate with the number of trials and the failures, as Chapter 17 did, and not the best run. A demonstration that worked once is not evidence.
- AI that acts. Keep a person in the loop for actions with consequences, keep an audit log, and be open about what the agent can do and what it cannot.
- Waste and repair. Print only what you need, keep spares so that a failure is a repair and not a replacement, and recycle electronics properly.
- Who can use it. Make the controls clear and the instructions short, so that a learner who is new, or who needs a different interface, can take part.
Responsible Does Not Mean Perfect
Nobody builds a perfect robot. Responsible means that you thought about who it affects, said honestly what it can and cannot do, and made it easy to stop. That is a habit you can start with the first project.
Lab: A Color-Sorting Capstone¶
In this lab you will finish the project of the chapter on the fake arm, with every procedure as running code: a startup and a shutdown, a monitor, a maintenance schedule, a color sorter, and a generated PROJECT.md. You will extend the arm-lab project, and the sorter uses the vision of Chapter 14, the planner of Chapter 16 and the safety layer of Chapter 17. Nothing needs hardware, a key or a network.
Step 1. Activate the project.
Step 2. Write the project module. Read it from top to bottom: startup and shutdown, then the monitor, then the maintenance schedule, then the sorter. Three details are worth noticing. clear_stop is a plain function and not a tool, so only a person's code can call it. Monitor wraps a session or a safety layer and has a call method, so anything that works on one works on the other. And sort_blocks lowers every plan step's speed to 30 degrees per second, because the safety layer of Chapter 17 asks a person to confirm anything faster than 40. Create armlab/project.py:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |
Step 3. Run the whole project. The script starts the arm, with the stop left in force by the "last session" and a pretend servo bus that is healthy. It looks at the table, sorts the three blocks through the monitor and the safety layer, keeps sorting without a rest until the monitor stops the arm, lets it cool, and shuts down. Create capstone_demo.py:
STARTUP
1. Power: does the supply cover the motors?
motors draw 3.6 A, with margin 4.50 A -> ok
2. Servos: do they answer, are they cool, are they inside their calibrated range?
all joints ok
3. A person checks the table and the E-stop
confirmed by the person
4. A person clears the stop, then the arm goes to its home pose
go_home -> ok
ready: True
SORT: the camera looks, the arm sorts, and every call goes through the monitor and the safety layer
red block at (0.160, +0.080) -> done
green block at (0.190, +0.000) -> done
blue block at (0.160, -0.080) -> done
MONITOR: keep sorting without a rest, and watch the temperature
round 4: hottest is elbow_flex at 35.8 C, 120 calls, 0 refused
round 8: hottest is elbow_flex at 46.6 C, 240 calls, 0 refused
round 12: hottest is elbow_flex at 57.5 C, 360 calls, 0 refused
WARNING: elbow_flex is at 50.2 C, above 50 C.
STOP: elbow_flex reached 60.2 C, at or above 60 C. Let the arm cool.
the monitor stopped the arm during round 13: stopped = True, 390 calls, 0 refused
COOL DOWN: a person waits, then clears the stop
after 20 minutes idle the hottest joint is at 44.2 C
SHUTDOWN
go_home -> ok
stop -> stopped: torque is off. Only a person can clear a stop.
Read the output as a day in the life of the arm. The startup stopped at nothing, because nothing was wrong, and the program asked its question of the person at step 3. The three blocks were found and sorted. The monitor warned at 50.2 °C and stopped the arm at 60.2 °C in the 13th round, and 20 minutes of rest brought the hottest joint only to 44.2 °C. The shutdown parked the arm and cut torque. The temperatures come from the toy model of this chapter and not from a real servo.
Step 4. Compare a script with a program that looks. The script has the three blocks' positions written into it. The second program reads them from the camera. Both are run on the table as expected, and then on a table where a student has nudged the blocks. Create compare_demo.py:
blocks where the script expects them
red script is 0.0 mm off (grasps), vision is 0.1 mm off (grasps)
green script is 0.0 mm off (grasps), vision is 0.1 mm off (grasps)
blue script is 0.0 mm off (grasps), vision is 0.1 mm off (grasps)
a student nudged the blocks by hand
red script is 14.1 mm off (misses), vision is 0.2 mm off (grasps)
green script is 22.4 mm off (misses), vision is 0.4 mm off (grasps)
blue script is 22.4 mm off (misses), vision is 0.2 mm off (grasps)
On the table as expected, both succeed, and the script is even a little more exact. Once the blocks move, the script misses all three by 14 to 22 millimeters, which is more than the 10-millimeter tolerance that this demo uses for a good grasp (a number chosen for the demonstration), and the camera still lands within half a millimeter. That difference is what a camera is for.
Pass Fake Data in, Never a Mocked Verdict
The comparison above renders a real picture of moved blocks and runs the real detector on it. It does not just say "the script fails". When you test a claim, produce the situation and measure it.
Step 5. Read the maintenance schedule. Create maintenance_demo.py:
1. The schedule: example intervals to start from, not manufacturer figures
every 10 h Check screws and connectors: Look and press: nothing loose, no cable half out.
every 10 h Inspect cables: Look for chafing and kinks where the cable bends.
every 25 h Check calibration drift: Hold the arm in the middle pose and run the drift check.
every 25 h Inspect printed parts: Look for cracks and stretched holes, especially near the servos.
every 50 h Check servo play: Wiggle each joint with torque off: a gearbox that rattles needs attention.
every 100 h Full recalibration: Run the calibration routine again and compare with the saved file.
2. After 42 hours of use, when the screws and cables were last checked at 30 hours
Check screws and connectors 12.0 h since the last time DUE
Inspect cables 12.0 h since the last time DUE
Check calibration drift 42.0 h since the last time DUE
Inspect printed parts 42.0 h since the last time DUE
Check servo play 42.0 h since the last time SOON
Full recalibration 42.0 h since the last time OK
At 42 hours, four tasks are due, because the screws and cables were last checked 12 hours ago against a 10-hour interval, and the calibration and the printed parts have never been checked. The servo-play check is at 84 percent of its interval and so it is marked "soon".
Step 6. Generate the project documentation. The script sorts once, runs the whole test suite, and writes PROJECT.md from what it measured. Create report_demo.py:
# Color-Sorting Arm
## What it does
A camera finds red, green and blue blocks and the arm puts each in the bin of its color, through the safety layer.
## Cost
Parts list, two arms: $243.77, before shipping, tax and printed parts (Chapter 6 has the landed cost).
## Last run
- red: done
- green: done
- blue: done
- calls: 30, refused: 0
- hottest joint: elbow_flex at 27.5 C
## Maintenance
- Check screws and connectors: 12.0 h since last done (due)
- Inspect cables: 7.0 h since last done (ok)
- Check calibration drift: 12.0 h since last done (ok)
- Inspect printed parts: 12.0 h since last done (ok)
- Check servo play: 12.0 h since last done (ok)
- Full recalibration: 12.0 h since last done (ok)
## Tests
52 passed
Open PROJECT.md in an editor. Every number in it came from the program, including the line from pytest. The cost line is the parts list for two arms of Chapter 6, and the note beside it says what it leaves out.
Step 7. Write the tests. The suite gets twelve more tests: startup succeeds and clears the stop, a hot servo keeps the arm stopped, no yes from a person keeps it stopped, shutdown parks and cuts torque, shutdown refuses while the gripper holds something, only a person can clear a stop, the monitor warns then stops then cools, the monitor notices a run of refusals, the maintenance states, vision finds the blocks to within a millimeter, the sorter skips blocks it cannot see, and every bin is reachable. Create tests/test_project.py:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | |
Step 8. Record your work.
git add .
git commit -m "Add the capstone: startup, shutdown, monitor, maintenance, color sorter and project report"
git log --oneline
Check Your Work¶
Your project is complete when all of these are true:
python capstone_demo.pyshowsready: True, a warning at 50.2 °C, a stop at 60.2 °C in round 13, and a shutdown that ends withstop.python compare_demo.pyshows the script missing by 14.1, 22.4 and 22.4 millimeters when the blocks are moved, and the camera program within half a millimeter.python maintenance_demo.pyshows four tasks due, one soon and one ok at 42 hours.python report_demo.pywrites aPROJECT.mdthat ends with52 passed.python -m pytest -qreports52 passed.- Earlier scripts still run.
git log --onelineshows an eighteenth commit.
Challenge: A Fourth Color¶
Add a yellow block to the sorter. You need three things: a hue range for yellow in COLOR_RANGES, a bin for it in BINS, and a test. Place a yellow block in a scene together with a red one, and check that the sorter finds both and puts each in a bin. Why does the red range not pick up the yellow block?
Click to see one solution
Yellow sits at a hue of about 30 on OpenCV's 0 to 179 scale, between red (near 0) and green (near 60). Add a range in armlab/vision.py and a bin in armlab/project.py, with the bin placed where it does not touch another bin or a block:
The test builds a scene with a yellow and a red block, with the yellow block drawn in BGR as (0, 255, 255):
The red range covers hues 0 to 10 and 170 to 179, and yellow is at 30, so the ranges do not overlap, and the mask for red stays empty on the yellow block. If you choose a hue range that is too wide, the two will start to share blocks, which is why you test with both colors in the same picture.
Summary and Key Takeaways¶
You can now plan, run, maintain and share an agent-controlled arm project.
- A capstone project is finished end to end and handed over: a goal, a success test, a safety story, a budget and a record of how to run it. Cut it down by removing one dimension at a time. Script vs policy vs agent is the choice of who decides each move: use the simplest that works, which is often a script that uses a camera for the facts and an agent only for the words.
- The four project ideas are the color sorting project, the desk assistant project, the chat-controlled arm and the data collection station. Each has a different hard part: finding blocks, staying safe near a person, deciding who may send commands, and recording consistent demonstrations.
- The startup procedure runs in a fixed order and stops at the first failure: power, servos, a person checks the table and the E-stop, a person clears the stop. The shutdown procedure parks the arm and then cuts torque, and never while the gripper holds something. Monitoring watches temperature, refusals and counts, and stops the arm when a limit is passed.
- A maintenance schedule lists tasks with intervals in hours of use, and marks them soon and due. The intervals in this book are examples and not a maker's figures. Wear and lubrication: do not lubricate a servo without its maker's guidance, and watch the printed parts for heat and creep. Servo replacement keeps the gear ratio, sets the ID alone on the bus, and recalibrates. Project documentation is best generated from measurements.
- Classroom use shares arms with fake-arm work first, pairs, and short rules. A lab schedule turns the chapters into weeks. Makerspace use adds sign-in, marked workspaces and an arm that is stopped when nobody is beside it. Group parts ordering is arithmetic and decisions about spares. An assessment rubric grades what the book taught, and rewards honest reflection.
- A bimanual setup, mobile manipulation and larger arms each add cost and safety work. Open-source contribution follows the GitHub flow and the project's own rules, with AI use disclosed. Responsible robotics asks who the robot affects: safety, privacy, honest results, a person in the loop, waste and access.
We Built, Ran and Looked After a Whole Project!
You started the arm in a fixed order, sorted blocks through every safety layer, watched me warm up until the monitor stopped me, scheduled my maintenance and wrote my documentation from real measurements. That is a complete project. If you want a taste of the mathematics behind my smooth motions, Chapter 19 has it!