code wiki / (root) / nx_robot_timing.nx

nx_robot_timing.nx

buildroot/runtime/nx_robot_timing.nx

2841 B71 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic robot
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_robot_timing.nx nx_robot_timing_gate.nx

imports: nx_syscalls.nx

imported by: nx_robot_timing_gate.nx

structs

none

consts

none

functions

14func ti_isqrt(v: i64) -> i64
called by 1: ti_arr
25func ti_arr(k: i64, accel_k: i64) -> i64 { return ti_isqrt(accel_k * k) }
called by 2: schedule_accelti_raw_iv calls 1: ti_isqrt
29func schedule_accel(n: i64, accel_k: i64, min_iv: i64, out_iv: *i64) -> i64
called by 1: main calls 1: ti_arr
41func ti_raw_iv(i: i64, accel_k: i64) -> i64 { return ti_arr(i + 2, accel_k) - ti_arr(i + 1, accel_k) }
called by 1: main calls 1: ti_arr
44func ti_min_iv(iv: *i64, n: i64) -> i64
called by 1: main
53func ti_total(iv: *i64, n: i64) -> i64
called by 1: main
61func steps_fired_by(iv: *i64, n: i64, now: i64) -> i64
called by 1: main