Microduck Simulator is an interactive 3D simulator of Pollen Roboticsโ Microduck, a bipedal duck robot about 25 cm tall and 800 g. It is built on specifications taken from the official microduck runtime and microduck_rl training repositories.
Real robot details used
- Servos: 15 Dynamixel XL330s. IDs are 20โ24 for the left leg, 30โ34 for the neck, head and beak, and 10โ14 for the right leg. The beak (ID 34) is excluded from every policyโs actions.
- Pose and limits: the actual HOME pose and joint limits. Sliders use the real robot convention (radians, signs as in HOME).
- Policy loop: runs at 50 Hz with a 61-D observation (angular velocity, gravity, joint positions, joint velocities, last action, commands) and a 14-D action, both shown live as a heatmap.
- Training settings: velocity command ranges of vx ยฑ0.4 m/s, vy ยฑ0.3 m/s and ฯz ยฑ1.0 rad/s; an air-time reward window of 0.125โ0.3 s; 2 cm foot clearance; battery voltage from 6.5 to 8.2 V; ยฑ1ยฐ backlash; and a ยฑ0.3 m/s push range.
- Policy names: the top bar shows the real task ID for each mode, such as
Mjlab-Velocity-Flat-MicroDuck.
Behaviours
- Walk: drive with the on-screen joystick or W A S D / Q E, and adjust body pose and head commands. Lengthening the gait period pushes air time out of the reward window.
- Roller skates: passive wheels under the feet and a swizzle glide with no foot lift.
- Sit ยท stand (Y): switched by a posture-flag command.
- Beak pick (G): the phase-encoded command can be seen circling in the observation panel. The duck can pick up the block and carry it while walking.
- Ball kick (K / L): shifts weight onto the support foot, then kicks a 70 mm ball.
- Forward roll (R): rolls over the head and lands back on its feet.
- Falls and stand-up: a push that moves the capture point past 62 mm knocks the robot over, and it gets back up by itself.
- Joint control: sliders for all 15 servos, plus the SIT and FOLD keyframes as presets.
- Quack (Space): opens the beak and plays a sound.
Panels
- Live readout: state, commanded and actual speed, trunk tilt, support, capture point and battery.
- Policy I/O: the 61-D observation and 14-D action.
- Foot contact: a contact timeline and the last air time for each foot.
- Servo table: target, actual and error for all 15 servos.
- Controls and overlays: camera presets, a support-polygon and centre-of-mass overlay, backlash and battery settings, and time scale.
Limitations: the motion comes from a kinematic generator (gait phases plus inverse kinematics), not from the trained ONNX policy or MuJoCo physics. Leg geometry is approximate, so poses can differ somewhat from the real robot, especially when the real SIT and FOLD keyframe values are applied directly.
Verified: headless Chromium ran every mode without script errors. Walking air time was 180 ms, inside the reward window. Push โ fall โ stand-up, block pickup and ball kick all worked, and there is no horizontal scroll at phone width.
Sources:
I built and published Build a Transformer, a page that shows how a developer codes the Transformer from โAttention Is All You Needโ in PyTorch, one line at a time.
Layout
- Left, code editor: each chapter has PyTorch code you could actually run.
- โจ Type it out types the code line by line and explains the important lines as they appear.
- Click any line to see what it does and how it changes the tensor shapes.
- Right, visuals: a diagram of how tensor shapes change, plus heat maps of real numbers. The heat maps come from a tiny Transformer (d_model = 8) that runs in your browser.
- Bottom, console: โถ Run cell (Ctrl+Enter) prints results such as
.shapeand parameter counts. They are calculated from the hyperparameters you set in the sidebar.
The 10 chapters
- Embeddings (รโd_model)
- Sinusoidal positional encoding
- Scaled dot-product attention
- Multi-head attention (splitting heads with view/transpose)
- Feed-forward network
- Encoder layer (Add & Norm)
- Decoder layer (causal mask and cross-attention)
- Full model (the output layer reuses the embedding weights)
- Training loop: Adam, a warm-up learning-rate schedule, label smoothing and teacher forcing
- Inference: greedy decoding you can step through one token at a time
Hyperparameters
- Base / Big / Tiny presets are available. The parameter counts come out at about 63.1M for Base and 214M for Big, which closely match the paperโs figures of about 65M and 213M.
- If d_model canโt be divided evenly by h (for example 512 and 12), a warning appears and the console shows an
AssertionError.
Things to keep in mind
- The tiny model behind the heat maps uses random weights that were never trained, so its attention patterns donโt mean anything.
- The German translation in the inference chapter is an example of what a trained model would produce, not real output.
Transformer Architecture is an interactive page that walks through the transformer, the architecture behind ChatGPT, in five stages
Tokens & Embeddings
- Splits your text into tokens (long words become pieces) and gives each one a token ID.
- For a selected token, shows its embedding, the positional encoding and their sum (the input vector) as heat maps, alongside a table of the sin/cos positional encodings.
- A 2D meaning map shows similar words clustering together, and that โking โ man + woman โ queenโ.
Self-Attention
- Computes real dot products from Q, K and V, divides by โd and applies softmax. You get arcs between tokens, the attention matrix and a step-by-step table for the selected row.
- Three heads to switch between: pronoun โ noun, previous token, and uniform averaging.
- In the classic example โThe animal didnโt cross the street because it was too tired / wideโ, โitโ attends to animal (75%) with tired and to street (75%) with wide. Turn on the GPT-style causal mask and โitโ can no longer see the adjective that comes after it, so it is left split between the two nouns.
Transformer Block: an animated step-through of LayerNorm โ multi-head attention โ residual add โ LayerNorm โ feed-forward โ residual add โ ร N layers โ logits. It includes a size comparison of the original Transformer, GPT-2 and GPT-3.
Next-Token Prediction: generates text one token at a time from logits, using temperature-scaled softmax and top-k sampling. Probability bars and entropy are shown, and you can click a candidate to choose the next token yourself.
How It Learns: on โthe cat sat on the ___ โ matโ, shows the cross-entropy loss and its gradient (p โ 1), with a curve of the loss falling at each gradient-descent step.
Some parts are simplified for teaching:
- Vectors have 2โ16 dimensions instead of thousands.
- The attention-head weights are hand-designed so each headโs job is easy to see.
- Next-token prediction uses a small n-gram model built from about 60 sentences instead of a neural network.
Mechatronics Lab is an interactive browser simulator that shows the core loop of mechatronics: sensor โ controller โ actuator โ mechanism. Each module shows the animated device on one side and a live oscilloscope on the other.
Modules
- DC Servo + PID: encoder-based position control with adjustable Kp, Ki, Kd, load torque and encoder resolution. Drag the dial to set a target. A live block diagram shows each stage, and the driver is marked when the voltage saturates at ยฑ12 V.
- Cart-Pole Balancer: an inverted pendulum kept upright by state feedback, with LQR-derived default gains. Click to shove the pole, or move the target to see the non-minimum-phase response, where the cart first moves the wrong way.
- 2-Link Robot Arm: inverse kinematics driving speed-limited joint servos. The gripper can follow the pointer or a circle, figure-8 or square path. The view shows the reachable workspace, out-of-reach targets and singularity warnings.
- Stepper Motor: compares wave, full-step, half-step and 16ร microstep drive, with a live coil-current sequence table. Raising the step rate or load causes lost steps.
- PWM + H-Bridge: shows how duty cycle, PWM frequency and inductance affect current ripple and motor speed. Switch states Q1โQ4 and current flow are visualized.
- IMU Sensor Fusion: a complementary filter combines a noisy accelerometer with a drifting gyroscope. RMS errors are compared live, and you can drag to tilt the board by hand.
Common controls: sliders for each parameter, Space to pause or resume, R to reset. Live readouts show key values such as error, current, speed and lost steps.
An interactive automotive engineering simulator that visualizes how an automatic transmission transfers engine power to the wheels and changes gears.
Explore the torque converter, planetary gearset, automatic shifting, gear ratios, and complete power flow through real-time animated visualizations.
Adjust throttle, vehicle speed, and vehicle load to observe how engine RPM, selected gear, output torque, and transmission behavior change during acceleration and cruising.
The explorer provides an intuitive introduction to automatic transmission mechanics, torque multiplication, gear shifting, and automotive powertrain engineering.
An interactive railway engineering simulator that visualizes the key technologies that enable high-speed trains to operate safely and efficiently.
Explore high-speed running, aerodynamics, distributed traction, braking, curve dynamics, and pantograph power collection through animated engineering visualizations.
Adjust train speed, curve radius, and braking demand to observe how aerodynamic drag, traction power, lateral forces, and vehicle stability change under different operating conditions.
The lab provides an intuitive introduction to high-speed rail engineering, vehicle dynamics, aerodynamic performance, electrical traction, and railway infrastructure.
An interactive propulsion engineering visualizer that demonstrates how a rocket engine converts propellant energy into thrust.
Explore the complete flow from propellant injection and combustion to nozzle expansion and high-velocity exhaust, with animated views of the engineโs internal processes.
Adjust throttle, chamber pressure, and altitude to observe how mass flow, exhaust velocity, thrust, and plume expansion change under different conditions.
The visualizer provides an intuitive introduction to rocket propulsion, combustion, nozzle dynamics, exhaust momentum, and thrust generation through simplified educational simulations.
An interactive automotive engineering simulator that visualizes how an automatic transmission transfers engine power to the wheels and changes gears.
Explore the torque converter, planetary gearset, automatic shifting, gear ratios, and complete power flow through real-time animated visualizations.
Adjust throttle, vehicle speed, and load to observe how the selected gear, engine RPM, torque, and transmission behavior change during acceleration and cruising.
The simulator provides an intuitive introduction to automatic transmission mechanics, torque multiplication, gear shifting, and automotive powertrain engineering.
An interactive engineering simulator that visualizes how skyscrapers respond to earthquake ground motion.
Compare Standard Structures, Tuned Mass Dampers, and Base Isolation Systems to see how different engineering approaches can reduce building sway and vibration.
Adjust ground motion, building height, damping, and shaking frequency while exploring seismic waves, structural response, and resonance in real time.
The simulator provides an intuitive introduction to earthquake engineering, structural dynamics, vibration control, and seismic protection systems.
AI Improves AI โ 3D Visualizer
An interactive 3D educational simulator that explains how AI can participate in improving future AI systems.
Explore techniques such as Knowledge Distillation, Synthetic Data, Self-Critique, Search & Selection, AI Feedback, and Agent Loops.
The simulator visualizes the improvement cycle:
Current AI โ Generate โ Evaluate โ Filter โ Learn โ Next AI
Adjust data quality, feedback, exploration, evaluation, and safety controls to see how they influence capability, reliability, and safety across multiple AI generations.
Overview
A six-tab interactive visualization of air conditioning principles, from the basic refrigeration cycle through to energy efficiency. Each tab runs a live Canvas animation with a component explanation panel on the right.
Content
Refrigeration Cycle โ Colored refrigerant particles circulate through four components in a loop. Pipe color indicates refrigerant state at each stage: low-pressure vapor (blue), high-pressure hot gas (red), high-pressure liquid (orange), and low-pressure mixture (cyan). Heat absorption and rejection are shown as animated particles at the indoor and outdoor units.
Compressor โ A slider-crank piston mechanism animates in real time, showing the suction and compression strokes, reed valve opening and closing, and gas density change inside the cylinder. A pressure gauge on the right updates with the crank position.
Evaporator & Condenser โ A split-screen comparison of the indoor and outdoor heat exchanger coils. Air flow arrows show warm air entering and cool air leaving the evaporator, and ambient air entering and hot air leaving the condenser. Refrigerant particles flow through the fin-and-tube coils on both sides.
PโH Diagram โ A pressure-enthalpy chart with a saturation dome. The four cycle states are plotted and connected by line segments for compression, condensation, expansion, and evaporation. A dot traces the refrigerant around the cycle in real time.
Heat Pump โ A toggle between cooling and heating mode. A four-way reversing valve swaps the roles of the indoor and outdoor units, turning the air conditioner into a heater. Heat-flow particle direction reverses with the mode.
Energy Efficiency (COP) โ Indoor and outdoor temperature sliders update the Carnot COP and actual COP in real time, displayed on a gauge. A Sankey diagram shows Q_cold, W_input, and Q_hot scaled to their relative sizes. A bar chart compares the current COP against the Carnot ideal and a resistive heater at COP 1.0.
Overview
A six-tab interactive visualization of hot air balloon physics, from the basic buoyancy principle through to wind-layer navigation. Each tab runs a live simulation alongside a detailed explanation panel covering the science, engineering, and practical piloting techniques behind hot air flight.
Content
Buoyancy โ Compares cold air molecules (tightly packed, dense, sinking) against hot air molecules (spread out, less dense, rising) side by side. Animated arrows show the opposing forces of buoyancy (upward) and weight (downward). The buoyancy formula and net lift equation are displayed below the balloon.
Burner & Vent System โ A cross-section view of the balloon interior. Holding the Fire Burner button produces an animated propane flame and heats the air inside the envelope, shown by rising convection arrows and a temperature gauge. The crown vent at the top releases hot air to reduce lift. The balloon responds in real time to the current envelope temperature.
Atmosphere โ Visualizes all five atmospheric layers from the troposphere to the exosphere with color-coded altitude bands. An ISA (International Standard Atmosphere) reference table shows how temperature, pressure, and air density change at each altitude. The hot air balloon operating zone (500โ3,000 m) is highlighted within the troposphere.
Flight Simulator โ A physics-based flight simulation. Holding the Burner button heats the envelope air, increases buoyancy, and the balloon climbs. Holding the Vent button releases hot air and the balloon descends. An altimeter and a vertical speed indicator update continuously. The sky color and ground detail change with altitude.
Temperature & Density โ A chart plots air density against temperature from โ20ยฐC to 250ยฐC, showing how density falls as temperature rises. Reference points mark ambient air (15ยฐC), warm air (100ยฐC), and hot balloon air (200ยฐC), with the density difference that creates lift highlighted between them.
Wind Navigation โ Shows six wind layers at different altitudes, each blowing in a different direction and speed. A map view tracks the balloon's position as it drifts with the wind. Altitude buttons step the balloon up or down into different wind layers, changing the direction of travel โ demonstrating how balloon pilots navigate without an engine by selecting their altitude.
Vehicle Exhaust Visualizer
An interactive educational simulator that visualizes how vehicle exhaust changes under different driving conditions.
Explore Idle, Cold Start, Cruise, Acceleration, Hill Climb, and DPF Regeneration, and compare Gasoline, Diesel, and Hybrid vehicles.
Adjust engine load, RPM, exhaust temperature, aftertreatment efficiency, and wind strength to observe changes in exhaust flow and dispersion. The simulator also explains key emissions such as COโ, NOโ, CO, HC, and particulate matter (PM), along with modern exhaust aftertreatment systems.
Overview
A six-tab interactive visualization of automotive exhaust emissions, covering gas composition, catalytic converter chemistry, particulate matter physics, engine operating conditions, urban air quality accumulation, and a direct comparison between internal combustion and battery electric vehicles. Each tab runs a live particle simulation alongside a detailed component explanation panel.
Content
Gas Composition โ A bar chart and donut chart break down the typical exhaust mix from a gasoline engine: nitrogen (~71%), COโ (~14%), water vapor (~13%), and the small but harmful fractions of carbon monoxide, nitrogen oxides, hydrocarbons, and particulate matter. Toxic and greenhouse gas badges highlight which components are regulated. Colored particles stream from a tailpipe in real time.
Catalytic Converter โ Shows raw exhaust entering a honeycomb substrate coated with platinum, palladium, and rhodium. Three simultaneous chemical reactions are displayed: CO oxidation to COโ, hydrocarbon oxidation to COโ and water, and NOโ reduction to harmless nitrogen. A conversion efficiency bar shows how close to 100% the catalyst is operating. Clean green particles exit the right side of the converter.
Particulate Matter โ A size scale compares PM10, PM2.5, PM1, and ultrafine particles against a visual reference. Three vehicle types โ car, bus, and truck โ emit particles that drift and disperse according to a wind indicator. A lung diagram marks the health impact zone where fine particles reach the alveoli directly.
Engine Conditions โ Three sliders control RPM, engine load percentage, and coolant temperature. Four emission bars (CO, NOโ, HC, PM) update in real time as conditions change, with Euro 6 limit markers showing whether the engine is within regulatory bounds. A particle stream changes color and density with the emission profile.
Urban Accumulation โ A city scene with moving vehicles gradually fills the air with exhaust particles. The sky color shifts from dark blue to orange-brown as the Air Quality Index rises through Good, Moderate, Unhealthy, and Hazardous levels. The AQI badge in the top bar updates live.
EV vs ICE โ A split screen places a gasoline engine on the left (emitting colored exhaust particles) against a battery electric vehicle on the right (emitting nothing from the drivetrain). A six-row comparison table covers direct COโ, NOโ, fine particles, well-to-wheel emissions, energy efficiency, and noise โ with the cleaner result highlighted in green for each category.
Overview
A six-tab interactive visualization of railway switch (points) mechanisms, from basic turnout geometry through to high-speed railway engineering. Each tab animates the switch in real time and includes a component breakdown panel on the right. The Throw Switch button operates every simulation.
Content
Basic Turnout โ The fundamental railway switch. Animated switch blades move between the straight (through) route and the diverging route. Shows the stock rails, movable blades, stretcher bar connecting them, frog crossing point, and approach signal. The signal only shows clear when the blades are fully locked in position.
Electric Point Motor โ A motorised switch actuator with animated gear reduction, actuating rod, detection contacts, and position indicator bar. Shows how the motor drives the blades, how detection contacts confirm full blade travel, and how an obstruction prevents detection โ automatically holding the signal at danger.
Double Crossover (Scissors) โ Four independent switches and a central diamond crossing that connect two parallel tracks. Cycles through four route modes: straight on both tracks, Track A crossing to B, Track B crossing to A, and both crossing simultaneously. Two trains run concurrently to illustrate route separation.
Three-Way Switch โ A single compact mechanism that routes an incoming train to one of three destinations. A three-position drive motor steps through left, centre, and right. The train animates onto whichever branch is selected, showing how the dual-blade assembly works as a unit.
Signal Interlocking โ The logic layer that makes conflicting routes physically impossible to set. A route table shows which signal and switch combinations are valid. Cycling through routes demonstrates that only safe signal-and-switch combinations can be activated together โ approach locking prevents switch movement once a train has passed a clear signal.
High-Speed Railway Switch โ Compares a standard 1:9 turnout angle against a high-speed 1:42 ratio switch. Annotates the blade length (60โ80m versus ~6m on a standard switch), the swing-nose frog that eliminates the flangeway gap, and the resulting increase in permitted diverging speed to 170+ km/h. A fast-moving train illustrates smooth high-speed diverging.
3D Invisibility Cloak Visualizer
An interactive 3D educational simulator that explains the basic concept behind an invisibility cloak.
Instead of making an object simply transparent, the simulator shows how light waves can be redirected around a hidden region and guided back toward their original paths.
Explore Cloaking Shell, Light Rays, Index Field, and Cross Section views while adjusting Cloaking Strength, Shell Thickness, Ray Density, and Wavelength.
The simulator also introduces transformation optics, metamaterials, wave bending, and the real-world limitations of invisibility technology through interactive 3D visualizations.
PID Tuning Simulator
An interactive control systems simulator designed to help users understand and experiment with PID control.
Adjust Kp, Ki, and Kd in real time and observe how they affect rise time, overshoot, settling time, steady-state error, and system stability.
Test different controller presets, change the setpoint, add disturbances and sensor noise, and monitor the Process Value, Control Output, Error, and individual P/I/D contributions.
The simulator also explains the roles of Proportional, Integral, and Derivative control through interactive visualizations and concept diagrams.
Overview
A real-time, browser-based visualization of the four-stroke internal combustion engine cycle. The cylinder cross-section animates using actual slider-crank kinematics, with a physically modeled pressure and temperature cycle for each stroke. RPM and crank angle are fully adjustable.
Content
Engine Cross-Section โ Animated cutaway showing the piston, connecting rod, crankshaft with counterweight, intake and exhaust valves, and spark plug. Gas color changes with each stroke: blue air-fuel mix on intake, white-blue on compression, orange-yellow flash on ignition, and grey on exhaust. The spark plug fires with a visible spark at the start of the power stroke.
Four Strokes โ Click any stroke tab to jump directly to that phase.
- Intake โ Piston descends, intake valve opens, air-fuel mixture drawn in
- Compression โ Both valves closed, piston rises, mixture compressed polytropically
- Power โ Spark ignites mixture near TDC, pressure peaks and drives piston down
- Exhaust โ Exhaust valve opens, piston rises and expels burnt gases
PโV Diagram โ Pressure-volume diagram showing the full thermodynamic cycle as a continuous curve, with a live dot tracking the current operating point.
Four Live Charts โ Scrolling history of cylinder pressure, temperature, valve lift, and torque output across the cycle.
Controls
- RPM slider (30 โ 600 RPM, default 100)
- Crank angle slider for manual step-through (0ยฐ โ 720ยฐ)
- Pause / Play / Reset
- Stroke tabs for direct phase navigation
Right Panel โ Live readings for pressure (bar), temperature (ยฐC), cylinder volume (%), and crank angle, plus a per-stroke explanation of valve states, pressure range, and the governing thermodynamic equation.
Overview
A real-time, browser-based visualization of tower crane operation, showing how load capacity changes with trolley radius. Two synchronized canvas views โ front elevation and top plan โ update live as the jib rotates, the trolley travels, and the hook rises or descends. A load-capacity curve tracks the current operating point against rated limits at all times.
Content
Front Elevation View โ Animated cross-section showing the mast lattice structure, slewing ring, operator cab, main jib with tie rods, counterjib with counterweight, trolley, hoist cable, hook block, and load. Height reference lines mark 10m intervals. A ground-level arrow indicates the current load radius projection.
Top Plan View โ Bird's-eye view showing jib rotation against a compass grid. Three concentric zone rings display the safe (green), caution (amber), and danger (red) radius bands. The load footprint is shown at the trolley position, and the current trolley radius is labeled along the jib.
Load-Capacity Curve โ A radius-vs-tonnage chart based on a simplified rated capacity curve. Green, amber, and red shaded areas mark the safe, caution, and danger utilization bands. The current operating point moves in real time as radius or load changes.
Safety Zones
- Safe โ below 80% of rated capacity at the current radius
- Caution โ 80โ95% of rated capacity
- Danger โ above 95%; overload risk, reduce load or radius
Controls
- Jib rotation (0โ360ยฐ), load radius (5โ60m), hook height (2โ50m), lifted load (0.5โ12t), jib length (30โ70m)
- Auto Demo cycles through eleven waypoints covering normal, caution, and overload conditions
- Pause and Reset buttons
Metrics Panel โ Live readings for load radius, hook height, jib angle, lifted load, rated capacity at current radius, and utilization percentage. A status badge and plain-language advisory update with each change.
Overview
An educational, browser-based visualization of how a sea bridge is built from marine survey through to completed roadway. A live Canvas animation grows the bridge stage by stage, with adjustable site conditions and a real-time progress chart. All content is qualitative and conceptual โ intended for learning, not engineering reference.
Content
Construction View โ The main simulation panel. The bridge assembles progressively across seven stages, with animated waves, underwater currents, floating construction equipment, foundation piles, piers, girders, deck, and lighting. Site condition sliders (water depth, wave activity, current strength, build speed) affect the visual environment in real time.
Seven Stages
- Marine Survey โ sonar barge scans the seabed with survey lines
- Temporary Works โ trestle platforms and a floating crane arrive offshore
- Foundation Piles โ driven piles penetrate to bedrock across all pier locations
- Piers & Caps โ concrete piers rise above the waterline with capping beams
- Girder Installation โ steel girders span progressively between completed piers
- Deck Construction โ the road surface is laid with lane markings
- Final Completion โ lighting poles and barrier rails finish the bridge
Construction Process โ A six-step flow diagram summarising the typical build sequence from site investigation to deck completion, with three reference cards on marine logistics, foundations, and superstructure.
Foundation Systems โ Six cards covering driven piles, drilled shafts, caisson bases, scour protection, pile caps, and marine exposure considerations.
Bridge Structure โ A load-path flow diagram tracing how forces travel from traffic through deck, girders, bearings, piers, and foundations into the ground.
Concept Map โ A simplified six-node overview of the full construction concept, from site investigation to roadway completion.
Right Panel โ Live telemetry showing stage number, overall progress percentage, wave index, and water depth, alongside a scrolling progress history chart and site condition readouts.