The Production Station: One Button, and Checks That Do Not Depend on Anyone Watching
For three days the cell of the case study was run by an engineer typing commands. On the fourth it had to be run by a technician with one button, with the engineers elsewhere. This page is the list of what the station does by itself, each item bought with a failure.
The flow
Section titled “The flow”- The technician mounts a camera and plugs it in. The station finds it, starts the preview, locks the exposure and reads the camera’s own serial number.
- The technician presses the one button. The station starts recording, checks the recording, starts the robot.
- The robot runs its program and returns to the loading position. The station stops recording and checks which program ran.
- Processing is queued. The technician mounts the next camera at once.
- A line appears in the list of cameras: serial, result, error per lens, baseline.
In our experience, the robot part takes 2 to 3 minutes and the processing 3 to 5 minutes on a 32-thread desktop computer, so the queue is what makes the station as fast as the robot.
Before the robot starts
Section titled “Before the robot starts”| The station refuses when | The failure that taught it |
|---|---|
| the recording file is not growing | The camera had dropped off USB, the screen still said “recording”, and the robot ran a whole path unrecorded |
| the frame rate measured from the file is below 58 | A camera was switched to 30 frames per second |
| the exposure is not the locked value | A re-plugged camera returns to automatic exposure |
| it has no serial number from the camera itself | The USB descriptor’s serial was the same on every unit |
| the camera model is unknown | The model selects the robot program; a serial format nobody had seen came up under the previous camera’s model |
| the robot is not in automatic mode, has an alarm, is moving, or is away from the loading position | A program stopped half-way resumes half-way |
| its reading of the robot is old | After a controller restart the link kept returning the last values |
| the program has never completed a verified run here and the speed is above 30 % | A first run of a new path was started at half speed while nobody was watching |
After the robot stops
Section titled “After the robot stops”- Which program ran. From the joint log: see Robot programs. A run of the wrong program is an error, and the recording is kept.
- The lens matches the model. The calibrated focal length must be the model’s lens. This catches the wrong model picked by hand.
- One take per camera. After each result the station keeps the camera’s best take and archives the others.
- Disk. A take is about 1 GB of video and stills. A take that passed has them deleted; the last take that did not pass keeps its own, so it can be processed again.
In our experience, “best take” must not mean “lowest error”. A take with less of the image covered is easier to fit: one camera’s first take had 0.325 px in the left lens with 108 of 160 image cells holding at least 10 corners, and a later take on a path planned for its lens had 0.331 px with 135. The second is the better calibration.
PASS, CHECK and the customer’s folder
Section titled “PASS, CHECK and the customer’s folder”The screen shows PASS in green or CHECK in amber with one line of reason. CHECK is a note to look again, not a verdict on the camera. Cameras marked CHECK shipped with their measured calibration.
Each camera gets a folder meant to be handed over with it, holding exactly three files:
| File | Content |
|---|---|
calibration.yaml |
Both lenses, the transform between them, the IMU: one file |
README.txt |
What every number means: the lens model as a formula, the frames, the units, which way each transform goes |
certificate.txt |
Serial, date, mean error per lens, baseline |
No report, no gate table, no verdict words. In our experience, the page that defines the numbers is the part most often missing from a calibration hand-over: our own file named its lens model with an internal label that nothing in the folder explained.
People
Section titled “People”- The technician and the engineers did not share a language. Every message on the station’s screen is in both languages, and a chat box on the station reaches the engineers.
- Rules that live in a conversation get broken. “First run slow” and “one program enabled” were both agreed, and both failed within a day. They are in the station now.
- The screen must never freeze. A camera that stayed on the bus and answered no request blocked the window for minutes during a robot run. Device calls have timeouts and run off the user-interface thread.
The prompt
Section titled “The prompt”- Inputs: none beyond the prompt; the numbers in brackets are yours to set.
- How to check: every numbered item has a test that fails when its check is removed; run the simulator with each fault by hand once and read what the technician would see.
Design and write the supervisor of a production calibration station, with a simulated robot andcamera so it can be tested without hardware. A technician mounts a camera on the robot, presses onebutton, and the station records a video while the robot runs its program, then processes therecording and shows the result. The technician is not a programmer and may not share a language withthe engineers; the engineers are not in the room.
Everything in the list below is a failure we had on a real cell. The station must catch each one byitself, because a rule that depends on someone watching will be broken the first time nobody is.
Before the robot starts, refuse with a plain reason when:1. no camera is streaming, or the recording file is not growing. Recording starts first, is checked for [2] seconds, and only then is the robot started; a refused start deletes that file. (A camera can drop off USB while the program still believes it is recording: the robot then runs a whole path with nothing recorded);2. the frame rate measured from the recording is under [58] frames per second when [60] is expected (some cameras have a 30 / 60 switch);3. the exposure is not the locked value, [1.5 ms] by hand (a re-plugged camera comes back on automatic exposure: set it again after every plug-in);4. the camera's serial number could not be read from the camera itself, and nobody typed one (do not use a USB descriptor that is the same on every unit);5. the camera model is unknown: the model decides which robot program is right. A table maps serial-number patterns to models; a serial that matches none makes the technician pick from a list, and the pick must not be carried over silently from the previous camera;6. the robot is not in automatic mode, has an alarm, is moving, or is not at the loading position (a program stopped half-way resumes half-way);7. the robot link is stale: after a controller restart an open connection can fail every request while the screen keeps the last good values. A value is fresh only if the request that fetched it succeeded within the last [3] seconds; a failed or late request clears the values, shows an error and reopens the link;8. the program for this model has never completed a verified run on this station and the robot's speed is above [30] %: a first run is slow by construction, whoever presses the button. Verified means item 10 answered ok; remember it per program name together with a checksum of the program's targets, so a changed program is new again. The station refuses; it does not change the robot's speed itself.
During and after the run:9. an alarm, a lost camera, or the robot stopping away from the loading position ends the run as an error and keeps the recording. On a lost camera the station does not stop the robot: the program brings it back to the loading position by itself;10. after the run, check from the joint log that the expected program ran, once (give this as aninterface, `check_run(log, expected) -> ok / not ok / cannot tell`, with a simple implementation).Not ok is an error and nothing is solved; cannot tell goes on to processing but does not count as averified run;11. processing is queued: the technician can mount the next camera while the last one is solved;12. the result on screen is PASS or CHECK in calm colours with one line of reason; CHECK means "lookagain", not "scrap". PASS or CHECK comes from a function `gates(report) -> (result, reason)` that Iwill supply; use a stand-in;13. after a result, keep one take's results per camera (the best: most of the image covered first,then lowest error). Videos: a take is about 1 GB; when a camera has a take that passed, delete allof that camera's videos; while it has none, keep only the video of its latest take so it can bereprocessed;14. write a folder per serial number meant for the customer, for every camera that has a calibrationwhether PASS or CHECK: the calibration in one file, a page that defines every number (lens modelformula, frames, units), a one-page certificate with the measured numbers. No internal reports, noverdict words. (The cameras are stereo; take the content of the calibration file as given by thesolver.);15. never block the screen on a device that does not answer: every device call has a timeout andruns off the user-interface thread.
Write it as: `station/supervisor.py` (a state machine with explicit states and the checks above, noGUI), `station/sim.py` (a simulated robot and camera that can be told to misbehave: drop the camera,report 30 frames per second, raise an alarm mid-run, return stale data, run the wrong program, stophalf-way), and `tests/test_station.py` with one test per numbered item that injects the fault andasserts what the station does and what it tells the technician. Messages for the technician gothrough one function so they can be shown in two languages, [English and Chinese]. Use `unittest` ifpytest is not installed.
Run the tests and print the result. Then list any item you could not test and why.How this prompt was tested
Section titled “How this prompt was tested”A fresh AI session got an earlier wording of this prompt and nothing else. It wrote a supervisor with the states idle, checking, refused, running, verifying and error, a queue of processing jobs beside it, a simulated robot and camera that can be told to misbehave, and 35 tests, at least one per condition of every numbered item. All 35 passed. It then removed each of the supervisor’s 22 checks in turn and confirmed that a test failed every time, which is the check the prompt asks for and the one that shows the tests test something.
It listed what it could not test: a device call that answers late while already in flight, the 1 GB size, colours on a real screen, and the second language without a native reader.
Its notes found real gaps in the list. Time-stamping alone does not catch a dead link, because the old values arrive “now”; the item now says what makes a value fresh. The retention rule contradicted itself. The list did not say whether a CHECK camera gets a customer folder; it does. The wording above carries those corrections.
Sources
Section titled “Sources”- USB Video Class specification — USB Implementers Forum; extension units, where vendor-specific controls such as a unit’s serial number live.