nx_robot_control.nx
buildroot/runtime/nx_robot_control.nx
about
nx_robot_control.nx -- SOVEREIGN closed-loop motion CONTROL (the essence of "true control":
read sensor -> compute -> drive actuator, in a loop, until the goal is reached). This is what
makes a robot/sensor/actuator actually CONTROL something -- the same loop the printer and the IoT
devices run, generalized. Fixed-point / NO FLOAT throughout (gains scaled by /100). A simple,
provably-stable first-order plant (a motor+load: position advances by (command - load)/inertia
per tick) stands in for real hardware so the loop is gate-verifiable without a machine.
NEVER-BRICK (#26) BY CONSTRUCTION: the controller output is CLAMPED to +/-UMAX, so no matter how
large the error, the actuator can never be commanded past a safe limit -- a hardware-safety
invariant proven mechanically by the gate, not promised. (The real hardware-write driver inherits
this clamp + a watchdog + safe-state-on-fault.) license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_robot_control_gate.nxnx_robot_firmware.nx
structs
| none |
consts
| none |
functions
| 15 | func ctl_p(e: i64, kp: i64, umax: i64) -> i64 |
| 23 | func ctl_p_raw(e: i64, kp: i64) -> i64 { return kp * e / 100 } called by 1: main |
| 26 | func plant_step(p: i64, u: i64, load: i64, inertia: i64) -> i64 |
| 32 | func run_closed(setpoint: i64, kp: i64, umax: i64, load: i64, inertia: i64, ticks: i64, out_maxu: *i64) -> i64 |
| 51 | func run_open(setpoint: i64, fixed_u: i64, load: i64, inertia: i64, ticks: i64) -> i64 |