Nice ! Finally someone who use Arduino for more than an LED brightness variator... Great Engineering 😊
@Diamonds45917 жыл бұрын
Il vient de me sauver mon TIPE pour les concours d'école d'ingé ! :D
@Arslab.random7 ай бұрын
Then you should follow @upir
@pricedempler3 жыл бұрын
I have long struggled with this concept and seeing FPV views of issues and corrections did not help that much. By 11 minutes in to this video, I understand this far better! I am a visual learner and the bar and 2 motors is a brilliant way to describe PID control. Thank you so much for this video!!!
@Diamonds45917 жыл бұрын
Woooooooow you saved my life ! I am making this exact project (for school, for exam especially) and I was having trouble with the PID but thanks to you, all is pretty clear now ! Thanks so much ! Greatings from France !
@ELECTRONOOBS7 жыл бұрын
Aymeric thanks, I'm glad you say that!
@Diamonds45917 жыл бұрын
It works !!! :D Thanks so much ! But can I have a little bit of help please ? Because I tried with your values (3.55, 0.003, 2.25) and it works (lucky huh ? :p), but how to tune those values more precisely for my project ?
@ELECTRONOOBS7 жыл бұрын
For a perfect PID you coudl use a lot of math. Check this link: iamechatronics.com/notes/general-engineering/466-quantitative-pid-tuning-procedures Basically you should put the bar to oscillate. Once it oscillates you should measure the amplitude (in this case in degrees) and the period. Using this values you could get the real PID values. But once you adn the second axis everything changes so you should make a 4 axis balance for that. It gets quite difficult using the formulas thats why I do it by hand (testing and testing till is ok).
@kerimmoral7 жыл бұрын
You can use Ziegler-Nichols PID method as well. You only need to calculate oscillation frequency and then get the constants from a table quickly.
@einarkummel4059 Жыл бұрын
And here I am 5 Years later doing the same school project...
@Joop_Brokking7 жыл бұрын
Great video! Please also limit the I-controller separately. Not only the total PID controller. This will prevent the extreme overcompensation at the end of the video (16:00). In your code the I-controller can increment way to much. You can find an example in the YMFC-AL code.
@ELECTRONOOBS7 жыл бұрын
Thank you very much. I'll improve the code!
@kerimmoral7 жыл бұрын
wow first time i see someone makes his own flight controller. I am very interested in control aplications. Good job, waiting to see the finished project.
@alexwang0077 жыл бұрын
I would really want to understand about proportional navigation law, and you must be the perfect person in both explaining, designing, and making it!! Yet ANOTHER AWESOME VID DAMN!!
@andremendes414 жыл бұрын
In my opinion, it is the best video to learn ao to do a drone program with arduino. And we can learn how drone works.
@dogzday4 жыл бұрын
electronoobs, you are the absolute LEGEND. you make things incredibly intuitive and simple. i love how you teach. i can only strive to be as good as you one day. you're very inspirational! you are truly among the best teachers i've ever seen in my life.
@chinmaykulkarni78354 жыл бұрын
I don't think anyone is like electronicnoob while explaining stuff his the best
@aonkat5 жыл бұрын
Boss..!! I was working on reading angles from MPU for 2 weeks!! your code did it so properly for me!! thanks!!
@walterp71253 жыл бұрын
Normally PID is called in a interrupt routine and must to use volatile variable. Elapsed time change every scan of program but it seems works. Good job.
@samayaraj75427 жыл бұрын
You are awesome! Awesome! You are helping many DIY enthusiast. Great job. Keep servicing. We owe you a lot.
@ELECTRONOOBS7 жыл бұрын
Thank you!
@rajdeepkumargautam5 жыл бұрын
Hello Can you please tell me How to connect all four motors to it and do wee need calibrate ESCs and then do we need to load code for ESC and MPU seperately in the same ARDUINO.
@pravinchavhan88903 жыл бұрын
@@ELECTRONOOBS hi , i just want to know how can i calulate number of 360 degree rotations completed by MPU6050 using arduino . it would be nice if u help me
@wemela5 жыл бұрын
@Electronoobs Nice vid. Well explained, although a little more theory might be welcome to some. Tip: the gyro's are actually already derivative values of the angle. There is no real absolute angular measurement. So the gyro values in degrees per second can be sent straight to Kd whereas the acceleration measurements (without any gyro component) can be fed to Kp and (after integration) to Ki. That should keep you slightly more in control. You may also add a derivative of the accelerometer to Kd but I doubt whether that will really help - it may actually make things worse. Please try and let me know (if you did) whether you see any difference for better or worse. Thanx. :-)
@musaibbinhameed92422 жыл бұрын
One of the best Demonstration's OVER PID TUNING . (THANKS A LOT )💗
@espenbgh2540 Жыл бұрын
Love your mountng with rubberband during initial test and build
@martinbubel74316 жыл бұрын
Bro this tutorial is hillariously good, I love it! Have been searching the whole web for something like this. Thank you so much!!!
@controllaw36654 жыл бұрын
We love this channel and it was one of the reasons to start our own. We are a very new channel and will bring content on control theory, linear systems and systems identification. Keep inspiring people, thank you very much!
@mikemontana74367 жыл бұрын
Thank you for the effort on your series of videos - they are an excellent balance of theory and implementation! I very much enjoy them!
@XJohuX7 жыл бұрын
this is amazing. it really improved my understanding for control systems engineering.
@MarionMakarewicz6 жыл бұрын
Wizards and magicians have nothing on you. Wow! You are such a great teacher.
@Thomasvdd91236 жыл бұрын
Thanks! I used your system to make my robot ride in a straight line. Before it went to one direction because the motors are bad quality.
@rajdeepkumargautam5 жыл бұрын
Hello Can you please tell me How to connect all four motors to it and do wee need calibrate ESCs and then do we need to load code for ESC and MPU seperately in the same ARDUINO.
@IncroyablesExperiences7 жыл бұрын
Nice ! At last someone who use Arduino for more than an LED brightness variator... Great Engineering 😊
@ProjectPhysX7 жыл бұрын
Amazing video! Thank you very much! I'm surprised by how the PID algorithm works. An alternative solution would be to look at the Quadcopter as a damped harmonic oscillator. By measuring the mass and length of the bar with the motors you can calculate the constants for the oscillator in order to be critically damped, so that it goes to the desired position as fast as possible. Also your formula for calculating the angle from the IMU data is quite effective for its simplicity. For just a little more accuracy you can add what's called "delta integration" for getting the angle from the gyro. Instead of angle=rv_new*time the formula would look like angle=1/2*(rv_new+rv_previous)*time. Combining gyro and accelerometer data with a high- and low-pass filter like you did seems to be the ideal solution. I tested the Kalman filter as an alternative, but it does not work better in this case and it is also more complicated. Finally, I have a question to you: How often per second can an arduino read the sensor data? In my experiments with a Raspberry Pi 2 and I2C it is limited to about 400, but the sensor supports up to 1000 read per second.
@ELECTRONOOBS7 жыл бұрын
Thanks for all!. Well, depends of the module i2c comunication. And yes, the MPU6050 is limited at 400kHz Fast Mode I2C for communicating with all registers, which is quite fast and also for the SPI in case of the MPU6000 20MHz SPI serial interface for reading sensor and interrupt register.
@ShashankSingh89565 жыл бұрын
Thanks a lot! The way you explain and the depth of your explanation are just great! Keep it up!
@MrPnew17 жыл бұрын
Thanks for these excellent tutorials and projects ELECTRONOOBS they are extremely well explained, documented and very thorough. A brilliant body of work.
@naboulsikhalid77635 жыл бұрын
can you let me call you " Great Mentor". seem s I don't need to go to school to learn, you fill it. thank you so much. and I am happy that you get the 100k milestone.
@no-ei4jw4 ай бұрын
That's the video I had been searching for
@marcelschlangen60276 жыл бұрын
One of the best declaration videos i've ever seen on KZbin! Great work! Thank you.
@rajdeepkumargautam5 жыл бұрын
Hello Can you please tell me How to connect all four motors to it and do wee need calibrate ESCs and then do we need to load code for ESC and MPU seperately in the same ARDUINO.
@7guitarlover9 күн бұрын
Just amazing ! Wonderful ! So much fun to watch
@HolyManta6 жыл бұрын
you made this so well!!!! are all your videos this good??
@haashiliiran.ahwazcity25067 жыл бұрын
nice nice nice THANK YOU Believe me or not there is no teacher like you sir. I really like your awesome & helpful & great Channel.
@ELECTRONOOBS7 жыл бұрын
Thank you very much, I'm so glad you say that!
@Superguru1232 күн бұрын
PID (Proportional-Integral-Derivative) control helps maintain consistent RPM (revolutions per minute) across motors to prevent imbalance. Suppose motor 1 on the right side is spinning 40 RPM faster than motor 2 on the left side, despite both receiving the same power. This difference is an error that can lead to instability. To correct it, the PID controller continuously calculates adjustments to the power supply of each motor to reduce the RPM difference. The PID control system works by calculating an 'error' (the difference between desired and actual RPM) and applying corrections in real-time to bring both motors to the same speed. This technique helps keep the system balanced and stable.
@TechnocratDIYEducation7 жыл бұрын
Best part is PID tuning. I really like it.
@acerdolby7 жыл бұрын
Fantastic video, I like your way of explaining things:)! keep up the good work
@GeraMF7 жыл бұрын
What makes the integral action is to add a pole to the system and causes oscillations or at worst becomes unstable. The PD controller is good for DC motors.
@ELECTRONOOBS7 жыл бұрын
You're right. PD should be better for this case!
@vovanikotin7 жыл бұрын
I coefficient very important for leveling. Have you coded antiwindup of I controller?
@GeraMF7 жыл бұрын
The sensor data are degrees per second then in controller it acts on the estimation of the state variables in this case the angles: pitch, roll and yaw. You can use two PID controllers or their variants. Connected in cascade one acts on the posture and the other confirms if it is fit to take off. If you are good at control theory you can use a fuzzy controller
@GeraMF7 жыл бұрын
set_point=Serial.parseFloat(); system1=get_Euler(0); Pid(set_point,system1,0.94,.06,.07,100); e=get_PID(0); e1=get_PID(1); //Serial.print("el er es : "); Serial.println(e); //Serial.print("la der es : "); Serial.println(e1); if(e0){ // salida=aumentar pertenencia(Matriz_A2,e); a[8]=P(0); //Serial.print("pertenencia en error : "); //Serial.println(a[8]); pertenencia(Matriz_B2,e1); //Serial.print("pertenencia de la derivada del error : "); b[8]=P(0); //Serial.println(b[8]); a1[8]=t_norma(a[8],b[8],1);// el minimo de los conjuntos difusos //Serial.print("el minimo de los conjuntos : "); //Serial.println(a1[8]); b1[8]=defuzzy(a1[8],Matriz_C2,4 ); // calcucla el valor real //Serial.print("area : "); Serial.println(b1[8]); } }
@electronicafacil67067 жыл бұрын
you are such a good Engineering
@supersummermario4 жыл бұрын
Excellent video, thanks a lot for sharing. I'm trying to implement using 1 motor only, obviously I've modified the code but the motor just beeps without starting. I can run the motor no problem with the esc calibration code. Anyway I'll keep trying!
@vishnukartha475 жыл бұрын
Very high level of explanation. Helped a lot. Thanks
@avacomputer28195 жыл бұрын
This is amazing! Great explanation! THANK YOU!
@youneselmir687 жыл бұрын
I have a idea you can tune the PID controller automaticly(auto tuning) to diterminate the the best angle
@endtimerevealed1373 жыл бұрын
how?
@harikamalakarreddydarapu74104 жыл бұрын
Awesome project
@dvdvideo12347 жыл бұрын
Well done colegue! Keep it up !
@chisingchou6 жыл бұрын
Great tutorial about PID control!!
@noco04TheGamer4 жыл бұрын
this was very interisting, I am making my own drone and i want to whrite my code myself
@andreymilovanov87207 жыл бұрын
A Very good explanation, but you have made an error in the discretisation of the integral term.
@xXfelitubeXx6 жыл бұрын
Two words: Great video!!
@mateusztocha92607 жыл бұрын
You can consider to use a Anii Windup block to compensate Integral part.
@mohamedmoutamid30033 жыл бұрын
Excellent Job i like your project good luck
@hondatechnodiag84955 жыл бұрын
wow u r amazing teacher in KZbin thank u very much
@SumitKumar-fc4bq7 жыл бұрын
Great tutorial... Can you please make tutorial on GPS RTH and GPS hold . I don't find any tutorial on it ..
@abdul.rahim.k7 жыл бұрын
Luv your channel......!!!!😘😘 You deserve a million subscribers!!!!!!!
@ulf84687 жыл бұрын
great video and thumbs up for the well commentated code!
@clemz40275 жыл бұрын
thx a lot for explaining in an understandable way that PID control :)
@sahil48825 жыл бұрын
Sir, i got just one problem in understanding the code you wrote pwmLeft =throttle +PID; pwmRight =throttle -PID; So, why this + and - PID please tell. By the way your videos have helped me a lot. Thank you Sir
@Gereon_4 жыл бұрын
Great video! Thank you for providing these for FREE! :)
@saadkarim69947 жыл бұрын
this is great video and it was very helpfull.tanks electronoobs
@DonQuichotteLiberia7 жыл бұрын
This is amazing. Great explanation.
@mibrahim42456 жыл бұрын
Great video,, but what about the motors electrical characteristics ? for example, how did you know that this is the best voltage to run the motors at ? whats the maximum and minimum voltages to be mapped by the PID computer function ? I may have missed something but I'm curious for an answer ...
@abdulhadilababidi80526 жыл бұрын
I love this..you are genius 😍😍😍😍
@prateekmahajan1902 жыл бұрын
Awesome explanation
@MrLimetto7 жыл бұрын
Almost everyting explained perfectly, for making it up by yourself :D The only thing I have problems with is the maths behind it. Would be stunning if you could take the time in resarching and explaining it :D
@ELECTRONOOBS7 жыл бұрын
Hi there. Thank you! There is not much math in to this tutorial. The only formula i'be esed is the Euler formula to obtain the angle using acceleration data. More of the math is explained on my webpage here: www.electronoobs.com/eng_robotica_tut6_1.php Then the only time I've used a formula is to apply the complementary filter which is 98% Gyro data and 2% Acc data. The rest is just sum or subtract of PID value. Keep up!
@saravanampatti1 Жыл бұрын
What a wonderful video. Thanks .
@victoraugusto27213 жыл бұрын
Great video my friend I have a question, how you find the bests values to kp, ki and kd constants?
@gregh37292 жыл бұрын
in the loop: total_output = current_output + PID_output; Servo.write(total_output); current output = total_output;
@mrz25288 ай бұрын
Hello A greeting from you ...At this year I have the 2212 930KV motor , my question is you ever used the ardupilot mission planner software to set up the PID in the multirotor ?...I dont used the arduino board but I used the crius aio pro controller to set up the PID in my motor ...What values did you obtain in your test...would the result be the same if the mission planner software was used?
@sparshmahajan39486 жыл бұрын
The main function ‘u’ is dependant on the time - t and the proportional and differential function too are functions of time. I don’t understand why the function which will be integrated is a function of torque where the variable ‘tau’ isn’t mentioned anywhere in the main function ‘u’.. I believe its a mistake?
@dipakprajapati78537 жыл бұрын
Nice,advanced!😊 if i want to study electronics, which should i choose? electronics ? electronics communications?
@ELECTRONOOBS7 жыл бұрын
Both are ok!
@RegisMichelLeclerc3 жыл бұрын
Brilliant! Maybe I'm asking something stupid or maybe you have already treated it, but how do you control the ESCs from the Arduinos?
@gabrielsperez306 жыл бұрын
you rock man :D thanks for sharing your knowledge. you are inspiring. keep it up
@andrewkasza72827 жыл бұрын
This is great information, a very helpful video. Thanks
@articker6 жыл бұрын
Very good video and links, this is huge help. Thank You!
@timothysimonthomas33965 жыл бұрын
Please do a dedicated detailed video on the code
@ilhamagungwicaksono27756 жыл бұрын
Thanks for the tutorial. Are you not getting the MPU6050 drifts after some while Sir?
@manuramnishad30283 жыл бұрын
You are genius❤️🔥
@eberger022 жыл бұрын
I did not realise gyro and accelerometer readings were combined like that! Is the graph titled ‘MPU6050 data graph’ at time 12.01 on the data sheet or your own work?
@rachealow56486 жыл бұрын
hi, may i know what the difference between pid_p, pid_i, pid_d and kp, ki, kd in the code? Are you tuning kp, ki and kd only? The calculation for pid_p, pid_i and pid_d, the output is pwm signal with unit us? If yes, how to convert the error in degree unit to pwm? So the motor speed is control by input the pwm signal?
@ratnaraj207 жыл бұрын
Thank you for such detailed explanation. :)
@azhaank6 жыл бұрын
Excellent way of explaining...can you tell me how to implement PID control for 3 axis ??
@justsomedude46605 жыл бұрын
you live with n a 4d world?
@bilelbouassida32862 күн бұрын
great work
@fernoratube7 жыл бұрын
Very nicely explained!!!
@DavizinhoR7 жыл бұрын
Hi friend, how are you? first, congratulations for the great job. i want to know if you get the transfer function of the system, and maybe would you kind enough to explain me how to make it.
@MrBeelai5 жыл бұрын
very good explanation. I am facing one problem, I wish to make a RC V22 osprey, the plane has two profiles one is hovering as a bi-copter and forward movement as a plane, If i wish to use the multiwii what will be the settings? Do the the plane need two Mpu 6050 for hovering as a bicopter and one as a plane? Thank you.
@savvaskokkos87546 жыл бұрын
Are you using the absolute value of the error because of the zero angle set point or it has to do with the whole PID tuning method?I mean the whole concept is to have the same behavior no matter what the set point is right?
@Ramii-x6x Жыл бұрын
thx for the video :P one question where u write the speed of the motors (if stabilized and gyro does not ask for correction) thx alot
@David-ev1hy7 жыл бұрын
Awesome video, My group is about to work on a project like this.I would like ask if this PID algorithm would be still able to balance platform even though a weight is applied to one side of the bar. thanks
@ELECTRONOOBS7 жыл бұрын
Yes, it would be the same. That's the thind about PID, it should control the bar even with different weight on the sides.
@DanielMelendrezPhD7 жыл бұрын
Well done, man!
@BLAZMOD7 жыл бұрын
💕looking for more abut PID💕
@ameywaghmare75832 жыл бұрын
I think this wont work if your desired angle is different from 0 degrees, say it is 30 degrees. The error will reduce, but so will your PWM. This is because your throttle corresponds to 0 degree angle. You also need to take care of throttle.
@xino1010107 жыл бұрын
excellent explanation
@abdssamadbouhfid7569Ай бұрын
I'm confused now normally PID controller can't control systems withe multiple inputs , so are using two PID controller one for each motors, or somehow you manege to control both motors by only one PID Controller
@juanm.jacinto67715 жыл бұрын
Hello Electronoobs I'd like to know if you have a publication of this experiment to add you as reference in other publication? or did you find this in some publication?
@pranavasthanaDelhi4 жыл бұрын
awesome explanation! Thanks
@sebypicu54432 жыл бұрын
Hello, very nice video, would you like to make a video with raspberry pi controlling brushless motors please? Or the same project, but with raspberry pi 4?
@francoisguyot7895 жыл бұрын
Is there any way to calculate the best constant values for Kp, Ki, and Kd please ??
@francoisguyot7895 жыл бұрын
Thanks for this very helpful video by the way !
@randomvideofromuniverse562211 ай бұрын
thank you very much,great video
@guywatcho16417 жыл бұрын
Hi very nice video tutorial. Please where can we find the next video?
@abcddd5806 жыл бұрын
can you go more in depth into complementar filters and kalman filters? Thanks!
@kaywanasivand3598 Жыл бұрын
Hi I want to do this project for my university and do not know much, and what should I start and what to learn to build?
@VArt19983 жыл бұрын
sorry I can't understand the video, because I don't speak English, can I ask why you calculated Total_angle[0] but didn't use it. As for Total_angle[1], why are you calculating in x and y when you are balancing on 1 axis. Thanks very much.
@santiagotorres71427 жыл бұрын
hello friend I have done this project with a single engine and it has worked very well, I would like to do a tutorial in Spanish but I have taken all your code so I would like to know if you authorize me to do a tutorial in Spanish with your code. I would leave the links to your video and the code in the description