Interactive Demo

Anti-pinch control of a vehicle window in real time, implemented as WebAssembly components.

This demonstration runs with the same WebAssembly binaries intended for ECU deployment โ€“ in the browser, without modification. The components are written in Rust, compiled once to WebAssembly, and connected via formal WIT interfaces.
Comparison of the Antipinch algorithm: Wasm runtime in Matlab Simulink vs. real ECU with Zephyr OS โ€“ identical ripple counter and pinch detection results

What you see: Sensor and actuator signals feed into two WebAssembly runtimes simultaneously โ€“ one running inside Matlab Simulink for simulation, the other on real embedded hardware under Zephyr RTOS. The anti-pinch algorithm is compiled as a Wasm component and runs unchanged in both environments. Exactly the same binary.

From Simulink to the browser: The anti-pinch algorithm, along with simulated sensor and actuator models, was converted from Simulink to C, encapsulated behind WIT interfaces, and compiled once into a Wasm component. The resulting .wasm file runs unchanged in any WebAssembly runtime โ€“ whether that's a browser, Simulink, or a microcontroller.

What the demo concretely shows:

  • Single artefact โ€“ the same .wasm files running here in the browser are designed to run unchanged on the target ECU
  • Versioned interfaces โ€“ WIT interfaces such as aptiv:antipinch/motor-driver-v2@0.1.0 define the component protocol in a machine-readable, toolchain-neutral format

Three WebAssembly components work together:

  • Anti-Pinch โ€“ Detects pinch forces via motor current measurement
  • Motor Driver โ€“ Simulates the window lift motor with realistic current behaviour
  • Soft Start/Stop โ€“ Smooth acceleration and deceleration via PWM ramps
How to Use
โ–ฒ Up / โ–ผ Down
Moves the window. In automatic mode (default) a single click is enough โ€“ the window runs on its own until it reaches the end stop or a pinch event is detected. In Manual mode the window moves only while the button is held.
โธ Pause / โ–ถ Resume
Freezes the entire simulation โ€“ motor, signal graph and controls are suspended. Click again to resume seamlessly.
Finger Switch & Slider
Available once the window is more than 14 % open. Shows virtual fingers that can be positioned between 20 %โ€“85 % in the window's path, bounded by the current window edge.

Tip: Best viewed at 1920 ร— 1080 (Full HD) or higher.

Window Status

Controls

ย 

Motor Control Signals

โ€”
Current: 0.00โ€‰A
Position: 0.0โ€‰mm
RPWM: 0.00
LPWM: 0.00

Next: News ยท Publications