Cleanflight - What's your favorite PID controller?

Which of the new PID controllers do you prefer?

  • PID 0 MultiWii (old)

    Votes: 3 4.9%
  • PID 1 MultiWii (rewrite)

    Votes: 12 19.7%
  • PID 2 LuxFloat

    Votes: 23 37.7%
  • PID 3 MultiWii (2.3 - latest)

    Votes: 20 32.8%
  • PID 4 MultiWii (2.3 - hybrid)

    Votes: 2 3.3%
  • PID 5 Harakiri

    Votes: 2 3.3%

  • Total voters
    61

kah00na

Senior Member
Can someone explain what a "PID controller" is? I've seen it in CleanFlight, but didn't know what it was.
 

Craftydan

Hostage Taker of Quads
Staff member
Moderator
Mentor
Here's a couple of good videos covering it:




it's a complicated subject and he does a pretty good job covering it, but just hitting his full overview is SEVERAL hours . . . but his intro videos do a good job of hitting the high points in a few minutes.
 

narcolepticltd

I unbuild stuff regularly
Ok so, on the mixy mix custom mix funtime, I did find the following article that explains it a bit more indepth than the cleanflight wiki... haven't read through all of it, but it looks like this might get my brain back together...

http://blog.oscarliang.net/custom-motor-output-mix-quadcopter/

if I have time this weekend I might dork around with a custom mixer on the twitchy tricopter... although the motors are equal distance apart, the FC sits forward of center, so that changes the angles and distances in relation to the motors and FC. I'll probably end up tearing something up and then just go back to a saved config... but gotta at least test it out =)
 

narcolepticltd

I unbuild stuff regularly
FGA, are you using LuxFloat on your warp, and is this the fix you were speaking of?

NOTE: Your pid controller 2 (LuxFloat) P/R/Y I term values should be divided by 10 to retain previous flight behavior when upgrading from < v1.8.0

Curious what your current setup looks like (although I'll be on 3s)
 

FinalGlideAus

terrorizing squirrels
Not using PID 2 on my Warpquad as I haven't tuned it for that yet but will soon. Been busy with the FPV side lately. I will have a PID 2 video out in the next 24hrs hopefully. It's half finished currently...
 

narcolepticltd

I unbuild stuff regularly
Not using PID 2 on my Warpquad as I haven't tuned it for that yet but will soon. Been busy with the FPV side lately. I will have a PID 2 video out in the next 24hrs hopefully. It's half finished currently...

Looking forward to that. I've only messed around with PID 5, and let my looptime slide back to default 3500 when I rolled back and missed it in the CLI (and was wondering why it was flying like crap). Now that things are back in place, I need to push a few batteries through it on 5 and 3 to see if I can notice any discernible difference.
 

kah00na

Senior Member
I finally figured out what you guys are talking about. This has to do with the "PID Controller" drop-down menu in CleanFlight on the "PID Tuning" tab. Shesh... I've always been using 0 because I had no idea what that was so I never changed it. Okay, I'm NOT asking what PIDs are or for anyone to explain them... what are "PID Controllers"? I'm guessing the answer is... PID Controllers are the brains that read and interpret the stick inputs and read the PID tuning that has been done to figure out how to adjust the motors in order to achieve what it is being instructed to do. The different "PID Controllers" must be different generations or iterations of that software written by different people. Uh, right?
 

narcolepticltd

I unbuild stuff regularly
I finally figured out what you guys are talking about. This has to do with the "PID Controller" drop-down menu in CleanFlight on the "PID Tuning" tab. Shesh... I've always been using 0 because I had no idea what that was so I never changed it. Okay, I'm NOT asking what PIDs are or for anyone to explain them... what are "PID Controllers"? I'm guessing the answer is... PID Controllers are the brains that read and interpret the stick inputs and read the PID tuning that has been done to figure out how to adjust the motors in order to achieve what it is being instructed to do. The different "PID Controllers" must be different generations or iterations of that software written by different people. Uh, right?

Sorry man... it was April 1st and I just figured you were trolling a little bit :p I'd already messed with some folks online earlier so I was expecting some kind of karmic internet retribution.
 

FinalGlideAus

terrorizing squirrels
I finally figured out what you guys are talking about. This has to do with the "PID Controller" drop-down menu in CleanFlight on the "PID Tuning" tab. Shesh... I've always been using 0 because I had no idea what that was so I never changed it. Okay, I'm NOT asking what PIDs are or for anyone to explain them... what are "PID Controllers"? I'm guessing the answer is... PID Controllers are the brains that read and interpret the stick inputs and read the PID tuning that has been done to figure out how to adjust the motors in order to achieve what it is being instructed to do. The different "PID Controllers" must be different generations or iterations of that software written by different people. Uh, right?

Simply put PID controller is the mathematical equation that takes the gyro and stick information and works out what to tell the motors to do so basically, yes it's the brains (software side). The thing is, these PID controllers are fairly complex and there is more than one way to accomplish the task i.e. the KK2 is different again and only has PI controller. Each of the different PID controllers are a slightly different mathematical equation with extra bits added here and there to achieve what the person who made it requires. The trick is finding the one which does the intended job the best.

As Quads and FC's evolve and become more powerful, so do the PID controllers. The current default PID controller is a Multiwii 2.2 controller which has been superseded a long time ago by Multiwii2.3 (which is PID 3 in Cleanflight). We can thank Timecop for not bothering to update to a newer and better PID controller but since Dominic came along with Cleanflight we now can. All these PID controllers were put on so people could test and we can decide which ones stay and which ones go. I would think that PID 0 and PID 4 will disappear soon as they are fairly useless. As nice as PID 5 is, unless the roll and pitch get uncoupled from RCrate I also class that PID controller as useless too.
 
Last edited:

narcolepticltd

I unbuild stuff regularly
Had a good bit of fun today learning to tune on PID 2 (thanks again for the starting gains FGA). It definitely feels completely different compared to PID 5 and PID 3. I still need some time with it to get it dialed in properly, but I now have a flyable tune for the time being. Had to do it manually, as after wasting 2 batteries trying to tune in flight, I realized it was only working to increment gains in the configurator. In flight none of my changes were saved (not going to roll back to 1.8.0 just to test right now).

One odd thing I just wanted to see if you can clear up... It looks like the normal gains from the non-float PID controllers are still present, and using LuxFloat modifies the pitchf/rollf/yawf values instead:

set pid_controller = 2
set p_pitch = 30
set i_pitch = 30
set d_pitch = 25
set p_roll = 30
set i_roll = 30
set d_roll = 25
set p_yaw = 30
set i_yaw = 20
set d_yaw = 0
set p_pitchf = 2.100
set i_pitchf = 0.480
set d_pitchf = 0.025
set p_rollf = 2.100
set i_rollf = 0.480
set d_rollf = 0.025
set p_yawf = 2.000
set i_yawf = 0.350
set d_yawf = 0.020
 

FinalGlideAus

terrorizing squirrels
Correct, PID 2 is a floating point PID controller so has a separate section. Exactly why, well one of the PID guru's will have to tell you that but I think its how it stores the settings or something.

PID 1 and 2 have a much more linear feel "out of the box" and the rest fee like they have heaps of expo "out of the box" so one feels soft and the other feels twitchy. With PID 1 and 2 I tend to run higher roll/pitch rates and lower RCrates and with the other I tend to run lower roll/pitch rates and higher RCrates. This gives them a similar feel.

BTW: Your Yaw P term seems awfully low for a mini....or was that for a tricopter? Ummm ok forget what I wrote the tri might be quite different, it's been a while since I've dabbled with them.... :)
 

narcolepticltd

I unbuild stuff regularly
Correct, PID 2 is a floating point PID controller so has a separate section. Exactly why, well one of the PID guru's will have to tell you that but I think its how it stores the settings or something.

PID 1 and 2 have a much more linear feel "out of the box" and the rest fee like they have heaps of expo "out of the box" so one feels soft and the other feels twitchy. With PID 1 and 2 I tend to run higher roll/pitch rates and lower RCrates and with the other I tend to run lower roll/pitch rates and higher RCrates. This gives them a similar feel.

BTW: Your Yaw P term seems awfully low for a mini....or was that for a tricopter? Ummm ok forget what I wrote the tri might be quite different, it's been a while since I've dabbled with them.... :)

yaw gains on a tri have been challenging, especially on a 200mm mini. I'm still toying around with it, but it may have something to do with my servo not being up to snuff.
 

FinalGlideAus

terrorizing squirrels
Yes that is the limiting factor on a Tricopter. You will never a get servo to move as fast as a motor can spool up or slow down so the crispness and response of your yaw may be limited to what the servo is able to achieve.
 

Cyberdactyl

Misfit Multirotor Monkey
A couple of things you can do above and beyond gain settings and servo strength for fast yaw is to use a smaller prop and to keep as much of the motor's mass and prop's plane of thrust in-line with the servo's axis.
 

zenguerilla

Senior Member
I don't want to mess this discussion up as I am fairly inexpert, but it seems like the PID Controller, (which I only see a selective option in Cleanflight), is not completely unlike an entirely different fork or version of firmware for each one.

With all the different things that each one does, it is somewhat similar to having stock firmware on a KK2.1, then flashing RC911 or Steveis, etc. Kind of like CF 1.8.0 PC 1, CF 1.8.0 PC 3, CF 1.8.0 PC 5, etc.

With clearly lacking the specific knowledge, I changed from PC 0 to a few others without changing any other settings and with each one the quad went crazy all over the place.
 

narcolepticltd

I unbuild stuff regularly
I don't want to mess this discussion up as I am fairly inexpert, but it seems like the PID Controller, (which I only see a selective option in Cleanflight), is not completely unlike an entirely different fork or version of firmware for each one.

With all the different things that each one does, it is somewhat similar to having stock firmware on a KK2.1, then flashing RC911 or Steveis, etc. Kind of like CF 1.8.0 PC 1, CF 1.8.0 PC 3, CF 1.8.0 PC 5, etc.

With clearly lacking the specific knowledge, I changed from PC 0 to a few others without changing any other settings and with each one the quad went crazy all over the place.


It isn't different firmware, but it is a different module of code written by different developers (and they all have different ways of handling the gains)