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

Kalman on d #205

Closed
wants to merge 13 commits into from
Closed

Kalman on d #205

wants to merge 13 commits into from

Conversation

Quick-Flash
Copy link
Member

This PR takes upon the work done in the kalman non-covariance code and adds more to it. This code takes the kalman filter used on the gyro and puts another kalman filter on the dterm. More testing is needed but it does fly!

bubi-007 and others added 12 commits April 19, 2020 09:21
* Kalman cleanup recommended by Marinus.
* for Non-Helio FC's.
* Needs A/B testing against existing firmware.
* Needs BBL deep analysis.
* Flies well. Zero ill-effect. Potentially better, if not placebo.
* Recommend testing on 6" and 7" quads to feel the difference.
…fluence' of github.com:nerdCopter/EmuFlight_nerdRepo into 20200419_Marinus_Kalman_covariance_without_crossAxis_influence
restructure the kalman filter so it can be used in more places in the code.
@nerdCopter nerdCopter added enhancement Minor enhancement to code help wanted Extra attention is needed do-not-merge hold from merging until fixed or otherwise labels May 3, 2020
@adrianmiriuta
Copy link
Contributor

adrianmiriuta commented May 4, 2020

@Quick-Flash
using the kalman filter after the pid is a good ideea
but using it only on the dterm is not.

You increase the phase delay between PI and D components, this cripples the PID .

I already implemented this approach about half a year ago, (PID->KALMAN->BIQAD)
but I use it only for lightweight tubular builds (it works very good for them).

see
https://github.com/3x8/sulaco/

@Quick-Flash
Copy link
Member Author

@Quick-Flash
using the kalman filter after the pid is a good ideea
but using it only on the dterm is not.

You increase the phase delay between PI and D components, this cripples the PID .

I already implemented this approach about half a year ago, (PID->KALMAN->BIQAD)
but I use it only for lightweight tubular builds (it works very good for them).

see
https://github.com/3x8/sulaco/

If this be the case, is there an advantage in changing the current dterm filters and replacing them with identical pidsum filters?

@adrianmiriuta
Copy link
Contributor

adrianmiriuta commented May 6, 2020

@Quick-Flash
No , it only works for Kalman filter

  1. you can scrap all gyro filtering (less delay)
  2. simplify configuration (only one kalman filter after the PID)

As to practical flight ... I do not know !
I like the feel, it is locked and responsive, but I fly mostly ultralight tubular builds (LOS),
my other builds are also very light ...
It has to be tested in field for FPV ... so i cannot really tell.

My implementation is a quick hack of Butterflight,
where if kalman filter is chosen for dterm it applies to the PIDsum. (not to dTerm)

Although it only works with the kalman filter,
because the output of the PID has much higher noise with higher frequency,
PT1, BIQUAD and other frequency domain filters cannot handle it.

logAndConfig_PIDsumKalman.zip

@Quick-Flash
Copy link
Member Author

Looking at your logs, this is your filtered pidsum
image
Yet your motors look like this
image

Your logging isn't looking at everything correctly or you've changed something between your pidsum and motor mixer.

@adrianmiriuta
Copy link
Contributor

adrianmiriuta commented May 6, 2020

@Quick-Flash
That is Incorrect.

The logged PID traces are before the filter, that is standard Butterflight (betaflight) behavior.

I made no changes there.
I can record a flight with a debug trace,
where the debug values are the filtered PID outputs/ axix.
If that is what you are interested in.

@gretel
Copy link
Contributor

gretel commented May 6, 2020

@adrianmiriuta you figured the temeletry bug, didn't you :)

@adrianmiriuta
Copy link
Contributor

@gretel
yea, that's a long time ago.

@nerdCopter
Copy link
Member

closing due another branch is more up to date

@nerdCopter nerdCopter closed this May 7, 2020
nerdCopter added a commit that referenced this pull request Dec 29, 2020
@Quick-Flash Quick-Flash deleted the kalman-on-D branch December 29, 2020 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge hold from merging until fixed or otherwise enhancement Minor enhancement to code help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants