nx_robot_control_gate.nx
buildroot/runtime/nx_robot_control_gate.nx
about
nx_robot_control_gate.nx -- R-ROBO-2 GATE: closed-loop "true control" + never-brick safety clamp.
Drives a plant from position 0 to setpoint 1000 (milli-units) with a constant load disturbance,
using only the sovereign no-float P-controller reading the (simulated) position sensor. VERIFIES:
(1) CLOSED LOOP CONVERGES to the setpoint within tolerance (it actually controls).
(2) it climbed from 0 (reached the target region).
(3) OPEN LOOP (fixed feed-forward, no feedback) does NOT converge -> feedback does the real work.
(4) NEVER-BRICK clamp: even at a huge error the commanded actuator output never exceeds UMAX.
(5) clamp has teeth: the UNCLAMPED command at that error WOULD exceed UMAX.
(6) HONEST: P-control leaves a small, measured steady-state error (~ load*100/Kp) -- not "perfect".
100% sovereign, integer-only. license_tier: ORIGINAL expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_robot_control.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 14 | func sw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 15 | func sn(v: i64) -> i64 |
| 26 | func check(name: *u8, cond: i64, tot: *i64) -> i64 |
| 33 | func abs_i(v: i64) -> i64 { if v < 0 { return 0 - v } return v } called by 1: main |
| 35 | func main() -> i64 |