Since I fly in the moutains, knowing the wind speed for me is paramount. However, I looked at the way ardupilot detremines wind speed for copters, and I feel it is too complicated and really not too precise, because estimating drag coefficients is no joke, streamlined phantom or 5" racer will have totally different coefficients, and all that is really not doable.
There is a very easy way of estimating windspeed, but this requires either to hover in loiter mode or let it drift in alt hold mode. But with fixed wings, I am used to do a 360 to get the readings, so that is a small sacrifice.
The way I see it:
A. whenever we are in Alt Hold mode, and there are no stick inputs for some time (depending on the weight, I would say it is in the range of 6…20 seconds), we can just read the GPS speed and heading to have exact wind speed.
B. whenever we are in Loiter Mode, without stick input, the inclination towards the wind will give us the speed and wind direction. To calibrate this, one can make a Lua learning script which would do the following:
- Copter is left to drift in Alt Hold mode so as to obtain wind speed and direction.
- Copter begins to fly in Alt Hold Mode against the wind, with LUA controlling Yaw and Pitch. First, LUA would turn the copter against the wind.
- Then LUA would progressively apply pitch stick, i.e. it would start like in steps of maybe 20 uS, i.e. 1520 1540 1560. For each step, it waits for maybe 10 seconds to give time for the speed to stabilize, then it saves the GPS speed to which the wind speed obtained in step 1 is added and the pitch angle. The script runs until a preset speed is reached, or until the copter goes to a certain distance, like 500 meters, from where it returns.
Thbe result would be a table something like this:
degree speed km/h
0.8 4
1.5 7
2.3 11
… …
12 35
Once we have this table stored, either as a file (I assume there is a function for that) or some extra parameters, then a simple script would do the following:
Whenever the copter is in Loiter Mode, no stick inputs for 5 seconds, obtain pitch and roll angles, calculate the inclination angle, and direction of inclination. Direction of inclination is the wind direction. Wind speed is interpolated from the table.