Day 20: asking the camera about the camera

Today I actually felt I was working in a team: my mates handled the observability and I was the actor. The goal was to measure the latency of the loop and whether it could hold the throughput the engine needs — to prove the system can do the thing we want it to do. Funny, but we worked for months without ever knowing whether the goal was achievable on the configuration we’d chosen. Real R&D, only on a private budget. I hope my wife doesn’t hear me.

The task was to hold a red cap — yes, the same red cap, and I hope we’ll be rid of it shortly — and wave it back and forth in front of the camera. Slowly at first, then faster, and faster, and then as fast as I could swing it without knocking anything off the bench. My mates timed every stage of it and I did the show. The arm followed me — looked good! Not roughly. It traced the path of my hand and stayed on it.

Then it stopped keeping up, and it stopped at a very specific place.

I asked for fifty-six degrees a second. I got forty-four. I asked for ninety-three. Forty-four. I asked for a hundred and twenty-two, waving like an idiot, and the joint answered forty-four — the same number, with the patience of something that has never once been interested in my plans. That is the motor’s top speed, arrived at from three directions, and no amount of enthusiasm on my side of the bench moves it.

The lag is about a tenth of a second. Subtract that delay and the arm reproduces the shape of my hand’s path to under a degree, which means it isn’t sloppy. It is exactly as punctual as its abilities allow, and you cannot ask it for anything outside them. Don’t shoot the pianist. He is doing his best.

Then I looked at the arm instead of at the numbers

Everything above is the arm against its own commands — and by that measure the day was finished before lunch.

The arm was following my hand beautifully and pointing somewhere else entirely.

Not wildly. A handful of degrees, consistently, on every pass. Enough that the cap was here and the arm was aimed just past it, patiently tracking a thing that wasn’t there.

So I wrote something to settle it: a small calibration that puts a marker on the joint, sweeps the arm through the camera’s view, and lets the camera work out which motor position means straight ahead. Proper method. No opinions involved. It ran over about a hundred degrees of arc, nine clean measurements, and returned a number nine degrees away from the one the robot had been using.

I was ready to write it into the configuration. Then I did the one check I’d normally skip: if that answer is right, what else has to be true?

It turned out the camera would have to be sitting about twenty-six millimeters to the side of the post it is bolted to. Which it very much isn’t, and wouldn’t be quietly.

Here is the trap, and it is a good one. Asking the camera where the arm points means asking the camera where the camera is. Two unknowns, one measurement — and the arithmetic will hand you a confident answer for either of them, in a tone that suggests you should trust it. My calibration wasn’t wrong in its method. It was wrong in the same way a witness who was also the suspect is wrong.

The thing that broke the tie was me putting the arm at zero, closing one eye, and looking down it.

It was straight. Not nine degrees off. Straight.

So the motor’s zero had been right all along, the camera’s aim is right, and the wrong number was hiding in a bracket nobody had measured — the fixture that holds the calibration marker sits at an angle to the arm, the design says one value, and the printed plastic quietly disagreed by nine degrees. Every measurement I took through that fixture inherited the difference. I own the most sophisticated instrument in the room, and the thing that settled the argument was me closing one eye!

So: Day 20

Done with the first stage! YoHooooo!!

We see a thing. Know where it is. Move toward it, and keep moving while it moves. That was the whole point of this first phase, written down back when I had one joint, no camera, and a very confident plan. Three months.

Ready for the next journey.

Get the next one by email