The SO-101's joint encoder counts 4096 ticks per turn, so the finest angle it can report is 1.534 milliradians (mrad). The joint doesn't move in ticks, though. Spring, damping and inertia carry it smoothly between readings, and we grade the controller on the true angle. So can the controller know the angle better than the sensor that measures it? I think this is the fun part. The sensor gives us rounded snapshots, but the joint has to move continuously between them, and that turns out to be enough.

The real SO-101 draws a kitten with a pen on a Wacom tablet. The clip shows 88 s of drawing at 4× speed, so it lasts 22 s. Open the video.

One reading on its own can't do it. Rounding to the nearest tick leaves an error somewhere in ±½ tick. If the angle is equally likely to sit anywhere inside the tick, that error comes to 0.443 mrad RMS. Tiny, until you ask the readings for more than position. To estimate acceleration you'd look at how much the reading changes between samples, then how much that change changes, and each step divides a tick-sized error by the short sample time. (That's why the model-based controllers take acceleration from the planned path, which has no ticks in it.) A one-step inverse has a second amplifier: it asks which goal will make the slow servo (dead time and lag) reach the target on the next step. Its weak response over that short interval multiplies measurement and model errors. Let's follow one joint, sampled 30 times a second, through both problems and the fix.

One joint, one 30 Hz step: rounding, amplification and the observer fixFive panels. 1: a smooth true angle and the stepped encoder reading. 1 tick equals 1.534 mrad and the RMS rounding error is 0.443 mrad. 2: the second difference of readings turns one tick into about 1.4 rad/s squared at 30 Hz, and four times that at 60 Hz. In simulation the servo moves the joint 0.15 tick per goal tick in one 33 ms step, so inverting it turns one tick of correction into about 7 goal ticks. The planned path gives clean acceleration. 3: an observer step. Previous estimate 10.0, prediction 11.2, reading 12.3, innovation 1.1, estimate 11.2 plus 0.4 times 1.1 equals 11.64 mrad. 4: the Kalman gain K equals P over P plus R, with R equal to 0.196 mrad squared. If P equals R, the error drops from 0.443 to 0.31 mrad. Each step P grows by Q and then shrinks by the factor 1 minus K. With fixed Q and R, K settles. An angle reading also corrects speed. 5: simulated tracking error is 0.398 mrad without an observer, 0.268 with the alpha 0.4 observer and 0.228 with a perfect sensor. Goal change per step falls from 39.1 to 5.9 mrad. A 24 s fit tracks as well as the true parameters, and 1152 s gives no improvement.One joint, one 30 Hz step① The encoder rounds1 tickerror ≤ ½ ticktrue angle (smooth)reading (steps)4096 ticks/turn → 1 tick = 1.534 mraderror spread evenly in ±½ tick → RMS 0.443 mrad② Two ways one tick gets blown upDifferentiate readingsa ≈ (qk − 2qk−1 + qk−2) / Δt²a: estimated accelerationqk: encoder reading at sample kΔt: time between readingsone tick at 30 Hz:1.534 mrad × 30² ≈ 1.4 rad/s²as big as fast motion60 Hz: 4× worseInvert the servogoal +1 tickjoint +0.15 tick at 33 ms1 tick of correction needs≈ 1/0.15 ≈ 7 goal ticks(sim, 0.3 rad/s; lag 78 ms)Accel fix: differentiate the planned path. No ticks in it.③ Angle fix: predict, compare, move part waymodelinnovation 12.3 − 11.2 = 1.1was 10.0predict 11.2read 12.3mradestimate 11.6411.64 = 11.2 + α × 1.1, with α = 0.4α: share of the innovation we accept. Repeat every sample.④ How far? Weigh the two errorsK = P / (P + R)K: the computed α(errors independent)P: prediction variance (model error)R: reading variance = (1.534/√12)² = 0.196 mrad²α = 0.40.5 if P = R0: trust prediction1: trust readingbigger P → K up; bigger R → K downP = R → K = 0.5: error 0.443 → 0.31 mradEach step, angle only:predict: P ← P + Q (Q: model variance per step)correct: P ← (1 − K) Pfixed Q and R → K settles to one fixed αAngle and speed together:a wrong speed predicts a wrong next angle.The covariance tracks that link, so oneangle reading corrects speed too.⑤ Result in simulation, Fitted modelno observerobserver α = 0.4perfect sensor0.3980.2680.228tracking error, mradone reading: 0.443goal change per step: 39.1 → 5.9 mrad4 params fitted from 24 s: tracking ≈ true params1152 s: no better. Rounding dominates what is left.

Try ②: one tick of rounding adds 1.534 mrad ÷ Δt² to the acceleration estimate. That is about 1.4 rad/s² at 30 Hz and four times as much at 60 Hz.

Predict ②: a reading jumps +1 tick from rounding alone. The one-step inverse moves the goal about 1/0.15 ≈ 7 ticks to chase it.

Try ③: a small α trusts the model and drifts when the model is wrong. α = 1 copies the readings, rounding and all.

Try ④: with fixed Q and R, K approaches a fixed value. This can take more than 12 readings. A larger Q raises K, and a larger R lowers it.

Predict ⑤: 1152 s of fitting data does no better than 24 s, because tick rounding dominates the remaining error.

The numbers in ③ and the P = R case in ④ are illustrations. The servo response in ② and the results in ⑤ come from simulation. The widgets compute their numbers live on illustrative paths.

The same trick finds forces nobody modeled. Suppose the gripper carries a load our model doesn't know about, or the arm sags. Now the readings land on the same side of the prediction, step after step. So we give the filter one more number to estimate: the extra torque d. That torque changes the predicted speed, which changes the predicted angle, and the filter moves d up or down until the readings stop landing on one side. It learns how big the force is, never what causes it. ③ estimates the joint's state (angle and speed), and d is a disturbance estimate. It helps to keep the two apart. In solve and mpc, each 30 Hz step applies Δt/0.3 s (about 11%) of the correction that the latest mismatch suggests, and the controller subtracts the estimate from the goal it sends. mpca runs a Kalman filter with two terms instead: a load that can change fast and sag that changes slowly (how the goal formula uses them).

A smoother angle estimate makes the commanded goal flip between neighboring ticks less often. One kind of chatter stays. The planned path can keep asking the servo to reverse direction by small amounts. Inside the servo's dead band, where small commands produce no motion, those commands rattle back and forth, and a reversal gate holds them off. So give each problem its own fix: fuse model and readings for rounding noise and model error, take acceleration from the planned path, plan around servo lag with the model, and gate the dead-band reversals.