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

  Рет қаралды 389,212

Joop Brokking

Joop Brokking

9 жыл бұрын

PLEASE USE THE YMFC-AL (AUTO-LEVEL) SOFTWARE: • YMFC-AL - Build your o...
These videos are just for reference. The new software is much easier to setup and supports almost all transmitters.
You can download the Arduino sketch here:
www.brokking.net/ymfc-al_main....

Пікірлер: 633
@tacpreppers4906
@tacpreppers4906 5 жыл бұрын
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.
@MrFlashgrenade
@MrFlashgrenade 9 жыл бұрын
I find this is the first video that actually explains in detail what PID settings do. Thank you very much!
@VincentArdolino
@VincentArdolino 7 жыл бұрын
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
@siddhantchaudhary4946
@siddhantchaudhary4946 5 жыл бұрын
You're the inspiration of millions of future engineers..... Respect
@wanderreels7385
@wanderreels7385 3 жыл бұрын
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.
@mickcooper8605
@mickcooper8605 7 жыл бұрын
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
@theconcerned9113
@theconcerned9113 7 жыл бұрын
Thanks, Joop, you have done the best drone tutorials I've ever seen.
@JuanAriasArias
@JuanAriasArias 8 жыл бұрын
Very good job. The best tutorial about PID that I have ever seen. Thank you so much.
@evgenyyakimov7779
@evgenyyakimov7779 4 жыл бұрын
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!
@manoelguidialvares6903
@manoelguidialvares6903 4 жыл бұрын
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 !!
@MrHristoB
@MrHristoB 4 жыл бұрын
I'm new to the multirotor business and this must be one of the BEST and clear PID explanation!!!! Bedankt Joop!!!
@avacomputer2819
@avacomputer2819 5 жыл бұрын
Hello, thanks a lot for this much needed video series! The best tutorial about PID that I have ever seen!
@tamasgiraszi7449
@tamasgiraszi7449 Ай бұрын
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.
@HanSolo1
@HanSolo1 7 жыл бұрын
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 4 жыл бұрын
Excellent explanation. Very good introduction for newbies (and probably more advanced users). Thanks a lot!
@samantareboredo7665
@samantareboredo7665 7 ай бұрын
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.
@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.
@pricedempler
@pricedempler 3 жыл бұрын
Thank you for showing the code AND the resultant behavior on the quad. Big help!!!
@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 жыл бұрын
Thank you for taking the time to write me this message. Really appreciate it!
@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.
@somiprakash1347
@somiprakash1347 3 жыл бұрын
Excellent video , going into the practical approach to designing PID loop into mcu ..
@MilanKarakas
@MilanKarakas 9 жыл бұрын
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.
@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 :)
@MEGAZSTUDIOS
@MEGAZSTUDIOS 8 жыл бұрын
Amazing piece of work, excellent control and response. Well done mate keep it up. ^_^
@freddiesnijman
@freddiesnijman 9 жыл бұрын
Excellent! PID, make more sense to me. Besides that I admire your teaching/coaching talent.
@Joop_Brokking
@Joop_Brokking 9 жыл бұрын
Freddie Snijman Thanks for the compliments!
@a_aron30490
@a_aron30490 7 жыл бұрын
You are a brilliant person, your videos really help me out in my computer programming class and our arduino projects
@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.
@mcynelly1637
@mcynelly1637 8 жыл бұрын
The best tutorial about PID that I have ever seen.
@Joop_Brokking
@Joop_Brokking 8 жыл бұрын
Thanks!
@buildingmyownracingdrone3537
@buildingmyownracingdrone3537 8 жыл бұрын
Agree, best ever. Goed werk!
@sardarhasseb8330
@sardarhasseb8330 9 жыл бұрын
Finally a best video for understanding multirotor pid :)
@theodordrymonis6728
@theodordrymonis6728 9 жыл бұрын
Very nice tutorial !!! Looking forward for the next video !!!
@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
@MrFlashgrenade
@MrFlashgrenade 9 жыл бұрын
I'm the eight viewer. I must call that a victory and take this opportunity to congratulate you on your wonderful project.
@Joop_Brokking
@Joop_Brokking 9 жыл бұрын
Insta Awesome Thanks!
@rtdave6982
@rtdave6982 7 жыл бұрын
I have learned many many things from you...Thank you.
@mrabalone3492
@mrabalone3492 7 жыл бұрын
AWESOME ! It helps a lot for my project thanks Joop Brokking
@RSP13
@RSP13 4 жыл бұрын
PID is now much cleaner for me. Thanks
@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!!!!!!!!!!!!!!
@carlosfreitas4056
@carlosfreitas4056 4 жыл бұрын
Thanks for everything. You are brilliant at teaching.
@EdCranium
@EdCranium 9 жыл бұрын
Fantastic work. PID explained so even I can understand it. Genius!
@karnikram
@karnikram 9 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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 жыл бұрын
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
@ng4559
@ng4559 9 жыл бұрын
Excellent job done!! Keep it up man!
@longplayernet
@longplayernet 4 жыл бұрын
Very Helpfull and cool practical examples!
@ycmgxekwa
@ycmgxekwa 6 жыл бұрын
Brilliant tutorial once again. Thank you very much.
@matiasbrollo6871
@matiasbrollo6871 Жыл бұрын
Le devo mucho a esta serie de videos. Muchas gracias.
@InnosWei
@InnosWei 6 жыл бұрын
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?
@originalthehrao
@originalthehrao 5 жыл бұрын
you are genius man. great work. thank you so much for sharing your knowledge.
@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.
@ranjitroshan3101
@ranjitroshan3101 6 жыл бұрын
Thank you very much for this wonderful video.
@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)
@robertparenton7470
@robertparenton7470 3 жыл бұрын
Thank You for sharing this valuable knowledge.
@user-tp9sk5rm6t
@user-tp9sk5rm6t 7 жыл бұрын
Great video !!!
@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?
@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.
@hemantjain511
@hemantjain511 6 жыл бұрын
Very nicely explained!! Thanks!!
@XyberZyen
@XyberZyen 7 ай бұрын
THX EXELENT FINALY une video to show to really do pid in a quad
@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
@nikodembartnik
@nikodembartnik 7 жыл бұрын
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 7 жыл бұрын
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: kzbin.info/www/bejne/eorTeXVjgcufpas
@nikodembartnik
@nikodembartnik 7 жыл бұрын
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?
@yusufaksel2516
@yusufaksel2516 4 жыл бұрын
Hey! Great tutorial series, thanks. I wondered something, what is the working principle of your test setup at 1:00 ?
@kripeshram4781
@kripeshram4781 6 жыл бұрын
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.
@mohammedzeyton
@mohammedzeyton 5 ай бұрын
VERRY VERRY AWESOME EXPLANATION WOOOOOW
@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: kzbin.info/www/bejne/pZSbeKlsZseZrLc I'm using my own algorithms to get is stable like that.
@carlscrivener2462
@carlscrivener2462 5 жыл бұрын
Great video! Can I ask why the roll limit is set to 400? Is this an arbitrary number?
@rje242
@rje242 7 жыл бұрын
Hey Joop, I really appreciate this video. I've built my quadcopter and would like to use your formula for tuning my PIDs, however, I'm using Cleanflight as my program. I'm wondering if you or someone could offer ideas of the equivalent rates to use on Cleanflight to start the tune as you did in this tutorial? Thanks
@arashabdi4052
@arashabdi4052 5 жыл бұрын
hi, i really appreciate about the all tutorials. according to your tutorials, implemented a Drone which flies nice, but when it takes off, immediately stats to go front or left by itself and i don't know why. another question is : if i am going to add position controller before rotational PID, how should i measure status of Drone while flying? MPU6050 is a good idea or GPS with arduino UNO? thank you so much.
@philthayer4087
@philthayer4087 7 жыл бұрын
Nice explanation!
@CountDownToDisaster
@CountDownToDisaster 8 жыл бұрын
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 8 жыл бұрын
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 жыл бұрын
don't listen to sander. he doesn't use ppm.
@claudiofe8318
@claudiofe8318 8 жыл бұрын
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 (+/-)
@Thomas-qr3bg
@Thomas-qr3bg 5 жыл бұрын
Hey Great Work Thanks For Sharing.
@victoraugusto2721
@victoraugusto2721 3 жыл бұрын
Great video my friend I have a question, how you find the bests values to kp, ki and kd constants?
@henk358
@henk358 7 жыл бұрын
Verry good thanks great work.thanks for sharing big help
@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¡...
@manoelguidialvares6903
@manoelguidialvares6903 4 жыл бұрын
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...
@nelsone.1472
@nelsone.1472 6 жыл бұрын
Hi good job,and very good proyect, I have a question about the battery, in the program you put esc_1 += esc_1 * ((1240 - battery_voltage)/(float)3500) but whas does mean the 3500?
@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
@wwilliams3270
@wwilliams3270 8 жыл бұрын
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.
@das250250
@das250250 5 жыл бұрын
Interesting project
@jackbosshard4502
@jackbosshard4502 8 жыл бұрын
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 8 жыл бұрын
+Jack Bosshard I have no idea. I never used a Arduino Due myself so I can't give you any useful advise.
@farhantandia7190
@farhantandia7190 6 жыл бұрын
Oh thanks for explained. In my case, my pwm output from pid calculation is responsive but when it write to esc ,the bldc response is slow(its like have some delay on it) so my quad can't stable in any pid constants that i tune.. Please help how to make my esc reponse fast according to yaw and pitch angle with no delay ?( thanks. Im using serial monitor to make a command. I just test my quad in quad test stand.
@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
@suhasrx100
@suhasrx100 8 жыл бұрын
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 8 жыл бұрын
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.
@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
@shubhobanerjee311
@shubhobanerjee311 8 жыл бұрын
hi! joop this series has inspired me to build my own arduino quadcopter, however i've made some modifications to the code. i am using a mpu6050. i was thinking, is it possible to use yaw ,pitch and roll angles from the mpu6050 and convert the reciever inputs to the same and then calculate the pid. like when the pitch stick is at top the reciever input becomes 15degrees and the gyro pitch angle is taken as the current position. thanx
@Joop_Brokking
@Joop_Brokking 8 жыл бұрын
If you need degrees you also need to use the accelerometer. You can read more about it here: www.starlino.com/imu_guide.html Please note that the YMFC-3D version 2 supports the MPU-6050. kzbin.info/www/bejne/eYXXfYObf7WVjrs
@shubhobanerjee311
@shubhobanerjee311 8 жыл бұрын
Thanx for the reply, i am already able to obtain the yaw pitch and roll angles with the help of example arduino code.
@kevinchahine7553
@kevinchahine7553 6 жыл бұрын
Spectacular
@abdullahagcayazi7581
@abdullahagcayazi7581 7 жыл бұрын
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/
@lard_dork
@lard_dork 8 жыл бұрын
D output = ((Gyro - Receiver) - (Gyro Prev- Receiver Prev) ) * D gain
@Joop_Brokking
@Joop_Brokking 8 жыл бұрын
+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!
@waleedgaming8064
@waleedgaming8064 7 жыл бұрын
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
@lazzday1
@lazzday1 7 жыл бұрын
Hi Joop! Amazing videos! So helpful! I have one problem though... I am trying to adapt your YMFC-AL code for autonomous flight, so no radio input! I have built a test stand like yours in this video to demonstrate the auto-level. I can't under stand how to adapt the setpoint for the PIDs to keep the quadcopter level in hover, as my PID input is angular motion, not angular position. When I try to implement my code on my test stand, the PID stabilizes the axis to the point where I push it, but doesn't auto-level! How do I covert the angular motion data to an angular position so I can auto level? Sorry if this doesn't make sense! Thanks
@Joop_Brokking
@Joop_Brokking 7 жыл бұрын
Watch this video: kzbin.info/www/bejne/eorTeXVjgcufpas It explains how to get a simple auto level feature.
@tipiapagopo
@tipiapagopo 9 жыл бұрын
this is great!
@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 ?
@kevinchahine7553
@kevinchahine7553 7 жыл бұрын
Very amazing
@dennisllante
@dennisllante 7 жыл бұрын
Been learning a lot from your videos, what modifications should i make if i want to adapt the code for a tricopter project? thanks! Also, are you releasing a tutorial for the telemetry module you made? thanks!
@Joop_Brokking
@Joop_Brokking 7 жыл бұрын
If you want to make a tricopter you need to send the PID output of the yaw to the servo. The motors are mixed with the roll and pitch PID as a triangle, not a square.
@dennisllante
@dennisllante 7 жыл бұрын
Beautiful! Thank you so much!
@ypenburger
@ypenburger 7 жыл бұрын
HEY DEAR KZbinRS, 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!
@cafersas
@cafersas 9 жыл бұрын
by the way incredible videos
@angryduck2669
@angryduck2669 7 жыл бұрын
Is it natural to have really big values of PID? For example if I set Pgain=100,Igain=50 and Dgain=100 for the roll axis, is it possible that it would work, I'm telling you this because with small values like yours it doesn't seem to work. Thanks in advance.
@nachocortizo3321
@nachocortizo3321 4 жыл бұрын
@Joop Brokking , first of all: great content! this is very informative! The generic PID definition uses DeltaTime as a multiplier for the I and D terms, but you seem to not use it... Is this because your feedback variables are in º/s. ? In my case I´m trying to simply control the Pitch/yaw/roll (so plain º). Thanks.
@Joop_Brokking
@Joop_Brokking 4 жыл бұрын
The delta-t is fixed in the loop time of the main program loop. For the YMFC it's 4ms. This way I don't have to take the delta-t into account.
@nachocortizo3321
@nachocortizo3321 4 жыл бұрын
@@Joop_Brokking Ah yes, I was looking through your code and makes sense! Thanks.
@Gagandeepsingh-uf2un
@Gagandeepsingh-uf2un 3 жыл бұрын
@@nachocortizo3321 had u finished your Quadcopter project did it ran well?
@shubhobanerjee311
@shubhobanerjee311 8 жыл бұрын
hi! joop. i have a question again, as you already know many esc work at a frequency of 50hz. so if we assume that you had 50hz escs and the pid calculations to be done 50 times a second, would the pid range be the same or 5 times the pid range of yours, since your escs run at a frequency of 250hz.
@Joop_Brokking
@Joop_Brokking 8 жыл бұрын
The PID settings would be the same. But you loose a lot of stability because the motors / ESC's only update 50 times a second in stead of 250 times. This means that you might need to tune the PID values.
@bask185
@bask185 7 жыл бұрын
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 7 жыл бұрын
The YMFC-3D need manual leveling. The YMFC-AL is auto level.
@KiyoshiKumo
@KiyoshiKumo 5 жыл бұрын
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.
@alaaahmed2008
@alaaahmed2008 7 жыл бұрын
Exellent video .. can you tell me please how i can do it the same projekt in arduino due and trought I2C, have a problem with the time interrupt . thanks
@alanmfls
@alanmfls 6 жыл бұрын
Hey joop, thanks for the videos, helped me a lot!! Do you know how can i get the PID gains with MATLAB? I already have the transfer function of the system
@Joop_Brokking
@Joop_Brokking 6 жыл бұрын
I never used MATLAB so I really have no idea.
@a..d2062
@a..d2062 5 жыл бұрын
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.
Can You Draw A PERFECTLY Dotted Line?
00:55
Stokes Twins
Рет қаралды 89 МЛН
WHO DO I LOVE MOST?
00:22
dednahype
Рет қаралды 80 МЛН
Empirical PID gain tuning (Kevin Lynch)
7:08
Northwestern Robotics
Рет қаралды 155 М.
PID Balance+Ball | full explanation & tuning
13:13
Electronoobs
Рет қаралды 731 М.
Hardware Demo of a Digital PID Controller
2:58
Gregory L. Holst
Рет қаралды 977 М.
12 | Program a PID controller to stabilize a drone
8:38
Carbon Aeronautics
Рет қаралды 18 М.
PID tuning on a string setup
6:09
srgicsuplb
Рет қаралды 28 М.
Bölüm 6 - Arduino PID Kontrol
21:17
Berkay'la Elektronik
Рет қаралды 36 М.
Quadcopter PID explained
12:18
Andrew
Рет қаралды 59 М.
PID Controller Explained
9:25
RealPars
Рет қаралды 791 М.
Неразрушаемый смартфон
1:00
Status
Рет қаралды 2,3 МЛН
Урна с айфонами!
0:30
По ту сторону Гугла
Рет қаралды 8 МЛН