-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Additional TPA breakpoint for low Throttle #13006
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
Conversation
Do you want to test this code? You can flash it directly from Betaflight Configurator:
WARNING: It may be unstable. Use only for testing! |
AUTOMERGE: (FAIL)
|
@SupaflyFPV thanks for testing and sharing your findings :-) |
Rebase on master and update comment Make TPA lower independent from air mode Included tpa_breakpoint_lower_vanish option Changes according to PR comments Corrected comment for API version Bugfix in msp.c Additional TPA breakpoint for low throttle
It may be easier to enable/disable via CLI, and perhaps more functionally clear, to re-name the CLI values:
Not sure about
I tend to like PS: Why do we need a separate threshold, other than just using the existing air mode threshold, to disable TPA_LOW if the user wants it only briefly at arming? |
I see what you mean Could be TPA_LOW_FOR_ARM The seperate threshold was created (used airmode initially) in order to remove the dependency for the feature on airmode. There may be situations where airmode is on a switch or off which complicates...if I remember correctly... |
I am using AIRMODE on a switch (as some might be using Idle Up settings) |
hey guys, thx for the feedback. given names:
dependency to air mode: i assume honestly this PR will mainly be used to tame the quad after arming until take-off for aggressive gains and / or filter settings. |
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
Co-authored-by: Jan Post <Rm2k-Freak@web.de>
@pichim please clarify what exactly tpa_rate_lower achieves, in the table above. |
@@ -237,6 +237,9 @@ typedef struct pidProfile_s { | |||
uint8_t angle_feedforward_smoothing_ms; // Smoothing factor for angle feedforward as time constant in milliseconds | |||
uint8_t angle_earth_ref; // Control amount of "co-ordination" from yaw into roll while pitched forward in angle mode | |||
uint16_t horizon_delay_ms; // delay when Horizon Strength increases, 50 = 500ms time constant | |||
uint8_t tpa_rate_lower; // Percent reduction in P or D at zero throttle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please ensure the comment is absolutely clear. For example, does a value of 20 mean that the TPA effect will cut D to 20% of normal, or result in D that is 80% normal, at zero throttle?
Currently, TPA high of 80 will cut the D to 20% of normal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey chris, since tpa lower is just an extension of tpa I basically copied the logic of how it is applied and adjusted the description according to tpa_rate and tpa_breakpoint. default values in the table above are now correct and the red line in the figure represents the defaults. maybe @SupaflyFPV has some clearer explanations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pichi is very clear in his comment here. "Percent reduction" means that with a value of 20 you will get 20% reduction/attenuation, or 80% of your original value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah its the same as TPA_RATE. It follows the same logic, just for the LOWER breakpoint. 👌
* Removed white spaces and everything that is not new Rebase on master and update comment Make TPA lower independent from air mode Included tpa_breakpoint_lower_vanish option Changes according to PR comments Corrected comment for API version Bugfix in msp.c Additional TPA breakpoint for low throttle * Changes according to PR comments * Update src/main/cms/cms_menu_imu.c Co-authored-by: Jan Post <Rm2k-Freak@web.de> * Update src/main/flight/pid_init.c
Hey @pichim |
@limonspb tbh, i have no idea : - ) i just copied how it was already done for tpa |
@limonspb please fix it :) |
i think |
* Removed white spaces and everything that is not new Rebase on master and update comment Make TPA lower independent from air mode Included tpa_breakpoint_lower_vanish option Changes according to PR comments Corrected comment for API version Bugfix in msp.c Additional TPA breakpoint for low throttle * Changes according to PR comments * Update src/main/cms/cms_menu_imu.c Co-authored-by: Jan Post <Rm2k-Freak@web.de> * Update src/main/flight/pid_init.c
Extension of the current TPA curve to lower the TPA factor for low throttle.
I have observed that the quadcopter can produce rough sounds up to jumping around when a higher loop gain is applied. During flight, these PID and filter settings behave fine and provide sufficient robustness margins, and the motor traces appear acceptable.
I attempted to address this issue through the use of dynamic filters and dynamic D gain; however, I discovered that using static filter and static D term settings result in better flight performance, particularly for handling prop wash.
During testing it was beneficial to extend the TPA curve by reducing the TPA factor for low throttle levels to resolve the quads issues after arming.
Update 13.11.2023
According to @haslinghuis proposal the name of all *_vanish parameters where changed to *_fade.
Parameters
Update 19.08.2023:
Included
tpa_breakpoint_lower_vanish
option so that the lower TPA curve vanishes with air mode. If this is set toON
the the TPA curve starts at0
with the value100 - tpa_rate_lower
and increases linear to100
until 'airmode_start_throttle_percent * 10 + 1000' is reached. TPA lower is only active if air mode is disabled. This means after throttle is overairmode_start_throttle_percent
once TPA lower will no longer be active and the user has full PID strength at low throttle.Also want to thank @SupaflyFPV and @KarateBrot for the discussions, the testing and helping with with the code itself.
Update 31.08.2023:
Removed dependency from TPA lower with the vanish option
ON
andairmode_start_throttle_percent
. The behavior of TPA is now dependent only on the three parameters listed below.Parameters
Propposed Default TPA Curve
Measured Sensitivity Function Roll-Axis