Robo Arm
Sixty robot arms, sixty random muscle brains. Each must grab the orange cube at A and drop it on the green pad at B. Press Play!
How the best half did, round by round
Checkpoints — the champion arm from each round. Tap to watch it work on today's table.
How it works
Ten senses
Each arm feels its two joint angles and how fast they swing, where its goal is, whether it holds the cube, how closed its claw is and how high it is.
Squeeze muscles
Every joint has a lift muscle and a lower muscle. The brain squeezes each one from 0 to 100%. The stronger side wins, and the joint turns. Gravity is always pulling the arm down!
Pick, carry, drop
Points for getting the claw to the cube, gripping it, carrying it toward B, and letting go over the pad. Wasting muscle power costs a little.
Copy with changes
Babies get their parents' brains with small random changes. Smoother muscle control means more babies.
Make it harder
Weak muscles, a heavy cube or a sliding pad break old tricks. The arms have to find new ones.
What just happened?
- In round 1 the arms flopped about: muscles squeezed at random and gravity won. Nobody told them how an arm works.
- Round after round, arms that happened to move the claw toward the cube had more babies. First they learned to reach, then to grip, then to carry and drop.
- Challenges changed the rules. Scores fell, then climbed again as the arms found new tricks. That is adapting.
- Factory robots do this job with hand-designed controllers. Research robots also learn it from rewards, like this, but with far more practice.
For grown-ups: what's really going on
This is neuroevolution: 60 small feed-forward networks [10 → 12 → 5] (tanh) improved by a genetic algorithm, with no gradients and no labels. The arm is a two-link planar manipulator with gravity, so it must actively hold itself up. That makes it a feedback control problem, like the drone and pole demos.
- Muscles: each joint has an antagonist pair. Activations (0..1) follow the brain's command through a first-order lag, so muscles take a moment to tense. Joint torque is
K · (lower − lift)plus gravity, which depends on the link angles and on the cube when it is held. Damping and joint limits keep the motion stable. - Inputs (10): shoulder and elbow angles, both angular velocities, the vector from claw to goal (the cube before the grasp, a point above the pad after), whether the cube is held, how closed the claw is, whether the cube is within reach, and the claw's height. Outputs (5): four muscle commands and a claw squeeze (positive = close).
- Grasp rule: the claw must be within 22 px of the cube with the grip more than 60% closed; it lets go when the grip falls below 45%. A released cube falls under gravity, and the delivery counts only if it lands on the pad.
- Fitness: closeness of the claw to the cube (with extra credit for coming very close), +45 for a grasp plus up to +40 for carrying the cube toward B, +100 plus a speed bonus for a delivery, a small penalty for a miss, and a small penalty for average muscle activation so the arms learn to move economically. Scores are summed over two random tables per round (one shown, one scored in the background).
- Genetic algorithm: the top 8% survive unchanged, the rest are children of the top quarter (30% uniform crossover) with Gaussian mutation whose size is spread from small to large.
- Measured in Node (best half of the fleet, one run): about 70% of the best arms could grip the cube by round 5 and 90% by round 20. Deliveries took longer: about 30% by round 35 and around 50% from round 50 on, with round-to-round swings because every round uses new cube and pad positions. The shoulder sits well above the table on purpose: with a low shoulder the cube at A was out of reach for any arm pose.
- The classic alternative: compute joint angles with inverse kinematics, plan a smooth path, and track it with a PID or computed-torque controller. Industrial arms do exactly that, with torque motors instead of muscles. Evolving muscle activations is slower and less precise but needs no model of the arm at all, and it resembles how a nervous system might learn.