This video was so well researched, I found it very useful. I had already integrated the rate angle readings to get an angle, but I had not considered the problem shown at 10:00. Thanks.
@7:51 how does "Z-axis/250/65.5 translate to Z-axis * 0.0000611" .... that answer is possible if you divide z-axis / 0.004 / 65.5..... so which is the right and which is wrong? did you mean to write 0.004 instead of 250 , or is the 250 correct and the real answer is not 0.0000611?
Great videos, I stopped by after finding your arduino/PID video. Here I set hours later still watching your channel. I wanted some basic PID understanding for a small rc car control demo, now I just want to scrap the car and go straight to quad. Way to promote your sport and hobby. Well done!
Great to hear and have fun building. Don't forget to check my channel for additional information about the YMFC-3D version 2 quad: www.brokking.net/ymfc-3d_v2_qanda.html
Great job! I think MPU6050 is one of the most extended IMU in market as you said. This explanations will help us a lot for understanding the basics about auto-leveling. Waiting for code!
Yes, it's indeed becoming fun now. Good fun! And this all while we are getting uducated by Joop. I really enjoyed the maths during the video. Thank you Joop.
@@Joop_Brokking QUESTION here for everyone and also JOOP : if 1 degree per second = 65.5 and then in 1 min it should be 60 * 65.5= 3930, then how can you say in one min it is 6 *65= 393. how can there be 6 seconds in 1 min. please tell me. is this a mistake. 3:30
Very educational video (for me). I was trying a two wheel self-balancing model using only the Acceleration data (with lot of mess on accel valued during wheel action). Learned a lot from the video. Thanks
I guess im asking the wrong place but does any of you know a trick to get back into an instagram account?? I somehow forgot my account password. I appreciate any help you can give me
@Fletcher Elisha thanks for your reply. I found the site through google and I'm trying it out atm. Takes a while so I will reply here later when my account password hopefully is recovered.
Thank you so much for this tutorial! It has helped me tremendously, and has also taught me how to communicate using the I2C protocol without a library!
You explanations and illustrations are very good. As are your videos ☺ I have had a gyro lying around for quite some time, but never really got to use it. Now it's time to get started. Thanks for the inspiration.
GREAT VIDEO - i'm hooked! i've seen these calculations when I was working on a 2wheeled robot (inverted pendulum) and now I understand the principal a lot better. Russ from Coral Springs, Fl usa
thanks you for this tutorial it worked but i made some slight modifications to make it much simplier, if you use the mpu 6050 light library it calculates the angles for you and then you can just apply the filter from this tutorial
I clicked the DONATE Button to support you., But THE JESUS WORDS You written SHOWS YOU ARE @ Different LEVEL., Love you brooooo., and your VIDEOS Are Awesome and VERY VERY Informative...!
Nice video. One safety feature that is missing in all hobby autopilots, is the ability to guess-navigate without GPS, using gyro, accelerometer, and barometer only and by adding a pitch angle to airspeed function to the code. Current autopilots either autoland or return to China when they lose GPS input which isn't ideal. If the drift isn't too much, then it'll be possible to have the autopilot perform a RTH roughly to where it started, without GPS. Such code can be improved by making it learn it's own pitch vs airspeed in flight and calculate wind while it has a GPS signal.
Unfortunately, the drift is far far too much with these inexpensive (as in, less than $250,000.00) MEMS-based devices. First, you double integrate noise (tens of centimeters of drift per second). Then, with as little as one degree of error in your gravity estimate, the error in double integrations grows to tens of meters each second. This is an interesting talk, by an expert at Invensense (a leading manufacturer of these devices). He gets into the double integration problem, around the 24 minute mark.
Hi, In this video (at 7:31) you said that the refresh rate is 250 Hz. In your video "YMFC-3D part 2" (at 2:13) you said : 250 Hz is the refresh rate of the controller. My question is : Where did you find this value ? I looked the datasheet of the Atmega328P, but I don't find it.
This is just a value that I used for the YMFC quadcopter flight controllers. You cant find it anywhere, it just because the loop time is 4000us. 1 / 4000us = 250Hz.
Great work out of remarkable Knowledge. I started to build my own version with the help of your illustrations. On the other hand I think at min 4:14 it should be angular velocity , not angle_in_degrees
Great video and a great starting point for beginners, really love it. I downloaded your sample code and I am wondering how you simulate the 250 Hz sampling rate. On the line 89 you are using delay(3) but I think it should be 4 as in 4 milliseconds. Then 1/4ms = 250 Hz. The comment on the line 172 also has 4 microseconds whereas it should be either 4 milliseconds or 4000 microseconds. Thought to let you know if you want to update your sample code. Anyway, great videos and tutorials, will definitely follow you. Thanks!
Hi Joop, when I compiled your program, I got an error massage saying that C" no matching function for call to Liquied crystal _12_: :begin. As far as I know, I have instaled a librery called liquid crysta. What else can I do to correct this error?
Hi, Joop! Love your videos so much. Learn a lot from you. In this series, you mention that there are reasons why you would not use mpu6050. Can you explain some of the reason why?
Why there is a problem when using the imu in more than 60 degrees? I want to try to find a solution to this but I don't know for what reason this problem happening. I tried to find an answer in the Q&A that you have in your website but didn't find any.
Hi Sir, Excellent video!!! You're saving my final project haha. I'd like to know, what software are you using to plot the sensor noisy data? Thanks from Brazil!!
You mentioned that you don't use the 6050 on your flight computer. What were you using and was it due to the inaccuracies/noise of the 6050's accel? Trying to build an IMU project using 6050s to implement some form of IMU position tracking. Unfortunately, this is appearing to be really hard.
hi really nice project. I have uploaded the same code on my arduino but I have problem with the experiment on 10:10 when I'm turning the mpu6050 both pitch and roll changing please help me thanks
Good day Mr.Brokking , instead of using Gyro angle as it is, for auto leveling if the problem with drifting can be solved. eg : The setpoint says 0 , if you allow the gyro for a long time in the same position it will drift to another value, but if check the rate of change of the gyro in level should be '0' even though it drifts( according to my understanding the drift is uniform). do my understanding is correct ?
117: angle_pitch += gyro_x * 0.0000611; 118: angle_roll += gyro_y * 0.0000611; 121: angle_pitch += angle_roll * sin(gyro_z * 0.000001066); 122: angle_roll -= angle_pitch * sin(gyro_z * 0.000001066); there is one problem in the code, in 122 lines, the value of angle_pitch should be a value from 117 lines. The arduino code has a value of 121 lines. This is where the error accumulates. Thank you for code :)
QUESTION here for everyone and also JOOP : if 1 degree per second = 65.5 and then in 1 min it should be 60 * 65.5= 3930, then how can you say in one min it is 6 *65= 393. how can there be 6 seconds in 1 min. please tell me. is this a mistake. 3:30
Hey! Another Great Video, Joop Brokking! I Just wanted to point out the formula you gave in 4:14 (angle_in_degrees = raw_gyro_output / 65.5). Shouldn't it be Angular_rate_in_degrees_per_second = raw_gyro_output / 65.5 ?
QUESTION here for everyone and also JOOP : if 1 degree per second = 65.5 and then in 1 min it should be 60 * 65.5= 3930, then how can you say in one min it is 6 *65= 393. how can there be 6 seconds in 1 min. please tell me. is this a mistake. 3:30
@@a..d2062 1 deg/sec gives a reading of 65.5. A full rotation(revolution) is 360 degrees. 1 minute is 60 seconds. Therefore, 1 deg/sec = 1/6 revolutions/minute (rpm). So, if 1/6 rpm gives a reading of 65.5 then 1 rpm should give a reading of 65.5*6 = 393.
Wonderfull videos. Including the second part. A question: You mentioned that you don't use the MPU-6050 yourself "for various reasons" in your copter project. So my question would be: What do you use instead? Or what would be your recommendation/what are the reasons? And do you have info on where to find more in the interent on improving the code concerning the limitations mentioned in the second video: tilt of the copter leading to an acceleration in an angle? I also saw you recommend SPI ahead of I2C. too bad I currently got an MPU6050. Keep up the great tutorials. They are very interesting and helpful.
Instead of getting the outputs on the LCD display i want it in my serial monitor. What changes are expected? I have tried directly using Serial.print(angle_pitch_output) but the values change way too slowly. Can anyone help? Thank you.
I am having issues with vibrational noise messing up my gyroscope data. I am running a basic complimentary filter @ 0.98 gyro and 0.02 accel data for my angles. How have you combated the vibrational noise from the motors spinning with the blades?
Does measuring the trajectory of a turning plane only require a gyroscope or also an accelerometer? (for trajectory measurement and not that of pitching) THANKS
I did not follow the whole math, but from [rogramming perspective seems like there is an error in here //Gyro angle calculations //0.0000611 = 1 / (250Hz / 65.5) angle_pitch += gyro_pitch * 0.0000611; //Calculate the traveled pitch angle and add this to the angle_pitch variable. angle_roll += gyro_roll * 0.0000611; //Calculate the traveled roll angle and add this to the angle_roll variable. //0.000001066 = 0.0000611 * (3.142(PI) / 180degr) The Arduino sin function is in radians angle_pitch -= angle_roll * sin(gyro_yaw * 0.000001066); //If the IMU has yawed transfer the roll angle to the pitch angel. angle_roll += angle_pitch * sin(gyro_yaw * 0.000001066); //If the IMU has yawed transfer the pitch angle to the roll angel. I guess, it should be like the following temp_pitch = angle_pitch; angle_pitch -= angle_roll * sin(gyro_yaw * 0.000001066); angle_roll += temp_pitch * sin(gyro_yaw * 0.000001066); Am I right?
Hi Joop, I have watched part 1 and part 2 several times but there is something that I can't understand. How did you solve the Gimbal lock problem. I know that hierarchy of the Gimbal is important. If the parenting combination is YZX or YXZ the gimbal lock can be avoided with maximum rating, but therefore you have to first rotate your yaw and afterwards you roll / pitch. If the parenting combination is ZYX, ZXY, XYZ or XZY there is a case of gimbal lock. This has to be solved with quaternion. Could you explain me how you solved this problem?
Hi Joop, first of all, thanks for the amazing tutorials and also for the so well commented code! Well, i just read your code for this IMU and did not understood the complementary filter that you used. Two variables you've declared seems not have been initialized on any part of the code but you still used them as follows. Could you please clear that for me? And very sorry for the bothering. *angle_pitch_output* = angle_pitch_output * 0.9 + angle_pitch * 0.1; *angle_roll_output* = angle_roll_output * 0.9 + angle_roll * 0.1;
Hello dear sir. first i want to thank you a loooooooooooooooooooooot for these tutorials. im trying to implement your YMFC project but i do have problemes during the setup. Indeed, the program stops in the gyro calibration. Do you have any kind of help about that?
I do not understand how this drone or any other coaxial thrust vectoring control drone are being controlled after all the gyro imu is moving the servos from interrupt service routine. How the remote control signal overrides the imu or vice versa?
Hi Joop, Thanks for your awesome video! I found a problem when i run this code. I found this code to have a long response time. For example, when i change the pitch angle to 45 degree in a second, the output_angle increased very slowly, almost cost 1 minutes. So how did you solve this question?
U mentioned that u personally dont use mpu 6050..then what u actually use and if u mention those particular problem u faced with mpu6050 ....will be the last nail from this video. ....anyway. .great job.....😍
Hello, i am using MinIMU9-v5, but there are some problems when i use this board. the VPython always got 'invalid lines' when received data from arduino. May i ask what is your arduino and Python codes?
Dear Joop Brokking, This video is so great. As i am newbie to use this MPU 6050 with arduino, I have something which I don't understand. In 12:11, why the sine value of pitch angle is subtracted from the row angle. I am clear that when MPU 6050 is rotated around yaw axis, the pitch angle is changed into yaw angle. But I am a bit confuse with how it is related with the code in arduino angle roll - = angle pitch * sin (gyro_z * 0.000001064); angle pitch + = angle roll * sin ( gyro_z * 0.000001064); why it is subtracted in 1st code and added in the 2nd code? To understand that concept, which reference do i need to read? I am really getting trouble in that step. Thank you for your video.
Many thanks Joop for such a comprehensive and helpful tutorial. Two questions, if you don't mind answering them: 1- Could you please explain what are the reasons you don't use MPU-6050 for your projects? 2- I got a Pololu AltIMU-10 v5 at about $23 US. After setting it up, the gyro is set to rest. Without accel-correcting term, the angles drift at a rate of about 0.16 deg/sec. i.e. about 1 deg of drift within each 6 sec. Do you think it is normal?
Joop i recently seen your YMFC-AL series and have built my own and love it have been working out some kinks with drift and what not all minor things and am working on some other things, i am new to quads and arduino at that. with all that being said i want to add GPS and more importantly alt hold. for now i want to start with sonar and then will be using another form or alt detection but i am at a loss of how to implement it into the ymfc code. if you would/ could help with this i would be greatly appreciated and i am sure that other noobs would love this as well.
Joop. Very much like your videos. They were very helpful in getting me started. I have a question. In your leveling algorithm, is looks like you use the gyro for quick adjustments to pitch/roll, and the accelerometer for a slower adjustment since the gyro, being an integral function can accumulate error. If I'm understanding it correctly, you sum the x,y,z accel values using pythagorean root-sum-squares method, and assume this largest hypotenus vector is gravity (down direction). But what if I've got my quad in a steady holding pattern doing circles at a 30 degree banked turn. If it was a properly coordinated turn, there would be no x or y accel, and z would be approx 1.15g's. Is there an algorithm that can handle this and still keep track of where true up and down is? Thanks
Hi sir excellent job Did you use a level shifter with the MPU6050? Do you recommend us to connect it directly to a 5v logic? or should we use a level shifter
i uploaded the sketch that i've downloaded from you website to my arduino uno as it is and i only made some changes in the lcd commands (the lcd.begin(20,4) command insted of lcd .begin() and the... LiquidCrystal_I2C lcd (0x27 , 2, 1, 0, 4, 5, 6, 7, 3,POSITIVE) insted of LiquidCrystal_I2C lcd(0x27, 16, 2); ) i am facing a problem now .. when i increas the angle of the mpu for a certain angle let say 45 deg of pitch for example the reading on the lcd becomes 45 deg for a moment only but then it starts in creasing slowly until it becomes 50-52 deg and in some cases when i decreas the angle below 30 deg let's say 29 the reading becomes 29 only for a short moment and starts droping for a certain level .and when the mpu was angled and then its placed horizantly the reading does not become 0 deg imediatly actually it becomes for example 9-6 degs and slowly drops to 0 deg ! i also want to ask if there any disadvantage if we use 2000 full-scale range?
@Joop Brokking, thanks for your all videos! in this video on copter you use "cheep" motors2212 1000kv , is that good motors,have a problem , is it stable ? thanks
Hello, thanks for your videos and all your work, I have a question about a signal of the mpu6050 in the montage with esc and brushless motot, the signal was good (the angle) but just the motor take on the mpu signal will be bad? ! I didn t understand why, I hope find some help and thanks for the second way
This video was so well researched, I found it very useful. I had already integrated the rate angle readings to get an angle, but I had not considered the problem shown at 10:00. Thanks.
Such a fabulous engineer! I am in france am studying engineering. And this year I wanted to build my own quadcopter. Thanks for your videos
@7:51 how does "Z-axis/250/65.5 translate to Z-axis * 0.0000611" .... that answer is possible if you divide z-axis / 0.004 / 65.5..... so which is the right and which is wrong? did you mean to write 0.004 instead of 250 , or is the 250 correct and the real answer is not 0.0000611?
Superb, I've checked out a lot of tutorials for MPU-6050 and your video is the best tutorial on the internet on this module. Thank you so much!
The best tutorial about MPU-6050 / MPU-9250
to describe your explanation as good will be insulting, because it is very good , danke !!!
Great videos, I stopped by after finding your arduino/PID video. Here I set hours later still watching your channel. I wanted some basic PID understanding for a small rc car control demo, now I just want to scrap the car and go straight to quad. Way to promote your sport and hobby. Well done!
Great to hear and have fun building. Don't forget to check my channel for additional information about the YMFC-3D version 2 quad: www.brokking.net/ymfc-3d_v2_qanda.html
Great job! I think MPU6050 is one of the most extended IMU in market as you said. This explanations will help us a lot for understanding the basics about auto-leveling. Waiting for code!
Hi I'm in 12th grade and I am really happy to see what I studied last couple of years is very useful in technology after 7 years 😊
Still teaching us dummies. You are a legend!!
Yes, it's indeed becoming fun now. Good fun! And this all while we are getting uducated by Joop. I really enjoyed the maths during the video. Thank you Joop.
Graag gedaan ;-)
@@Joop_Brokking QUESTION here for everyone and also JOOP : if 1 degree per second = 65.5 and then in 1 min it should be 60 * 65.5= 3930, then how can you say in one min it is 6 *65= 393. how can there be 6 seconds in 1 min. please tell me. is this a mistake. 3:30
@@a..d2062 Full turn (360°) in 1 minute (60s) means that angular velocity is 360° / 60s = 6°/s
Your video is absolutely the best on MPU-6050 tutorial! Crystal clear and inspiring! Thanks so much!
unrated channel , you deserve more
hey Joop, is it possible to use the Serial monitor instead of the LCD display ?
Very educational video (for me). I was trying a two wheel self-balancing model using only the Acceleration data (with lot of mess on accel valued during wheel action). Learned a lot from the video. Thanks
The best part of this video is angle shifting . It's really very tricky
You are an amazing teacher, thank you for all the time and effort you are putting in these videos! wow
I guess im asking the wrong place but does any of you know a trick to get back into an instagram account??
I somehow forgot my account password. I appreciate any help you can give me
@Griffin Patrick instablaster :)
@Fletcher Elisha thanks for your reply. I found the site through google and I'm trying it out atm.
Takes a while so I will reply here later when my account password hopefully is recovered.
@Fletcher Elisha It did the trick and I actually got access to my account again. Im so happy:D
Thank you so much, you really help me out !
@Griffin Patrick no problem :)
Thank you so much for this tutorial! It has helped me tremendously, and has also taught me how to communicate using the I2C protocol without a library!
You explanations and illustrations are very good. As are your videos ☺
I have had a gyro lying around for quite some time, but never really got to use it. Now it's time to get started.
Thanks for the inspiration.
GREAT VIDEO - i'm hooked! i've seen these calculations when I was working on a 2wheeled robot (inverted pendulum) and now I understand the principal a lot better.
Russ from Coral Springs, Fl usa
Very good and easy to understand explanation! I'm already looking forward to seeing part 2 :)
Best video I watched about this topic. Thx
thanks you for this tutorial it worked but i made some slight modifications to make it much simplier, if you use the mpu 6050 light library it calculates the angles for you and then you can just apply the filter from this tutorial
Thanks for the code! I plan to use this to check the leveling of my RV and maybe auto level in the future.
Perfect explanation even for laymen. You could maybe add links to further study materials for those, that want to know more about this topic.
I clicked the DONATE Button to support you., But THE JESUS WORDS You written SHOWS YOU ARE @ Different LEVEL., Love you brooooo., and your VIDEOS Are Awesome and VERY VERY Informative...!
I'm very impressed with your channel. Thanks, for such a detailed description. Your projects are great
Nice video.
One safety feature that is missing in all hobby autopilots, is the ability to guess-navigate without GPS, using gyro, accelerometer, and barometer only and by adding a pitch angle to airspeed function to the code. Current autopilots either autoland or return to China when they lose GPS input which isn't ideal. If the drift isn't too much, then it'll be possible to have the autopilot perform a RTH roughly to where it started, without GPS. Such code can be improved by making it learn it's own pitch vs airspeed in flight and calculate wind while it has a GPS signal.
Unfortunately, the drift is far far too much with these inexpensive (as in, less than $250,000.00) MEMS-based devices. First, you double integrate noise (tens of centimeters of drift per second). Then, with as little as one degree of error in your gravity estimate, the error in double integrations grows to tens of meters each second.
This is an interesting talk, by an expert at Invensense (a leading manufacturer of these devices). He gets into the double integration problem, around the 24 minute mark.
+stephmon This sounds very interesting, could you link to the talk?
please keep making these videos. thay are so awsome. you must be a professor
Awesome video! This something i've always wanted to understand in that kind of detail, thanks!
After 5 years, I am still not able to build my own drone. I am serious this time. Thank you
Man I love Joop's videos.
Where you can get the code for calculating a simple angle just as at 9:00 ?
Hi,
In this video (at 7:31) you said that the refresh rate is 250 Hz. In your video "YMFC-3D part 2" (at 2:13) you said : 250 Hz is the refresh rate of the controller.
My question is : Where did you find this value ?
I looked the datasheet of the Atmega328P, but I don't find it.
This is just a value that I used for the YMFC quadcopter flight controllers. You cant find it anywhere, it just because the loop time is 4000us. 1 / 4000us = 250Hz.
is there a way to tweak the code to control 4 BRUSHED motors? i have been studying the code and have some ideas
you have a good voice i was able to concentrate on what you were saying.
wow, thank you so much for this, you have saved me days of work figuring it out
Great work out of remarkable Knowledge. I started to build my own version with the help of your illustrations. On the other hand I think at min 4:14 it should be angular velocity , not angle_in_degrees
Fantastic video. Never seen such kind of explanation.
Great stuff.
Looking forward to part 2.
You make me laugh and understand at the same time👍
the best channel i have seen ever
GREAT VIDEO! Concise and a lot of fun to watch.
Great video and a great starting point for beginners, really love it. I downloaded your sample code and I am wondering how you simulate the 250 Hz sampling rate. On the line 89 you are using delay(3) but I think it should be 4 as in 4 milliseconds. Then 1/4ms = 250 Hz. The comment on the line 172 also has 4 microseconds whereas it should be either 4 milliseconds or 4000 microseconds. Thought to let you know if you want to update your sample code. Anyway, great videos and tutorials, will definitely follow you. Thanks!
Awesome video, very easy to follow your teaching. Thanks for your efforts!
Hi Joop, when I compiled your program, I got an error massage saying that C" no matching function for call to Liquied crystal _12_: :begin. As far as I know, I have instaled a librery called liquid crysta. What else can I do to correct this error?
Hi. Can you tell me how to calculate the yaw angle
Thank you very much for these very well made video.
Keep up the good work
I figured out the board. I am now wondering how you do the wiring here?
Hi, Joop! Love your videos so much. Learn a lot from you. In this series, you mention that there are reasons why you would not use mpu6050. Can you explain some of the reason why?
Why there is a problem when using the imu in more than 60 degrees? I want to try to find a solution to this but I don't know for what reason this problem happening. I tried to find an answer in the Q&A that you have in your website but didn't find any.
Hi Sir, Excellent video!!! You're saving my final project haha. I'd like to know, what software are you using to plot the sensor noisy data?
Thanks from Brazil!!
angle roll -= angle pitch *sin (yaw angle)
can someone tell me if this is theoretically near correct? will studying euler angle solve my question?
You mentioned that you don't use the 6050 on your flight computer. What were you using and was it due to the inaccuracies/noise of the 6050's accel? Trying to build an IMU project using 6050s to implement some form of IMU position tracking. Unfortunately, this is appearing to be really hard.
hi really nice project.
I have uploaded the same code on my arduino but I have problem with the experiment on 10:10 when I'm turning the mpu6050 both pitch and roll changing please help me
thanks
Good job.could just give us some tips to get yaw readings please?
Please check this video for more information about the yaw implementation: ua-cam.com/video/vPGChdmfKl0/v-deo.html
very nice video! Im alreay waiting for the next one!
Good day Mr.Brokking , instead of using Gyro angle as it is, for auto leveling if the problem with drifting can be solved. eg : The setpoint says 0 , if you allow the gyro for a long time in the same position it will drift to another value, but if check the rate of change of the gyro in level should be '0' even though it drifts( according to my understanding the drift is uniform). do my understanding is correct ?
117: angle_pitch += gyro_x * 0.0000611;
118: angle_roll += gyro_y * 0.0000611;
121: angle_pitch += angle_roll * sin(gyro_z * 0.000001066);
122: angle_roll -= angle_pitch * sin(gyro_z * 0.000001066);
there is one problem in the code, in 122 lines, the value of angle_pitch should be a value from 117 lines. The arduino code has a value of 121 lines. This is where the error accumulates.
Thank you for code :)
QUESTION here for everyone and also JOOP : if 1 degree per second = 65.5 and then in 1 min it should be 60 * 65.5= 3930, then how can you say in one min it is 6 *65= 393. how can there be 6 seconds in 1 min. please tell me. is this a mistake. 3:30
Hey! Another Great Video, Joop Brokking! I Just wanted to point out the formula you gave in 4:14 (angle_in_degrees = raw_gyro_output / 65.5). Shouldn't it be Angular_rate_in_degrees_per_second = raw_gyro_output / 65.5 ?
QUESTION here for everyone and also JOOP : if 1 degree per second = 65.5 and then in 1 min it should be 60 * 65.5= 3930, then how can you say in one min it is 6 *65= 393. how can there be 6 seconds in 1 min. please tell me. is this a mistake. 3:30
@@a..d2062 1 deg/sec gives a reading of 65.5. A full rotation(revolution) is 360 degrees. 1 minute is 60 seconds. Therefore, 1 deg/sec = 1/6 revolutions/minute (rpm). So, if 1/6 rpm gives a reading of 65.5 then 1 rpm should give a reading of 65.5*6 = 393.
Wonderfull videos. Including the second part.
A question: You mentioned that you don't use the MPU-6050 yourself "for various reasons" in your copter project. So my question would be:
What do you use instead? Or what would be your recommendation/what are the reasons?
And do you have info on where to find more in the interent on improving the code concerning the limitations mentioned in the second video: tilt of the copter leading to an acceleration in an angle?
I also saw you recommend SPI ahead of I2C. too bad I currently got an MPU6050.
Keep up the great tutorials. They are very interesting and helpful.
thank you for all videos, would you please share with us the reason for not using the mpu 6050 in your flight controller, thanks in advance
6050 in flight controllers acted up and seemed worse than the 6000, so the 6000 is always preferred
from where did you get the formula and relation between the roll and the pitch
Instead of getting the outputs on the LCD display i want it in my serial monitor.
What changes are expected?
I have tried directly using Serial.print(angle_pitch_output) but the values change way too slowly.
Can anyone help?
Thank you.
I am having issues with vibrational noise messing up my gyroscope data. I am running a basic complimentary filter @ 0.98 gyro and 0.02 accel data for my angles. How have you combated the vibrational noise from the motors spinning with the blades?
12:24
im confused
the sin function needs an input in radians, but it also outputs a radian, so dont we need to convert it back to degrees?
hey my question is how can we select 259Hz frequency why we don't select an other
Omg. I love your explanation
If I attach a ruler scale with MPU6050, will it give me 100% accurate angle while installing LCD TV panel on wall in house?
Does measuring the trajectory of a turning plane only require a gyroscope or also an accelerometer? (for trajectory measurement and not that of pitching)
THANKS
Sir, This is an awesome implementation. What is the method that you used to real-time graphing at 6.14?
I did not follow the whole math, but from [rogramming perspective seems like there is an error in here
//Gyro angle calculations
//0.0000611 = 1 / (250Hz / 65.5)
angle_pitch += gyro_pitch * 0.0000611; //Calculate the traveled pitch angle and add this to the angle_pitch variable.
angle_roll += gyro_roll * 0.0000611; //Calculate the traveled roll angle and add this to the angle_roll variable.
//0.000001066 = 0.0000611 * (3.142(PI) / 180degr) The Arduino sin function is in radians
angle_pitch -= angle_roll * sin(gyro_yaw * 0.000001066); //If the IMU has yawed transfer the roll angle to the pitch angel.
angle_roll += angle_pitch * sin(gyro_yaw * 0.000001066); //If the IMU has yawed transfer the pitch angle to the roll angel.
I guess, it should be like the following
temp_pitch = angle_pitch;
angle_pitch -= angle_roll * sin(gyro_yaw * 0.000001066);
angle_roll += temp_pitch * sin(gyro_yaw * 0.000001066);
Am I right?
Hi Joop, I have watched part 1 and part 2 several times but there is something that I can't understand. How did you solve the Gimbal lock problem. I know that hierarchy of the Gimbal is important. If the parenting combination is YZX or YXZ the gimbal lock can be avoided with maximum rating, but therefore you have to first rotate your yaw and afterwards you roll / pitch. If the parenting combination is ZYX, ZXY, XYZ or XZY there is a case of gimbal lock. This has to be solved with quaternion. Could you explain me how you solved this problem?
Hi Joop, first of all, thanks for the amazing tutorials and also for the so well commented code! Well, i just read your code for this IMU and did not understood the complementary filter that you used. Two variables you've declared seems not have been initialized on any part of the code but you still used them as follows. Could you please clear that for me? And very sorry for the bothering.
*angle_pitch_output* = angle_pitch_output * 0.9 + angle_pitch * 0.1;
*angle_roll_output* = angle_roll_output * 0.9 + angle_roll * 0.1;
good video, it helped me a lot. would it be the same with the mpu9250 sensor?
What do you mean by the refresh rate of controller?
Hello dear sir. first i want to thank you a loooooooooooooooooooooot for these tutorials. im trying to implement your YMFC project but i do have problemes during the setup.
Indeed, the program stops in the gyro calibration. Do you have any kind of help about that?
What are the sizes of the drone and propellers you are using? Please also share the kv rating of the motor u are using
Do you have any opinion on using 9DOF IMU for the AL quadcopter??
I do not understand how this drone or any other coaxial thrust vectoring control drone are being controlled after all the gyro imu is moving the servos from interrupt service routine. How the remote control signal overrides the imu or vice versa?
Hi Joop, Thanks for your awesome video! I found a problem when i run this code. I found this code to have a long response time. For example, when i change the pitch angle to 45 degree in a second, the output_angle increased very slowly, almost cost 1 minutes. So how did you solve this question?
Where does the number "0.0000166" at 11:56 come from? thank you!!
Please turn on the "CC" in the right bottom corner in all your clips.
Please make it possible to turn on closed subtitles
Can I use any other accelerometer+gyro+compass+magnetometer with this same code.If not pls give the code
U mentioned that u personally dont use mpu 6050..then what u actually use and if u mention those particular problem u faced with mpu6050 ....will be the last nail from this video. ....anyway. .great job.....😍
what is the better alternative of MPU6050?
Hello, i am using MinIMU9-v5, but there are some problems when i use this board. the VPython always got 'invalid lines' when received data from arduino. May i ask what is your arduino and Python codes?
Dear Joop Brokking,
This video is so great. As i am newbie to use this MPU 6050 with arduino, I have something which I don't understand.
In 12:11, why the sine value of pitch angle is subtracted from the row angle. I am clear that when MPU 6050 is rotated around yaw axis, the pitch angle is changed into yaw angle. But I am a bit confuse with how it is related with the code in arduino
angle roll - = angle pitch * sin (gyro_z * 0.000001064);
angle pitch + = angle roll * sin ( gyro_z * 0.000001064);
why it is subtracted in 1st code and added in the 2nd code?
To understand that concept, which reference do i need to read?
I am really getting trouble in that step.
Thank you for your video.
Did you figure it out? I'm struggling with the same problem, I've got the code working but I don't understand the math
Very good post! I appreciate your work. I tried to download the code from the 1st link but I get download failed. Is the link still available?
Many thanks Joop for such a comprehensive and helpful tutorial. Two questions, if you don't mind answering them:
1- Could you please explain what are the reasons you don't use MPU-6050 for your projects?
2- I got a Pololu AltIMU-10 v5 at about $23 US. After setting it up, the gyro is set to rest. Without accel-correcting term, the angles drift at a rate of about 0.16 deg/sec. i.e. about 1 deg of drift within each 6 sec. Do you think it is normal?
I don't understand where you get 250hz as the refresh rate. Is that something you find in the data sheet?
Joop i recently seen your YMFC-AL series and have built my own and love it have been working out some kinks with drift and what not all minor things and am working on some other things, i am new to quads and arduino at that. with all that being said i want to add GPS and more importantly alt hold. for now i want to start with sonar and then will be using another form or alt detection but i am at a loss of how to implement it into the ymfc code. if you would/ could help with this i would be greatly appreciated and i am sure that other noobs would love this as well.
Joop. Very much like your videos. They were very helpful in getting me started. I have a question.
In your leveling algorithm, is looks like you use the gyro for quick adjustments to pitch/roll, and the accelerometer for a slower adjustment since the gyro, being an integral function can accumulate error. If I'm understanding it correctly, you sum the x,y,z accel values using pythagorean root-sum-squares method, and assume this largest hypotenus vector is gravity (down direction).
But what if I've got my quad in a steady holding pattern doing circles at a 30 degree banked turn. If it was a properly coordinated turn, there would be no x or y accel, and z would be approx 1.15g's.
Is there an algorithm that can handle this and still keep track of where true up and down is? Thanks
Hi sir excellent job Did you use a level shifter with the MPU6050? Do you recommend us to connect it directly to a 5v logic? or should we use a level shifter
Very nice detailed explanation. Thanks for sharing.
i uploaded the sketch that i've downloaded from you website to my arduino uno as it is and i only made some changes in the lcd commands (the lcd.begin(20,4) command insted of lcd .begin() and the... LiquidCrystal_I2C lcd (0x27 , 2, 1, 0, 4, 5, 6, 7, 3,POSITIVE) insted of LiquidCrystal_I2C lcd(0x27, 16, 2); ) i am facing a problem now .. when i increas the angle of the mpu for a certain angle let say 45 deg of pitch for example the reading on the lcd becomes 45 deg for a moment only but then it starts in creasing slowly until it becomes 50-52 deg and in some cases when i decreas the angle below 30 deg let's say 29 the reading becomes 29 only for a short moment and starts droping for a certain level .and when the mpu was angled and then its placed horizantly the reading does not become 0 deg imediatly actually it becomes for example 9-6 degs and slowly drops to 0 deg !
i also want to ask if there any disadvantage if we use 2000 full-scale range?
@Joop Brokking, thanks for your all videos! in this video on copter you use "cheep" motors2212 1000kv , is that good motors,have a problem , is it stable ? thanks
The motors are from DJI and perform very well. Especially the new version.
Hello, thanks for your videos and all your work, I have a question about a signal of the mpu6050 in the montage with esc and brushless motot, the signal was good (the angle) but just the motor take on the mpu signal will be bad? ! I didn t understand why, I hope find some help and thanks for the second way
Besides 5V and GND, what are the other 2 pins on the LCD display that the white and grey wires are connected to?