Hadrien Cornier GitHub

Essays & explorations / 37 essays

Learning robotics.

Experiments, diagrams, and questions from learning how robots move, learn, and make decisions.

Series · 9 parts ·

Reinforcement learning, one problem at a time

Speedrunning RL for an ML practitioner

The problems that shaped reinforcement learning, from Q-learning to fixed datasets and flow policies, following Sutton and Barto.

Start with Part 0
Show all 9 partsHide the parts
  1. Part 0Pick an RL algorithm by reading the symptomWhy I am learning reinforcement learning, and the six problems that drive its algorithms: delayed reward, exploration, waiting, scale, reusing data and feedback.3 min
  2. Part 1Foundations of value-based RL: a family tree and a Q tableOne selected branch of RL, the value-based methods from the trial-and-error idea to DQN, where each later method fixes a problem an earlier one handles badly. Then Q-learning, which nudges one score toward the reward plus its best guess about the next cell.47 min
  3. Part 2Bootstrapping: learning what a state is worth before the reward arrivesWhy waiting for the final reward is slow, and how borrowing the next state's estimate lets you learn during the walk, with one worked update.9 min
  4. Part 3Shared weights: how one update reaches states you never visitedWhen states share a few weights, one update can teach states you never visited, and it can also blur two states together and move the target you're chasing.4 min
  5. Part 4On-policy and off-policy: whose future are we learning?A value target has to assume what you do next: on-policy learning assumes the moves you actually make, and off-policy learning assumes a different policy's moves.17 min
  6. Part 5The deadly triad: value estimates that grow on zero rewardFunction approximation, bootstrapping and off-policy data each make RL practical. Off-policy value learners such as deep Q-networks (DQN) and soft actor-critic (SAC) use all three, even though together they can let a prediction feed its own target with nothing to pull it back down.5 min
  7. Part 6Which actions deserve the credit?Four ways a policy-gradient update can go wrong on a robot task: blaming actions for the past, rewarding every attempt, overshooting on reused data, and groups that teach nothing. Reward-to-go, baselines, PPO clipping and group advantages, with their limits.7 min
  8. Part 7Learning from a frozen robot log: three ways it breaksA fixed robot dataset can mislead a learner in two different ways: a hole, where it asks about actions nobody tried, and mistakes, where it copies bad demonstrations. Stay close to the data for the first, and weight actions by the reward for the second.3 min
  9. Part 8Mode averaging: two good routes, one bad averageWhy copying demonstrations that go left and right around a box can send a robot into the box, and what flow policies and action chunks change.14 min

Series · 8 parts ·

Precise control of the SO-101 arm

How I built the best controller for the SO-101

Why a low-cost servo arm misses its target, and what sensing, goal choice, learned corrections, a pen holder and a drawing tablet do about it.

Start with Part 1
Show all 8 partsHide the parts
  1. Part 1Target and goal: what to send an SO-101 servoStart from torque = inertia × acceleration, then add each term a cheap servo arm really has: gravity, friction, a payload, dead time, a dead band. Each term is one way the arm misses its target.28 min
  2. Part 2Finer than the sensorThe sensor side of the joint equation: why differences of encoder ticks explode the noise, and how an observer or a Kalman filter can estimate an angle finer than one tick.4 min
  3. Part 3Six ways to choose the goalOne general formula for the goal sent to a servo. Every controller I built, from a plain look-ahead to MPC, is that formula with some terms set to zero.35 min
  4. Part 4Learning what physics misses, and how far the gain reachesWhere a neural network fits in a robot controller. A network that learns only what the physics model gets wrong does the same job as a Kalman disturbance estimate, with more freedom, and this is where recent research is going.7 min
  5. Part 5HardwareA pen holder that shows the arm’s error, not its ownI want to see my SO-101 trajectory errors as ink on paper. For that, the pen must not add an error of its own. I made five holder designs. The one I release is a printed sleeve that slides onto the stock gripper: 4 printed parts, nothing to buy, any pen from 8 to 13 mm.24 min
  6. Part 6Where the last millimeter goesMy SO-101 arm cannot see its own pen tip. A tablet can. Here is what the tablet showed: how much error a learned correction removes, which causes are left, and why the base joint matters most.22 min
  7. Part 7Teaching my drawing arm to keep learningAfter part 6: direct motor drive, learning between drawings, feedback during a stroke, and a twin tested across days. The repeat floor is not a claim of one-millimeter control.12 min
  8. Part 8Measuring the tool in 3DI get $10,000 worth of measurements from a $40 drawing tablet. Now I want the height of the pen too.5 min
19 min readDiagram of OpenVLA: the input image goes through DinoV2 and SigLIP encoders and an MLP projector, the instruction goes through the Llama tokenizer, Llama 2 7B processes both, and an action de-tokenizer outputs a 7D robot action: change in position, rotation and gripper.

Why I am learning robotics

The most impressive robots of the last decade stayed in videos because they could not generalize. Language models changed that, and robotics now looks like language models in 2019.

roboticsindustry