-
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 PID loop I term wind up fix #9159
Conversation
Now that the AHRS is improved and the GPS update rate has been increased, with more constellations available for higher precision. I am aware, that for both of these controllers to perform at their best, they will likely be influenced or limited by functions like these.
I raise this idea after reading your reply.. But also after expereincing very little benefit of - |
I've noticed that the WP tracking accuracy doesn't work well on faster wings which often seem to be flying wings. It always struggled for flying wings anyway given it's controlling heading which flying wings can't do as accurately as a conventional plane for obvious reasons. Having said that it does work better than the previous method on slower conventional craft that are set up correctly so is useful if you need better accuracy. I simply wouldn't use it if accuracy isn't important. Having said that it could be improved probably by adding PID control ... just a question of whether it's worth it. |
Exactly my findings.
True. Conventional aircraft with a vertical tail seem to benefit more from it..
It seems beneficial in theory, and from what you wrote in your post in #9026. Which I assume you wrote for a test some months back ? |
Does this change make sense @DzikuVx ? Seems to make sense on the face of it and it fixes the original problem related to WP missions but I noticed the I term for multirotor velocity PID gets reset to 0 all the time when it probably shouldn't. Might need rethinking. |
@breadoven I think it makes sense. The I term on MR indeed should be analyzed. It looks like suboptimal approach indeed |
I think we should try limit/freeze integrator first, Since it is a go-to solution for anti-windup in control engineering. |
As far as Nav is concerned the problem seems to be more to do with the fact the control state, mainly PID related especially I term, isn't reset properly when target conditions change. It gets reset changing between modes but not when target conditions change within a mode, e.g. moving to the next WP which has completely different position and altitude settings. Need to find a clean way of resetting the control state when required. Perhaps one way is to simply check if the new desired position has changed significantly from the last desired position which can be done in |
@breadoven in such case I set it to |
@DzikuVx |
I think #9224 is a better solution than this PR as it stands and it appears to fix the original problem although you'd need to check it doesn't affect other things given that the PID controller is used for other stuff such as multirotor velocity control. However, I still think that for WP mode in particular it's sensible to reset the PID loop between WP's simply because the target setpoints between WPs will typically have changed so significantly as to render the current PID status irrelevant. Certainly any other factors such as wind affects will be insignificant compared to the large change in WP target setpoints. |
I think #9224 is quite safe since it only zeros the back calculation in a specific condition. @Jetrell . In #9222, is the current method here refer to #9224 ?
|
The WP setpoint sometimes changes significantly and sometimes doesn't. So it is better to improve the robustness of the PID controller first. If that is impossible/difficult then consider a Reset. |
@shota3527 At the time, I only tested #9222, with bad results. |
This isn't really much of an issue anyway, only causing problems if you set unrealistic altitude changes between waypoints that you should know can't be achieved. Perhaps it's time to try using velocity control for for fixed wing altitude rather than distance. This problem would go away in that case. Can't imagine there are many planes that don't use a Baro if that is the only reason for not using velocity. GPS altitude will probably still work OK just not as accurate. |
You wont get any arguments from me.. Both This issue I see with |
Is it a really good idea to add velocity control for for fixed wing on altitude? Unrealistic altitude changes between waypoints can easily happen. due to user error on unit conversion(M to CM) or miscount of 0s when setting the waypoint altitude. |
Closing since it's unlikely to be used. |
Closes #9026.
Resets I term in Nav PID controller when P term saturated which avoids I term wind up upsetting Nav PID loop when Nav target conditions change.
Tested on HITL sim OK for fixed wing. Needs testing for multirotor.