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

jipp

Senior Member
i have been reading this thread, i can't seem to get the yaw i want without the pitch and roll being crazy as well. maybe i just need to learn to fly the pid 2 that i had in a 1 time. LOL

The computer is going with me to the field next time so i can change stuff and check it right then.

where do you usually fly?
chris.

yeah i did see clean flight was ported to CC3D. i was mostly joking about not running CC3D>. at this point i just need to learn how to build a quad, then tune/fly.. even tho flying/tuning seem to go together it would appear.
i want to try naz and also brainFPV tau.. for now i will keep OP on then CC3D. ( i figure every FC is gonna have its strong point.. so you have to try them out to see what you like.. some of the guys flying naz maybe get better at flying if they were flying another board.. im probably talking out my rear here but if its anything like cars it sorta makes sense you have to set it up with the hardware/brand you like.. somethings just fit us better, i can not see why FC would not be the same way..even if its just mentally if that is what it takes to make you become a grade A pilot so be it. )

i have my quad ready to plug a battery in now.. but im gonna wait till morning. i am feeling physically better today..ok, like i maybe able to sleep tonight. and if i do something stupid and get blue smoke it will ruin my night and ill be up all night taking it apart etc..

chris.
 
Last edited:

jipp

Senior Member
i fly different places but mostly in chandler lately as i have been flying with Capt_Beavis on sundays.

thats cool. i sometimes forget how big this valley is. have a great day flying.

im reading the release notes for Open Pilot right now.
we will see if i get blue smoke or not in a hour or so.

heh, im guessing smoke!


chris.
 

notreallyme

New member
OK PID2 lux float gets my vote, finally found some settings that make it do what i want when i want. Here are some quick vids from today.
 

jipp

Senior Member
looks like a fun day. had a twitch in the motor it sounded like in the fist video. was that from playing with pids?
chris.
 

notreallyme

New member
at what time in the video are you talking about? not sure about the twitch you are talking about. if you are talking about the shaking that was happening when i was turning and descending at the same time. i know i still have some tuning to do but pid 2 is my new fav just needs a little tweaking.
 
Last edited:

narcolepticltd

I unbuild stuff regularly
looks like a fun day. had a twitch in the motor it sounded like in the fist video. was that from playing with pids?
chris.

those were just oscillations from dropping altitude/throttle, and go away once you get everything tuned up. Looking good notreallyme! glad you're liking PID 2 :)
 

notreallyme

New member
Thanks

The rolls are a little slow(i think i can fix that), and the oscillations from turning and dropping down needs a little attention(not sure how to get that to go away). but i do like the progress that pid2 gave me.
 

narcolepticltd

I unbuild stuff regularly
Thanks

The rolls are a little slow(i think i can fix that), and the oscillations from turning and dropping down needs a little attention(not sure how to get that to go away). but i do like the progress that pid2 gave me.

for your rolls and flips, try upping the roll/pitch/yaw rates on the same tab as the pid gains, over on the right hand side. Up them slowly till you find the spot where you're comfortable.

also, just incase (cause I was suffering from this initially), before you make any adjustments to the RC rate or roll/pitch/yaw rate, make sure your roll/pitch/yaw/throttle move the full range from 1000 to 2000 left/right/up/down, as that will give you a lot more resolution and umph (has to be done from your transmitter in mixing).
 

notreallyme

New member
thx Narco, i will recheck to make sure i have full range(i believe i have this done already) and yes the roll and pitch rates is what i was talking about to fix the speed of rolls. do you have any suggestions for the oscillations? not sure where to go to fix them.
 

SHIFFTY

Junior Member
I get those same twitches in mine as well... haven't started tuning the PID's yet tho either just been flying it as it is. which of the settings do you need to adjust to get those small shakes out of it? still new to the tuning aspect of this
 

narcolepticltd

I unbuild stuff regularly
thx Narco, i will recheck to make sure i have full range(i believe i have this done already) and yes the roll and pitch rates is what i was talking about to fix the speed of rolls. do you have any suggestions for the oscillations? not sure where to go to fix them.

PM me your gains and rates (or post them here for the experts to see and offer advice).
 

Ocean

Member
Sorry to piggy back your thread but felt this didnt deserve a whole new thread...

I was tuning on PID 1 today and managed to push the P way up to over 7 (was using BLHeli 13.1 with oneshot), however I noticed that there were slight oscillations at anywhere above 50% throttle, usually I would just crank up TPA but since PID 1 doesn't use this, what do I do? Is this just a bad tune due to wrong I and D gains or too high P as well?

Also, there is little documentation on how to tune the D gain, most people say it changes the way your P and I interact and you have have to adjust them once tuning D. But how do you actually tune the D gain?
 

FinalGlideAus

terrorizing squirrels
Sorry to piggy back your thread but felt this didnt deserve a whole new thread...

I was tuning on PID 1 today and managed to push the P way up to over 7 (was using BLHeli 13.1 with oneshot), however I noticed that there were slight oscillations at anywhere above 50% throttle, usually I would just crank up TPA but since PID 1 doesn't use this, what do I do? Is this just a bad tune due to wrong I and D gains or too high P as well?

Also, there is little documentation on how to tune the D gain, most people say it changes the way your P and I interact and you have have to adjust them once tuning D. But how do you actually tune the D gain?

D (Derivative) tries to guess what is going to happen next based on past sensor readings. If you have P and I set perfectly but have D set to zero and try to do a quick roll and center the stick quickly afterwards, you will find the quad will wobble on the roll axis for a second and then settle down. This because the P term is doing exactly as you command but when you stop the roll quickly it has no warning and goes past the point at which you asked it to stop so it tries to correct quickly, but doing so it goes past the other direction. These over corrections get smaller and smaller until it reaches the point it intended originally.

Now, if you have the correct amount of D term it will see that you are quickly starting to center the stick when stopping the roll and take corrective action to not go past the intended stopping point. You would think that just using heaps of D would be the answer but that has side effects too. Too much D will make the quad less responsive because it is trying think too much and preempt what you are doing.

So basically you enough D to stop the wobbles but not too much that it slows down the response. Note that D has an effect on the other parameters I the PID loop so they "may" need tweaking after adjusting D.

Hope that helps...
 

joshuabardwell

Senior Member
Mentor
Another way to think about the D term is that the D term prevents overshoot on the other two terms. It acts to damp down the correction force applied by the P and I terms as the quad's position gets closer to "correct". Let's say that we have just a P term, and you input a sudden stick input. The FC detects that the quad's intended position no longer matches its intended position and applies force to correct. Because the quad is far away from its intended position, the P term is large and so is the correction force.

What happens as the quad's position approaches "correct"? The P term gets smaller, and so does the correction force. If the P term is too large, the quad will overshoot the "correct" position (just due to momentum) and that's where you get oscillations from. Okay, so you reduce the P term to a smaller value, and now the quad doesn't oscillate, but it doesn't have a good and snappy response either. So now you turn up the D term. Now, when the quad is far from the intended position, the correction force is large, but as it gets closer to the intended position, the D term causes a reduction in the output of the PID loop. So think about it numerically: Output = P * D. If we are far away from the "correct" position, D = 1 and P is unchanged. As we approach the "correct" position, D gets smaller and P is damped down.

The net effect is that a higher D term lets you raise your P term without overshoot, which means you can have a snappy, responsive quad, without oscillations. One approach to tuning P and D is to set I and D to zero, then raise P until oscillations just appear, then raise D until the oscillations go away. Now raise P a little bit more until the oscillations come back. Finally, raise I until the quad holds its attitude and heading steadily when there are no inputs. Now see how she flies.
 

FinalGlideAus

terrorizing squirrels
That seems to be the standard response to tuning a quad but I found that method early on to be tiresome and annoying. Each parameter changes its own specific set of features so if you understand that then there is no need to turn I and D to zero and make life hard for yourself. I start with a rough guess of PID's that will be at least close and so long as it flies ok I then get roll/pitch rates and expo set so they feel nice also. If the quad is flying not too bad at this stage I go right to tuning D on roll and pitch. Remember that if you start at P then I then D you will have to go back and adjust P and I again so you may as well Start on D if the others are close and save yourself the hassle. Once the oscillations are gone from abrupt stick movements I then focus on P gains to get a crisp resonce and and remove the single bounce from abrupt control inputs. After that work on I gaiñs so the quad holds postion well. Finally I work on yaw P and I gaiñs. This is all done LOS and gets me very close so the next step is putting on the goggles and fine tuning any issues I couldn't pick flying LOS. The final step is to record at 60fps and playback on my computer to watch for anything strange that I couldnr see through the goggles.

Note that the first tuning step via LOS will get you 95% there and is plenty good enough for most pilots.
 
Last edited:

narcolepticltd

I unbuild stuff regularly
That seems to be the standard response to tuning a quad but I found that method early on to be tiresome and annoying. Each parameter changes its own specific set of features so if you understand that then there is no need to turn I and D to zero and make life hard for yourself. I start with a rough guess of PID's that will be at least close and so long as it flies ok I then get roll/pitch rates and expo set so they feel nice also. If the quad is flying not too bad at this stage I go right to tuning D on roll and pitch. Remember that if you start at P then I then D you will have to go back and adjust P and I again so you may as well Start on D if the others are close and save yourself the hassle. Once the oscillations are gone from abrupt stick movements I then focus on P gains to get a crisp resonce and and remove the single bounce from abrupt control inputs. After that work on I gaiñs so the quad holds postion well. Finally I work on yaw P and I gaiñs. This is all done LOS and gets me very close so the next step is putting on the goggles and fine tuning any issues I couldn't pick flying LOS. The final step is to record at 60fps and playback on my computer to watch for anything strange that I couldnr see through the goggles.

Note that the first tuning step via LOS will get you 95% there and is plenty good enough for most pilots.

I feel like I'm back in school every time this thread gets replies... at least this time I'm not sleeping!
 

jipp

Senior Member
I feel like I'm back in school every time this thread gets replies... at least this time I'm not sleeping!

its fun to learn when one is interested in the subject.. cough cough high school was such a joke.. teach the same thing they did in 8th grade all over again, blah i had much more fun at college and was a much better student.. compared to high school and the only reason i kept going to high school was for the girls. heh.

chris.