Multicopter Tuning - Introduction to PID theory and how to tune your multirotor
HTML-код
- Опубликовано: 7 сен 2024
- Consider supporting the channel by visiting www.patreon.com/painless360
In this video we cover how the parts work in a PID loop and then use that know how to look at simple ways we can test if the PID settings are right on our model.
The main party of this video is the same content as one that was a hidden video for subscribers back in the Spring of 2015 but due to the overwhelming demand I've updated the content and added some flight video to help explain the topic.
Understanding how the Proportional, Integral and Derivative parts of the control loops work is vital to helping newer pilots get the best tune they can as quickly as they can.
In this video we cover:
- Introduction (0:02)
- Things to consider (2:32)
- What P, I and D are and how they work (5:03)
- How we can check and tune our PID levels (9:13)
- Things to consider when tuning (12:54)
Thanks for watching, please LIKE and SUBSCRIBE.
Happy flying!
You are one of the few english speaking I do understand without trouble. And I am used to american accent having lived in the US for a while. This is a way of showing kindness and appreciation to subscribers. Your videos are really Painless! Thanks.
+probante Thank you! :D
English is not my native language and you are one of the people I enjoy to listen talking and I fully understand everything.
this 1 video, has now made my understanding of sorting my PIDs out a lot simpler for me ...and a lot of others I seen from the comments, once again great work sir....
+CX20 BIGSHARK Dave Brown Thanks Dave, I;m so pleased that I got the level right for most of the audience. Hope it helps you get your models dialled in..
3 years since the last feedback, man, know ur video is still helping people, im for Brazil, and never found a video in my language wich was even close to the quality of your explanatio. didnt have much trouble whith naza v2, but almost quit minipix board, but now im able to calibrate both with accuracy. thank you man, keep up the good work!
You might not hear this a lot, but hot damn, it is incredibly nice that you're so good at explaining it and so thorough. There is no doubt about anything you say. Doubt is dead. Good job.
Thank you! :D
Man, thats the best explanation of PID's on the entire interwebs, Thanks Chief! I finally get it, just need to suss out the TPA now.
+Mighty Chu "TPA basically allows an aggressively tuned multi-rotor (one that feels very locked in) to reduce its PID gains when throttle is applied beyond the TPA threshold/breakpoint in order to eliminate fast oscillations.." ;)
+Painless360 Ah right, I wont worry too much about that until i'v gone around the PID's a few times then, brilliant. Thanks again man! Really apreciate your channel.
This hobby has changed so much over the course of a year. Most of the components on that quad are outdated in today's standards! I can't wait to see where we will be next year, and then I'll be writing this same comment again. :D
Thank you for clarifying "PID" my 20 years automotive driveability, electrical, sport tuning kicked in my craft is smooth as glass. Excellent explanation of protocol and theory. Great video!
an explanation that makes sense and it's easy to understand coming from a trusted Source thank you
You're very welcome, glad it made sense.. Happy flying!
your the best! took you 18 min to explain what needs to known. many many many thanks ! in the air whitout issues straight after this vid.
Great to hear - happy flying!
just wanted to say this may have been the best RUclips informational vid I've seen. I'm in corporate training and we pay loads for this level of org and infotainment. Well done on the gloss, but more importantly PIDs now make sense to me. Thank you!
Glad it made sense. My professional life I'm a business dev/consultancy chap that spends a lot of time creating models for businesses and delivering custom training. Glad it shows :D Happy flying!
Thank you so much for sharing your knowledge with us . I never thought I would understand this pid tuning stuff . Thanks to this video and your analogies I clear understand how things work now . Learned something new today 🤓
Good Heaven's folks! I studied this almost 50 years ago now. It's the science, some would say the art, of Cybernetics. I vaguely remeber the Nyquist stability criteria! This video, to my mind, is a very good explanation of a really complex subject. Compex because the theory behind it involves something called 'imaginary numbers' which together with 'real' numbers make the mathematical concept of, guess what, a complex number. I really like the way this has been presented. Only wish I could have used it back then to build a UAV. We had the control theory, but lacked the miniturised technology. Back then it would probably have been done with analog rather than digital computers. What a wonderful and mind stetching hobby this is. I'm going to present this extreemly valuable aspect shortly to my Member of Parliament. Bob UK. (Edited for poor spelling).
Best of luck with the presentation! Break a leg ;)
RC PID tuning video...posted day 1...over 100+ likes...You are a great teacher. Thanks for the vids.
I know, it's an oldie, but it's also a goldie. Thanks for the class, mate.
Good information. It took a while, years ago, to wrap my head around them and while I'm no pro, it usually only takes one good battery to get great numbers. Then I usually take a couple more batteries flying around and slightly tweaking them if needed and setting the other parameters that surround the flight characteristics of the specific board I am using. I subscribe to the D, then P, and finally I method (Dave's).
finally an explanation that I understand tnx painless 360!
Glad it makes sense!
+painless360 you have the best quad tutorials on RUclips
+JJc6996 Thank you.
Thanks, just got done building my first quad and some of ur videos have helped me out so much.
Very good primer on PID. Now I am interested to delve deeper and get the maths behind it.
Very good explanation, going to tweek my PID's now rather than rely on autotune, its got a bit twitchy since going to DJI props on my CX20
Tks for the video , my quad had the shakes, your video explaination has help me fixed the problem
I clicked on this to learn about PID's and I didn't even realize that you had a Nighthawk pro. That is just a bonus because I alos have it! Anyway thank you for the info!
Very much thank you Doc! my rotorhead is healed! Great insights around PID tuning.
Building my first quad with CC3D (yeah, the oldie). I find your videos very informative, thank you.
Thanks for the explanation. This is my first time dealing with control loops and you made it easy to understand. Keep the great videos coming!
Very well explained. Your channel is a great resource.
thanks for your help mate. I just needed to calibrate the esc's properly. Thought I'd done it right the first time but obviously not. Anyway thanks again mate, if it wasn't for videos like yours id never have got off the ground.
Glad to hear you're flying! Best of luck!
Best PID explanation I have experienced so far! Thank you as always!
how can this video not have 1.000.000 likes? I guess there are more than 1000000 drone pilots out there, so why?
.... like the quad, ghost, flying thingy. Adding another piece to the puzzle thanks for the info, brain hurt on this one.
thank u for this video now i finaly under stand pid (i already have watched tens of video's about pid)
A big thanks for all your great videos
I have watched a lot of your videos and always learn something, thanks!
pneumatics and electronics? sounds like my job!
Good stuff man
+magicalpencil Then this should make sense ;) Happy flying!
Painless360 yeah! cheers man, it has been a good day for flying, for once!
Thank you...exactly what I was looking for. Great video by the way.. more detailed than most
love the toilet analogy....i have learned a lot from u...the thing is now every time i take a whizz....i want to reset my pids!!....thank u so much!!
hi mate. time to change the name of the channel to rc academy..... we ll call you the professor..... also can you do a video about batteries....your experience with different brands.... thanks a loy
+alisher rakhimov Thanks for the feeback and idea! Happy flying!
Thank you so much for this video! I now actually have an understanding of this.
Center of Gravity on the craft will affect the way it handles and can blur tuning efforts. The most common mistake with new pilots and modelers is to have the weight too far back with CoG behind the flight controller. This will make the quad feel as if the rear wants to wash out, and some of that lifting in FFF you mention.
Tilted motor mounts, dihedral mounts on arm or motor, and motor plane on frame will also affect tuning. Regardless, Painless360 still covers the "feel" of what needs to be tuned so if you apply the concepts, then you will still find the quad tuned better.
Centering the weight so the craft sets level at the center of the FC if possible will make tuning quick work though.
+Hiway Great points Hiway!
So true about CoG too far back. Happened to me on a QAV250 where on yaw it was so slippery. Solution - repositioning components for better balance and CoG.
modern day FC's can compensate
3 days before my birthday!
Thanks for taking the time to make this video!
Great video made it very understanding 👍 Thank you very much👍👊
Brilliant explanation!
thanks for good tutorial, you are great teacher
+oh yeah Thank you..
also you can tune a non square quad. zmr etc by modifying the CLI settings in clean flight. Oscar lang has a great tutorial on it.
Excellent. just what I wanted. Thanks
+wad5uk Glad it made sense, this was one of the hardest videos get a level of detail that would be useful and not to complex or patronising! Happy flying!
Very helpful video, thanks a lot.
Thanks again for an excellent video.
great stuff! feels much clearer now thanks.
seems like someone could take that slide at the 12:00 mark and make a mini game out of it. some basic 2d wireframe thing where people could play with the PID settings to nail in a good flight, with a randomized sweet spot each reset so it's not a memorize the numbers to finish the "game" sorta deal.
you are a genius. thank you so much
+maxdessureault Thank you for watching and commenting!
Love your backyard. You can come anytime to get mine to look like yours! :) Another great video, thanks!
:D Happy flying!
Thank you for this video
wow! im adhd and Damn this helped a lot haha
Thanks alot for taking your time to explain this to us beginners. I have been flying with factory settings. It was hard but i think it made me a good pilot:-=) Heh he. Please upload files for download if possible. You can download other peoples settings. Thanks for the upload.
+Normann What files?
There was on one video where they shhowed how to adjust pid and such. And he had his settings on a file people could download. And use for upload in the open pilot program. If you see in the open pilot program. You can see that you can import settings. You see:-)) I havent found the video. But i saw it like a year ago when i started building. Thanks for taking your time to teach us this. Realy apreciate it:-)
+Normann I see, you mean the tuning settings? You can't use another's setting unless the frame, motors, props, balance, battery weight, battery size, flying style and piloting skills are exactly the same.. Best of luck.
Im starting now to understand the settings in the open pilot manager. Wow what a fun hobby.
I was looking for that kind of video!!! Thanks man!
+Fr33lumby© I'm so pleased it helps - this was the second attempt at the video to try and explain this..
Amazing mate. Your videos are just excellent!
I am using a cc3d on librepilot my transmitter is I flysky i6.
Excellent, thanks.
Taking my snapshot now incase i really mess this up lol i have always just avoided pids but now im alot better and all i notice when i fly is the wobble on sharp turns messing me up now who wouldve thought that not having a finely tuned quad would effect me :)
+Ultimatevapor918 happens to most of us eventually. See the videos on Tuning from Joshua Bardwell. Some great practicle examples of tuning on his channel.
yea ive been watching him and talking back and forth ive got better but not perfect yet im getting some wobble on sharp turns and a little in forward flight
your channel is so valuable to guys like myself starting out in this hobby, can you do so skyline32, they is very little out their....massive thannks
+ResidentOfEvil 34 We have a video or two on it that explains the differences in the connections between it, and the Naze32. We have a full set of Naze32/Cleanflight videos that should help you figure it all out..
Found them.... Thank you..... Subscribed.
OMG Best video on youtube many many thanks :)
You're welcome! :D
Painless360 No thank you,my Eachine racer 250 With new F3 board was having really bad shakes after making inputs after watching your video I understood what to do,did it and now she's flying sweet 😊
Great explanation, its refreshing to have a more systematic explanation, now what about rates nd tpa? how those affect tuning?
Tpa?
on the right side of PID, you have roll rate, pitch rate, yaw rate, TPA and TPA Breakpoint, I haven't found any info on TPA breakpoint but some people tune also the "rates" and tpa. What are your thoughts on this
I see, what GUI are you using?
Cleanflight
I see. "TPA basically allows an aggressively tuned multi-rotor (one that feels very locked in) to reduce its PID gains when throttle is applied beyond the TPA threshold/breakpoint in order to eliminate fast oscillations.."
i.e. you can get the craft to tone down the PID settings when you are flying like a loon! :)
Happy flying!
very helpful thanks
Nice explanation. I am new in RC world. One question: Pg-24 of "PID without a PhD" is asking to start with D , then P , then I but in video you are starting with P?. Any specific reason?
Pg-24 reference of "PID without a PhD"
------------------------------------------------------------
"Once you get the setup ready, set all gains to zero. If you suspect that you will not need differential
control (like the motor and gear example or the thermal system) then skip down
to the section that discusses tuning the proportional gain. Otherwise start by adjusting
your differential gain"
You need a little P to stabilise the craft, no P will mean that the craft is pretty un-flyable. Happy flying!
IAM using libre pilot with a cc3d with 5 4 props and 12a becs. And yes there on right and spinning in right position ..and using flysky fs iA6b battery 3s ... please please help
+Painless360 I have a s500 drone with a cc3d and when I pitch forward or backward my drone immediately wants to pitch over to where it seems like it is going to flip over and it loses alot of altitude in a very short amount of time. what pid gain do you think is making it do this?
Thank you thank you thank you!!!
+mxte You're welcome. Glad it made sense!
Hi. Great video as usual. I would like to ask a question on PID tuning. Everything I read and see on line talks about the PID setting on pitch and role. What about the Yaw PIDs? what effect altering the YAW have on the quad and how do you know when they are correct?
+Ray Gibbins Very similar to the others - if the yaw oscillates then check the P isn't too high, if it drifts then look at I etc.. Best of luck!
Great Video Sir, I have a question though...... I use QGroundControl on my Pixhawk, on the Firmware update it shows Pixhawk Pro Autopilot x.x.x.x.x with no version numbers. If I want to read the Wiki to find out about the PID's How do find out which version I have downloaded....? Thanks in Advance....
James.....
Hi The manual for NAZE says cover the baro with foam and shield the board from sunlight.
I notice you use a perspex cover and no foam. Is this just for video clarity or is the manual being over cautious?
Great tutorials BTW I've learnt so much from you. Thanks
+Stephen Thorpe We always cover a baro with foam, the boards we build are actually inside the middle of a carbon frame so are shielded from the sun. The advice is there as the cheap gyros used on the model 'drift' with temperature. Happy flying!
If I give my quad abit of throttle to take off the ground then back off to hover it drastically goes up and down. And if I then land it, it start to jump very aggressively on the ground
+Matt Graves that may not be the PIDs. I'd check the esc calibration and settings in the flight controller first. We had something similar recently and I covered my troubleshooting process in video 7 of the 'Quadcopter building for beginners ' playlist. Best of luck!
Nice vid. Thanks ☺
Hello Mr painless long time fan here. After seeing a lot of your quadcopter videos I decided to buy one for myself and I ended up getting a DJI 450 ripoff quadcopter and I set it up with a KK2.1.5 board. I flew in a little bit and got a little too excited and took it to my terrace where I tried to do some hover and straight line flying, unfortunately, the damn thing flew away and I have not been able to find it yet (I cut throttle when it went too high and it started acting VERY WEIRD after that and flew away into the sunset) . Could you please make a video where you show us how to locate a lost drone, set up a GPS system location system or just general noob tips..
I think it'll help out a lot of beginners like me from losing out on a lot of expensive equipment due to sheer stupidity.
+Brenden sounds like an excellent idea! I'll make that one! Hope you recover yours soon..
+Painless360 thank you. looking forward to you video.
You can preview it here - ruclips.net/video/K-5B_k8VOfA/видео.html Hope it helps a little.. Let me know..
Incredible. Thank you! :D
Hello again sir i have a emax 280 and me like you i double the pids and had your symptoms (like your video ) can you give me your pid setup to test in my? Thank you anyway for your time. ..
osmm information. .. loved it
Nice video Painless, just a general question about pid. If a quadcopter has a large battery crossing the frame from back to front (like yours in this video) but it is also located 6cm under the chasis , so the movement in the roll axis takes more effort, what shoul I do? Increase my P in the roll axis? Decrease it ? Raise the I?
I ask this because my batteries have died so I cannot test anything right now.
+Dashz A larger battery lower on the frame will make the craft slower to respond compared to one with a lighter battery higher up. This affects the way it moves and how quickly the frame can be accelerated and then stopped in the new desired orientation. Any change to the frame layout will affect the PIDs - slightly.. Best of luck!
Have a question, just got an immersionrc vortex 285, i come from flying dji f450 so i like steady stable cruising. I know the vortex is made for racing but i want to set the throttle and the yaw, pitch and roll less sensitive so i can cruise more and not crash all the time. When i throttle up i have a hatd time hoovering and i just want more stable controls, i want to change my pid’s so it flies more like my f450, stable and more for cruising. The controls that are set now are to sensitive for me even if i fly in angle mode. To what values do i have to set my pid’s so it flies more like i want and how can i make my throttle les sensitive so that it does not shoots up like a rocket when i throttle up and doesn’t fall to the ground when i try to compensate and throttle down. I hope you can help me, been watchong your vodeos for a couple weeks and learned a lot! Thanks in advance mate!
G'day I have just upgraded from APM to Pixhawk controller. since the change i have noticed that the motors get quite hot after only going for about 10 minutes when compared to the APM. I am using the same batteries and ESC. Could this be a problem with the tuning? I have tried an auto tune with no difference. Thank you for all the time you put into making the videos. I find them pleasant to watch and informative.
Possible, I've not seen that here so I'd have a look in the forums for another pilot who've had something similar.. May need vibration damping or a different LPF setting..
LPF?
Try googling 'lpf painless360' to find out more.. ;)
Very nice
One point I am not clear on. Why wouldn't P correct for a sustained error? Lets say my commanded bank angle was 30 degrees and that the model moved out of 30 degrees by small increments over time. Why wouldn't P act to remove the error? I guess I don't really understand why we need an I gain at all.
+Brayton Thompson Have a read of the other resources I point to - maybe one of the explanations in those will make more sense. I also struggled with this when I first came across PID loops and P Only, PI only as well as PID loops are common in control systems... Best of luck
great video, your explanation of D was not that clear to me, can you use an example?
thanks
Just a confirmation on this PID tuning. When you do this, do you have to be in rate mode or is it OK to be in horizon mode (because you said in your video that self-leveling should be off)?
+Jan Bobis Rate mode really..
+Painless360 Thanks
Thank you for this info!!
Hi PL. Another great vid, thanks for taking the time to make it. Quick question.. I get quick oscillation with quick roll inputs. I really thought it would be P but right through the ranges it still does it? I'm using Naze32 with a looptime of 500, no mag, accel or baro. Any thoughts ☺
+doondedulin44 I'd check for excessive vibration in the craft first, then reset to defaults on the PIDs and start again. Could be P or D needs tweaking..
+Painless360 OK thank you. Will give it a try today :)
Hello Painless360, firstly let me thank you very much for all your videos. It was a great help when building my first quad. I'm just about to start tunning my PID but I come to bit of a problem. I have all sorts/weights of batteries and if possible I want to keep same PID setting for all batteries. So in order for PID to work with all, should I tune with the heaviest or lightest battery I have? thank you in advance for reply.
+Martin Munz Tune with the one you'll fly with most ;) The difference in weight and inertia will affect the tune..
OK. Thanks for quick reply. Somehow I start to tune P and strange thing is that I increase it on Roll to 14 and only than I get wobble and pitch even to 25,5 (highers possible) and still no wobble. How this can be? (using latest betaflight on Naze 32)
With the wrong P, can wobbles actually amplify each other so the drone will flip over?
+nandakoryaaa I've never seen it but you can get nasty oscillations in a badly setup model..
what do the PID values refer too gain /min per repeat / repeats per min as seen in my long past industrial pneumatic Foxboro Model 40 days
+Joe Stubbs They are arbitrary figures that are used with whatever PID loop code/system is bring used. Happy flying!
Thank tiu for this video. Question for you when you tune do you tube for all axis? If I'm tuning P do I tune for pitch/roll/yaw before moving to I or D?
+sparkyondub2zz You do each in turn several times. As you get D higher you will find that you can also increase P a little more too.
Does anybody know if it is okay to extend the motor wires?
I added about 3 inches of wire to each lead of my motors.
I'm having troubles flying and I'm wondering if this is why....
+odinata if they are the same size and the connections are all good then it should be fine.. Best of luck!
what would cause a wobble that starts slow, and builds up gradually till it's violently swinging the quad?
+Joe Smith Sounds like one of the values is too high. It'll be P or D probably depending on the speed of the oscillation. Try one then the other.. Best of luck!
when you say to increase a little, how much should I bump it up? I know that I need to increase I as my nose rises but how much should I bump it up each time? I am using multiwii rewrite in clean flight on an emax nighthawk pro 280. thanks :)
+Angus Gebers That all depends on the software you are using. Read up on others who've tuned what you're using. Normally the increments are very small for I and D.. Best of luck!
there are PID for lost of different options like pitch roll yaw alt how do you know what PID to change
+Tim Simons Most often the PID for pitch and roll are the same/ very similar. Have a look at the documentation for the FC/FW you are using.. Best of luck.
I've watched this video over and over I cannot figure out why when I do a punch out on three 3's my quad is fine but when I do a punch out on 4S he wobbles and makes a terrible sound I have a qav210 I'm running Cobra 2204 2300 KV Motors 30 amp ESC on a cc3d board I noticed the wobble during fpv I can hear it as soon as I punch out and take off
+Ultimatevapor918 you need to recheck your PIDs if you are using a different size battery.. Best of luck..
Hi painless, thanks again for all your videos, helped me build my first quad a Robocat 270mm with the SP racing F3, and 20A mini afro esc's.
I haven't played yet with PID's, and i was wondering if you should tune PID's for pitch/roll/yaw separatly or at the same time ?
Also, to tune PID's I need to be in accro mode right ?
Thanks a lot !
+Hamza Bendahou We have a video on PIDs that should help - best of luck!
so in essence, P corrects angle, I angular speed, and D angular acceleration?
Kinda. P is the correction, I is there to overcome persistent deviation and D can be through of as the 'speed' of the reaction.. ish! The documents I link to are great for the detail. Happy flying!
So
P is how much it reacts to your control inputs.
I how much it reacts to outside forces
D speed that p and I work at
+Cool Kicks Not quite, P and I both work on any difference from the position you want and the actual position the craft is in.. Best of luck!
lol i understand how it muct be a pan to explain to people
if possible please explain yaw tuning on apm.. having a hard time tuning yaw
+Ashish Faustine Same principle, if it oscillates - reduce P, it it creeps - increase I etc..
Ok I'll try