A robot brain small enough to run on the robot's own chip. Play with the robot and watch the brain think, live.
A robot brain that fits on a chip
SHARANG is a 46 cm two-legged robot. Its brain, TinyWorld, is a small world model that runs on the robot's own microcontroller, with no laptop and no cloud. Fifty times a second it reads the sensors, sets all ten motors, and imagines the next half second to warn when a fall is coming.
196 kBthe whole brain
1.45 msto think, every 20 ms
0 / 144falls in simulated tests
40 sstanding on the real robot, run from its chip
The robot here is a physics copy of the real one, run by the exact numbers stored on its chip.
Try this
Watch: TinyWorld alone bends the knees and keeps the body upright, and the diagram under the robot shows its brain at work.
Coloured words match the parts of the brain in the diagram: point at one to light it up and see what it means. Each step has one thing to try.
For engineers
Every 20 ms TinyWorld reads 66 sensor numbers, updates a 128-number memory, picks a 16-part latent state and sends 10 joint commands; it also rolls its memory forward to forecast a fall.
The simulation is MuJoCo built from SHARANG's CAD parts, driven by TinyWorld's int8 weights (the ones flashed on its STM32N6) through a servo model fitted to the real robot's logs. Everything in the diagram is computed live from this robot.
The body it has to balance
Ten motors, five per leg: hip roll, hip pitch, knee, ankle pitch and ankle roll. Point at a name to find it on the robot and in the diagram.
46 cmtall
≈2.05 kgprinted in PETG
≈US$311of parts
STM32N6the chip
The motors are slow and answer late, by up to 0.23 s. That is why the brain was trained against a model of exactly how slow they are. It never practised being pulled: it holds a 3 N rope (the weight of about 300 g) and topples at 4 N.
Try this
Watch: the weight moving between the feet in Feet and motors, and the caption under the robot that says what changed.
For engineers
Ten ST3215 serial-bus servos report position, speed, load and temperature. Under load they show up to 228 ms of delay and about 6.5 rad/s² of acceleration, so the controller was trained against a model of them. E19 never trained with a rope: it holds about 3 N and topples at 4 N.
Feet and motors: weight on each foot and its pressure point from the contact forces; motor load = joint torque / 2.9 N·m servo maximum, the same unit the real servos report.
Read, think, move: 50 times a second
Every 20 ms the same loop runs: read the sensors, let TinyWorld think, send new targets to the motors, let the robot move, and read again. Thinking takes 1.45 ms. The whole loop, with the half-second forecast, uses 9.51 ms of the 20.
1.45 ms thinking9.51 ms used20 ms tick
When it walks, a second small network on the same chip, the teacher, sets the motors while TinyWorld keeps forecasting. Step 7 says why.
Try this
Watch: it stands still for 3 s first, as the real robot does. Then the rows of the diagram follow the rhythm of the steps. Set Speed to ¼× to follow one step.
For engineers
The loop: sensors → TinyWorld → 10 commands → a jerk-limited S-curve filter → the servos (delay, lag, speed and acceleration limits fitted to the robot's own logs) → physics → sensors again. Each command is a correction on a scripted gait: joint target = base pose + 0.3 × command.
On the STM32N6 at 600 MHz one world-model step takes 1.45 ms; the whole tick, with 5 imagined steps, took 9.51 ms of the 20 ms. The diagram smooths over about 0.4 s of robot time so the rhythm is readable. By default the colours show change: how far each number has moved from its own 1 s average, so a steady stance looks calm and a push stands out; switch to "value" to see the numbers themselves. Point at any value for the exact, unsmoothed number. The moving dots on the wires show direction only: the real pass through the network takes 1.45 ms.
Timing: README and mcu/RESULTS_ON_CHIP.md.
Inside the brain, in five parts
Sensors: what it feels. Which way is down, how fast it turns, every joint's angle and speed: 66 numbers.
Encoder: squeezes those into a 64-number summary.
Memory: 128 numbers carried from tick to tick, so it knows what just happened, not only what is happening.
Latent state: a short code for the situation now: 16 slots, each picking 1 of 8 options.
Actor: turns code and memory into the 10 motor targets. The fall head reads the same numbers and gives the chance of a fall.
Why a memory? The motors answer up to 0.23 s late, so the brain has to remember what it asked for and what has happened since.
In the diagram the encoder, memory and latent state sit together as the world model: its picture of what is happening. The actor and the fall head form policy and risk: both read the same 320 numbers (latent 128 + memory 128 + summary 64).
Try this
Watch: every square is one real int8 number on the chip. Point at a row to see the actual sum it computes.
For engineers
The encoder is three 64-unit layers (symlog → Linear, RMSNorm, SiLU). The memory is a GRU split into 4 independent blocks of 32: each block keeps its own 32 numbers and reads shared summaries of the old memory, the old latent and the last command.
From the new memory and the summary, the posterior scores 8 classes in each of 16 groups and the chip keeps the most likely class: that is the latent state. The actor reads latent, memory and summary (320 numbers) through three layers of 64 and outputs the joint commands; a separate fall head reads the same 320 numbers.
178,304 int8 weights and 4,396 scales in 21 layers: 195,888 bytes on the chip.
Seeing a fall coming
TinyWorld has two alarms. The fall head answers at once: how likely is a fall in the next half second? Imagination looks ahead: the brain plays the next 25 ticks forward in its head, without sensors, and adds up the danger.
In our test a 6 N pull toppled the robot in 0.42 s. The fall head passed 50% 0.26 s before it went down, imagination 0.12 s before.
Try this
Watch: the red Fall head and pink Imagined risk bars climb before the robot goes down, and the imagination's curve in the diagram crosses its 50% line. Click a time in the event list afterwards to replay the moment.
Honest result: in simulation the direct alarm ranked falls better than imagination, and acting on either alarm was no better than a simple tilt rule.
For engineers
To forecast, TinyWorld runs its memory forward 25 steps (0.5 s) without sensors, holding the last command. A prior guesses each latent from memory alone and a continue head gives the chance of no fall at each step: imagined risk = 1 − the product. The chip runs 5 imagined steps per tick, so a new forecast arrives every 0.1 s; so does this page.
Fall ranking in simulation: fall head ROC-AUC 0.989–0.992, imagined rollouts 0.902–0.942.
A teacher network learned by trial and error in simulation, against a model of the real motors.
TinyWorld learned from the teacher: control first, prediction second.
It was shrunk to 8-bit whole numbers and written out as C code.
It was tested on a chip in the loop, then on the real robot.
Why control first? Learning to balance before learning to predict gave 0 falls in 144 simulated tests, against 20 and 65 when everything was learned at once.
For engineers
A teacher learned corrections on a scripted gait with reinforcement learning in MuJoCo, against the fitted servo model. TinyWorld then learned from the teacher control first: imitation, then world-model heads on a frozen state, then a gated fine-tune.
The student was compiled to per-row int8 C, checked against PyTorch, run in hardware-in-the-loop, and finally put on the robot.
README, report §3.3-3.4 and §5.1-5.2.
On the real robot, and what is not done yet
On 19 November 2026 TinyWorld, running on the robot's own chip, stood the real robot for 40 s, sat down, held the sit for 7.9 s and stood back up in 1.2 s. Under the robot is the chip's own log of that run.
Try this
Watch: the side view moves with the angles the servos reported; the two alarms jump during the lurch into the sit, then settle.
Not done yet
TinyWorld has not yet walked the real robot from the chip. Real walks ran from a laptop with a steadying hand (15 of 36 twenty-second trials completed). On the chip, as here, a teacher network walks and TinyWorld forecasts. Its fall alarm has not yet been checked on real falls.
Try this
In simulation, under the real motor limits, it falls in most walks.
For engineers
19 Nov: E19 in SHARANG OS on the STM32N6 stood 40.1 s, sat, settled after a lurch to 16.7° and held 7.9 s, then stood up in 1.2 s. The day before, E18 stood the robot for 42.1 s and 9.0 s at a mean tilt of 2.95°. With the robot held and limp, a hand tilt pushed the chip's risk past 0.5 at 13.7°, 0.44 s before the 20° stop.
Code, models and data: TinyWorld_World-Model_on_MCU. Simulation: MuJoCo 4.0.1 (WebAssembly); its control loop matches the training environment tick for tick.
Loading…
Tilt–Fall head–Imagined risk–
Weight
left – · right –
motor loadleftright
% of max torque · red line = 60% limit
step height –
Drag the body to pull · drag the floor to turn · scroll to zoom
Loading the physics engine and the robot…
Skill
Push
What just happened: push, pull or change the skill and each event is explained here, with the rows it touched lit in the diagram. Click a time to replay that moment.
1 Teach
Residual reinforcement learning on a scripted gait, MuJoCo MJX, servo model fitted to real logs.
6–44×
calmer standing than the first policy, on the real robot
2 Distil
Control first: imitation → world-model heads on a frozen state → gated fine-tune.
0 / 144
simulated falls, against 20 and 65 for joint training
3 Compile
Per-row int8 C (wm_step.c), checked against PyTorch.
195,888 B
3.4×10⁻⁶ (fp32) and 2.4×10⁻⁴ (int8×int16) max error
4 Test
Hardware-in-the-loop on an STM32G474, then the real robot on its STM32N6.
7,200
HIL steps with 0 falls; real stands, sit and stand-up from the chip