nx_robot_timing.nx
buildroot/runtime/nx_robot_timing.nx
about
nx_robot_timing.nx -- SOVEREIGN step-timing / timer-ISR rung (below the signal rung): turns a
step COUNT into a time-SCHEDULE of pulses. A real MCU drives steppers from a timer ISR that fires
STEP edges at computed intervals; acceleration = intervals that start large (slow) and shrink to a
cruise floor. Integer ramp via isqrt (arrival of step k ~ sqrt(k) under constant accel; classic
no-float stepper ramp). NO FLOAT.
NEVER-BRICK (#26) BY CONSTRUCTION: every inter-step interval is floored at MIN -> the instantaneous
STEP RATE can never exceed 1/MIN. This is the safety bound the signal rung could not enforce (it
had no time): a too-fast step train skips steps / overruns the driver / can damage the mechanism.
Here it is impossible by construction, and the gate proves it by exhaustive sweep.
license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_robot_timing_gate.nx
structs
| none |
consts
| none |
functions
| 14 | func ti_isqrt(v: i64) -> i64 called by 1: ti_arr |
| 25 | func ti_arr(k: i64, accel_k: i64) -> i64 { return ti_isqrt(accel_k * k) } |
| 29 | func schedule_accel(n: i64, accel_k: i64, min_iv: i64, out_iv: *i64) -> i64 |
| 41 | func ti_raw_iv(i: i64, accel_k: i64) -> i64 { return ti_arr(i + 2, accel_k) - ti_arr(i + 1, accel_k) } |
| 44 | func ti_min_iv(iv: *i64, n: i64) -> i64 called by 1: main |
| 53 | func ti_total(iv: *i64, n: i64) -> i64 called by 1: main |
| 61 | func steps_fired_by(iv: *i64, n: i64, now: i64) -> i64 called by 1: main |