The solver
SPICE-class maths, not a lookup table
Your circuit is solved by Modified Nodal Analysis, with backward-Euler transient analysis running while your code does — the same class of maths professional circuit simulators use. Capacitors charge on real curves, and motor winding inductance turns a PWM signal into genuinely chopped current with freewheeling through the driver’s body diodes.
Locked-step co-simulation
The chip and the circuit advance together
Every time a pin changes, the circuit is re-solved and the result is fed straight back into the chip. digitalRead and analog readings come from your wiring, not from stubs. Servo pulse widths and buzzer tones are measured from the real signal edges.
The driver stage
A DRV8833 built out of hardware, not rules
The driver is modeled as switches and body diodes, so forward, reverse, coast and brake all emerge from the circuit itself — including regenerative braking that circulates current with zero battery draw.
Mechanical physics
480 substeps a second, meshing as a constraint
Gear meshing is solved as a physical constraint: backlash dead zones, per-stage efficiency loss, and tooth skip once the tooth-force limit is passed. Motor back-EMF is fed back into the electrical solve, so mechanical load changes what the circuit does.
Closed-loop actuators
A servo that can actually fail to hold
The servo runs a real position-control loop inside its published torque-speed envelope: it slews at the real spec speed, holds position, and fails to hold if you overload it. The stepper runs against a detent torque and misses steps under load.
Mass properties
Exact, not estimated
Parts you sketch get exact mass, centre of mass and inertia computed from their geometry. Concave shapes are decomposed into up to 24 collision hulls, so a curved cradle actually cradles.