The simulator
A free 3D robot arm simulator powered by Blockly
Learn robot programming online in a browser-based digital twin. Build Blockly programs on the left, simulate a five-joint arm in the middle, and inspect collision checks and scores on the right.
The arm
Five joints, in a chain
Servo mode drives one joint at a time to an absolute angle, so the learner works out the angles. Certified Cutter Grid practice is the exception: its fixed-world moves are compiled through deterministic inverse kinematics before execution.
| Joint | Axis | Range | Initial | Speed |
|---|---|---|---|---|
| Base YawbaseYaw | X | 30° … 150° | 90° | 60°/s |
| Shoulder Roll (simulation only)shoulderRoll | — | -45° … 45° | 0° | 45°/s |
| Shouldershoulder | Y | 30° … 150° | 90° | 45°/s |
| Elbowelbow | Z | 17.5° … 162.5° | 90° | 60°/s |
| Wristwrist | B | 0° … 180° | 90° | 75°/s |
X, Y, Z, B, and the parked cutter axis E all start at the firmware Home value of 90°. Shoulder Roll exists only in the simulation and starts at 0°. Geometry offsets map that hardware state to one safe rendered pose; there is no hidden second starting pose.
The blocks
Three Servo blocks, plus certified Cutter Grid moves
Servo mode uses angle, wait, and repeat blocks. Cutter Grid practice adds six fixed-world directions and integer distances. Blockly emits validated Program IR, never JavaScript, and the planner freezes a deterministic joint trajectory before replay.
set <joint> to <angle>°
Drives one joint to an absolute angle. The joint list comes from the challenge, and an angle outside the joint’s range is rejected before the program runs.
wait <ms>
Holds the current pose. Accepts 0 to 5000 milliseconds.
repeat <n> times
Runs the blocks inside it 1 to 20 times. A loop costs one block instead of n, which is where most of the efficiency score is won.
Head clearance
A refusal, not a collision
The head is not made of voxels and cannot be cut. Before the simulator commits a command, it continuously sweeps the tool path against the head geometry. This is a geometric constraint, so a fast move cannot tunnel through a physics-engine tolerance.
If the sweep finds contact, the run stops at the last safe pose. The source block is highlighted and the simulation enters a recoverable error state. The renderer never hides a correction: when the arm stops, the interface identifies the block responsible.
What the log says
12:04:31 run started · challenge neat-short-haircut
12:04:31 shoulderRoll → 15°
12:04:32 shoulder → 72°
12:04:33 elbow → 10° refused · head clearance · holding last safe pose
12:04:33 state → error (recoverable) · block 3
Scoring
What the score is made of
Three sub-scores, each clamped to 0–100, combined with fixed weights. The displayed number carries one decimal; full precision is kept internally.
Completion
×0.60|Target ∩ Result| / |Target ∪ Result| × 100
Voxel IoU against the target hairstyle. Cutting too much costs exactly as much as cutting too little.
Efficiency
×0.25min(100, ReferenceProgramCost / ProgramCost × 100)
Program cost is source blocks plus 0.25 per executed command, so a loop is cheaper than the same moves written out.
Time
×0.15min(100, ReferenceTimeMs / EstimatedDurationMs × 100)
Estimated from joint travel and speed, never measured from the browser. A slow laptop cannot cost you points.
Final score
0.60 × Completion + 0.25 × Efficiency + 0.15 × Time
If a provider supplies weights that do not add up to 1, the simulator reports a clear error instead of silently normalizing them.
Calibrated reference: Neat Short Haircut
The starter program scores at least 80 for completion and deliberately leaves room to improve. Matching it is not the ceiling.
Controls
Running a program
- Run
- Executes from the challenge’s initial state.
- Pause / Resume
- Stops and restarts the clock without losing the pose.
- Step
- Completes exactly one atomic command, from idle or paused.
- Stop
- Ends the run without recording a score. The panel shows provisional completion only.
- Reset
- Restores the simulation and keeps your program.
- Test
- Evaluates the program headlessly, same engine and same result, in milliseconds.
Honestly
What is not built
Listing this is cheaper than letting someone discover it in a classroom.
- Accounts and saved workspaces
- Generic runtime inverse kinematics outside the certified Cutter Grid planner
- Scissor actuation or a physics engine
- Realistic hair strands (the simulator uses voxels)
- Robot self-collision
- A dedicated mobile build
- MQTT transport in the app (specified, not yet wired)
- Sign-in and verified player identities
Questions
Asked often
- Do we need to buy a robot?
- No. The simulator is the product and it runs in a browser. The physical arm exists, and the firmware is open, but nothing on the teaching path depends on owning one.
- What does it run on?
- Use Chrome or Edge on a desktop at roughly 1280×720 or larger. The 3D workbench expects a keyboard and pointer, and there is no dedicated mobile build.
- Can a student cheat the score?
- In a versus round the program is replayed on the server and the score is the server’s. Nothing the browser reports is trusted, and the estimated execution time is computed from joint travel rather than measured, so hardware differences cannot move it.
- Can the robot hit the head?
- No. Head clearance is a geometric constraint checked by a continuous swept test, not a physics simulation with a tolerance. On contact the arm stops at its last safe pose and enters a recoverable error state.
- Does it need an account?
- Solo practice does not require one. Accounts and saved workspaces are not implemented yet; the list below shows the remaining gaps.
- Is it finished?
- The public web client and Rust API are deployed. The Servo loop, Cutter Grid practice and lessons, solo mode, and versus mode are playable and covered by Chrome and Edge acceptance. Accounts, saved workspaces, app-side MQTT, and dedicated mobile support are not implemented.