Skip to content
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

Navpid back calculation anti-windup can only shrink integrator #9224

Merged
merged 3 commits into from
Dec 8, 2023

Conversation

shota3527
Copy link
Contributor

@shota3527 shota3527 commented Aug 7, 2023

Close #9026
Replace #9222
Replace #9159

From here we can see the real problem is opposite i-term accumulation, It should be positive all the time. But it is negative in this video
#9026 (comment)
image

Changes:

Prevent opposite iterm accumulation in nav pid controller when nav pid controller is saturated a lot. Keep original back-calculation anti-windup feature behaves the same in most of the time

TEST in SITL, waypoint altitude setting is 1000m and 50m
https://youtu.be/BpIjCNhJQlA

Quads in SITL,waypoint altitude setting is 200m and 50m
https://youtu.be/8E7bP7ufIjU

@shota3527
Copy link
Contributor Author

shota3527 commented Nov 7, 2023

I think a similar problem might affecting the MC vel pid.

@shota3527 shota3527 changed the title navpid back calculation anti-windup can only shrink integrator Navpid back calculation anti-windup can only shrink integrator Nov 14, 2023
@shota3527
Copy link
Contributor Author

shota3527 commented Nov 14, 2023

@breadoven
I have found a similar problem exists MC vel pid.
Screenshot 2023-11-15 022934
The navigation mode is activated at 16.760s, at that moment, I term on x is 0
At 17.640s the iterm is already +282 and continues growing. iterm should be negative at this moment. since the setpoint is lower than the actual speed.

And at 22.804.
Screenshot 2023-11-15 023400
We can see that it still hasn`t reached the target vel. And wrong accumulated iterm is working against the p and ff term.

I suggest to merge this PR to fix Iterm issues in ALL NAV pid controller

@shota3527
Copy link
Contributor Author

shota3527 commented Nov 15, 2023

Evidence of the opposite i-term problem is found in both FW and MC nav controllers.
The side effect is very limited since this PR only stop the back-calculation anti-windup when it is working too hard
And real mc fly test have been conducted without problems.

A similar solution has been implemented in the angular rate controller at #9215
It was used during VTOL testing, and no problems were found.

@breadoven
Copy link
Collaborator

Any objection to merging this @DzikuVx ?

@DzikuVx DzikuVx added this to the 7.1 milestone Dec 7, 2023
@DzikuVx DzikuVx changed the base branch from master to release_7.1.0 December 8, 2023 09:06
@DzikuVx DzikuVx merged commit fc08d44 into iNavFlight:release_7.1.0 Dec 8, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fixed wing - dive at waypoints if target altitude is not reached
3 participants