Conversation
|
There is still one minor issue: the blackbox logs the rate updates as events just like the FF updates, but the new rates are not reflected in the setPointRate traces (at least as displayed in the explorer). They seem to just reflect the initial rates settings. This makes it difficult to verify the tune or troubleshoot other problems if you have done an autotune during the flight. Perhaps this can be fixed in a separate PR. |
448b185 to
036dce3
Compare
|
I added a setting to set the D-gain relative to the P-gain but left the default at zero for now. When the weather permits I will experiment with higher |
|
Would it be worthwhile to also automatically set the max acceleration settings? I keep debating this with myself but I haven't reached a conclusion. |
# Conflicts: # src/main/fc/settings.yaml
# Conflicts: # src/main/fc/settings.yaml
# Conflicts: # docs/Settings.md # src/main/build/debug.h # src/main/fc/settings.yaml
# Conflicts: # src/main/build/debug.h # src/main/fc/settings.yaml
# Conflicts: # src/main/build/debug.h # src/main/fc/settings.yaml
Now tested and working
This PR improves the autotune mode on fixed wing by letting autotune set the correct rates for your airplane (closes #6025). There are three autotune 'modes': with
AUTOautotune will automatically adjust the max rate settings according to the capabilities of the airplane by setting the rates consistent with 80% control surface deflection. This leaves 20% room for P and I to provide stabilization.LIMITworks the same asAUTObut the rates are never increased above the starting values. This could be useful if you have a very agile plane and want to limit the rates. WithFIXEDthe rates are not changed.The basic algorithm is as follows. When the stick input goes above 80%, autotune for 250ms records the target rate, the realized rate, and the PID output send to the mixer. After this period it will use the maximum observed values to calculate what the rotation rate would be at 80% control surface deflection. The rate setting is then updated from the current value towards this optimal value by 10% of the difference. For example, if the current rate is 150 deg/s and it calculates the optimal rate is 300 deg/s, then the new rate is
150 + (300 - 150) * 10% = 165. The FF update work in a similar fashion, where it calculates what FF value is needed to achieve the current rate target.Here is some dvr with the
AUTOmode:Autotune.AUTO.mode.mp4
I made
AUTOthe default mode because this gives rates close to what they would be in manual mode. iNavFlight/inav-configurator#1188 will set conservative default rates that any airplane will be able to achieve. If users with more agile planes tune from that starting point then the other modes will cause small servo throws. This could cause a lot of support questions.Thanks @b14ckyy for helping with testing and ironing out the kinks in the logic 👍