The SO-101 arm below is drawing a kitten on a Wacom tablet, with a pen in a sleeve on its gripper. With the physics controller from the earlier posts in this series, the root mean square (RMS) error is 2.52 mm. To get it, compare where the tablet saw the pen with where the plan put it at the same instant, square those distances, average them, and take the square root, so big misses count extra. Add a small learned correction, frozen before the run, and the error drops to 1.01 mm.
The interesting part of that last step is where the error was hiding. The joint encoders report that every joint is close to its goal, while the tablet reports that the pen is millimeters off. So where does a millimeter go when every sensor on the arm says things are fine? Which controller changes actually bought accuracy, and what can a cheap arm never see about itself? We'll follow the error from the base joint out to the pen tip. Unless I say otherwise, the numbers are physical runs on four drawings (kitten, star, spiral, square) with a 1.5 mm pen press at 20 mm/s.
One tick at the base is a third of a millimeter
Let's start with the joint that turns out to matter most: the shoulder pan, the base rotation about a vertical axis. The pen sits R = 231 mm out from that axis. The encoder counts 4096 ticks per revolution, so one tick is 2π/4096 ≈ 1.534 mrad, and at the pen that becomes RΔθ ≈ 0.354 mm. The servo only takes goals in whole ticks, so rounding alone costs up to ±0.18 mm, about 0.10 mm RMS.
A tenth of a millimeter against an error of 2.5 means quantization is not our culprit. The lever is what to remember. Every angle error at the base gets multiplied by 231 mm before it reaches the paper: 1 mrad of pan error moves the pen 0.231 mm along x, the direction pan sweeps across the tablet (along y it is only 0.019 mm). We'll use that conversion twice more.
The setup, and how far the earlier controllers got
The series so far: joint dynamics, quantization and filtering, goal selection, learning a residual torque, and the pen holder.
Two sensors that disagree
The arm has two ways to know where the pen is. Its encoders give joint angles, and pushing those through the arm geometry gives an encoder-derived pen position. The tablet gives the actual contact point. Neither one is the plan, so the pen error e splits into three pieces:
e = u + tr + c
tr is the tracking error, the encoder-derived pen minus the command: what the joints themselves got wrong. u is the unseen part, tablet minus encoder-derived pen: everything that happens after the encoders, in gears, links, table, holder or pen. c is the learned correction, zero for now.
For the uncorrected controller the mean squared error is 7.51 mm², which is the 2.74 mm RMS. The mean squared size of u is 4.97 mm², that of tr is 1.69 mm², and the remaining 0.85 mm² is a cross term that appears because u and tr are not independent; they tend to grow at the same moments. Set tr to zero, as if the servos tracked perfectly, and the error is still 2.22 mm. (That is an offline counterfactual on the logs, not a run with perfect servos.) So most of the error lives where the controller's own sensors can't look.
That is the tablet's job in this project. It is the lab reference for where the pen really went, and later it supplies the training labels. The arm's eventual job is three-dimensional kitting and tool transport with changing payloads, where there is no tablet, so whatever we learn from it has to run on the arm's own sensors.
The full error budget
The attribution fits components to 44 physical runs across 10 motions, and tests each component with one whole motion left out. The target is the uncorrected controller. Shares are fractions of total mean squared error, which is a different quantity from each component's own RMS.
| Component | Own RMS | Share |
|---|---|---|
| x-direction pen lag beyond stream delay, plus directional offset | 1.30 mm | 39% |
| Pan startup and reversal tracking | 0.94 mm | 18% |
| Unexplained u | 0.97 mm | 10% |
| Tablet stream delay | 0.37 mm | 10% |
| Constant-and-position map | 0.64 mm | 9% |
| Wrist-flex tracking | 0.56 mm | 4% |
| Pan steady-motion and hold tracking | 0.50 mm | 4% |
| Elbow, lift and roll tracking | 0.45 mm | 3% |
| y-direction lag beyond stream delay | 0.24 mm | 2% |
| Nib height, pressure, acceleration | 0.42 mm | 1% |
The unexplained remainder includes about 0.4 mm of tablet-plus-encoder noise.
The base turns late
Which joint carries the error? Three of the components in that fit belong to pan: pen lag along x (39%), pan startup and reversal tracking (18%), and pan steady motion and holds (4%). Together that is 61% of the uncorrected squared error. Removing the pan-associated error offline takes the RMS from 2.74 to 1.63 mm.
Reversals show the mechanism most plainly. When a goal changes direction, lift and elbow respond within 50 ms. Pan takes a median of 267 ms over 46 reversals in uncorrected runs. Once it does start, it is about 10 mrad behind, and with our conversion that is 10 × 0.231 ≈ 2.3 mm of pen along x, every time the drawing turns a corner that needs the base.
The measured reversal plot
Friction leaves a fingerprint in the gain
Why would the base sit still for a quarter of a second? Two suspects produce the same symptom, a dead band where small errors don't move the joint: friction and backlash. One knob tells them apart.
The servo pushes with torque P·e, where P is its proportional gain and e is the position error. Stiction (static friction) holds the joint until the torque exceeds a breakaway threshold T, so the joint moves only when P·e > T, and the dead band is e = T/P. Double P and a friction dead band halves. A backlash gap is geometry, so P doesn't change it.
Older pan-hold logs answer the question. The dead band goes from 26.2 mrad at P4 to 9.2–9.7 at P16, 3.8–4.1 at P32, and below one encoder tick at P128, while the product P·e stays roughly between 100 and 160 from P4 to P32. That inverse dependence on gain is the evidence for friction. The backlash we can see inside the encoder loop is small, about 1 mrad at most.
The same equation explains a quieter offset. To hold the arm up against gravity the servo needs torque, and with finite gain torque only exists when e is nonzero, so a loaded joint always sits a little off target. Stacked on top of that, the firmware has its own dead zone of about 1.5 ticks (2.3 mrad), and pan holds within about 2.6 ticks, roughly 0.9 mm at the pen. In step tests at P32 on 11 October, commands of 10 ticks or less did not move pan at all. The joint and controller also add 20–25 ms of delay at a 60 Hz control rate. When the controller models friction during drawing, the dead band shrinks to 2.2 mrad, but each reversal still starts late.
So why not crank the gain? We tried a modest version: P32 on pan, elbow, wrist flex and wrist roll, with lift at P16 in both conditions. Over four paired blocks the RMS dropped by 0.061 mm (standard error 0.015 mm). Our predefined rule still scored it a loss, because lift overshot its stop. But we hadn't changed lift's gain, so that overshoot says little about the gains we did change. The next test changes the elbow and wrist-flex gains and uses a revised check for ringing after a stop. We don't have that result yet.
Does the arm shake?
Offline analysis of the logs finds that the controller's goal chatter excites a shoulder-lift mode near 4.3–4.5 Hz. In the strongest 2.5 s window, goal excursions reach about 20 mrad while the joint responds with about 2 mrad, one or two ticks. Over a whole drawing, the chatter is 6.0 mrad RMS and the response 1.4 mrad RMS. The tablet and encoder study finds no tablet-only component between 2 and 12 Hz, and ringing after a stop is about one encoder tick.
The gripper camera shows no obvious difference with the head off or on. With image motion below 2 Hz removed (70 s per recording, 960 px wide, 30 frames/s), the residual is 0.25 px RMS head off and 0.28 px head on, with no peak at 4–5 Hz. The wide-angle lens and the small encoder response limit what this can show, so a camera that sees no shaking does not refute the offline resonance finding.
The part no encoder sees
Back to u, the tablet-minus-encoder discrepancy. Plot it against planned pen speed and you get roughly a straight line. That is what a time lag looks like: if the pen runs τ seconds late at speed v, it trails by v·τ. The slope gives an effective lag of 86 ms along x and 35 ms along y. Some of it is the tablet itself, whose stream arrives about 20 ms late; that hurts the score without moving any ink.
Here's a check you can do in your head. Shift the reference 115 ms earlier before scoring, and the RMS falls from 2.74 to 1.74 mm. At 20 mm/s, 115 ms is 2.3 mm of path, the same 2.3 mm we got from the late base. A big piece of the error is the pen running consistently behind along its own path.
What exactly is late along x? I don't know yet. Three suspects survive:
- Structural compliance. The base, table or holder bends under torque, with deflection = torque / stiffness. The x discrepancy shifts by −0.77 mm per 10% of pan load, and adding load to the fit shrinks the fitted direction offset from −0.54 to −0.14 mm. A separate offline analysis, though, fails to explain the pose-dependent error through load deflection.
- Pen drag. The x offset is −0.44 mm at 0.5 mm press and −1.01 mm at 2.0 mm, zero in y, and almost zero in hover. Drag fits that press dependence, but it can't be all of the lag, because 32–36 ms of x lag remains when the pen hovers.
- Backlash, at most about 1 mrad inside the loop. Project notes put the encoder on the output shaft; nobody has checked that against the datasheet.
A hover replay of the same motions would separate drag from bending. It hasn't been run.
The measured speed plot
Teach the path to lead
Before fixing u, it helps to know whether it repeats. Mostly it does: the physics controller's error measures as 98% repeatable, with a repeatable component of 2.58 mm against a random 0.58 mm. Repeatable error is the kind a fixed correction can cancel.
The previous post's fix, a learned torque residual called PhysR, reached 2.27 mm. Compare that with the 2.22 mm floor for perfect tracking. A better torque model improves tracking, and tracking is the smaller piece. To reach u we have to change the path we ask for.
That's what the learned head does. For each of the five joints it reads six features of the planned motion: sine, cosine, angle, velocity, acceleration and a saturated velocity (velocity clipped to a limit). That's 30 numbers plus a constant. A 5×31 weight matrix W maps them to five joint-angle offsets of a few milliradians, which get added to the planned path before the physics controller sees it.
Training uses the tablet. After every control tick, recursive least squares (RLS) moves W toward the offset that would have cancelled the error it just measured. The idea is ordinary: compare what we predicted with what the tablet says we needed, then move partway toward it, new = old + K·(label − prediction). Say the head currently outputs 2 mrad, the tablet says 5 mrad would have cancelled the error, and the gain is K = 0.1. The 3 mrad surprise moves the output to 2.3 mrad. RLS sets K using its uncertainty about each weight, and a forgetting factor below one discounts older observations. Then we freeze W. A frozen head needs only the planned path, no tablet, so it runs on the arm alone.
On the kitten you can watch it work. The offsets sit near zero during pan holds and smooth travel. At quick reversals they jump to 10–14 mrad, which reads as the head asking the base to start early, by roughly as much as the base was late.
Which features matter? Constants alone give 2.64 mm and pose alone gives 2.65 mm. Add velocity, acceleration and the rest of the motion terms and you get 1.03 mm. Offline, on recorded logs of new motions, a bigger neural network scores 1.025 mm against 1.047 mm for ridge regression on the same features. The gain came from telling the model how the arm is moving; extra capacity bought 0.02 mm.
The update rules in full
For the head, φ is the feature vector, y is the cancellation-offset label, P is the parameter uncertainty and λ < 1 discounts old observations (the value used is not stated):
K = Pφ / (λ + φᵀPφ)
W_new = W_old + (y − W_old φ) Kᵀ
P_new = (P − KφᵀP) / λ
The controller's EKF uses the same pattern to track a missing torque: d̂_new = d̂_old + K(q_encoder − q̂_model), where the estimated state also includes the joint speeds. The scalar gain K in the worked example is explanatory and ranges from 0 to 1.
Scoring a millimeter honestly
Here's the physical scoreboard on the four drawings: 2.74 mm for the physics controller, 2.27 with PhysR, 1.14–1.15 for two neural corrections, and 1.057 for the frozen head. The replay below draws the recorded tablet traces of one night at 8× speed.
A millimeter is small enough that the measurement starts to fight back, and three conditions come with that 1.057. First, controllers drift. The same frozen head scored 1.03 and 1.14 mm in blocks an hour apart. Suppose baselines read 1.057 and then 1.14, and a candidate run between them reads 1.00. It looks 0.057 mm better, but the baseline itself moved 0.08 mm, so the run tells you nothing. That's why every comparison runs baseline, candidate, baseline, and one candidate run is never enough. Second, these four drawings are the ones we used to pick controllers, so 1.057 is flattered by that selection. Circle and plus were held out for validation and haven't been scored. Third, the tablet's datasheet quotes ±0.25 mm at the center, which hasn't been checked independently, so differences below 0.25 mm are weak evidence.
The kinds of evidence get different jobs too. Physical runs rank controllers. Analysis of recorded logs generates candidates, with data split by whole motion so a test motion never appears in training. Simulation rehearses physical motions and tests ideas at high run counts, but it never ranks learned controllers, because the simulator shares the controller's model. That model leaves out backlash and compliance, assumes a rigid structure, and uses one friction magnitude that misses the larger startup friction. A model like that favors planners built on itself: whole-path planning gained at most 5% in simulation with the exact model and did 23–364% worse under small model mismatch.
Per-drawing traces and where each number comes from
How far off is the shared model? Over a 10-tick horizon (about 0.17 s) its endpoint prediction error is 1.81 mm, against a tracking error of 1.24 mm. Over one tick it is 0.40 mm.
What is left in the last millimeter
Offline, the next gains come from memory. Hysteresis means a joint's output depends on its history. Imagine reversing a joint: it may have to cross a small gap before the output follows. We give the head a number that tracks where the joint sits inside that gap (the play state), plus the last direction of motion. On motions held out of training, the error falls from about 1.13 to 1.03 mm. A kernel model, which builds nonlinear features from similarity to past motions, reaches about 1.01 mm. These features describe the data without proving a physical backlash, and none of these candidates has run on the arm yet.
Variety in the training data matters more than repetition. Retrained on 3 to 12 distinct motions, the kernel model drops from 1.172 to 0.985 mm, and it is the only one still falling, by about 0.008 mm per extra motion. Extrapolating gives 0.90–0.94 mm at 24 motions. Training once on each of twelve motions gives about 1.04 mm; repeating a smaller set of six motions gives about 1.07 mm, despite more runs overall. Under all of this sits a residual of about 0.5–0.6 mm that repeats on a given motion but that none of the features we tried predicts on a new one.
Some routes are stuck in the lab. A fast Kalman head that reads the tablet live reaches 0.74–0.84 mm offline, but it needs the tablet, and tuning it for zero lag when the real lag is 30 ms or more makes it diverge by 4–6 mm. A better lift servo won't help much, since lift tracking explains only 0–2% of the error.
The frozen weights encode this arm's friction, its lag, and even the tablet's stream delay, all learned on one arm, one tablet pose and one plane. New drawings, a changed payload, another arm, another plane and 3D motion are all untested. Away from the tablet, the arm needs a sensor it can carry that says more about where the pen actually went. A gyroscope can measure how fast the base turns, but gravity can't tell it which way the base faces. Accelerometers could catch shaking and bending, and a gripper camera looking at a mat of markers is another option; both are still plans. Heat weakening the motors is another suspect we haven't measured. The plan restarted on 11 October goes suspect by suspect, from backlash and friction to the firmware dead band, bending, servo behavior, temperature and drift. For each one, I'd ask what measurement tells it apart from the others and how uncertain that measurement is, and look in the logs we already have before spending another run on the arm.
Hysteresis features and learning curves
The play state for a gap of width w updates as s_k = min(max(s_(k−1), q_k − w/2), q_k + w/2), where q_k is the joint angle. Several widths plus the sign of the last motion encode the joint history. The unexplained discrepancy is similar in size at rest and in motion. Exact held-out RMS: 30-feature linear 1.1314 mm, linear hysteresis 1.0285 mm, kernel 1.0077 mm. The run-count comparison is 12 distinct motions × one run (1.039 mm) against six distinct motions over 17.6 total runs as reported (1.067 mm).
So here's where it stands. First I'd check that result on the circle and plus, the drawings we held out, with baseline runs on either side. Then come more varied training motions and tests of the remaining mechanical suspects. And to leave the tablet behind, the arm needs its own view of what happens between its encoders and the pen.
Four questions to check yourself
Pan is off by 4 mrad. Roughly how far is the pen off along x? (a) 0.09 mm (b) 0.9 mm (c) 9 mm
Answer
(b). 4 mrad × 0.231 mm/mrad ≈ 0.92 mm. The 231 mm lever does the multiplying.
A perfect torque model removes all tracking error. Can the uncorrected controller then reach 1.0 mm? (a) Yes (b) No, it stops near 2.22 mm (c) Yes, once you also subtract about 0.1 mm of score noise
Answer
(b). Setting tr = 0 leaves u, and the decomposition gives 2.22 mm. A tenth of a millimeter of noise can't close a 1.2 mm gap; only a change to the path itself reaches u.
Baselines read 1.057 and 1.14 mm, and a candidate between them reads 1.00 mm. What do you conclude? (a) The candidate wins by 0.057 mm (b) The test is inconclusive (c) The candidate wins by 0.14 mm
Answer
(b). The baseline moved about 0.08 mm within the block, more than the apparent gain. Repeat the bracketed comparison.
You double a joint's gain and its dead band stays the same size. Which mechanism does that point to? (a) Friction (b) Backlash
Answer
(b). A friction band follows e = T/P and halves when P doubles. A geometric gap does not depend on P. Mixed mechanisms shrink only partly.