TUMBRINK
LogMotion-Control Rig V3

Inverse kinematics on the Pi 5

Moved IK solving off the ESP32 onto a Raspberry Pi 5. The rig now flies coordinated eight-axis moves from a single camera-path definition.

The problem with IK on a microcontroller

The ESP32 was doing two jobs: solving where eight joints need to be for a given camera position, and generating clean step pulses for eight TMC2209 drivers. The second job is hard real-time. The first one is floating-point-heavy and wants headroom for iteration. On one core budget, they fight — and the symptom was subtle timing jitter exactly when the solve got expensive, in the middle of the most interesting moves.

Splitting the brain

The fix is the same split every serious motion system uses: a planner and a step generator. The Raspberry Pi 5 now owns the kinematics. The ESP32 keeps the one job it is genuinely great at — jitter-free step timing — and consumes joint-space targets streamed over serial.

Camera paths are defined once, in world coordinates: where the camera is, where it looks, how it rolls, over time. Nobody thinks in joint angles anymore. The machine figures out the rest.

The solver

Eight axes for a six-degree camera pose means the rig is redundant — there are infinitely many joint solutions for most poses. The solver uses that freedom instead of fighting it: the travelling counterweight tracks the arm to keep the base moment low, and the X-dolly resolves reach limits so the arm stays in its sweet range.

It's a damped least-squares solve over the pose error, with the redundancy resolved by secondary objectives. Numeric, not analytic — boring, robust, and fast enough at a few hundred solves per second on the Pi.

Latency and timing

The Pi streams joint targets ahead of real time into a buffer on the ESP32, which interpolates between them at step resolution. A two-frame buffer absorbs scheduling hiccups on the Linux side; the steppers never feel them. If the buffer ever runs dry, the rig ramps to a stop on the path instead of jumping — a miniature six inches from the lens makes you think about failure modes.

What this unlocks

Repeatability was already there mechanically; now it's there end-to-end. A camera path is a file. Run it today with the key light, run it tomorrow with practicals only, and the frames line up. That is the foundation ALIVE stands on — multi-pass photography of the same move in different lighting states.