Is there a way to have the APM increase the throttle when flying into the wind to maintain a minimum ground speed?
For example if the cruise throttle is 50% at 10m/s and the wind is 10m/s, when flying directly into the wind the APM doesn't seem to increase the throttle and instead just sits there basically hovering in one spot, when there is still another 50% throttle available to easily overcome the head wind.
If the airspeed sensor is disabled, the throttle would be increased strictly due to the decreased ground speed, but that also has other drawbacks such as poor track following due to not knowing the direction of the wind to properly compensate. It seems like it would be useful to have both min/max/cruise airspeeds and ground speeds so they can be configured independently of one another to overcome this issue?
Yes, that functionality is present. MIN_GNDSPD_CM is in centimeters per second and determines your minimum groundspeed, increasing your airspeed to compensate for wind. Will not exceed your max airspeed (which needs to be set correctly! Otherwise it will dive the plane into the ground trying to gain speed!)
ArduPlane currently does not compute the speed and direction of the wind at all and cannot follow tracks correctly, with or without airspeed sensor. As it has no crosstrack integrator, it is impossible for it to reach the track line in wind.
If Arduplane doesn't calculate wind speed/direction, where do the "wind_dir" and "wind_vel" values come from?
Interesting... I didn't realize its the planner that calculates that.
I ran some tests changing MIN_GNDSPD_CM while heading into a 7m/s head wind with a cruise airspeed set to 7m/s (effectively a 0 ground speed) but I wasn't able to get the throttle to change at all. The maximum airspeed was set to 22m/s.
Is there something else that I'm missing perhaps? The cruise throttle is set to 40%, so there is lots of room available there.
Not sure, it isn't something I've used, I'll look at the code for it soon.
Don't see why it wouldn't be working.
I'll test it in SITL at some point.
Edit: Are you sure your airspeed tuning actually reaches and holds an airspeed?
I did this all in Xplane and the plane would hold the airspeed perfectly at slightly below the minimum throttle setting (33% rather than specified 40%) even while being pushed backwards by the head wind.
This was all in auto mode of course.
I should maybe clarify, in your first post you said: " increasing your airspeed to compensate for wind. Will not exceed your max airspeed (which needs to be set correctly! Otherwise it will dive the plane into the ground trying to gain speed!)"
I know APM will point the nose down to increase airspeed in some cases, but usually only to the cruise air speed, not the maximum airspeed. Are you saying it would point the nose down to increase the ground speed as well, or just increase the throttle, or both?
Ok, I'll look at correcting it. By the way, if you have an airspeed sensor, you will not be using the throttle setting.
Additionally, you should check that target_airspeed is holding steady.
Yes, I do have a airspeed sensor on my actual plane, and the target_airspeed was holding steady at 7m/s (the cruise airspeed) during the above test.