Skip to main content

Module wind

Module wind 

Source
Expand description

Wind from the air’s push on a rotor-borne vehicle: drag inverted to air velocity, one axis at a time, and filtered on world wind.

Thrust acts along the thrust frame’s z, so the specific force along its x and y is the air’s push alone. Each axis’s drag model, a bluff-body term ½ρv²/B plus rotor momentum drag μv (ArduPilot’s and PX4’s drag fusion: NavEKF3_core::FuseDragForces, Ekf::fuseDrag), is inverted to the air velocity along it; the wind along it is the ground velocity’s component less that. A two-state Kalman filter on wind (north, east) takes each axis as a scalar measurement whose noise is the force noise over the drag’s slope there, so an axis with little drag (a tailsitter’s span in hover) counts for little, and the wind across it is learned once a turn puts more drag on it. Both stacks fit the drag frame to the body with thrust along z and treat X and Y alike apart from their coefficients; per-axis noise is what lets a flat-plate airframe use it.

The measurement is averaged over UPDATE_PERIOD_S, as both stacks do, before each update. Allocation-free and fixed-size.

Structs§

WindConfig
The drag model, per thrust-frame axis (x, y), and the filter’s noise.
WindEstimate
The wind and its uncertainty.
WindEstimator
Estimates the wind from the vehicle state while the caller says it is airborne on rotors.

Constants§

AIR_DENSITY_KGPM3
Sea-level air density, in kg/m³ (ISA).
DEFAULT_FORCE_NOISE_MPS2
Default WindConfig::force_noise_mps2: ArduPilot’s EK3_DRAG_M_NSE (AP_NavEKF3.cpp).
DEFAULT_GATE_SIGMA
Default WindConfig::gate_sigma: both stacks gate drag at 5σ (NavEKF3_core::FuseDragForces, Ekf::fuseDrag).
DEFAULT_INITIAL_SD_MPS
Default WindConfig::initial_sd_mps, in m/s: past any wind a rotor-borne vehicle flies in, so the first measurements set the estimate.
DEFAULT_MAX_AXIAL_SPEED_MPS
Default WindConfig::max_axial_speed_mps, in m/s: at 1 m/s a sim tailsitter’s calm-air estimate is 0.14 m/s off 10 s after its takeoff, 0.22 m/s with no skip (#608).
DEFAULT_PROCESS_NOISE_MPS_PER_RT_S
Default WindConfig::process_noise_mps_per_rt_s: lets a steady wind’s estimate move about 0.1 m/s a second, slow beside a hover’s drift.
UPDATE_PERIOD_S
Seconds the measurement is averaged over before each update: about 5 Hz, as both stacks average their specific force (NavEKF3_core::SampleDragData, EstimatorInterface::setDragData).

Functions§

specific_force_ned
The specific force on the vehicle (what an accelerometer reads: acceleration less gravity), in m/s², in NED, the frame state.attitude rotates the body into: (0, 0, −g) at rest.