Raspberry Pi Pico W LESSON 51: Ultimate Pitch and Roll Gadget Using the MPU6050

  Рет қаралды 3,083

Paul McWhorter

Paul McWhorter

Күн бұрын

Guys the kit is out for the new Arduino R4 that we will be using in our next Arduino Class. Great time to go ahead and pick up your gear here:
amzn.to/41NlRzn
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 create a 2 axis tilt meter that is fast, accurate, and low noise by creating a Complimentary Filter. I then show you how to remove long term steady state errors in the measurements. The complimentary filter allows us to enjoy the best of both worlds between the accelerometer data and the gyro data. We show how to use a complimentary filter to get roll and pitch angles which are fast, accurate, low noise and not subject to errors from vibration or accelerations. Then, we remove the small remnant steady state error. We demonstrate this using the gyros and accelerometers on the MPU6050. With this stable, compensated data stream coming from the MPU6050, we will then display the results on the OLED 1306 display. We will create both a qualitative floating bubble on the display, and we will show the quantitative roll and pitch. We also then show how this cool widget can run remotely, using the battery and small power board. 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. ]
#raspberrypipicow
#mpu6050
#complimentaryfilter

Пікірлер: 60
@mtslyh
@mtslyh 10 ай бұрын
I missed your other lesson and wouldn't have even known about it if you hadn't gone through this here. Great stuff! I learned about digital signal processing back in college but haven't had a chance to use it since then. This brings back some old memories and rekindles a fire that I used to have long ago. I definitely need to start adding this type of material to my toolbox. Thanks for all you do!
@lorisrobots
@lorisrobots 10 ай бұрын
I really enjoyed this series of lessons. I know you start a new class at the beginning so beginners are able to follow. But a series like this (IMU6050) is great for those of us who follow your classes and are not quite beginners anymore. I definitely picked up some new ideas that I plan to use in some projects going forward. Keep extending our knowledge of electrical engineering. Thanks!
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Thanks Lori! I really appreciate the help. Yes, the new arduino lessons will go all the way back to the turn the LED on and off, and some are complaining about that. However, the Pico Pi lessons are just getting to the real interesting stuff, and I think the noise filtering was beyond intermediate, and really getting into more advanced engineering concepts. Many of the same people complaining about me going back to basics on the new arduino lessons were the same ones complaining my IMU data filtering/fusion work was too tedious and they were bored with it. So, I think that there is sometimes not an understanding of the goal of the channel. I want to take people from knowing absolutely nothing about the topic all the way to doing complex engineering solutions. There is no way every lesson can be exactly what every viewer is wanting. So, I start from the basics. On the Pico Pi lessons I did that, but soon enough we have gotten to complex projects. Same will be for the new arduino lessons. We will start from square 1, but we will take it much further than we went on the old arduino lessons, and will get into interrupts, the onboard opamps, the DAC, WiFi and the various new hardware elements on the board. I appreciate your understanding that there is actually a thought out strategy of how I stage these classes. Sure appreciate your participation in the channel.
@charlotteswift
@charlotteswift 10 ай бұрын
@@paulmcwhorter Hi Paul I've just read Lori's comment and your reply. I was one of the people who was getting tired of the MPU6050 lessons but not because of the complexity - it was because we had something like 2 months of lessons and I realised that you were losing quite a large proportion of your audience and then you might decide that you didn't want to continue with the Pico W lessons and that would have been a shame. I have never said that you shouldn't start from the basics with the Arduino R4 lessons. I just said that some people had said that they wouldn't be watching the new classes because they already know it all. I will be very grateful that you're starting from the beginning as I am a complete Arduino rookie. I have to admit that I was rather disappointed that you did not appear to have looked at my ultimate solution for the MPU6050 but the main reason that I post videos is to give other people the chance to see another way of doing things. It isn't just Lori and Keith who try to help out!!
@briankelly4095
@briankelly4095 3 ай бұрын
You aren't going "a bridge too far" Paul. It's fascinating to see technology up close. Thanks for your dedication to this topic.
@louistoweill4232
@louistoweill4232 6 ай бұрын
I really liked these lessons. I had some inconspicuous typos that were difficult to find and I learned from that too. I am going to need to rewatch some of the lessons to let the material sink in but that will be rewarding also.
@crs1548
@crs1548 10 ай бұрын
Love the nitty gritty programming of this project! The details are what keep me coming back!
@mikew877
@mikew877 9 ай бұрын
The MPU project were fun! Enjoy all the lessons.
@peterbest2434
@peterbest2434 10 ай бұрын
Thanks Paul. I was playing with using a mpu6050 as a remote level for my caravan I.e. 6050 in the Caravan with levels displayed on my phone in the car. Found accelerator reading jumping around when caravan moved. Now I know why and have better understanding of how to fix it.
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Excellent Project. Also, excellent example of why you need to use the math and noise compensation techniques I taught in the last few lessons.
@leeg.1402
@leeg.1402 10 ай бұрын
I like getting into the nitty-gritty of solving real world problems. However, it gets a little tedious at times, especially when I’ve seen the material before (I took your earlier IMU class). Keep up the good work Paul. I enjoy your classes and always watch each video at least twice. Looking forward to the R4 class.
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Well next week we move on to NeoPixels, a topic I have not done before.
@larryplatzek9017
@larryplatzek9017 10 ай бұрын
Enjoy adding things to my tool box! Engineering knowledge is GREAT!
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Totally agree!
@justmc62
@justmc62 9 ай бұрын
Thank you Paul for all the hard work you put into these lessons . I have been involved for a while, went through two Arduino courses , Python, vPython , now the Pico and soon the Arduino R4 .. I am sorry to hear that YT is not supporting this style of content. Doing my part on Patreon.. love the journey ..
@paulmcwhorter
@paulmcwhorter 9 ай бұрын
Fantastic!
@alanphillips5853
@alanphillips5853 10 ай бұрын
I enjoy your lessons immensely, I managed to use your server / client example and extend it to control some neopixels, using the analogue read I added an LDR and an auto function [admittedly migrated from a personal existing arduino project]. Keep getting under the hood - I always want to.know why im writing a line of code, or adding a capacitor or multiplying by root of 3 etc etc. “If you give a man a fish, you feed him for a day. If you teach a man to fish, you feed him for a lifetime.” Kids don't learn because they don't understand what and why they are learning.
@deewansonicengineering
@deewansonicengineering 10 ай бұрын
I am so glad I am one of your subscribers, I have learnt a lot from you. Well done, sir.
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Glad to hear that
@jamescullins2709
@jamescullins2709 10 ай бұрын
Paul, you are doing great, just what I love to learn!
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Glad to hear it!
@jamescullins2709
@jamescullins2709 10 ай бұрын
You are welcome. I wish I had had you in high school. Our math teacher knew her subject well but never used practical examples that I felt useful so I lost interest. I know at 81 it is a bit late in life to start but I am enjoying it very much thank you.@@paulmcwhorter
@scottwait3585
@scottwait3585 10 ай бұрын
Paul! This series is so great. There are so many cool things we can do with the projects that you do. Thank you
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Glad you enjoy it!
@DrDave327
@DrDave327 10 ай бұрын
This lesson has a boat load of tricks I plan to carefully document in my notes. Thank you for the awesome content, Paul!!
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
DrD, as you can probably see these lessons were really not about the mpu6050, but about how to deal with real world engineering problems associated with real sensors in real applications. In almost all projects, you face imperfect data, and have to deal with drift, noise, long term steady state error, and measurement speed. In the last six or seven lessons, I showed how to handle those problems. I got a lot of negative feedback from people about dwelling too long on this component, but I am really committed to teaching people who want to learn in depth. There are lots of channels that just scratch the surface.
@DrDave327
@DrDave327 10 ай бұрын
That is why you are the best, my friend!
@vaughntaylor2855
@vaughntaylor2855 9 ай бұрын
Paul, it is sincerely appreciated you taking the time to go as deep as you do into this subject! Thank You! and God Bless
@davidstacer
@davidstacer 3 ай бұрын
Great series. I've learned so much but one question remains. Both Pitch and Roll were briefly shown in the video. Is your code accurate for both pitch and roll at the same time? Hold it at a 45 in pitch and 45 roll and see what is shows.
@edSabio572
@edSabio572 9 ай бұрын
Thanks Paul! I had to comment out the OLED display code to finish the lesson. The OLED quit on me and have to order a new one.... :' ' ( I appreciate you getting under the hood. I feel you make a difference in my learning...
@paulmcwhorter
@paulmcwhorter 9 ай бұрын
Excellent!
@pralaymajumdar1206
@pralaymajumdar1206 7 ай бұрын
Outstanging lesson.. Captivated❤.
@joker12-e3v
@joker12-e3v 10 ай бұрын
Great tutorial again. Can I ask where you got the 1306 library from?
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
I have a video on it in an earlier lesson in this playlist. That video shows how to get the 1306 set up.
@MrLuizChaib
@MrLuizChaib 10 ай бұрын
Paul, excelent series for The MPU5060, but you leitor behind The Y axis. How to deal with tkat drift? Shoud we use an other sensor, or a GPS? Thanks anyway
@mroemer8972
@mroemer8972 9 ай бұрын
I am so happy that you take the time to teach and not just tell what to do. Is there any way that you can explain how to get more then two I2C devices to communicate with the pico W.
@paulmcwhorter
@paulmcwhorter 9 ай бұрын
It should work if the devices to not have the same I2C address. Just try it and see what happens.
@jamescullins2709
@jamescullins2709 7 ай бұрын
Paul a question, what am I going to do with all these lawn chairs!
@paulmcwhorter
@paulmcwhorter 7 ай бұрын
Don't despair, these last few lessons have been pretty heavy duty. Hopefully you got it working after watching the video.
@jamescullins2709
@jamescullins2709 7 ай бұрын
Not a problem, I am understanding it, you are a great instructor@@paulmcwhorter
@JohnIwa
@JohnIwa 10 ай бұрын
Hello Paul, is there going to be a series on the arduino uno r4 wifi?
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Yes, tune into the Live Stream this Friday Evening, US Time. I will be reviewing the Uno R4 Wifi, and announcing the upcoming class on it. We will be using this kit: amzn.to/3Hdq0mz
@larryplatzek9017
@larryplatzek9017 10 ай бұрын
kit ordered for the Arduino R4 wifi.
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Excellent!
@davidconley9852
@davidconley9852 5 ай бұрын
Thanks!
@paulmcwhorter
@paulmcwhorter 5 ай бұрын
Really appreciate that, Thanks!
@jamescullins2709
@jamescullins2709 7 ай бұрын
how about moving some of the housekeeping stuff to the other core?
@paulmcwhorter
@paulmcwhorter 7 ай бұрын
Yes, at this point in the class I had not taught dual core programming or threading so did not use that method. It will be covered in future lessons.
@jamescullins2709
@jamescullins2709 7 ай бұрын
Great thanks.@@paulmcwhorter
@MrLuizChaib
@MrLuizChaib 10 ай бұрын
Sorry about this portuguese text correction
@taurus548
@taurus548 10 ай бұрын
I am getting a persistent fault with lines 32&33 in Paul's code "pitchA=math.atan(yAccel/zAccel)/(2*math.pi)*360" and "rollA=math.atan(xAccel/zAccel)/(2*math.pi)*360" The error is given as "ZeroDivisionError: divide by zero." I presume it is telling me that zAccel= "0". But how can that be? ZAccel should have gravity in it and be non-zero. Is there a simple issue I am missing?
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Indeed, somehow you are getting a xAccel of zero. Lots of different ways this might happen, so you need to troubleshoot your code. Try putting in a print statement right after measuring zAccel, and print it out. See if it does not become zero, and figure out why it is happening. There are orientations where zAccel might read zero, so you would need to do a special case for that (if zAccel = zero, make it some small number), or use the atan2 function which does the error checking for you.
@hello81642
@hello81642 6 ай бұрын
They say MPU6000 has better gyro performance. Why not use that? Or use MPU9250 or another IMU
@dytwtilak4607
@dytwtilak4607 Жыл бұрын
respected sir i had followed you since 2018 but i wish made video tutorial on the freeRTOS Verilog (FPGA) embedded Linux this will help lots of people to grow. Thank you
@crs1548
@crs1548 10 ай бұрын
I am legend!
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
LEGEND!
@scottpettygrove7821
@scottpettygrove7821 9 ай бұрын
Catching up a bit. Here's my homework solution for this episode. kzbin.info/www/bejne/invGdJaErZ54gsksi=FJOLSqgjInrXBE-p
@paulmcwhorter
@paulmcwhorter 9 ай бұрын
LEGEND!
Raspberry Pi Pico W LESSON 52: Controlling Neopixels in MicroPython
27:13
When u fight over the armrest
00:41
Adam W
Рет қаралды 25 МЛН
Raspberry Pi Pico Project Play Sound Melody
1:49
Interesting videos for you
Рет қаралды 159