Complete idiot learns to tune PIDs

Thorondor

Active member

Before I go wrecking my quad, I'd like to confirm that I picked up everything from this video correctly. Here's my understanding of how to tune a quad:

Disable all the fancy stuff so you only have raw PIDs messing with your flying. Only enable them if you still have problems after tuning. Start with P values to get your preferred sensitivities in. Next, fiddle with D until you get a good balance between control responsiveness and bounceback control. After you get P and D set, play around with I to make you feel either floaty or on rails. When all that's set, test for the problems that those fancy filters are meant to fix (i.e., for anti-gravity throttle punch to see if a corner dips or not) and turn them on as necessary.
 

PsyBorg

Wake up! Time to fly!
PID = Proportional,Integral, Derivative.

I call them Power,Interference, Determination to more closely associate what they do in my brain. the dude in the video does a decent job teaching but is not exactly spot on in definition or use of it all. He also fails to mention that when changing pids you can drastically over heat and smoke motors if you just go swapping numbers randomly like he was doing. If he were using the cheapest parts possible like most builders these days that quad would have fried at least three times in that video.

P... "Power" of the rotation on the controlled axis. This determines how aggressive the inputs will be at the outputs. Basically how hard the changes attack in motion.

I... "Interference" of outside factors like wind, aerodynamics and torque effecting the stability of the craft. This is the push back against those forces and how strong the resistance will be.

D... "Determination" or how hard the controller works to smooth out the efforts of the other two controls.

P and D work as a team up to a point. I is the loner and works by itself as a guardian of P and D.

The first step in PID tuning is to find the rates you will be flying at first as those play a bigger part in how PIDS will function then most "tuners" explain. For example, if you just cruise around and say do cinematic video you want to tune for a non aggressive extremely smooth flight so you would not tune P too high and have the I term very tight to stiffen up any spastic movements in flight. For a flippy floppy freestyle flight you would want a higher P gain for the super crisp response to inputs and an I term setting just high enough to correct for snappy maneuvers and the torque needed to do them. Both styles use different rates and require different control expectations from the FC.

If I were to follow that video (and I just might for this new build I am just finishing) I would disable the filters as shown and begin tuning for different settings for the three styles of flight I want to do with it having it all on switches to change at will. This means I will need to set three rate profiles THEN begin the tuning process for each.

Once rates are set I will start with stock P gain and lower I gain by a third as well as D gains. (NEVER tune in auto leveling modes) I start by raising P gains in beta flight by 10 points with a quick flight to test response and motor temps. I will keep doing that until I get either a spastic response or start feeling higher motor temps on short flights. Then I will bump D gains up at intervals of 2 until the jitteryness eases up. I never use high d gains like most other pilots as I like to have super locked in feel no matter what I fly. I use it more at the end of P gain tuning to smooth out the roughness as well as for motor temp control.

Once that is feeling close to how I like it I will adjust I gains by doing punch outs straight up looking for any changes in yaw, pitch or roll as it goes thru the power cycle of hard throttle up to free falling back down. Once there is no dipping or twisting going up or coming back down I raise I gain a touch more to compensate for the higher average winds we have here.

Bottom line is tuning is a personal preference to how you fly so there is no magic number. You just need a good understanding of what the PID settings do and how to manipulate them to get the craft to do what you want and how you want it to feel. Just be very aware you can fry gear fast with drastic changes so small changes to find the edge of locked is better then big changes crossing that threshold and lighting your esc's and motors on fire.
 

Bricks

Master member
I like the way you renamed PID`s as I am not a true quad guy this helped me understand more of what they do, just by changing the names. I think PID`s should just be named this way across the board it would be much easier for beginners to better understand..
 

Thorondor

Active member
PID = Proportional,Integral, Derivative.

I call them Power,Interference, Determination to more closely associate what they do in my brain. the dude in the video does a decent job teaching but is not exactly spot on in definition or use of it all. He also fails to mention that when changing pids you can drastically over heat and smoke motors if you just go swapping numbers randomly like he was doing. If he were using the cheapest parts possible like most builders these days that quad would have fried at least three times in that video.

P... "Power" of the rotation on the controlled axis. This determines how aggressive the inputs will be at the outputs. Basically how hard the changes attack in motion.

I... "Interference" of outside factors like wind, aerodynamics and torque effecting the stability of the craft. This is the push back against those forces and how strong the resistance will be.

D... "Determination" or how hard the controller works to smooth out the efforts of the other two controls.

P and D work as a team up to a point. I is the loner and works by itself as a guardian of P and D.

The first step in PID tuning is to find the rates you will be flying at first as those play a bigger part in how PIDS will function then most "tuners" explain. For example, if you just cruise around and say do cinematic video you want to tune for a non aggressive extremely smooth flight so you would not tune P too high and have the I term very tight to stiffen up any spastic movements in flight. For a flippy floppy freestyle flight you would want a higher P gain for the super crisp response to inputs and an I term setting just high enough to correct for snappy maneuvers and the torque needed to do them. Both styles use different rates and require different control expectations from the FC.

If I were to follow that video (and I just might for this new build I am just finishing) I would disable the filters as shown and begin tuning for different settings for the three styles of flight I want to do with it having it all on switches to change at will. This means I will need to set three rate profiles THEN begin the tuning process for each.

Once rates are set I will start with stock P gain and lower I gain by a third as well as D gains. (NEVER tune in auto leveling modes) I start by raising P gains in beta flight by 10 points with a quick flight to test response and motor temps. I will keep doing that until I get either a spastic response or start feeling higher motor temps on short flights. Then I will bump D gains up at intervals of 2 until the jitteryness eases up. I never use high d gains like most other pilots as I like to have super locked in feel no matter what I fly. I use it more at the end of P gain tuning to smooth out the roughness as well as for motor temp control.

Once that is feeling close to how I like it I will adjust I gains by doing punch outs straight up looking for any changes in yaw, pitch or roll as it goes thru the power cycle of hard throttle up to free falling back down. Once there is no dipping or twisting going up or coming back down I raise I gain a touch more to compensate for the higher average winds we have here.

Bottom line is tuning is a personal preference to how you fly so there is no magic number. You just need a good understanding of what the PID settings do and how to manipulate them to get the craft to do what you want and how you want it to feel. Just be very aware you can fry gear fast with drastic changes so small changes to find the edge of locked is better then big changes crossing that threshold and lighting your esc's and motors on fire.
Would there be more or less of a risk of burning considering I'm using 802 motors?
 

PsyBorg

Wake up! Time to fly!
Would there be more or less of a risk of burning considering I'm using 802 motors?

The risk is the same on any motor or esc combination. If you go to far they go poof. Realistically there are too many factors to say if a motor or esc is at higher risk. Quality of the electronics is the biggest factor. Cheap parts with wide tolerances at the component level can smoke if you look at them funny. This is why Beta flight devs are making the effort with filtering and very low starting pids so people using a wide range of parts can get in the air long enough to actually tune the gear without starting a fire.

They also scale the resolution of their PIDS differently then others like KISS. For example Kiss P gains for roll on a free style quad range from 3.4ish on 6s up to 4.8ish on 4s. Betaflight can range from low 30s to the 90s as the scaling is different and less sensitive. This allows for a finer tune.

The nice thing is you can play around with the numbers and actually learn what the changes do provided you dont do extreme changes like the kid in the video you linked. Just do one axis and one control type at a time. If things get too wonky you can always go back and default everything provided you are paying attention to heat stress on your gear and you dont pop it.
 

Thorondor

Active member
The risk is the same on any motor or esc combination. If you go to far they go poof. Realistically there are too many factors to say if a motor or esc is at higher risk. Quality of the electronics is the biggest factor. Cheap parts with wide tolerances at the component level can smoke if you look at them funny. This is why Beta flight devs are making the effort with filtering and very low starting pids so people using a wide range of parts can get in the air long enough to actually tune the gear without starting a fire.

They also scale the resolution of their PIDS differently then others like KISS. For example Kiss P gains for roll on a free style quad range from 3.4ish on 6s up to 4.8ish on 4s. Betaflight can range from low 30s to the 90s as the scaling is different and less sensitive. This allows for a finer tune.

The nice thing is you can play around with the numbers and actually learn what the changes do provided you dont do extreme changes like the kid in the video you linked. Just do one axis and one control type at a time. If things get too wonky you can always go back and default everything provided you are paying attention to heat stress on your gear and you dont pop it.
Also, in the video, he changed the PIDS by a ridiculous amount to show what the extremes look like. I assume that if you change them from stock by a few digits at a time there isn't much risk?
 

PsyBorg

Wake up! Time to fly!
Also, in the video, he changed the PIDS by a ridiculous amount to show what the extremes look like. I assume that if you change them from stock by a few digits at a time there isn't much risk?

already gave suggestions in Post#2

Edit: I just finished a 3 inch build and shut off all the filters suggested then started tuning my way. Feels nice and locked in and I am not getting any heating issues at all and it was mid 90s yesterday when I did most of the tuning. It flys more like KISS smooth then Betaflight filtered smooth. Really didnt need much changes other then a slightly higher P on all axis and lower D by about 20%. I still need to play around to get smart audio fully functional though.
 
Last edited:

Piotrsko

Master member
Been my experience that P & D are inversely related, but messing with I gets you in trouble really fast

Why the compleat idiot routine? You're one of the most competent software people I have seen here.
 

"Corpse"

Legendary member
Been my experience that P & D are inversely related, but messing with I gets you in trouble really fast

Why the compleat idiot routine? You're one of the most competent software people I have seen here.
How does messing with I cause trouble? It's just like a long-exposure P gain.
 

Thorondor

Active member
Been my experience that P & D are inversely related, but messing with I gets you in trouble really fast

Why the compleat idiot routine? You're one of the most competent software people I have seen here.
Not sure what you're talking about, I've done little to nothing with software.