QX-250 purpose-built 6-DOF quadcopter model (Simcenter Amesim 2511)
===================================================================

CONTENTS
  qx250_purpose_built.ame       The Amesim model (open in Simcenter Amesim 2511+).
  amesim_submodel/QX250FC.spe   Custom submodel interface (12-state 6-DOF plant + cascade controller).
  amesim_submodel/QX250FC.c     Submodel dynamics (compiled to C by Amesim).
  qx250_model.py                Validated numpy/scipy reference implementation of the same law.
  qx250_scenarios.py            Reference scenario battery (hover, roll recovery, step, gust, mission).
  qx250_ctest.c                 Standalone C convergence check (Euler + RK4).
  qx250.fmu                     FMI 2.0 Co-Simulation FMU (the reduced-order model) -- tool-agnostic,
                                no Amesim runtime needed. Setpoint inputs + 12 state outputs.
  fmu_sources/qx250_fmu.c       FMU source (FMI 2.0 CS wrapper around the same dynamics).

MODEL
  QX-250: mass 0.50 kg, arm 125 mm, I = [0.0025, 0.0025, 0.0045] kg.m^2, T_max 6.1 N/motor.
  Controller: cascade position -> velocity -> attitude -> body-rate PID + Quad-X mixer with
  per-motor saturation. 12 explicit states (x y z, u v w, phi theta psi, p q r).

PARAMETERS (on the sim_params block)
  x_ref, y_ref, z_ref   position setpoints [m]
  yaw_ref               heading setpoint [rad]
  roll0                 initial roll perturbation [rad] -- set e.g. 0.2618 (15 deg) for a
                        disturbance-recovery run.

SOLVER NOTE (important)
  The control law contains hard actuator saturations (per-motor thrust clip). A variable-step
  standard integrator with an unbounded max step can under-resolve the fast body-rate loop during
  large saturating transients and report an artificially large overshoot. Use the FIXED-STEP
  Runge-Kutta integrator at 0.5 ms (Run Parameters -> Fixed step), which matches the RK4 reference
  (15 deg roll recovery: -6.1 deg overshoot, settles < 1.6 s). See qx250_ctest.c for the reference.

FMU (qx250.fmu) -- the reduced-order model
  FMI 2.0 Co-Simulation, tool-agnostic (no Amesim runtime). Drive it from any FMI master
  (Simulink, PyFMI/FMPy, Simcenter, TC, etc.).
    inputs  (vr 1-4) : x_ref, y_ref, z_ref [m], yaw_ref [rad]
    param   (vr 5)   : roll0 [rad] (initial roll, e.g. 0.2618 = 15 deg)
    outputs (vr 6-17): x y z, u v w, phi theta psi, p q r  (the 12 states)
  Fixed-step RK4 (0.5 ms) sub-integration inside each communication step. win64 binary +
  source included. Validated through the FMI API: position step x->3 m / z->2 m no overshoot;
  15 deg roll recovery, overshoot -6.08 deg. Quick check with FMPy:
    python -m fmpy simulate qx250.fmu --show-plot

Reproduced natively in Amesim ("Number of states: Explicits: 12"). Part of the FlyNow QX-250
digital-thread project -- flynow.xcelerator.us.
