PID controller Simple explanation with a Quadcopter as example.

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ส.ค. 2024
  • This video is about a pid controller with a practical example. You will briefly know what a pid controller is and understand the variation of gains in pid loop.
    Please leave any suggestions in comments.
    Resources:
    For esp32 flight controller and WiFi pid tuning code.
    Esp32 GitHub repository: github.com/pra...
    References:
    Joop Brooking - • YMFC-3D part 5 - Quadc...
    Manoj Konar - / @pixstrome8735 , / manoj-konar-159212192

ความคิดเห็น • 114

  • @priyanshpanchal6604
    @priyanshpanchal6604 หลายเดือนก่อน +10

    Honestly speaking brother I am studying Aerospace Engineering in one of the best universities in the world rn and even proffs here don't explain half as good as you did.... Massive respect

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you for your kind words, I appreciate it!

  • @creativeflash1713
    @creativeflash1713 หลายเดือนก่อน +3

    Such a beautiful explanation to to let everyone understand flying mechanics in physical space

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you so much!

  • @satish0918
    @satish0918 หลายเดือนก่อน +5

    Sir you have explained this very well . Keep it up

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you brother!!

  • @mattiesplattie
    @mattiesplattie หลายเดือนก่อน +3

    Best demo I’ve seen, thank you!

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      Thank you so much!

  • @pranav4533
    @pranav4533 26 วันที่ผ่านมา +3

    😊waiting for next video

    • @pratikphadte
      @pratikphadte  26 วันที่ผ่านมา

      Sure! This week!

  • @PAMarechal
    @PAMarechal หลายเดือนก่อน +2

    Good Job. You can also use the Ziegler-Nichols method to calculate the coefficients for I and D. It was developed by John G. Ziegler and Nathaniel B. Nichols. The method presented here uses the generation of continuous oscillation in a closed loop.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Yes sir I agree, I wanted to mention this method. It is being used in the pixhawk flight controllers. Thank you for sharing your input, glad!

  • @johnathonwalty8915
    @johnathonwalty8915 หลายเดือนก่อน +1

    Thank you for this nice explanation with real world example. Very cool.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you so much!!!

  • @youeladamas7840
    @youeladamas7840 หลายเดือนก่อน +3

    Very nice lesson you should teach class pid controllers are used in many things aswell. Also wear a glove while doing this testing your a pilot don’t hurt your hands

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      Yes they are! You are right safety is top priority!

  • @rlrentertainmentsinventions
    @rlrentertainmentsinventions หลายเดือนก่อน +6

    Nice Explanation bro try to increase volume for your new videos

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +5

      Yes you’re correct, I noticed it. I’ll keep this in mind for the next videos. Thank you for pointing it out.

    • @rlrentertainmentsinventions
      @rlrentertainmentsinventions หลายเดือนก่อน +2

      @@pratikphadte it's ok bro all the best

  • @Hmingmawia_Ralte
    @Hmingmawia_Ralte หลายเดือนก่อน +2

    Subscribed, thats awsome bro. We buy flight controller and use some presets; but you build it yourself 😁 you are amazing.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you for your comment, made my day! 💪

  • @DheerajSinghal02
    @DheerajSinghal02 หลายเดือนก่อน +1

    Nice work, I also worked on flight controller development long ago....

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you, nice to meet you!

  • @nightshowdown4178
    @nightshowdown4178 หลายเดือนก่อน +3

    as always video is just great and very informative
    i like your work and salute you for all the hardwork you do for a single video
    🫡

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      @@nightshowdown4178 thank you for subscribing and supporting! Thank you so much!!

    • @nightshowdown4178
      @nightshowdown4178 หลายเดือนก่อน +1

      @@pratikphadte hey just wanted to give you suggestion
      would it be better if you upload code explanation series like carbon aeronautics or joop brokking that what you entire code is doing and how an individual can make it ?
      just a suggestion hehe🙂

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      @@nightshowdown4178 ill take up on it, but the thing is Carbon Aeronatics and joop have already done a god jobs, to recreate it, it seems like a re work. But never the less, ill try making. I have some more good stuff coming UP. I really appreciate your suggestion and advice, thank you so much for supporting!

  • @pixstrome8735
    @pixstrome8735 หลายเดือนก่อน +1

    Well explained keep it up! 😁 That's me! 5:16!

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you Manoj for the idea on the stand! Glad to have connected with you! The stm32 quadcopter is crazily stable!

  • @asutoshpatro
    @asutoshpatro หลายเดือนก่อน +2

    Great explanation sir.!

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you brother!

  • @shubhamneurekar7641
    @shubhamneurekar7641 หลายเดือนก่อน +2

    Nice video bro very informative

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you bro ♥️

  • @Ajay-di3zn
    @Ajay-di3zn หลายเดือนก่อน +2

    Nyce

  • @VU2IIA
    @VU2IIA หลายเดือนก่อน +1

    Nice PID demo, will check your GH, liked & subscribed .

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you so much!

  • @MrI8igmac
    @MrI8igmac หลายเดือนก่อน +4

    Nice work. this is helpful. Im still working with a bread board on my esp32s3, i glued it to my prototype 3d print drone.
    I had this idea of using airflow sensors to maybe add another layer of stability or accuracy. Maybe you find this idea interesting.
    Im still waiting on step up voltage converter.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Way to go man! Excited to hear your ideas, would love to see your progress, subscribing to you right away!

    • @MrI8igmac
      @MrI8igmac หลายเดือนก่อน +1

      @@pratikphadte dude. Is that a linux computer

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Yes! It is, helps with ros2

  • @SasmeetNadkarni
    @SasmeetNadkarni หลายเดือนก่อน +5

    Bro this was in in my recommendations.
    Drone man vodlo zhalo

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +3

      My man Sasmeet! Thank you!

  • @shivamkhamble6181
    @shivamkhamble6181 หลายเดือนก่อน +1

    Impressive as always, bruhhh ❤

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you bro!♥️

  • @fifaham
    @fifaham หลายเดือนก่อน +1

    @10:42 the center of gravity in this case is not aligned with the frictionless horizontal bar, this doesn't represent the actual calibration. Your ideal axis of swivel must change to probably adding a vertical frictionless bar that is collocated with frictionless horizontal for a valid calibration. Alternatively, you may need to figure out where exactly the COG located and hang the drone right on that COG point.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Yes you are correct, I made this video for people to understand learn about a pid controller and not specifically about the drone. You are right the values will change when I fly the quadcopter independently. I hope my answer makes sense.

  • @ro-kg5vb
    @ro-kg5vb หลายเดือนก่อน +3

    I think I should be zero here. The angle is already an integration and the rotation speed of the motors also change slowly, I mean when you have a new controller output, the motor speed is still the same and needs time to change, almost like another integration. So it is not good to add even more I in the controller. You could also try to use 2 control loops. So the inner loop is the pitch RATE controlled by an PID controller that gets the target pitch rate from the outer loop, that is also an PID control loop. The outer loop should have I gain = 0. The first step of tuning is that the inner loop only so the copter can rotate at a rate that you want. If that works, add the outer loop. The horizontal bar is also an issue as others already commented. I'd suggest to use a thread that is connected so it fits the center of gravity. A thread will have almost no friction but limited number of rotations. So I'd keep the horizontal bar until the control works good enough so that the number of rotations is not an issue anymore.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you for your reply, however I could grasp it not so well, if possible can you share me some resources I can follow, especially the dual loop part. And yes you are right about the rod, i made this video for people to understand and learn about a pid controller and not specifically about the drone. You are right the values will change when I fly the quadcopter independently. I hope my answer makes sense.

    • @ro-kg5vb
      @ro-kg5vb หลายเดือนก่อน +1

      @@pratikphadte I'm not sure if I can post a link as yt sometimes blocks the comment, but the term to search is
      mathworks cascade control loop
      for example.

    • @what_on_arth
      @what_on_arth 10 วันที่ผ่านมา

      Removing the integral gain for this specific constrained system may work due to a lack of external perturbations, but will not work in-flight. The "I" gain helps mitigate lots of external factors such as mass imbalance, wind gusts etc. A quick check is to see what happens if you put the battery to one side of the frame instead of the center with no integral gain. From experience I can tell you that your vehicle will (in this constrained setup) stabilize at a non-zero roll angle. In-flight this would mean your vehicle will stabilize with a coupled roll-pitch tilt and fly off into the sunset. ;))
      Furthermore, two control loops generally make sense when you have time-scale separation, e.g rotational and translational dynamics where rotational dynamics are much quicker than translational. Then you could have one loop for stabilization (rotational dynamics) as you have now which operates at relatively higher sampling rates, and another one for navigation/guidance/waypoints (translational kinematics/dynamics) which operates at lower sampling rates, typically a difference of 10x. Then you could have the outer loop (slower) command attitudes from the inner loop (faster) for translational motion.
      @pratikphadte, loved the work. I did something similar on an Arduino Mega last summer. Worked out for a bit, but as you may have figured out from your own experience, quick and responsive PID control and stabilization across the normal flight envelope is not something that boards like an Arduino or an ESP32 handle well with their relatively massive overhead. Switched to an APM 2.8 and later to a Pixhawk 2.4.8, couldn't be happier today with all the flying that I do and the additional functionalities they offer. Good luck and happy flying!

  • @sarvajittilve7542
    @sarvajittilve7542 หลายเดือนก่อน +1

    Great bro!

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thank you bro!

  • @impushprajyadav
    @impushprajyadav หลายเดือนก่อน +4

    Is that ur mic or ur voice is already awesome?

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      Little bit of both i would say, Thank you so much, made my day! 😊

  • @sarvagnaraval5529
    @sarvagnaraval5529 หลายเดือนก่อน +1

    Nice

  • @fifaham
    @fifaham หลายเดือนก่อน

    @11:00 when the drone flies in the air it will have completely different COG location point. This is due to the fact that the parts are not distributed perfectly symmetrical relative to the center.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Yes you are correct, I made this video for people to understand learn about a pid controller and not specifically about the drone. You are right the values will change when I fly the quadcopter independently. I hope my answer makes sense.

  • @myetis1990
    @myetis1990 21 วันที่ผ่านมา +1

    you should consider that you wil not use the connection part during real flying, so you need to compensate the PID values for real weight and geometry.

    • @pratikphadte
      @pratikphadte  21 วันที่ผ่านมา

      Yes I agree, again this video is to demonstrate the PID controller and not to be referred completely as a guide to tune your quadcopter.

  • @puneethff4927
    @puneethff4927 หลายเดือนก่อน +1

    Hi brother
    Its good to see these kind of videos and leant too many things from you ..
    And brother do you know about autonomous drones like . Pixhawk + rpi and ai stuffs ?
    Like.. purpose is human tracking or
    Kind of like that and crop management and more ?
    I am trying to build this for college project brother
    I will contact you on LinkedIn brother its easy to discuss there

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      Hello bro, I’m excited to hear about your ideas, you should just dive in them. I appreciate you asking me for advice, I want to help you and I get many messages asking me for help! But I’m occupied by my work and as a creator time is super valuable, I would be able to help you better if you take up my Patreon as that supports me. Thank you for understanding, no hard feelings.

  • @mehul4mak
    @mehul4mak 27 วันที่ผ่านมา +2

    I understand PID, one of the best video but I am still not able to find out why drone oscillate even if you are not giving any command. What phenomenon is it?

    • @pratikphadte
      @pratikphadte  27 วันที่ผ่านมา +1

      Thank you for your kinds words, can you please mention the timestamp? If you are talking about the very high oscillations, it’s because of the overshoot in the p controller.

  • @neymarjr266
    @neymarjr266 หลายเดือนก่อน +2

    see how your drone is stable almost stable at p =1 and rest values zero . But my drone is free falling have tried different values of p. Also my circuit is connected using jumper wire not pcb/gbp.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Hello, the results will vary as this is done on a stand, and the system is different from an independent quadcopter , I suggest you to follow a p value of 0.7 and d value of 0.008, I you can keep 0

    • @neymarjr266
      @neymarjr266 หลายเดือนก่อน

      @@pratikphadte see in my drone correction are happening but in your case the drone is in center stable that is not happening

  • @zoeyzhang9866
    @zoeyzhang9866 หลายเดือนก่อน +3

    Nice test, any custom PCBs/3DP can help? (PCBWay zoey)

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +3

      Thank you, yes I’ll approach if required!

    • @zoeyzhang9866
      @zoeyzhang9866 หลายเดือนก่อน +2

      @@pratikphadte NO problem, you are welcomed. And you can find my contact in channel info.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      I did, super thanks!

  • @blazinghammer
    @blazinghammer หลายเดือนก่อน +4

    Bro i tried to blow away the ant 0:56

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      😂😂😂 right on

  • @CuddleCoder
    @CuddleCoder หลายเดือนก่อน +1

    Well done. Where do you get these drone parts from India?

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Thanks, you can check at robu.in

  • @AltamashMusaShaikh
    @AltamashMusaShaikh หลายเดือนก่อน +2

    And they say you don't need maths in CS

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      CS is the language, math is the song 😅

    • @ckush928
      @ckush928 หลายเดือนก่อน

      @@pratikphadte Were you trying to say the other way around.

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      @@ckush928 nope 😊

  • @itsgodzagain
    @itsgodzagain หลายเดือนก่อน +2

    just get a apm 2.8 and leave the calculation at home and fly around!

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      The purpose was to explain pid and I didn’t have an apm 😅

  • @neymarjr266
    @neymarjr266 24 วันที่ผ่านมา +1

    do ready-made flight controller give direct pid value

    • @pratikphadte
      @pratikphadte  21 วันที่ผ่านมา

      The pid values are kind of related to the drone system so ideally it’s never the case but fast fc like thee speedybee have a good processing speed and that makes their pid values workable for a broader bandwidth of Systems, they may give the most perfect result but it’s almost satisfactory.

  • @dipanshudhote5671
    @dipanshudhote5671 12 วันที่ผ่านมา

    Hello Pratik, I build a mini drone based on esp32 all works fine but there is one issue while uploading the code or pressed reset button the motors get starts automatically until uploading gets finished, I already set these pins to 0 in setup section, then what might be the error causing it... ?????

  • @sasmit82
    @sasmit82 หลายเดือนก่อน +1

    Is that a custom FC board you made for esp32 ?

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Yes!

    • @nikitam4677
      @nikitam4677 หลายเดือนก่อน +1

      @@pratikphadte Thank you for good video. Can you give some guides or resources which we can use to make ESP32 drones?

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      @@nikitam4677 thank you so much!, please check my diy esp32 playlist for esp32 drone.

  • @satyamagrawalblogs
    @satyamagrawalblogs หลายเดือนก่อน +2

    Actually flying pid use please

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      I have showed one in my pid WiFi tuning video, check that one, also there is a small 2 min video showing the flight, you may check that as well.

  • @neymarjr266
    @neymarjr266 หลายเดือนก่อน +1

    do we get same pid value from the same drone but from diferrent flight controller

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      No it depends, if the fc has good clock freq then for better working I can select a lower time cycle which can sort of give me pid values which will be different Than the esp32 pid values

    • @neymarjr266
      @neymarjr266 หลายเดือนก่อน

      @@pratikphadtewould it be same for arduino uno and amp2.8 as they both have 16M hz , will it be same?? . Because i am trying pid tuning but facing problems using the arduino .

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Can’t say for sure but yes

    • @neymarjr266
      @neymarjr266 หลายเดือนก่อน

      @@pratikphadte bro have you done this thing on arduino

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      No I haven’t, you can check joop brokking for Arduino fc

  • @manhcuongnguyen2784
    @manhcuongnguyen2784 หลายเดือนก่อน +1

    Hello, I followed your instructions, but I couldn't find your webserver to customize the PID. Could you share the address of that webserver with me?

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      Hello, please follow the WiFi tuning video, in that I have mentioned how to get the ip address of the esp32.

    • @manhcuongnguyen2784
      @manhcuongnguyen2784 หลายเดือนก่อน

      @@pratikphadte I figured it out! Thank you so much, and I hope to see more videos about quadcopters from your channel in the future.

    • @neymarjr266
      @neymarjr266 หลายเดือนก่อน

      is the code working properly and making the drone stable

  • @kushangsolanki999
    @kushangsolanki999 หลายเดือนก่อน +1

    How did you get all this info ?? Even I need to learn all this in detail

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +2

      Follow the resources in my other videos. Joop Brokking and carbon aeronautics are the best out there.

  • @TanmayGaude23e4
    @TanmayGaude23e4 หลายเดือนก่อน +1

    Are you goan ? 🙋🏻

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      Hoi bro, Kide mhanta? Ghat?

    • @TanmayGaude23e4
      @TanmayGaude23e4 หลายเดือนก่อน +1

      Ghat! Just discovered pid controllers and found u, vids powerful asa, really helpful. Good to see u use linux. Is it always the case ?

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน +1

      @@TanmayGaude23e4 thanks bhava, no Linux is not necessary, just better for Ros

    • @beastlyy858
      @beastlyy858 หลายเดือนก่อน +1

      I from mechanical engineering,I want to learn more about Robotics,can you suggest me how to go about it,I am from Goa

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      @@beastlyy858 yeah please refer articulated robotics for mainstream robotics.

  • @sumitgumtya
    @sumitgumtya 27 วันที่ผ่านมา +2

    bro make PID video in hindi

    • @pratikphadte
      @pratikphadte  27 วันที่ผ่านมา +1

      My audience is very niche I feel that’s why I make videos in English, but yes I can work on that idea. Thanks

  • @saadanasilmamuna2880
    @saadanasilmamuna2880 7 วันที่ผ่านมา

    English is a weird language. German accent can be funny but such English remains fully understandable. Finnish accent is weird but even such English remains fully understandable. However, under Indian accents English will fully loose its clarity. There are so many nice videos on the Internet which remain tolerable just on the condition you switch the sound off and read the subtitles.

  • @Prateek1234q.
    @Prateek1234q. หลายเดือนก่อน +2

    Idk i am trying to make the TVC mount for a model rocket but it just doesn't want to work ig , and idk if i am wrong with the math or with the programming 🫠

    • @pratikphadte
      @pratikphadte  หลายเดือนก่อน

      You’ll get it working! Keep up the work!