-
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
[Multirotors only] Small improvements to the vertical position controller #9554
Closed
JulioCesarMatias
wants to merge
24
commits into
iNavFlight:master
from
JulioCesarMatias:AltHoldImprovs
Closed
[Multirotors only] Small improvements to the vertical position controller #9554
JulioCesarMatias
wants to merge
24
commits into
iNavFlight:master
from
JulioCesarMatias:AltHoldImprovs
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a new approach to Altitude-Hold, which consists of making the Z Position control algorithm more intelligent.
All vertical control P and PID controllers contain the following filters (which are as macros):
#define NAV_MC_VEL_Z_ERROR_CUT_HZ 5 // Low-Pass filter on velocity P error in Alt-Hold
#define NAV_MC_ACC_Z_ERROR_CUT_HZ 20 // Low-Pass filter on acceleration PID error in Alt-Hold
And it also contains some other macros that have also been added:
#define NAV_MC_INTEGRAL_RELAX_TC_Z 0.10f // Acceleration PID Integral relaxation time constant is used to decay the I term to 3% in half a second.
#define NAV_MC_OVERSPEED_GAIN_Z 2.0f // Gain controlling rate at which z-axis speed is brought back within velMaxDownCms and velMaxUpCms range ("max_manual_climb_rate" and "max_auto_climb_rate" params).
The commands to configure Altitude-Hold mode are available in the
PID Tunning
tab, or via CLI. Below is the list:Param Name:
nav_mc_pos_z_p
Description:Position Z controller P gain. Converts the difference between the desired altitude and actual altitude into a climb or descent rate which is passed to the throttle rate controller
Param Name:
nav_mc_vel_z_p
Description:Velocity Z controller P gain. Converts the difference between desired vertical speed and actual speed into a desired acceleration that is passed to the throttle acceleration controller
Param Name:
nav_mc_acc_z_p
Description:Acceleration Z controller P gain. Converts the difference between desired vertical acceleration and actual acceleration into a motor output
Param Name:
nav_mc_acc_z_i
Description:Acceleration Z controller I gain. Corrects long-term difference in desired vertical acceleration and actual acceleration
Param Name:
nav_mc_acc_z_d
Description:Acceleration Z controller D gain. Compensates for short-term change in desired vertical acceleration vs actual acceleration
Param Name:
nav_jerk_z
Description:Jerk limit of the vertical kinematic path generation used to determine how quickly the aircraft varies the acceleration target