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 !!
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
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.
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
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
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.
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.
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.
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
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.
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!
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
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?
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.
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.
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!!!
@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.
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.
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 (+/-)
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?
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.
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?
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
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
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?
+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
Joop , it is a little hard to understand the units of measurment for the variables. 1. For example at 9:21 you say that the gyro and reciever inputs are in deg/s and then you divide the gyro_roll so as to get the deg/s but the gyro already gives angular velocity measured in deg/s ? 2. It's not really clear to me how exactly you transfer the reciever input(wich is in pulse length) tu deg/s and viceversa for esc commands. Ido not get this here ,please enlighten me . Thanks
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.
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?
+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.
+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?
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.
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.
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.
I am confused please help at 10:10 in the video.you talk about the degrees per second. Where does the ((500-8)/3)=164d/s come from.where does the 500 and -8 come from.
sorry to ask again you mean the maximum receiver signal is 500-8 therefore the max dps is 164 when divided by 3. what do you mean exactly when you say 500 is the receiver signal ? how does 500 relate to the degrees per second.? sorry for this daft question. I am just a bit confused. Thank you for answering so quickly.
also how do you know that 500 is the maximum dps of the quadcopter. did you measure this somehow before and realise that 500 exactly from the control is also the maximum dps at 500 for the quadcopter.
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?
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.
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.
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
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?
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!
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!
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/
I do not understand the spoken English but the written yes, someone can explain me what it says about the tunning of the pid. From minute 12:55 to the end. I need to configure my quadcopter
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
awesome project. but i have question. I would like to see the error value, PID values, as well as its PID chart. how do I get to see its. as in this video, at minute 4:50. thanks Joop Brokking.
thanks joop brokking. in the code your upload, where I use serial.print if I want to see the final value of the PID, time (us), receiver (dps), gyro (dps), the value of P, the I and D? because I want to see a graph of PID to determine its stability.
I see joop brokking. Thanks. How about. in the code your upload, where I use serial.print if I want to see the final value of the PID, time (us), receiver (dps), gyro (dps), the value of P, the I and D? because I want to see a graph of PID to determine its stability.
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)
Great Job excellent video! but there is some think i don't understands here you choose de maximum command to 164dps (setpoint) how do you know that's not too high and the drone isn't going to fall ? thanks in advance for your answer ^^
ok thanks but can we consider that the max 164dps command is like we ask the drone to have a 45° angle on the considered axe. Sorry to bother but i'm doing a drone for a study project only using a gyrocope as a capteur and i don't know how to explain how i choose this part of the code (164dps max setpoint) thanks in advance for your answer
The 164dps tells the drone that it must rotate 164dps. It's not a fixed angle. In this video I explain the auto level function and the angle calculation: th-cam.com/video/DYpHB-LfloI/w-d-xo.html
yes i saw this video but you are using an accelerometre. the thing is i don't understand how to think with speed and not position. Because when you put de joystick to 2000 us (convert in 164dps in the code) if it's the roll you ask the drone to rotate at 164dps to the right, like that it goes to the right. But i don't understand if i keep the joystick to 2000us why the drone just goes to the right and don't rotate on the roll axe indefinitely ? ( i know what i say is stupid because the pid is correcting the thing but that's my problem )
The confusion is probably the difference between rate and auto level. The video that I linked is the auto level that uses an accelerometer and angles. When you release the sticks the quadcopter levels itself. If you use only a gyro the quadcopter is flying in rate mode. This means that when you release the sticks the quadcopter will keep it's current position. Then you move the stick full right the PID input is 164 degrees per second. The PID controller will change the motor speed until the gyro detects 164 degrees per second. And it will keep rotating at 164 dps as long as the stick is full right. Meaning that the quadcopter flips upside down proximately 2 times per second.
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 ?
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!
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
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.
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!!!!!!!!!!!!!!
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.
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
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?
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
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!
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?
+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.
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)
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.
Error = receiver - gyro. but receiver is a PWM value where as gyro output is a deg/sec value..so what is the dimension of the value that we get by the subtrating them ??? PWM - deg/sec = ????
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...
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.
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
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!
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
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
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. th-cam.com/video/CTtLPeJPbXY/w-d-xo.html
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...?
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
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 !!
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
You're the inspiration of millions of future engineers..... Respect
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.
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
Thank you for taking the time to write this positive comment.
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
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.
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.
Karnik Ram Yes, you are right! I should have added brackets in the presentation sheet. +1 for you sir!
thank you sirs to both of you for pointing out a bracket error... and at the same time confirming there was an error
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.
I find this is the first video that actually explains in detail what PID settings do. Thank you very much!
I'm new to the multirotor business and this must be one of the BEST and clear PID explanation!!!! Bedankt Joop!!!
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.
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
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.
The best tutorial about PID that I have ever seen.
Thanks!
Agree, best ever. Goed werk!
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!
Thank you for showing the code AND the resultant behavior on the quad. Big help!!!
Very good job. The best tutorial about PID that I have ever seen. Thank you so much.
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!
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
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?
Excellent explanation. Very good introduction for newbies (and probably more advanced users). Thanks a lot!
D output = ((Gyro - Receiver) - (Gyro Prev- Receiver Prev) ) * D gain
+Brian Boozebacon Not many people have seen / noticed this typo in the presentation ;-) +1 for you!
+Brian Boozebacon just noticed the same error.
Thanks for clarifying!
Thanks, Joop, you have done the best drone tutorials I've ever seen.
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.
Thank you for taking the time to write me this message. Really appreciate it!
Excellent video , going into the practical approach to designing PID loop into mcu ..
Very useful videos for those who are building their own flight controller. Special thanks to mention that D gain should be fixed first.
Excellent! PID, make more sense to me. Besides that I admire your teaching/coaching talent.
Freddie Snijman Thanks for the compliments!
You are a brilliant person, your videos really help me out in my computer programming class and our arduino projects
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.
Thank you for your reply and that this video was educational.
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!!!
@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.
Hello, thanks a lot for this much needed video series!
The best tutorial about PID that I have ever seen!
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.
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 (+/-)
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?
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.
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?
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
poor child, it has been 3 yrs, Mr. Joop still didn't answer u
@@donyip9674 One day my brother, one day he will.
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
Hey! Great tutorial series, thanks. I wondered something, what is the working principle of your test setup at 1:00 ?
PID is now much cleaner for me. Thanks
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?
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.
+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
don't listen to sander. he doesn't use ppm.
Joop , it is a little hard to understand the units of measurment for the variables.
1. For example at 9:21 you say that the gyro and reciever inputs are in deg/s and then you divide the gyro_roll so as to get the deg/s but the gyro already gives angular velocity measured in deg/s ?
2. It's not really clear to me how exactly you transfer the reciever input(wich is in pulse length) tu deg/s and viceversa for esc commands.
Ido not get this here ,please enlighten me .
Thanks
Maybe this video will give you some more insight:
th-cam.com/video/DYpHB-LfloI/w-d-xo.html
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.
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?
+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.
+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?
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.
+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?
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.
Great video! Can I ask why the roll limit is set to 400? Is this an arbitrary number?
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.
I am confused please help at 10:10 in the video.you talk about the degrees per second. Where does the ((500-8)/3)=164d/s come from.where does the 500 and -8 come from.
500 is the receiver signal and 8 is the used dead band.
sorry to ask again
you mean the maximum receiver signal is 500-8 therefore the max dps is 164 when divided by 3.
what do you mean exactly when you say 500 is the receiver signal ?
how does 500 relate to the degrees per second.?
sorry for this daft question. I am just a bit confused.
Thank you for answering so quickly.
so do mean the maximum right(or left etc) stick push on the controller is 500. this hence represents the maximum dps.
also how do you know that 500 is the maximum dps of the quadcopter. did you measure this somehow before and realise that 500 exactly from the control is also the maximum dps at 500 for the quadcopter.
Great video. I thought it was gonna be super hard to understand but you explained it soo well :)
I'm the eight viewer. I must call that a victory and take this opportunity to congratulate you on your wonderful project.
Insta Awesome Thanks!
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.
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?
The YMFC-3D need manual leveling. The YMFC-AL is auto level.
How did you come up with the constants for the complementary filter you used for finding battery voltage at 8:40 ?
I used these values before and they give a usable result. So it's just experience / trial and error.
Finally a best video for understanding multirotor pid :)
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.
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.
Amazing piece of work, excellent control and response. Well done mate keep it up. ^_^
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
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
Le devo mucho a esta serie de videos. Muchas gracias.
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?
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!
In the code the PID controllers are limited by this line:
int pid_max_roll = 400;
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!
where can i find the pid arduino code?
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/
I do not understand the spoken English but the written yes, someone can explain me what it says about the tunning of the pid.
From minute 12:55 to the end.
I need to configure my quadcopter
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
I have learned many many things from you...Thank you.
Hi sir i ask u why multiple (angle_pitch Or angle_roll) by 15 to find level_adjust. why this number (15)?
please help
awesome project.
but i have question.
I would like to see the error value, PID values, as well as its PID chart. how do I get to see its. as in this video, at minute 4:50. thanks Joop Brokking.
You have to use Serial.print to output the values.
thanks joop brokking.
in the code your upload,
where I use serial.print if I want to see the final value of the PID, time (us), receiver (dps), gyro (dps), the value of P, the I and D?
because I want to see a graph of PID to determine its stability.
and if i starting the motor, value of throttle not on 0%. it abuout 10%. whats happen?
It's normal that the motors start spinning when you start the quadcopter. You can see the same here: th-cam.com/video/gz-Mywo7bGc/w-d-xo.html
I see joop brokking. Thanks.
How about.
in the code your upload,
where I use serial.print if I want to see the final value of the PID, time (us), receiver (dps), gyro (dps), the value of P, the I and D?
because I want to see a graph of PID to determine its stability.
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)
There will be precedence issue in the calculation of Derivative out put i think. The video is very informative. Thanks for sharing.
Great Job excellent video! but there is some think i don't understands here you choose de maximum command to 164dps (setpoint) how do you know that's not too high and the drone isn't going to fall ? thanks in advance for your answer ^^
It's just a trail and error value that works fine for most pilots.
ok thanks but can we consider that the max 164dps command is like we ask the drone to have a 45° angle on the considered axe. Sorry to bother but i'm doing a drone for a study project only using a gyrocope as a capteur and i don't know how to explain how i choose this part of the code (164dps max setpoint) thanks in advance for your answer
The 164dps tells the drone that it must rotate 164dps. It's not a fixed angle.
In this video I explain the auto level function and the angle calculation: th-cam.com/video/DYpHB-LfloI/w-d-xo.html
yes i saw this video but you are using an accelerometre. the thing is i don't understand how to think with speed and not position. Because when you put de joystick to 2000 us (convert in 164dps in the code) if it's the roll you ask the drone to rotate at 164dps to the right, like that it goes to the right. But i don't understand if i keep the joystick to 2000us why the drone just goes to the right and don't rotate on the roll axe indefinitely ? ( i know what i say is stupid because the pid is correcting the thing but that's my problem )
The confusion is probably the difference between rate and auto level. The video that I linked is the auto level that uses an accelerometer and angles. When you release the sticks the quadcopter levels itself.
If you use only a gyro the quadcopter is flying in rate mode. This means that when you release the sticks the quadcopter will keep it's current position. Then you move the stick full right the PID input is 164 degrees per second. The PID controller will change the motor speed until the gyro detects 164 degrees per second. And it will keep rotating at 164 dps as long as the stick is full right. Meaning that the quadcopter flips upside down proximately 2 times per second.
Very nice tutorial !!! Looking forward for the next video !!!
tHANLS A LOT FOR SHARING YOUR KNOWLEDGE !! COULD YOU PLEASE SHARE WITH ME , THE EXCEL SHEET ? THANKS
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 ?
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!
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
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.
Fantastic work. PID explained so even I can understand it. Genius!
Thanks for everything. You are brilliant at teaching.
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!!!!!!!!!!!!!!
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.
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.
Great video my friend I have a question, how you find the bests values to kp, ki and kd constants?
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
Excellently explained but where do those 'dt' terms go? (as in pid formula) Don't you need to multiply with the time step in case of integral......?
The program loop is fixed to 4ms. That is why you don't include time as it will not change.
Can you make a video on concept of choosing pitch and diameter of propeller of drone
Very Helpfull and cool practical examples!
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?
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
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!
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?
+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.
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)
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.
Est il possible d'utiliser lora esp32 avec sx1276 pour transmettre les commandes de la manette au drone ?
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.
Error = receiver - gyro.
but receiver is a PWM value where as gyro output is a deg/sec value..so what is the dimension of the value that we get by the subtrating them ???
PWM - deg/sec = ????
PWM difference == thrust difference == angular motion == deg/sec.
when will the 6th part will come ,anxiously waiting 4 it ??
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...
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.
You can use the sliders on the transmitter to level the quadcopter. Make sure that you don't move the quadcopter at startup.
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
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!
Yes that is possible. But you need to modify the code yourself.
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
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
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.
th-cam.com/video/CTtLPeJPbXY/w-d-xo.html
Thanx for the reply, i am already able to obtain the yaw pitch and roll angles with the help of example arduino code.
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...?
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
ahmed mohamadi have u solved the problem yet im also having the same problem qlways flipping towards right
Which propeller you are using? My BLDC is DJI 2212 920KV.
While trying to fly Everytime props
Getting spit out.
What should I change to the code if I'm using 1400kv motors with 1045 props?
Can I keep modifying pid values in flight controller code without resetting the arduino board? Sorry if my question makes no sense. Iam a beginner
i tried your code but my drone is not flying. it's flipping. can you please help me?
How you choose the PID values of yaw to get the PID values of roll?
icant find the arduino code related to this video in your website