inav icon indicating copy to clipboard operation
inav copied to clipboard

Refactoring on pid iterm

Open shota3527 opened this issue 2 years ago • 4 comments

Some pid refactoring mainly addresses the accumulation of iterm. I believe this will improve flight performance on low-authority multirotor, such as vtol platform.

Changes:

  1. Stronger iterm_windup, enhances the effectiveness when the value is set below the default value(50), no accumulation occurs when iterm_windup+50 of motor correction range is reached. When value is set to equal or above 50, remain the same behaviors as the current master.
  2. ~~combine itermLimitActive with itermFreezeActive to itermFreezeActive. Because the actual itermLimitActive implementation has the same result as itermFreezeActive~~
  3. remove fw_iterm_throw_limit and introduce pid_iterm_limit_percent
  4. pid_iterm_limit_percent limit the accumulated iterm by percentage of pidsum_limit or pidsum_limit. This iterm limit is also applied to MR pid controller. The default value is set to 33%, which behaves the same as fw_iterm_throw_limit default 165.
  5. add option to enable tpa on yaw axis
  6. I term back caculation anti-windup can not push the I iterm to opposite direction

Have done some tests with SITL in the real flight simulator, The flight performance was terrible but become acceptable with vtol platforms

shota3527 avatar Aug 05 '23 05:08 shota3527

e6e9ee1e33a2cfb8585e9bc2e2fc8da1e3e009e8 we need something equivalent to IMAX

shota3527 avatar Aug 05 '23 12:08 shota3527

Ah, I thought it's for MR and wanted to test it today :)

DzikuVx avatar Aug 10 '23 08:08 DzikuVx

after some study, i have found this pr https://github.com/iNavFlight/inav/pull/6387

thinking about revert this

combine itermLimitActive with itermFreezeActive to itermFreezeActive. Because the actual itermLimitActive implementation has the same result as itermFreezeActive

shota3527 avatar Oct 05 '23 07:10 shota3527

@shota3527 I see this was opened, then closed, then re-opened. Is it still current?

sensei-hacker avatar May 26 '25 18:05 sensei-hacker