YMFC-3D part 5 - Quadcopter PID controller and PID tuning.

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 พ.ย. 2024

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

  • @mickcooper8605
    @mickcooper8605 7 ปีที่แล้ว +3

    Having never flown a quad or any other RC model before I have watched these videos over and over again then took the plunge. I purchased some secondhand 2830 motors from ebay, made up a 450(ish) frame from upvc pipe fitted it with 30A esc's one of which was Faulty ! I used a "Beestore" pro mini which is fitted with an AMS1117 voltage regulator supporting up to 800mA for the controler. I loaded and ran the setup and calibration sketches and all worked fine. This evening I loaded the controller sketch and she flew straight out of the box even with an "odd esc". My activity's were cut Short by the weather but with a bit of tinkering (and four matching esc's) I'm going to have hours of fun. Thanks Joop for all your hard work and the many hours you have put into these videos, your explanations and demonstrations of how it all works are second to none. I just wish I were better at the coding side but I fear age is not on my side. LoL

  • @manoelguidialvares6903
    @manoelguidialvares6903 5 ปีที่แล้ว +7

    I am a control and automation engineer, who just finished a master in mechatronics. I am a true passionate to control engineering, and since 2013 when I was first introduced to control systems,i have NEVER EVER seen such a good simple explanation to a PID, specially regarding the derivative part. Actually, I only could reason about it by thinking about poles or spectral analysis. But your simple yet extremely clever explanation and demonstration gave me a new light on this subject and gave me a more 'physical' feeling about it, which IMO is essential to an engineeer.
    I also want to build a drone from scratch a a hobby, and your YMFC serie is simply tailormade to my needs. I am infinetely grateful for your contribution, and hope you keep posting such good videos and projects. Keep on the AWESOME work, you are an inspiration !!!
    Best regards !!

  • @tacpreppers4906
    @tacpreppers4906 5 ปีที่แล้ว +14

    Hands down, the best PID explanation I've seen so far, and being a quad/fpv pilot, I've seen many, . Joop, you're an ace, thanks for taking the time to do this. It's on the shoulders of "giants" like you that we build. Keep up the excellent work.

  • @siddhantchaudhary4946
    @siddhantchaudhary4946 5 ปีที่แล้ว +13

    You're the inspiration of millions of future engineers..... Respect

  • @MrFlashgrenade
    @MrFlashgrenade 9 ปีที่แล้ว +3

    I find this is the first video that actually explains in detail what PID settings do. Thank you very much!

  • @wanderreels7385
    @wanderreels7385 3 ปีที่แล้ว +1

    I was lookign for someone who could teach every bit of coding that was necessary for building the drone . And I am very happy with the content you have posted. Thank you so much.

  • @blrcnc9848
    @blrcnc9848 8 ปีที่แล้ว

    Hi, I am a CNC hobbyist. I am absolutely a novice to Audrino. Your video series is an inspiration for me to explore the audrino world. I have already place an order for UNO after seeing your video. I may not understand everything right away. But your explanation breaks down everything and logical to understand. Thank you so much for putting together this wonderful video series. I am excited as hell to start with this Quadcopter project.
    Thank you,
    Nave

    • @Joop_Brokking
      @Joop_Brokking  8 ปีที่แล้ว

      Thank you for taking the time to write this positive comment.

  • @MrHristoB
    @MrHristoB 4 ปีที่แล้ว +1

    I'm new to the multirotor business and this must be one of the BEST and clear PID explanation!!!! Bedankt Joop!!!

  • @VincentArdolino
    @VincentArdolino 8 ปีที่แล้ว +9

    Your explanation and test models are awesome. The best explanation of what P & I & D actually are as demonstrated with physical models.
    Keep up the good work

  • @karnikram
    @karnikram 9 ปีที่แล้ว +39

    Hello, thanks a lot for this much needed video series!
    Just want to point out a slight error in one of the equations at 3:36.
    It should be,
    D-output = (gyro - receiver - gyroprev + receiverprev)*Dgain
    and not,
    D-output = (gyro - receiver - gyroprev - receiverprev)*Dgain

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว +9

      Karnik Ram Hi, gyro - receiver is the error and represents the 'e' in the equation at 1:51. The error is always calculated the same. In your line the previous error is calculated different than the actual error.

    • @karnikram
      @karnikram 9 ปีที่แล้ว +16

      Previous error = gyroprev - receiverprev
      Current error = gyro - receiver
      Current error - previous error = (gyro - receiver) - (gyroprev - receiverprev) = gyro - receiver - gyroprev + receiverprev
      Negative sign negates the negative sign.

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว +26

      Karnik Ram Yes, you are right! I should have added brackets in the presentation sheet. +1 for you sir!

    • @warren1192
      @warren1192 3 ปีที่แล้ว

      thank you sirs to both of you for pointing out a bracket error... and at the same time confirming there was an error

  • @samantareboredo7665
    @samantareboredo7665 ปีที่แล้ว +1

    thank you. I just wanted to thank you for the enormous professional work you have done. My drone flies wonderfully thanks to you. I congratulate you immensely.

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

    This is an amazing series! I started to create my own drone, with some knowledge which I never use before. This series helps to the whole knowledge in context and make my understanding deeper.

  • @evgenyyakimov7779
    @evgenyyakimov7779 4 ปีที่แล้ว +1

    This video is Excellent! I found it very easy to pick up this complex topic with very little background in the area. Thank you for your efforts!

  • @JuanAriasArias
    @JuanAriasArias 8 ปีที่แล้ว +8

    Very good job. The best tutorial about PID that I have ever seen. Thank you so much.

  • @freddiesnijman
    @freddiesnijman 9 ปีที่แล้ว +32

    Excellent! PID, make more sense to me. Besides that I admire your teaching/coaching talent.

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว +3

      Freddie Snijman Thanks for the compliments!

    • @a_aron30490
      @a_aron30490 7 ปีที่แล้ว +5

      You are a brilliant person, your videos really help me out in my computer programming class and our arduino projects

  • @mcynelly1637
    @mcynelly1637 8 ปีที่แล้ว +9

    The best tutorial about PID that I have ever seen.

  • @HanSolo1
    @HanSolo1 7 ปีที่แล้ว +1

    Thank you for the build tutorial, after a couple months this semester research project for me just flew a few minutes ago, after some pid tuning frustrations!!!

  • @CRXhome
    @CRXhome 5 ปีที่แล้ว +1

    Excellent explanation. Very good introduction for newbies (and probably more advanced users). Thanks a lot!

  • @avacomputer2819
    @avacomputer2819 6 ปีที่แล้ว +3

    Hello, thanks a lot for this much needed video series!
    The best tutorial about PID that I have ever seen!

  • @pricedempler
    @pricedempler 3 ปีที่แล้ว +1

    Thank you for showing the code AND the resultant behavior on the quad. Big help!!!

  • @theconcerned9113
    @theconcerned9113 7 ปีที่แล้ว +1

    Thanks, Joop, you have done the best drone tutorials I've ever seen.

  • @somiprakash1347
    @somiprakash1347 4 ปีที่แล้ว +1

    Excellent video , going into the practical approach to designing PID loop into mcu ..

  • @imranzahoor4407
    @imranzahoor4407 7 ปีที่แล้ว

    I'm really out of compliments this time because every compliment is less worthy than your work. Brilliant work I've ever seen. Thank you so much. Your videos helps me a lot in my final year project of electrical and control engineering.
    bundle of thanks and salutes for you.
    regards.

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว +1

      Thank you for taking the time to write me this message. Really appreciate it!

  • @subhadeepchowdhury5244
    @subhadeepchowdhury5244 ปีที่แล้ว

    Very useful videos for those who are building their own flight controller. Special thanks to mention that D gain should be fixed first.

  • @CineSoar
    @CineSoar 8 ปีที่แล้ว

    I've been watching with interest. Thank you so much, for a well annotated sketch, as I will be doing this project with my son and it is a great help, to see each line described so well. When I saw your excel spreadsheet for PID, I decided to duplicate it, so I could play with the values myself. What I found very interesting, was to calculate and graph the PID Output, as well. I found this very useful, to show how changing the gains from 'neutral' (all = 1), to your actual flight values, dramatically changes the PID Output, from something that is dominated by I, to a shape that looks much more like D, with a trendline influenced by I. I also found that the graphing the effects of over and under tuning each value in turn, allows you to see how that behavior exhibits itself in the reaction. There were a few 'aha' moments, as I began to visualize how a large change in value for a certain gain, changes the response profile. Combining this with the airframe behavior (from watching your's and other's tuning videos) is pretty powerful. You might consider a supplemental video, exploring this in more detail.

    • @Joop_Brokking
      @Joop_Brokking  8 ปีที่แล้ว

      Thank you for your reply and that this video was educational.

  • @MilanKarakas
    @MilanKarakas 9 ปีที่แล้ว +1

    Excellent tutorial, and the best explanation what (the hell*) is PID or PI on my KK2 board (there is no derivative, or D setting). At first it looks incredible complicated, but in your series of videos - if explainded as you just did - now it look much more clear and easy to understand.
    Thank you very much.

  • @MrFlashgrenade
    @MrFlashgrenade 9 ปีที่แล้ว +1

    I'm the eight viewer. I must call that a victory and take this opportunity to congratulate you on your wonderful project.

  • @nikodembartnik
    @nikodembartnik 8 ปีที่แล้ว +1

    Hi
    I am working on my own flight controller I almost finished it. Currently I am working on stabilization. I saw your code and I don't know how you can use deg/sec as input for PID. Let's say that your quad isn't moving and it is tilted 45 deg, your program wouldn't see that. In my program I use degrees as input for PID but I have some problems with tunning. You can see my quadcopter at my chanel. I want to ask how big should gains be for degrees input. Thanks!

    • @Joop_Brokking
      @Joop_Brokking  8 ปีที่แล้ว

      This is the 3D version. So the PID will try to match the gyro and receiver input.
      The YMFC-AL however has an auto level feature. It's explained in this video:
      th-cam.com/video/DYpHB-LfloI/w-d-xo.html

    • @nikodembartnik
      @nikodembartnik 8 ปีที่แล้ว

      Thanks for quick answer. I know but I can't understand how you can use deg/sec for PID input in auto level version, how is it possible. And can I use degrees instead of deg/sec?

  • @lard_dork
    @lard_dork 9 ปีที่แล้ว +23

    D output = ((Gyro - Receiver) - (Gyro Prev- Receiver Prev) ) * D gain

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว +7

      +Brian Boozebacon Not many people have seen / noticed this typo in the presentation ;-) +1 for you!

    • @GOLDFINGER412
      @GOLDFINGER412 8 ปีที่แล้ว

      +Brian Boozebacon just noticed the same error.

    • @rohanselvan4339
      @rohanselvan4339 5 ปีที่แล้ว

      Thanks for clarifying!

  • @tarekelmanshawy9201
    @tarekelmanshawy9201 6 ปีที่แล้ว

    Please ,enable subtitle option in all your videos to make more people who aren’t fluent in English,understand what you talk about.
    Thanks for efforts.
    Follower from Egypt.

  • @MEGAZSTUDIOS
    @MEGAZSTUDIOS 9 ปีที่แล้ว +1

    Amazing piece of work, excellent control and response. Well done mate keep it up. ^_^

  • @usamasadiq8991
    @usamasadiq8991 7 ปีที่แล้ว

    You have done fabulous work here and really simple
    and it helped me a lot in my FYP. so hat's off for you thanx.

  • @bogenriederlukas
    @bogenriederlukas 8 ปีที่แล้ว

    Great video. I thought it was gonna be super hard to understand but you explained it soo well :)

  • @claudiofe8318
    @claudiofe8318 8 ปีที่แล้ว +1

    as you may know that the maximum output is 400 pid?
    float pid_p_gain_yaw = 4.0; //Gain setting for the pitch P-controller. //4.0
    float pid_i_gain_yaw = 0.02; //Gain setting for the pitch I-controller. //0.02
    float pid_d_gain_yaw = 0.0; //Gain setting for the pitch D-controller.
    int pid_max_yaw = 400; //Maximum output of the PID-controller (+/-)

  • @sardarhasseb8330
    @sardarhasseb8330 9 ปีที่แล้ว

    Finally a best video for understanding multirotor pid :)

  • @elliotg8403
    @elliotg8403 3 ปีที่แล้ว +3

    I'm confused why you've used gyro deg/s as your set point. Surely it would make sense to use the actual deg value otherwise the quadcopter could stabilise its gyro angle rates without actually being level itself?

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

      Yes, these angel mode flight controllers perform better but I guess the reason of using a rate mode flight controller is that the calculations are simpler. So the required time for one cycle is low. Note The flight controller needs to run at least at 250 hz.

  • @RSP13
    @RSP13 5 ปีที่แล้ว

    PID is now much cleaner for me. Thanks

  • @CountDownToDisaster
    @CountDownToDisaster 9 ปีที่แล้ว +1

    Hey, Joop, how is it that we can control two of the ESCs through D7 and D4, even though they aren't PWM pins (they don't have the ~ thing by the number)? Isn't PWM required to send pulses to an ESC?

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว +2

      I don't use the hardware PWM function for this project. Watch part 4 (ESC) on how I created the pulses for the ESC's.

    • @sandervanleeuwen9395
      @sandervanleeuwen9395 8 ปีที่แล้ว

      +CountDownToDisaster He doesn't use PWM, but he uses PPM, this way the ESC's only have to be updated once in a cycle. This is faster because the processor won't have to switch the port from time to time as you have with PWM

    • @nemobondt9117
      @nemobondt9117 7 ปีที่แล้ว +2

      don't listen to sander. he doesn't use ppm.

  • @vitaliyd193
    @vitaliyd193 9 ปีที่แล้ว

    DUDE THANKS@!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! AWESOME!!!
    I remember your 1st soundless videos, and my wish to hear your explanations! AND NOW YOU KEEP MaKING US ENJOYING YOUR VIDEOS!!!!!!!!!!!!!!

  • @joh1ish
    @joh1ish 7 ปีที่แล้ว

    Hey Joop, superb video! I wanted to bring something to your attention about the Arduino servo library. In your videos you went to a great trouble in order to make the refresh rates of the Arduino faster for the ESCs, hence better PID control, but I found that
    with one single change to the Servo header file, you can have the Arduino servo library refreshing at the interval you want. You
    may do this by changing the #REFRESH_INTERVAL value. Simply copy the file to the desktop, change the value, and copy the file back to the servo folder. I am going to check this out with an oscilloscope tomorrow.
    Just wanted to let you know for less headache in the future :D

  • @rtdave6982
    @rtdave6982 7 ปีที่แล้ว +1

    I have learned many many things from you...Thank you.

  • @vishnukartha47
    @vishnukartha47 4 ปีที่แล้ว

    There will be precedence issue in the calculation of Derivative out put i think. The video is very informative. Thanks for sharing.

  • @a..d2062
    @a..d2062 5 ปีที่แล้ว +3

    QUESTION:
    Dear Joop Brokking
    for the PID part,
    (pid_error_temp = gyro_roll_input - pid_roll_setpoint;)
    why are you subtracting a mixed (accelerator and gyro) value with a purely Gyro value to find the error.
    As you have stated that the Gyro value on its own is not accurate hence we must use a mixed (accelerator and gyro) value as it is accurate.
    I thought you would have used a mixed (accelerator and gyro) value and subtracted it from another mixed (accelerator and gyro) value.
    hence giving us a accurate pid_error_temp value.
    I am really confused about this matter please can you help. thank you

    • @donyip9674
      @donyip9674 ปีที่แล้ว

      poor child, it has been 3 yrs, Mr. Joop still didn't answer u

    • @a..d2062
      @a..d2062 ปีที่แล้ว

      @@donyip9674 One day my brother, one day he will.

  • @theodordrymonis6728
    @theodordrymonis6728 9 ปีที่แล้ว

    Very nice tutorial !!! Looking forward for the next video !!!

  • @matiasbrollo6871
    @matiasbrollo6871 ปีที่แล้ว

    Le devo mucho a esta serie de videos. Muchas gracias.

  • @InnosWei
    @InnosWei 6 ปีที่แล้ว +2

    Hello Joop, your videos are great, I am wondering about one thing though. What do you need total angles from gyro+acc if you only use the gyro angular rate for your PID control? Is using angles and assumming the transmitter stick position inputs desired angle of the quad is a wrong approach?

  • @mcebisisolilo3714
    @mcebisisolilo3714 5 ปีที่แล้ว

    Hi Joop, Thanks a lot for this video, you have made this very clear for me. Your explanation and major part of your code has allowed me to build my own UAV (Unmanned Aerial Vehicle), one problem i am facing is that the structure of my drone is a Hexacopter (runs with 6 motors). For a Quadcopter, the ESC equations are as follows:
    pulse_length_esc1 = instruction[THROTTLE] + roll_pid + pitch_pid - yaw_pid;
    pulse_length_esc2 = instruction[THROTTLE] - roll_pid + pitch_pid + yaw_pid;
    pulse_length_esc3 = instruction[THROTTLE] + roll_pid - pitch_pid + yaw_pid;
    pulse_length_esc4 = instruction[THROTTLE] - roll_pid - pitch_pid - yaw_pid;
    what will these equations be if i have 6 ESCs instead of 4, your assistance would be greatly appriciated

  • @EdCranium
    @EdCranium 9 ปีที่แล้ว

    Fantastic work. PID explained so even I can understand it. Genius!

  • @ypenburger
    @ypenburger 8 ปีที่แล้ว +3

    HEY DEAR TH-camRS,
    I hope some of you can help me. I have made a 3D flying quadcopter with this example of Joop Brokking. It flies pretty stable and such, but after some time the quadcopter starts to act weird. I am trying to keep it level, but the quadcopter makes sudden pitch moves and start moving towards me. When I try to push the stick so the quadcopter goes away from me, it obeys. But almost right after, it wants to come back at me. Its almost like it wants to come to his master haha. But with all seriousness, did anybody have such an experience? I dont know if its a problem with the gyro or maybe with the PID controls. Just the be clear, its not a smooth motion like its drifting, but its really like the neighbour has a transmitter as well and tries (after two minutes) to kill me by pulling the pitch stick down for a little moment at a rate of 1 time every two seconds.
    Thanks in advance!

  • @suhasrx100
    @suhasrx100 9 ปีที่แล้ว

    First of all, Great Video Tutorial Series Joop, Hats Off!!!!!
    What I noticed is, you have mounted the gyro underneath the right arm [During PID demo 5:24...], will correction be much more accurate if gyro has been mounted towards or at the center.

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      Thanks for the compliment! The gyro only detects angular motion. Perpendicular motion will not affect the gyro's output. The best location for mounting the gyro is away from vibrations. This usually means in the center of the frame.

  • @carlosfreitas4056
    @carlosfreitas4056 4 ปีที่แล้ว

    Thanks for everything. You are brilliant at teaching.

  • @mrabalone3492
    @mrabalone3492 8 ปีที่แล้ว

    AWESOME ! It helps a lot for my project thanks Joop Brokking

  • @carlscrivener2462
    @carlscrivener2462 5 ปีที่แล้ว +1

    Great video! Can I ask why the roll limit is set to 400? Is this an arbitrary number?

  • @fifaham
    @fifaham 2 ปีที่แล้ว

    @3:39 Is there a mathematical error in the D calculation ( (error) - (previous error) ) or am I wrong? Just curious. I am talking about the signs in the equation.

  • @originalthehrao
    @originalthehrao 5 ปีที่แล้ว

    you are genius man. great work. thank you so much for sharing your knowledge.

  • @tanmaykhatri7454
    @tanmaykhatri7454 2 ปีที่แล้ว +1

    Hello sir , I'm tanmay and I'm a engineering student . I am working on the Arduino based drone with the help of your video . I facing many challange to setup best PID values . Sometimes those values works correctly then i take the flight of the drone but unfortunately drone flip on the specific height, like 9 feet . I have been facing this problem currently . Could you help me to solve this problem . When i press the reset button on the Arduino . drone gives the stable flite but suddenly drone flip into the sky and it stops working . From this problem i have losted one Arduino uno board . You are my last hope. What did i do to solve this problem . All parts are working properly buy unfortunately i don't know what's the problem . I have been trying to solve this problem for 3 months . I started to make the drone 3 months ago . But this problem didn't solve . I'm waiting for your reply . I am making this drone for my college project
    So please help me . I will appreciate your help .
    Please reply me sir . I will tell you my all problems in the drone .
    thank you , please reply me ❤️

  • @robokishan
    @robokishan 7 ปีที่แล้ว +1

    sir i still dont understand why you are dividing it by 57. bcz its already has 17.mdps
    then your equation should ne x. * 57 =1

  • @longplayernet
    @longplayernet 4 ปีที่แล้ว

    Very Helpfull and cool practical examples!

  • @kripeshram4781
    @kripeshram4781 6 ปีที่แล้ว +1

    Hey Joop, my quad is yawing violently when I use the pid-i as in your code
    -> pid_i_mem_pitch += pid_i_gain_pitch * pid_error_temp;
    The i - gain seems to happen even when the quad is stationary and there is no change in angle!
    But when I changed it to -> pid_i_mem_pitch = pid_i_gain_pitch * (pid_i_mem_pitch + pid_error_temp);
    It worked fine. Have I made an error elsewhere in the code which could have led to this?
    Thank you for the amazing videos! I have learnt so much from them.

  • @TheAdrv
    @TheAdrv 9 ปีที่แล้ว

    Great work !!!, I'm working on my Ardu-quadcopter, I would like relate your project to mine, but I have some troubles, because I'm using xbee modules as receiver and transmitter, is a bit dificult because the transmission of the information is more slow.I just need keep watching your videos for resolve the troubles with my project.
    !Enhorabuena¡...

  • @ycmgxekwa
    @ycmgxekwa 7 ปีที่แล้ว

    Brilliant tutorial once again. Thank you very much.

  • @hierryh
    @hierryh ปีที่แล้ว

    Hi Joop,
    on the STM32 pid software, I don't understand the following correction ( you don't speak about it on this video):
    roll_level_adjust = angle_roll * 15; //Calculate the pitch angle correction.
    pid_roll_setpoint -= roll_level_adjust; //Subtract the angle correction from the standardized receiver roll input value.
    How have you calculated the value of 15 ?

  • @khalidMohsin
    @khalidMohsin 3 ปีที่แล้ว

    Hi sir i ask u why multiple (angle_pitch Or angle_roll) by 15 to find level_adjust. why this number (15)?
    please help

  • @bask185
    @bask185 8 ปีที่แล้ว +1

    I have a question: you only use the gyroscope values and not the accelerometer data right? The gyroscope only gives information about change of movement but not about the actual current position. How does the quadcopter knows when it is leveled if it only responds to movement? If you tilt the Qcopter 1 degree before power up, won't it drift by 1 degree all the time?

    • @Joop_Brokking
      @Joop_Brokking  8 ปีที่แล้ว

      The YMFC-3D need manual leveling. The YMFC-AL is auto level.

  • @qmu2
    @qmu2 7 ปีที่แล้ว

    Hello +Joop Brokking
    how u decide to use this equation for the complementary filter? and why 80% 20%? and why do you divide the gyro roll output by 57.14286?
    why did you subtract 8 from 500? and why did you divide by 3 at 10:35 ?
    thanks

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

    Hello Joop, can you share the code for this balance stand project, i also made one to test PID, im confused to how i control the PWM of two ESC to balance the the Rod.

  • @robertparenton7470
    @robertparenton7470 3 ปีที่แล้ว

    Thank You for sharing this valuable knowledge.

  • @CHINTUKLApi
    @CHINTUKLApi 4 ปีที่แล้ว

    Hay what do u meant by gyro is this roll, pitch and yaw value also pls tell me how i get more appropriate gyro values
    I have the setpoints and orientation of my drone by which i get the error of (R , P, Y)
    Roll, pitch and yaw and the values of (R, P, Y)
    is (-30.0, -30.0 ,-30.0) at its inital position on ground and throttle is be 00.0
    PLS Help Me 🥺🥺🙏🙏
    Ya one more thing i am using Python

  • @victoraugusto2721
    @victoraugusto2721 3 ปีที่แล้ว

    Great video my friend I have a question, how you find the bests values to kp, ki and kd constants?

  • @ng4559
    @ng4559 9 ปีที่แล้ว

    Excellent job done!!
    Keep it up man!

  • @powderdominic
    @powderdominic ปีที่แล้ว

    if you somehow see this and still respond, could you please answer my question:
    How did you eliminate noise from the MPU-6050 angle readings? Did you use a Kalman filter? Thanks!

  • @dhrubajyotigogoi7685
    @dhrubajyotigogoi7685 4 ปีที่แล้ว

    Hello Joop, been following for over a year. Very thankful for such an elaborate guide. My query is are we using position/angle data in the PID controller or is it just the angular speed as the set point. I mean are we controlling roll/pitch speed or the roll/tilt angle. Using speed as the set point my P control behaves a like a D control (just damps motion)

  • @ambujjain212
    @ambujjain212 3 ปีที่แล้ว

    Thanks Joop, for this amazing video series. I have a question regarding the base throttle signal for quad-copter hovering. How do make sure that when throttle stick is in the middle, i.e. transmitting 1500us pulse the drone hovers?

  • @joeprince7509
    @joeprince7509 9 ปีที่แล้ว +1

    I've watched this video many times now (which is great by the way), but there's one fundamental thing that I'm not understanding in regards to the rate mode.
    If the error is the difference between the gyro reading and the user's input (in deg/s), then when the quad starts rotating and approaches the desired rate won't the error decrease to 0, meaning there is no correction factor and just the throttle value is written to the motors? Perhaps I'm missing something?

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      +Joe Prince Yes, the error will decrease to zero. But the pid-controller will work on it to keep the desired rate.
      So my input is 20deg/s and the quad rotates 20deg/s. The error is zero and only the throttle will drive the motors.
      But when the quad rotates 19deg/s the error is 1deg/s and the motors are corrected.
      In practice the error is never zero. The controller is constantly correcting the multicopter. It goes so fast that it looks steady. But in fact the multicopter is very unstable.

    • @joeprince7509
      @joeprince7509 9 ปีที่แล้ว +1

      +Joop Brokking I appreciate the insight and information. I have a question in regards to this line: "The error is zero and only the throttle will drive the motors."
      If the error is zero and only the throttle is driving the motors (let's say 50% throttle or 1500µs), then how is the quad rotating? Don't we need a difference in motor speeds in order to obtain rotation? That's kind of what my first question was referencing, the fact that if our error is zero then we're writing the same value to the motors (in this case the throttle) which in my mind means the quad is not rotating. Am I completely misinterpreting this?

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      Joe Prince
      As I wrote, in practice the error is never zero. And if it becomes zero during rotations the I-controller is 'loaded' and will make the quad rotate.
      But you are right about the fact that the multicopter does not rotate that well with all the 4 motors spinning at the same speed.

    • @joeprince7509
      @joeprince7509 9 ปีที่แล้ว

      +Joop Brokking Does that mean it wouldn't be possible to write a "P" only controller for rate mode, since there is no "I" term to build up?

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      Only a p-controller will not work. You need at least p and d to make it fly. If you look @14:00 in the video you see that I fly the multicopter with only the p and d controller. It fly's but does not feel locked in. The i-controller makes the multicopter locked in.

  • @GeraMF
    @GeraMF 7 ปีที่แล้ว

    Friend a correction the PID controller is based on the relative stability therefore the error must be negative by the unitary feedback. Said above: E (S) = R (S) -Y (S)

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      It all depends on how the output is handled. I used the plane as my reference. Therefore the PID controller might be different as in your book-stuff.

  • @factstation2910
    @factstation2910 2 ปีที่แล้ว

    Sir.. I'm a kid currently studying in class 10th ,,,, watched your video to complete my drone.. as I use some different hardware there is a problem in PID tuning.. just need your help how can I do this to make my drone fly

  • @ranjitroshan3101
    @ranjitroshan3101 6 ปีที่แล้ว

    Thank you very much for this wonderful video.

  • @abdullahagcayazi7581
    @abdullahagcayazi7581 7 ปีที่แล้ว +2

    Hey Joop!
    First off, great project. I understand the concept of PID stabilization now but being an aerospace major, my programming skills are still a bottleneck. I'm using an MPU-9250 for my gyro board, and currently i'm just trying to get the PID code to work. I've changed up the registers and everything for it to work properly, but the PID outputs on the serial monitor are giving me just the top results, like only 400, or -400. Why could this be? I've changed the sensitivity, do I need to change the numbers that the raw data gets divided by somewhere?
    Thank you!

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      In the code the PID controllers are limited by this line:
      int pid_max_roll = 400;

    • @abdullahagcayazi7581
      @abdullahagcayazi7581 7 ปีที่แล้ว

      Yeah I know that but the only thing I was getting was either +400 or -400. Nothing in between. It was because I wasnt using an RX so I had to change up the code a bit, thanks either way!

    • @MixalisXaxalios
      @MixalisXaxalios 7 ปีที่แล้ว

      where can i find the pid arduino code?

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      It's in the YMFC code: www.brokking.net/ymfc-al_main.html
      Or you can check this page: brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/

  • @mclay2038
    @mclay2038 7 ปีที่แล้ว

    Joop, great video. I've noticed in some of your other videos that you have very good altitude hold. I was wondering what your process is for tuning the PIDs for altitude hold? Thanks.

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      The altitude hold test is form this video: th-cam.com/video/oc8Gv61bfvU/w-d-xo.html
      I'm using my own algorithms to get is stable like that.

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

    tHANLS A LOT FOR SHARING YOUR KNOWLEDGE !! COULD YOU PLEASE SHARE WITH ME , THE EXCEL SHEET ? THANKS

  • @arnavmarchareddy1831
    @arnavmarchareddy1831 7 ปีที่แล้ว

    in the code for the flight controller, i still dont get how you figured out how to send the calculated pulses to the esc's based on the pid corrections and the reciever inputs. esc_1 = throttle - pid_output_pitch + pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 1 (front-right - CCW)
    esc_2 = throttle + pid_output_pitch + pid_output_roll + pid_output_yaw; //Calculate the pulse for esc 2 (rear-right - CW)
    esc_3 = throttle + pid_output_pitch - pid_output_roll - pid_output_yaw; //Calculate the pulse for esc 3 (rear-left - CCW)
    esc_4 = throttle - pid_output_pitch - pid_output_roll + pid_output_yaw;

  • @waleedgaming8064
    @waleedgaming8064 7 ปีที่แล้ว +1

    Your videos are awesome! I myself built the YMFC-AL quadcopter and it works well.
    The only problem I am facing is that when I change the value of I, the quad tilt in one direction and I have to use subtrims to level it. It works perfectly fine with I=0;P=1.5 and D=15. Can you guide me how can I tune the value of I to make it more stable. Even at I= 0.01 , the quad tilt in one direction. Waiting for your reply.

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      You can use the sliders on the transmitter to level the quadcopter. Make sure that you don't move the quadcopter at startup.

    • @diegochaucagallegos9173
      @diegochaucagallegos9173 7 ปีที่แล้ว

      The same thing happens to me ... always when starting starts to the side, and it is difficult to stabilize it, since the position to self-level will always be to one side

  • @jackbosshard4502
    @jackbosshard4502 9 ปีที่แล้ว

    Joop Brokking, thanks for your interesting presentation. Due you think that the Arduino Due with a higher clock frequency could run your code without to much adaptations?

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      +Jack Bosshard I have no idea. I never used a Arduino Due myself so I can't give you any useful advise.

  • @yusufaksel2516
    @yusufaksel2516 4 ปีที่แล้ว

    Hey! Great tutorial series, thanks. I wondered something, what is the working principle of your test setup at 1:00 ?

  • @ubotics27
    @ubotics27 7 ปีที่แล้ว

    Great video Sir Joop. please I wish to know ,Where is the receiver signal from ?? I'm currently working on a wind pendulum project and I hope to adopt your PID lesson to balance the pendulum at center within the shortest time given , the pendulum has 4dc fans attached to its 4sides .how can I apply your lesson? Thanks for your help in advance

  • @manoelguidialvares6903
    @manoelguidialvares6903 5 ปีที่แล้ว

    Btw which tuning method did you use ? I do not know them by heart since I mostly use matlab and simulink in my job, but it looks like those Ziegler-Nichols, Angstrom, AMIGO tunings...

  • @AbdulRehman-rk5go
    @AbdulRehman-rk5go 9 ปีที่แล้ว

    Joop Brokking. my quadcopter is quiet similar to you.i tunned my quad as you said in this video and my tunning parameters are given below:
    p = 0.035;
    i= 0.3;
    d = 1.35;
    The problem is that my quadcopter is flying without oscillations but it does not fly straightly.

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      +Abdul Rehman A quadcopter that is quiet similar might need complete different pid settings.
      My guess is that your i is to high and your p is to low. Try to lower your i gain back to 0.05 and increase your p and d gain.
      Did you try the initial settings of the program (p=1.3, i=0.05, d=15)? What gyro, esc's, motors and props do you use ?

    • @AbdulRehman-rk5go
      @AbdulRehman-rk5go 9 ปีที่แล้ว

      thankx for your reply. but i am saying that my quad is flying good but the problem is that it does not stay horizontally at its position. My question is that..... is there wrong pid tunning or xbee is not calibrated or any other problem?

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      Abdul Rehman
      The YMFC has no auto level mode. When you release the sticks the quad will stay in the same position (angle). So it will not return to a level position.
      If your quad is slowly changing it's angle the zero position of the stick is not correct.

    • @AbdulRehman-rk5go
      @AbdulRehman-rk5go 9 ปีที่แล้ว

      Joop Brokking thank you.

    • @AbdulRehman-rk5go
      @AbdulRehman-rk5go 9 ปีที่แล้ว

      +Joop Brokking . can you plz come on skype for the tunning of my Quad? i will be very thankful to you.

  • @lowies1dubbing
    @lowies1dubbing 8 ปีที่แล้ว

    ben nu al een end op weg met de basis van de pid's...thnx

  • @sardarhasseb8330
    @sardarhasseb8330 9 ปีที่แล้ว

    when will the 6th part will come ,anxiously waiting 4 it ??

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

    VERRY VERRY AWESOME EXPLANATION WOOOOOW

  • @KiyoshiKumo
    @KiyoshiKumo 6 ปีที่แล้ว

    Hello ! I've tried to print out the gyro, and channels value but in monitor it didn't print anything. I'm using YMFC-3D PID code, i modified it.

  • @zaki841
    @zaki841 6 ปีที่แล้ว +1

    Thank fo your video
    Sir i built the ymfc 3d but the problem is that my quadcopter doesn't go up it only flip around the right what could be the problem

    • @pinballball5208
      @pinballball5208 6 ปีที่แล้ว

      ahmed mohamadi have u solved the problem yet im also having the same problem qlways flipping towards right

  • @munkhjargalnymsuren5543
    @munkhjargalnymsuren5543 7 ปีที่แล้ว

    i have build my first quadcopter f450. i did all calibration in mission planner and ESC. but some of moters rotating faster than others. do you know why?

  • @intiazahmed3609
    @intiazahmed3609 4 ปีที่แล้ว

    Which propeller you are using? My BLDC is DJI 2212 920KV.
    While trying to fly Everytime props
    Getting spit out.

  • @yimmonirak9537
    @yimmonirak9537 7 ปีที่แล้ว

    Hi Joop Brokking,what your code balance test in your video????

  • @hhotsauce
    @hhotsauce 5 ปีที่แล้ว

    Joop could you please tell me how to balance the motors and props using the program in part 4. how can I test for minimum vibrations in the arms using a program...?

  • @arijitroy4267
    @arijitroy4267 6 ปีที่แล้ว

    Hello Joop, I have followed all instructions in the series of YMFC 3d V2.. While doing the PID tuning, when I keep the throttle at a constant value (above minimum) for a few seconds, the ESCs start to beep and I lose control of the motors. They switch off and I cannot start the motors again unless I reset my Arduino. Could you please help me with this problem?

    • @arijitroy4267
      @arijitroy4267 6 ปีที่แล้ว

      I'd like to add that I do not face this problem with the esc_calibrate code. The motors work fine even at full throttle and I can easily bring them back to a stop voluntarily. However, when running the Flight_controller code, the motors stop after a while and ESCs start beeping.
      I am guessing there may be some stray power flow to the Arduino causing it to reset. That said, I have used a diode between the battery and Vin. So I am really confused what the problem could be. Please help.

  • @ChaozBoom
    @ChaozBoom 7 ปีที่แล้ว

    Hi Joop, I am doing a similar project, and your work is proving invaluable, so thank you!
    Just a quick question- why is it you use the EEPROM library for your YMFC-AL program? I am fairly new to Arduino, and have not experienced this library before. Could I not convert the receiver channel just using a simple 'map' to an integer for example, instead of an allocated register within the UNO's EEPROM?
    Thanks again, and keep up the good work!

    • @Joop_Brokking
      @Joop_Brokking  7 ปีที่แล้ว

      Yes that is possible. But you need to modify the code yourself.

    • @ChaozBoom
      @ChaozBoom 7 ปีที่แล้ว

      Thanks for the reply, that's fine as I am writing my own code anyway, I was just wondering what the benefit of using the EEPROM library is?
      Many thanks

  • @wwilliams3270
    @wwilliams3270 9 ปีที่แล้ว

    Thanks for the Videos. Has made things much more clearer to understand.But I was wondering, could I use the standard Servo.h library to use the ESCs? I checked the cycle rate and its about 3000 Microseconds to complete the Loop once, with the gyroscope, PID calculations and a few more LED signals. Is that too slow?

    • @sandervanleeuwen9395
      @sandervanleeuwen9395 8 ปีที่แล้ว

      +W Williams 3 ms is not slow. This means that your Arduino corrects it position 1 / 0.003 = 333 times in one second. This is more than enough for a steady quadcopter, which needs at least 50 cycles. Sorry, I don't know enough of the Servo library to give you a heads up.

  • @revvedupofficial
    @revvedupofficial 9 ปีที่แล้ว

    Hello sir hoop, I'm totally confused about the PID control sketch. Can you please provide me the sketch of your PID control

    • @Joop_Brokking
      @Joop_Brokking  9 ปีที่แล้ว

      +ankur upadhyay There is a link for the final code in the description of part 6.