Wind Estimation and Barometer Compensation
A multirotor needs no airspeed sensor for the EKF to work out what wind it is flying in — how strong, and from where.
That estimate does two jobs:
- Gives the pilot a real-time reference
- Compensates for wind disturbing the barometer: when the controller is exposed to airflow, pressure readings get pushed around, which shows up as a few metres of climb or sink after fast forward flight slows down
There are three steps: airframe drag coefficient, propeller drag coefficient, then barometer compensation.
1. Working out the airframe drag coefficient
1. Weigh it
Weigh the aircraft with its battery, in kg.
2. Measure the frontal and side areas
Take two photos from a few metres away — one of the front, one of the side — and use them to measure the frontal and side areas. An online tool can overlay a grid on the photo or trace the outline:
- Add grid to image (free): scale the grid to a known dimension of the aircraft in cm, count the squares covering the airframe (propellers excluded) and that count is the area in cm²
- SketchAndCalc (one-hour free trial): draw a polygon around the airframe outline and read the area in cm² straight off

▲ Grid overlaid on the photo — count the squares covering the airframe

▲ Tracing the outline in SketchAndCalc, which shows the area directly
Divide the area in cm² by 10000 to get m².
3. Enter the parameters
| Parameter | How to calculate |
|---|---|
EK3_DRAG_BCOEF_X | weight (kg) ÷ frontal area (m²) |
EK3_DRAG_BCOEF_Y | weight (kg) ÷ side area (m²) |
The IRIS in the photo, as an example:
| Item | Value |
|---|---|
| Weight | 1.45 kg |
| Frontal area | 203 cm² = 0.0203 m² |
| Side area | 217 cm² = 0.0217 m² |
EK3_DRAG_BCOEF_X | 1.45 ÷ 0.0203 = 71.4 |
EK3_DRAG_BCOEF_Y | 1.45 ÷ 0.0217 = 66.8 |
2. Working out the propeller drag coefficient
The propeller drag coefficient, EK3_DRAG_MCOEF, can only come from flight testing. The calculation and how to read it are covered in this official ArduPilot video.
- Pick an open site with a wide field of view and little wind; the flight test needs a certain distance flown in all four directions (front, back, left, right)
- Set
LOG_DISARMEDto 1 andLOG_REPLAYto 1 so the propeller drag coefficient can be worked out from the log after the flight - Arm and take off in Loiter (hover) mode (to keep the EKF position estimate good) and fly to the centre of the test area
- Switch to AltHold (altitude hold), hold the altitude steady and leave the sticks alone; watch which way the aircraft drifts to read the wind direction and speed
- Fly the aircraft back to the centre of the test area, turn the nose into wind, then push the pitch stick fully forward until the aircraft finishes accelerating upwind
- Release the pitch stick to centre; the aircraft slows down gradually, so wait for it to drift back near the centre of the test area
- Once it has drifted back, fly the aircraft to the centre of the test area for the next test
- Yaw 90° (clockwise, say) so one side faces the wind; once aligned, hold full left roll stick until the aircraft finishes accelerating upwind, then release the stick to centre and let it drift back
- After flying back to the test area, yaw another 90° so the tail faces the wind; once aligned, pull the stick fully back until the aircraft finishes accelerating upwind
- Yaw 90° so the right side faces the wind; once aligned, hold full right roll stick and repeat the above
- Land, then download the onboard log — see downloading flash logs
The official video gives the following calculation:
MCOEF = (a - ρ × V² / (2 × B)) / V
ais inIMU.AccX; take the value at the moment the pitch angle crosses 0Vis inGPS.Spd— the ground speed at that momentBisEK3_DRAG_BCOEF_X/Yfrom the parameter tableρis fixed at 1.225
Apply this formula to each of the four directions flown above and take the average of the four results — that is the propeller drag coefficient.
TIP
EK3_DRAG_MCOEF normally ends up somewhere between 0.1 and 1.0.
3. Watching wind speed and direction live in the ground station
Once enabled, the estimated wind goes to the ground station in the MAVLink WIND message.
In Mission Planner: Flight Data screen, Quick tab, double-click any value and pick wind_dir or wind_vel. The aircraft must use the compass as its yaw source for wind speed and direction data to be sent back, and the data only appears while flying.

▲ Bringing up wind direction and speed on the Quick tab in Mission Planner
4. Reading wind speed from a log
The EKF wind estimate is logged in the XKF2 message — look at VWN (north wind) and VWE (east wind).

▲ Expanding XKF2 in the log browser and ticking VWN / VWE
5. Barometer position error compensation
With a wind estimate you can compensate the pressure error wind causes at each barometer, in four directions (front, back, left, right). The calculation is shown in this official ArduPilot video.
1. Test flights
Step 1: Take off and find the wind
Set LOIT_SPEED to 800, take off and hover at 3–5 m, keep your hands off the sticks and let it hold position. Watch which way the aircraft drifts and note the wind speed and direction.
You can also read it directly in the ground station: wind_vel and wind_dir.
Step 2: Point the nose into wind
Yaw so the nose points straight into the oncoming wind. Hover for 10 s afterwards.
This makes “forward flight” upwind. Flying upwind gives enough airspeed.
Step 3: Fly forward for 8 s
Push the pitch stick fully forward once, then hold it there without moving.
The aircraft accelerates to 8 m/s and holds that speed on its own — you do not need to hunt for a speed.
Count 8 s, then release the stick. Loiter brakes by itself and stops in place. Hover for 10 s.
Step 4: Move right for 8 s, then left for 8 s
Push the roll stick fully right, hold for a count of 8, release, hover for 10 s.
Then push the roll stick fully left, hold for a count of 8, release, hover for 10 s.
Keep the nose pointing the same way throughout both segments — still into wind.
Step 5: Return to the start and yaw 180° on the spot
Fly the aircraft back to the take-off point, let it settle, then yaw 180° so the nose faces away from the wind (tail into wind). Hover for 10 s afterwards.
Step 6: Fly backwards for 8 s
Pull the pitch stick fully back once, hold for a count of 8, then release.
The aircraft still travels in the same direction, so the tail stays into wind.
2. Work out the position error coefficient for each direction
- Get air density in kg/m³ from an air density calculator
- Static pressure error ΔP = −air density × gravitational acceleration × altitude error
- Dynamic pressure Δq = 0.5 × air density × airspeed²
- Position error coefficient = ΔP ÷ Δq
Altitude error: take the barometric altitude over the middle 8 s of the straight-flight segment and subtract the average of the two baselines — the 8 s hover before entering the segment and the 8 s hover after leaving it (BARO.Alt).
Gravitational acceleration: constant 9.80665 m/s².
Airspeed: V = sqrt((VN - VWN)^2 + (VE - VWE)^2); XKF1 supplies VN and VE, XKF2 supplies VWN and VWE.
NOTE
The coefficient should land between -1 and +1.
3. Enable compensation and enter the coefficients
Set BARO1_WCF_ENABLE to 1, then restart the controller.
Parameters for the first barometer:
| Parameter | Direction |
|---|---|
BARO1_WCF_FWD | Positive X (front) |
BARO1_WCF_BCK | Negative X (back) |
BARO1_WCF_RGT | Positive Y (right) |
BARO1_WCF_LFT | Negative Y (left) |
BARO1_WCF_UP | Positive Z (up) |
BARO1_WCF_DN | Negative Z (down) |
NOTE
With more than one barometer, the prefix becomes BARO2_WCF_*, BARO3_WCF_* and so on — each one is calculated and entered separately.

