ReviewOS

stacks/drone

Multirotor control: stabilize the first simulated quadcopter

#5
Open chris opened this 8 days ago ·
8 days ago

What to build

Use owned rate, attitude, velocity and position control with a quad-X actuator allocation model to stabilize a physics simulator, then a disabled-prop bench harness.

Acceptance criteria

  • Verify controller units, saturation, anti-windup, slew limits and actuator mixing against independent worked cases. Software/model cases pass; measured motor/ESC work remains below.
  • Demonstrate step responses, wind/disturbance rejection and sensor-delay tolerance in a physics model. Evidence is limited to the explicitly declared synthetic model.
  • Keep board outputs inhibited until the separately validated authority supervisor permits them. No physical control transport or board-output path was added.
  • Include a scoped continuation list for tuning, autotune, helicopter/autorotation and advanced control variants.

Implemented first simulation slice

Commit 7cf288c adds:

  • Owned position P, velocity PI, quaternion attitude P and filtered body-rate PID loops, with bounded integrals and constraint tracking.
  • Original quad-X force/moment mapping, per-motor thrust clipping/slew and achieved-command wrench feedback. Values are simulated newtons, never PWM/DShot commands.
  • A six-degree rigid-body model with invented mass/inertia, motor lag, wind/drag, external torque and a simple floor constraint.
  • Modeled raw IMU/NAV-PVT frames through our sensor pipeline and estimator. Controller inputs contain estimates and measured rates; plant truth is used only for sensor synthesis and evaluation.
  • Explicit initial simulation-north alignment and an opt-in estimator initialization-only gravity mode. Default estimator behavior is preserved; absolute-heading/navigation health remain unavailable.
  • Native Stacks controls:simulate shared by Buddy and the standalone CLI, read-only capability exposure, generated helper exports and reproducible response reports.
  • Latched inhibition for loss of estimator health, reference/boot/reset changes, stale targets, invalid rates/epochs and clock/schedule faults. Current-tick estimator health is mandatory; an uncertainty regression prevents reusing expired health.

Validation: 131 Bun tests / 16,326 assertions, including 15 control/physics tests; two native CTest contracts; five Python tests; lint, application/runtime/view typechecks and roadmap validation pass. Standalone hover and IMU-loss commands ran outside the checkout, and report regeneration matches the retained evidence.

CI passed for application checks, the standalone controls command and both Pico firmware profiles.

The 20-second hover/step/wind/delay cases stay within the tested position/tilt bounds without floor contact. IMU loss at 3000 ms latches zero simulated commands at 3060 ms and does not silently resume when packets return. The model falls afterward; inhibition is not a landing controller.

See control guide, ADR 5, retained scenario report and validation.

Remaining native bench and validation work

  • Complete #2/#3/#4 measured timing, calibration, heading and estimator prerequisites.
  • Test higher-fidelity physics, biased/noisy sensors, GNSS loss, jitter, parameter/delay sweeps and stability margins against an independent reference model.
  • Measure motor/ESC/thrust/battery/propeller behavior. Add priority allocation and collective-thrust tracking anti-windup; validate bandwidth and delay margins.
  • Port bounded controls to the native scheduler and execute the disabled-prop harness with recorded deadline/stack/response measurements.
  • Keep physical outputs inhibited until #6 authority, RC override, kill and reset/failsafe behavior is independently validated.
  • Add recorded manual tuning, guarded identification/autotune, gain scheduling, notch filtering, feedforward and jerk-limited trajectories.
  • Validate disturbance observers, geometric control, LQR/MPC variants behind the same failure contract.
  • Implement helicopter swashplate/rotor/governor/autorotation as separate dynamics/allocation profiles with their own evidence.

This issue remains open and in progress. The model uses a supported 600 ms startup, declared heading, deterministic dither/quantization and gyro propagation after alignment. These assumptions do not establish real airframe control, physical observability, flight safety or disabled-prop hardware validation.

Blocked by

  • #4 Estimation: publish owned attitude and local-position estimates

Sign in to comment on this issue.