Skip to content

Gusts

With gusts: "dryden", the server runs a gust model of its own and sends SITL the result. Every SYSTEM_TIME message, 20 times a sim second, it advances three random processes from the current height and airspeed, adds the gust to the mean wind, and sets SITL’s SIM_WIND_SPD, SIM_WIND_DIR and SIM_WIND_DIR_Z. SITL’s own turbulence, SIM_WIND_TURB, is set to zero.

The model is the low-altitude form of the Dryden turbulence model in MIL-F-8785C. Three gust components, along the mean wind (u), across it (v) and vertical (w, up positive), are each a first-order random process with a strength σ and a length scale L. With h the height in feet, held between 3 m and 1000 ft:

Strength Length
w σw = 0.1 × mean wind Lw = h
u σu = σw / (0.177 + 0.000823 h)0.4 Lu = h / (0.177 + 0.000823 h)1.2
v σv = σu Lv = Lu / 2

Near the ground the horizontal gusts are stronger and much longer than the vertical one, and every length grows with height. Each length becomes a time constant at the current speed, τ = L / V with V the larger of airspeed and mean wind (frozen turbulence: the aircraft flies through a fixed pattern of air). The model is Dryden-type rather than Dryden exactly: the true v and w filters are second order, and here all three are first order.

Dryden gust components over sixty sim secondsThree strips share a time axis and a scale of plus or minus 3 m/s. The along-wind and cross-wind components wander slowly with standard deviations of 1.00 and 1.36 m/s; the vertical component is smaller and faster, 0.75 m/s.+3-3u, along · σ 1.00 m/s+3-3v, across · σ 1.36 m/s+3-3w, up · σ 0.75 m/s0102030405060sim seconds into the record
wind_history from a hover near 10 m in an 8 m/s mean wind, gusts: "dryden", seed 7. The gust is what the server adds to the mean wind before sending SITL itsSIM_WIND_* values every tick.

The other two settings are simpler. "off" sends a steady wind once. "sitl" hands turbulence to SITL’s own SIM_WIND_TURB, set to σ_w (0.1 × mean wind × scale). That turbulence is not Dryden, and it can’t be made to be. Reading SITL’s source (SIM_Aircraft.cpp) and measuring it in flight shows:

  • Horizontal: a new random direction at every physics step, so the horizontal part is white noise up to 600 Hz.
  • Vertical: a first-order process with about a 4 Hz corner, so it’s mostly buffeting.
  • No dependence on flight: one strength at every height and speed, with no length scales and no bandwidth setting.
  • Only while airborne, drawing from the same random stream as the simulated sensor noise.

Against Dryden at 0.1 Hz, its gusts are 36 to 41 dB weaker horizontally and 13 dB weaker vertically. Its one strength in its favour: it’s generated inside SITL, so it repeats exactly, and an exact session can fly it. Dryden gusts are sent from here and can’t be.

SITL smooths every wind it is sent with SIM_WIND_TC. At ArduPilot’s default of 5, that’s a 0.8 s time constant, which cut our Dryden gusts by 5 to 25 % in strength, the vertical component most. With Dryden gusts on, the server now sets SIM_WIND_TC to 0.1, which lets them through nearly whole. With steady wind it goes back to 5, so a change of steady wind still eases in. A harness that sends its own gusts should do the same.

SITL also shapes the wind by height. Its default, SIM_WIND_T 0, weakens it by a square law below SIM_WIND_T_ALT (60 m): a wind sent as 8 m/s blows 4.6 m/s at 20 m and 1.8 m/s at 3 m, and nothing at the ground. The gusts kept the full speed’s strength, so near the ground they were too strong for the wind they rode on. A wind now has a profile. uniform, the default, sets SIM_WIND_T 1, so speed_mps is the wind at every height and the gusts fit it. sitl leaves SIM_WIND_T to the parameters, and that is what a wind gets when it names no profile but the session’s set names SIM_WIND_T (TerraHawk’s presets set 1). Recipes written before the profile existed replay with sitl, which is what they flew. Exact flights take a uniform wind too: they fly in a second boot, where wind on the pad repeats.

Ground-level wind is real wind on the pad: in a uniform 8 m/s, the stock quadplane SITL model never lifts off (an AUTO VTOL takeoff reports “Potential VTOL Thrust Loss” and sits there). That is the model, with or without gusts. Pick a lighter wind for stock-model takeoffs, or profile: "sitl" to keep the old calm at the surface.

A first-order random process with time constant τ and strength σ (an Ornstein-Uhlenbeck process) has an update that is exact at any step size. With a = Δt / τ and φ = e−a:

xk+1 = φ xk + σ √(1 − φ²) nk,   nk ~ N(0, 1)

Its stationary variance is σ² whatever Δt is. That matters here because Δt is not small next to τ near the ground: Lw equals the height, so at 3 m and 15 m/s the vertical time constant is a fifth of a second, against ticks a twentieth of a second apart.

The gust model this package inherited used the forward Euler form instead:

xk+1 = (1 − a) xk + σ √(2a) nk

Its stationary variance V satisfies V = (1 − a)² V + 2a σ², which gives

V = σ² / (1 − a/2)

So the Euler gusts are too strong by a factor that depends on the step, and the update diverges outright once a passes 2, where |1 − a| > 1. For the vertical channel at 3 m:

Speed Δt a Euler σ / target
5 m/s 0.05 s 0.083 1.022
5 m/s 0.10 s 0.167 1.044
15 m/s 0.05 s 0.25 1.069
15 m/s 0.10 s 0.50 1.155
15 m/s 0.50 s 2.50 diverges

At the server’s 20 Hz ticks that is 2 to 7 % too much vertical gust near the ground, more for a fast aircraft, and the u and v channels, with lengths several times longer, much less. A simulation of 400 000 steps of each form agreed with the formula within one percent. The exact form costs the same arithmetic, so it is the default.

method: "euler" keeps the old form. It draws the same random numbers in the same order as the code it came from, so a harness can move onto this model, reproduce its earlier runs number for number, and re-baseline on exact when it chooses.

A seed seeds the model’s random number generator. Real SITL delivers SYSTEM_TIME on an exact 20 Hz sim clock, so two flights with the same seed see the same tick times and draw the same numbers. That is what makes a gusty A/B test fair: change one parameter, fly the same seed, and the air is the same sequence. It is nearly identical, not exactly: each gust still lands in whatever physics step it reaches, which depends on the wall clock. For air that repeats exactly, the gusts would have to come from inside SITL, which today means SITL’s own turbulence above or a change to SITL itself. The gusts still depend on height and airspeed, so two flights that diverge in altitude feel the same random sequence scaled to where each one is.

scale multiplies the gust (not the mean wind), up to 5, for a rougher day without changing its character. The step size is capped at half a second, so a long gap between ticks cannot produce one enormous jump.

Every snapshot carries the gust now and the SIM_WIND_* values SITL was last given, and wind_history returns up to two minutes of both at whatever resolution you ask. Because the model runs in the server rather than inside SITL, the record of what the aircraft flew through exists without digging it out of the dataflash log.