Design lab
Physics check: the engine against closed-form answers
A dispensing simulation is only as good as its friction, impacts and forces. These tests run in your browser, right now, using the same engine configuration the simulator uses (2 ms step, mm–ms–g units, so forces are in newtons) and compare against textbook solutions.
running…
What was fixed to get here
Coulomb friction
Matter.js's stock solver applies kinetic friction as a fixed impulse independent of the normal force, at a 2 ms step that is ~20× too weak, and blocks slide down a μ = 0.3 plane as if it were frictionless. js/contact.js replaces it with a sequential-impulse solver: accumulated normal impulse, friction clamped to μ·N (μs when the contact starts sticking, μk when sliding), restitution from the approach speed. The incline test above matches to 0.01 %.
Force-limited actuators
Slides and rotors are dynamic bodies with mass, driven by a PD servo whose force is clamped to the motor rating. A pill caught in the mechanism stalls the motor at exactly its rated force; that is the jam signal and the squeeze the pill sees (tested: a 4 g plate driven into a wall reports 8.00 N).
Suction as a force
Vacuum acts as F = ΔP·A_cup·seal on the pill, a spring-damper holds the pill to the cup only up to that force. Snag a pill on the neck and the seal breaks and it drops, nothing is teleported or pinned.
Known limitation
Rolling of a smooth disc is under-predicted (the disc is a polygon: facets make it lurch instead of roll). Nothing in the six concepts relies on free rolling of long distances except round pills on belts and lanes, where the results should be read as slightly pessimistic for rolling.