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

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

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер: 63
@lorisrobots
@lorisrobots Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
@@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!!
@mtslyh
@mtslyh Жыл бұрын
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!
@briankelly4095
@briankelly4095 5 ай бұрын
You aren't going "a bridge too far" Paul. It's fascinating to see technology up close. Thanks for your dedication to this topic.
@leeg.1402
@leeg.1402 Жыл бұрын
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 Жыл бұрын
Well next week we move on to NeoPixels, a topic I have not done before.
@davidconley9852
@davidconley9852 7 ай бұрын
Thanks!
@paulmcwhorter
@paulmcwhorter 7 ай бұрын
Really appreciate that, Thanks!
@crs1548
@crs1548 Жыл бұрын
Love the nitty gritty programming of this project! The details are what keep me coming back!
@deewansonicengineering
@deewansonicengineering Жыл бұрын
I am so glad I am one of your subscribers, I have learnt a lot from you. Well done, sir.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad to hear that
@mikew877
@mikew877 11 ай бұрын
The MPU project were fun! Enjoy all the lessons.
@jamescullins2709
@jamescullins2709 Жыл бұрын
Paul, you are doing great, just what I love to learn!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Glad to hear it!
@jamescullins2709
@jamescullins2709 Жыл бұрын
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
@louistoweill4232
@louistoweill4232 8 ай бұрын
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.
@justmc62
@justmc62 Жыл бұрын
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 Жыл бұрын
Fantastic!
@scottwait3585
@scottwait3585 Жыл бұрын
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 Жыл бұрын
Glad you enjoy it!
@DrDave327
@DrDave327 Жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
That is why you are the best, my friend!
@vaughntaylor2855
@vaughntaylor2855 11 ай бұрын
Paul, it is sincerely appreciated you taking the time to go as deep as you do into this subject! Thank You! and God Bless
@peterbest2434
@peterbest2434 Жыл бұрын
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 Жыл бұрын
Excellent Project. Also, excellent example of why you need to use the math and noise compensation techniques I taught in the last few lessons.
@pralaymajumdar1206
@pralaymajumdar1206 9 ай бұрын
Outstanging lesson.. Captivated❤.
@larryplatzek9017
@larryplatzek9017 Жыл бұрын
Enjoy adding things to my tool box! Engineering knowledge is GREAT!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Totally agree!
@alanphillips5853
@alanphillips5853 Жыл бұрын
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.
@mroemer8972
@mroemer8972 11 ай бұрын
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 11 ай бұрын
It should work if the devices to not have the same I2C address. Just try it and see what happens.
@joker12-e3v
@joker12-e3v Жыл бұрын
Great tutorial again. Can I ask where you got the 1306 library from?
@paulmcwhorter
@paulmcwhorter Жыл бұрын
I have a video on it in an earlier lesson in this playlist. That video shows how to get the 1306 set up.
@edSabio572
@edSabio572 Жыл бұрын
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 Жыл бұрын
Excellent!
@MrLuizChaib
@MrLuizChaib Жыл бұрын
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
@jamescullins2709
@jamescullins2709 10 ай бұрын
Paul a question, what am I going to do with all these lawn chairs!
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
Don't despair, these last few lessons have been pretty heavy duty. Hopefully you got it working after watching the video.
@jamescullins2709
@jamescullins2709 10 ай бұрын
Not a problem, I am understanding it, you are a great instructor@@paulmcwhorter
@jamescullins2709
@jamescullins2709 10 ай бұрын
how about moving some of the housekeeping stuff to the other core?
@paulmcwhorter
@paulmcwhorter 10 ай бұрын
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 10 ай бұрын
Great thanks.@@paulmcwhorter
@davidstacer
@davidstacer 5 ай бұрын
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.
@JohnIwa
@JohnIwa Жыл бұрын
Hello Paul, is there going to be a series on the arduino uno r4 wifi?
@paulmcwhorter
@paulmcwhorter Жыл бұрын
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 Жыл бұрын
kit ordered for the Arduino R4 wifi.
@paulmcwhorter
@paulmcwhorter Жыл бұрын
Excellent!
@taurus548
@taurus548 Жыл бұрын
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 Жыл бұрын
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.
@MrLuizChaib
@MrLuizChaib Жыл бұрын
Sorry about this portuguese text correction
@hello81642
@hello81642 8 ай бұрын
They say MPU6000 has better gyro performance. Why not use that? Or use MPU9250 or another IMU
@crs1548
@crs1548 Жыл бұрын
I am legend!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@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
@scottpettygrove7821
@scottpettygrove7821 Жыл бұрын
Catching up a bit. Here's my homework solution for this episode. kzbin.info/www/bejne/invGdJaErZ54gsksi=FJOLSqgjInrXBE-p
@paulmcwhorter
@paulmcwhorter Жыл бұрын
LEGEND!
@COSMOSIS245
@COSMOSIS245 15 күн бұрын
I know I'm almost a year late, but does anyone know why it's taking 30 seconds for the values to even start changing in the shell and then another 15 to actually get to the set point? My mpu6050 is mounted vertically (portrait, power LED on the top, so an issue could be present in my attempt to modify it), which is why I'm measuring pitch and yaw. There were also issues with dividing by zero when calculating the pitch/yaw "A" values so I temporarily fixed it by making it add a small positive number. Thanks :) xAccel=mpu.accel.x yAccel=mpu.accel.y zAccel=mpu.accel.z xGyro=-mpu.gyro.x yGyro=mpu.gyro.y zGyro=mpu.gyro.z pitchA=math.atan(zAccel/(yAccel+0.0001))/(2*math.pi)*360 yawA=math.atan(xAccel/(yAccel+0.0001))/(2*math.pi)*360 pitchComp=pitchA*0.005+0.995*(pitchComp+xGyro*dt)+errorP*0.002 yawComp=yawA*0.005+0.995*(yawComp+zGyro*dt)+errorY*0.002 errorP=errorP+(pitchA-pitchComp)*dt errorY=errorY+(yawA-yawComp)*dt
@paulmcwhorter
@paulmcwhorter 14 күн бұрын
Your low pass filter is way to slow: pitchComp=pitchA*0.005+0.995*(pitchComp+xGyro*dt)+errorP*0.002 yawComp=yawA*0.005+0.995*(yawComp+zGyro*dt)+errorY*0.002 Try something more like .95 and .05
@COSMOSIS245
@COSMOSIS245 14 күн бұрын
@@paulmcwhorter Thank you so much! You just saved my project :)
Raspberry Pi Pico W LESSON 52: Controlling Neopixels in MicroPython
27:13
Raspberry Pi Pico W: Wireless Weather Station
17:13
ExplainingComputers
Рет қаралды 302 М.
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН
Война Семей - ВСЕ СЕРИИ, 1 сезон (серии 1-20)
7:40:31
Семейные Сериалы
Рет қаралды 1,6 МЛН
Who is More Stupid? #tiktok #sigmagirl #funny
0:27
CRAZY GREAPA
Рет қаралды 10 МЛН
Raspberry Pi Pico LCD Projects
17:25
ExplainingComputers
Рет қаралды 125 М.
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18
GreatScott!
Рет қаралды 625 М.
Who would pay $120 for a Raspberry Pi?
9:31
Jeff Geerling
Рет қаралды 284 М.
Remote Weather Station - Solar powered Pico W SoftAP
5:32
Raspberry Pi Pico Data Throughput (Ep. 0.2)
10:05
Life with David
Рет қаралды 7 М.
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН