Raspberry Pi Pico W LESSON 42: Measuring Tilt With an MPU6050 Accelerometer
ฝัง
- เผยแพร่เมื่อ 28 ส.ค. 2024
- You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
/ paulmcwhorter
In this class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.
amzn.to/3ubMRs1
In this video, I will show you how to measure acceleration using the MPU6050 Six Axis IMU chip. I will then show you how using trigonometry will allow you to quantitatively calculate the amount of tilt from the Z axis acceleration reading. I will give an explanation of the math and physics behind problem, and will show you how to incorporate the MPU6050 into your projects. Enjoy!
[Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. ]
#IMU
#mpu6050
#micropython
Paul, please continue teaching all the math. Yes there are those who would rather use existing libraries and they can do so. But speaking for myself, I enjoy trying to understand the math!, Thank you and God Bless you and yours!
I agree, the math behind the work is really important to understand.
It really helps a lot!
my opion as well. I hate to use code with no understanding but it works, so use it. Thank you.
I also agree 150%. Math is the fuel in the Electrical Engineer's Mind.
Perfect video as always, i like the way you teaching
Thank you Paulo, it was very important material, I used it, thank you
First of all Paul it is very cool to find out you worked with these devices in the early development days. 🥳 As for myself the math is the main thing I want to understand. Then writing the code makes more sense if all these trig terms are second nature. The creative thinking kicks in when the MPU6050 mystery is understood. 😎 Thank you so much.
I agree with Vaughn, Please continue teaching the math involved. Libraries are fine and have their place, but I like the details of what is actually happening and how to get there. Nine times out of ten it includes math!! Thanks for all that you do.
Great video! Thanks. I like the way you present this motivating people to understand the math behind.
I was able to do the homework assignment. After having it on my mind for four days it came to me in the shower. The direction of the tilt was quite simple. The direction of tilt is the direction of, in this case, yAccel. One if statement…..LEGEND! Thanks for the challenging homework.😊
Keep up the explanation exercises it helps alot in the learning process
I like the direction you are sending us.
Great! This is just what I want to learn behind the theory.
hi Paul absolutely love where we are going wirh this right now i love you explainations and how this should be done right! keep up the good work sir
excellent video thanks
Feels like a straight road from idea to something tangible, without math - red lights, getting in the way.
Paul, like most of the other commenters, I ask that you continue covering the math to teach how to think like an Engineer rather than those who simply try to find libraries or code instead of developing their own solutions. I don't have a Sunfounder kit yet, but hope to get one between now and Christmas so I can restart these lessons from scratch and develop my solutions.
Thank you so much Paul!
Great video! This kind of "physics" thinking does not come easily to me. It is a bit more than just math thinking IMO. I appreciate you taking the time to explain it carefully and drawing those helpful diagrams.
Thanks! Hope to see more homework solutions from you soon.
@@paulmcwhorter I am trying to catch up so may just make a video once we get to the full tilt-o-meter project. I didn't have any unique takes on any of the homework so far. If I do, I will share it. Thanks for all you do!
Great solution
You gave enough
I never thought to use the Z axis. I assumed I had to work with xAcel to find theta X. Silly mistake. I was using cos(1-xAcel/1) it would give an accurate reading from 0 to 90, but would give an error every time xAcel went below 0. I tried adding Abs() - for absolute value - but that didn't fix it. So I folded up like a cheap walmart lawn chair! haha
Please keep up the math!
Thanks again
Thank you Paul for all your work you put into these tutorials .. I have a question regarding the math .. I see the formula written to go from Radians to Degrees as
"degrees = theta/2*pi * 360 but when you code it it's written " thetaDeg= theta/2/pi*360 .. what am I missing ? They don't appear to use the same computation... TY !
Thanks Paul. Math rocks keep it coming! What type of critter was swimming in the river behind you?
❤
25:07 I need to understand first principles of the maths (UK spelling) so can work things out in future projects.
Teach us how to do the math,, best way I think
Thanks Paul! I was going to use libraries but thought better of it. Will try again with the math. By the way,🤔 someone was swimming in the background... But never came up (?)
Didnt notice that, but those guys are fishermen. Sometimes they go down to work on their nets. They stay under a really long time, and sometimes come up what seems like a half mile away. Incredible lung capacity.
Here is my video for lesson 41 (very late due to thunder and lightning, floods, trees falling down, power cuts, no internet or telephone etc) : th-cam.com/video/4VZEM_NsWLM/w-d-xo.html
LEGEND!
Hi I am following this lesson and I get a tilt angle reading of aprox 19 deg sitting flat on the table is this a problem with my Accelerometer.
ps. love your work
Check your program very carefully. It should be way more accurate than that. Very unusal for one of these components to be bad, so check your work carefully.
I'm having the same problem. My MPU sitting on the table reads between 25 and 28 degrees. And its not even a static value. Did you manage to solve this?
⚡
My Z gives a maximum of 0.88 G instead of the expected ~1 G : - (
I thought I had a solution, but kept gettin math errors when the angle got to 90° for x & y or 0° for z
Yes, if you are using atan, it will error at 90 degrees. So we have to treat that as a special case.
It took me weeks to feel that I had a proper solution for lesson 42. Here's my homework for 41 & 42 combined. th-cam.com/video/2l2G6pBajdk/w-d-xo.html
Thanks for all the work you put into these lessons Paul. Keep the math coming !
LEGEND!
I think i did this homework last week... Positive pitching raises the nose and lowers the tail of aircraft, and positive rolling raises the left wing and lowers the right wing. I'm sharing it again th-cam.com/video/YgxmvZeMtyk/w-d-xo.html