-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nav altitude control improvements #8920
Nav altitude control improvements #8920
Conversation
Just to clarify for Multicopter testing.
I wasn't completely sure where the two platforms would crossover in the use of this controller.. Does this now mean MC |
The RTH climb phase for MC is unchanged. It never used the altitude rate controller, just set the target altitude directly which uses the MC specific altitude velocity controller to control climb rate. That was part of the reason for making this change, the existing code is a bit inconsistent with controllers used. The altitude rate controller should probably only be used where you want to set a climb rate with no specific target altitude, e.g. when adjusting altitude or performing an emergency descent. |
@breadoven I tested these changes with a multirotor. Then I proceeded to use my MC Cruise mode.. A combination of To elaborate on this combination flight mode. I don't know if this is related. But it always proceeded to climb in Althold, by a meter every couple of seconds. |
Theoretically this change only affects multirotors during the RTH home altitude adjustment phase and during an emergency landing. It shouldn't have any other affect, certainly shouldn't make any difference to AltHold. The main benefit should be for fixed wing. If the AltHold altitude is drifting it will be obvious by checking desired altitude in the BB log. Only reason that should change after AltHold is enabled is by RC adjustment. |
I looked back through the logs.. And it had me stumped for a bit... But found the problem in another test.. Its all good. |
@breadoven I got around to testing this feature today with a fixed wing. It now works much better than before... As it used to descend below the target by up to 15m, when the plane was in the descending loiter, on the headwind side of the circuit. When |
@breadoven In your above two statements.. I assume one is referencing the actual climb out altitude. And the other is the controlled altitude, as its traversing the distance between RTH activation and the home location ? I notice some discrepancies in a few of my multi-rotor RTH tests recently, using the last commit. The observation was seen in the RTH climbout phase.. And the RTH fly home altitude. I thought I'd leave this as a reference, in case you return to this PR at some point. |
This change shouldn't affect MR during climb and on route RTH phases. Only affect is during the adjustment to home altitude. I guess the easiest way of checking if something unforeseen is happening is to look at the desired Z position in the log file. This will confirm if it's targeting the correct settings or not. |
I checked out the log.. As it turns out. The altitude estimation wasn't perfect on the first few flight and the Sat count was rather low in those tests. And it appeared to improved a bit, by the time I moved back to test the original method. So I ran another few tests today, with both firmware's, back to back. With a different quad, that's using an M10 GNSS unit. |
@breadoven I tested this again today with a MC. Using the same settings as linear decent mode. |
Well I don't see any reason not to merge if testing seems OK. Should be an improvement on the current situation. |
Should improve loiter altitude control behaviour during navigation.
Removes use of climb rate controller to control altitude change during certain Nav phases. The required altitude is instead set directly as the target altitude. Seems to give better control due to improved PID behaviour avoiding overshoot issues seen on fixed wing.
Adds target altitude to climb rate controller to allow climb rate reduction as the target altitude is reached. This was used to improve the above initially but then became redundant when climb rate control was removed. However, it still seems useful for Emergency landings to allow a higher rate of descent initially, reducing as take off altitude is approached (doesn't help if landing above take off obviously but it's a useful compromise perhaps). If the target altitude option is not used the altitude rate controller just provides a constant unlimited climb rate.
Also adds a change to reduce max climb pitch for a fixed wing when performing loiter climbs. This is for stall prevention and currently set at 2/3 of the normal max climb pitch setting (
nav_fw_climb_angle
).HITL sim tested OK for FW. Untested on multirotor as of yet.