cadence / robot arm / helpBack to the demo

Robot Arm

A robot arm on a table picks up a red block and puts it in one of two bins. A lit lamp names the bin it should use. You can move that bin while the arm carries the block, and the arm follows it.

What it shows about CadenceThe arm’s brain runs in real time, like the brain of a living being: about five times a second it senses where its hand, the block and the target bin are, and settles on its next move. Because it senses the bin anew at every decision, moving the bin in the middle of a carry, something it never met while it learned, turns its next moves toward the new place. It needs no new lesson for that. The brain also has a real state that lasts from moment to moment: a working memory of the last moments.

What you see

On the left, the arm in a physics simulation. On the right, its brain, live. Both run inside your browser.

1 2 3 4 5 6 7 8 9
The page at 1280 by 800 pixels, while the arm carries the block toward bin A. The numbers match the list below.
  1. The arm, a Franka Panda robot with a two-finger gripper (its hand), simulated with real contact physics: the block can slip, tip and bounce. A blue trail follows the fingertips, and a small blue dot marks where the brain’s last move sends the hand.
  2. The block, the thing the arm picks up.
  3. The target bin (here bin A), with its lamp lit. The words over it say which bin it is. While the arm carries the block they read “drag bin A”: that is the moment to move it. A small amber dot above the bin marks where the hand lets go.
  4. The other bin (here bin B), with its lamp dark.
  5. The line at the top left says what is happening and what you can do next.
  6. The buttons: which bin is the target, Run (Stop while it runs), Reset, Shuffle, and the speed.
  7. Motor, the next move: what the brain chose at this decision. Three rows of bars for moving the hand −2 to +2 cm along x, y and z, and one for open or close. The outlined bar is the choice.
  8. The brain’s layers: Layer 3 (the top), the working memory beside it with its history (memory over time), then Layer 2 and Layer 1. Every square is a neuron, brighter when more active. Lines show the strongest signals: cyan going up, violet coming back down, teal from the working memory.
  9. The senses: what the brain is told at each decision, in groups. The group Target bin − hand is where the target bin is, seen from the hand; it changes the moment you move the bin.

Above the brain, three numbers: Decision (how many moves so far), Settle (how many sweeps the brain took to settle; on every second decision the panel replays the settle sweep by sweep and this counts along) and Think (how long the settle took in your browser). Every part of the page has a small ?, or explains itself when you rest the pointer on it.

Why it matters

A living brain runs in real time. It senses, settles and acts in one continuing loop, so a change in the world changes the next move. A robot needs the same, because things around it move. This brain decides about five times per second of arm time, and each decision gives it 200 ms. In your browser one settle takes tens of milliseconds (a median of 16.3 ms in the page check), so the arm on screen moves at the speed of real time, without pauses.

It meets something new without a new lesson. While it learned, the bins never moved: they stood at two fixed places. Here you can move the target bin in the middle of a carry. The brain senses the bin’s new place at its next decision, and the moves it settles on head there. Its synapses stay exactly as they were trained; nothing is retrained.

Its answer is the settled state of the whole brain. At each decision the senses, the three layers, the working memory and the motor neurons settle together into one state, signals going up and coming back down, and the move is read from that state. Every second decision the panel replays that settle, sweep by sweep.

A fair comparison. A conventional network of the same task, trained by backpropagation on the same teacher (a control), placed as many blocks on the physics it trained on: 0.968 against 0.973 for this brain’s design, and on held-out physics it did better, 0.738 against 0.698. The moved bin was tested on Cadence brains only. So this page shows a real-time brain that settles and follows a moving target; it does not show an advantage over a conventional network on this task. What the brain did beyond its teacher: on the hardest physics it never trained on (light, slippery, bouncy blocks), it placed 0.465 of the blocks, the teacher it learned from 0.295.

What you can do

How it works

The senses. At each decision the brain is given 262 numbers about the true state of the scene (not camera pixels): where the hand is; where the block is, seen from the hand; where the target bin is, seen from the hand; the angles and speeds of the arm’s seven joints; how far the gripper is open, and whether it is closed and holding; its own last move, fed back in; and which lamp is lit.

The brain. One deep Cadence brain (Brain.compose) with three layers of 256, 128 and 64 neurons, a working memory of 64, and 17 motor neurons: 791 neurons and 155,264 synapses. Each higher layer sends a signal back down to the one below (the apical, top-down signal). At each decision the whole brain settles: its parts repair their disagreements with one another until they agree, and the strongest motor neuron in each row gives the move.

Its memory. Long-term, what it knows lives in its synapses, learned during its life and unchanged on this page. Short-term, the working memory is written at every decision and read by Layer 3, so the last moments shape the next move; it starts empty at each Run.

Its acts. Each decision moves the hand by −2 to +2 cm along x, y and z and opens or closes the gripper. A fixed reflex (inverse kinematics, part of the application, not learned) turns the hand move into targets for the seven joints, and the physics then runs 0.2 s of arm time.

How it learned. By imitating a scripted teacher (reach over the block, close, lift, carry, let go) for 400 episodes, with the block’s size, mass, friction and bounciness varied. A lesson came only where the brain disagreed with the teacher. At first the teacher moved the arm half of the time; by the end the brain did all of it. The bins stood at their two places the whole time. There is no reward in this demo.

Following a moved bin. One of the senses is where the target bin is, seen from the hand. When you move the bin, those numbers change at the next decision, and the brain settles on moves toward the new place. When you switch the target, the lit lamp and that sense both change.

The page. The physics is MuJoCo 3.17, compiled to WebAssembly, with the same simulated table, arm and bins the brain learned in. The brain is the released Cadence library (cadence-net 0.95.2) running in Python inside your browser (Pyodide). Replayed against recorded Python trials, the page’s brain gives the same command at all 104 recorded decisions.

The numbers

ReadingValueEvidence
On the page, mouse only: the target bin dragged to a new place while the arm carries the block; the block lands in the moved bin5 of 5, in each of two runspromise_moved_bin-20261113-1134.json, promise_moved_bin-20261113-1206.json
On the page: the target switched to the other bin mid-carry; the block lands in that bin1 of 1, in each of two runspromise_moved_bin-20261113-1134.json, promise_moved_bin-20261113-1206.json
On the page: bin B moved to (0.66, −0.12) m mid-carry; placed in the moved bin60 decisionspage_check.json
On the page: time for one settle (median)16.3 mspage_check.json
On the page, on a machine at a load average near 250: time for one settle (median per run); share of arm time shown at clock speed at 1×83 to 114 ms; 0.80 to 0.98promise_moved_bin-20261113-1134.json
On the page at 1×: share of arm time shown on screen at clock speed1.0page_check.json
Target bin put at five places it never trained with, before the trial: blocks placed right, of 20 each20, 19, 19, 20, 19moved_bins.jsonl
Target bin at its two trained places: placed right, of 20 each19, 19moved_bins.jsonl
Target bin in a far corner (0.72, 0.32) m: placed right, of 2010moved_bins.jsonl
Varied physics it trained on, 200 new trials: placed right, brain / teacher0.955 / 0.955stage2b_final.json
Hardest physics it never trained on, 200 trials: placed right, brain / teacher0.465 / 0.295stage2b_final.json
Controls with no learned brain (random moves, a blind brain, a newborn brain): placed right0.0 eachstage2b_final.json
Earlier stage, mean of three seeds: placed right, this brain’s design / backpropagation network (control)0.973 / 0.968stage2_final.json
Earlier stage, held-out physics: this brain’s design / backpropagation network0.698 / 0.738stage2_final.json

Each file is in the demo’s evidence/ folder of the repository. Positions are in metres on the table; the bins learned at (0.62, −0.22) and (0.62, 0.22). The promise run works the real page in a headless browser, with the mouse, as a visitor does (robot-arm/tools/promise_moved_bin.py): it drags the target bin to four new places, as soon as the arm has lifted the block or once it has carried it half the way across, and switches the target once.

Limits