9-Axis IMU LESSON 21: Visualizing 3D Rotations in Vpython using Quaternions

Поділитися
Вставка
  • Опубліковано 23 жов 2024

КОМЕНТАРІ • 125

  • @Samloops
    @Samloops 4 роки тому +13

    Paul, I've been working with computers both in my job and as my hobby since the early 70's but have never had so much computing fun as I've had following your entire series on the IMU. This has been a real eye opener. It is a part of computing I've never really had any experience with. Thank you so much for all the time and effort you have put into it. Very much appreciated! For an even silkier-smooth experience, try modifying the Arduino code to send four or five decimal places for quat.x, y and z. For example: Serial.print(quat.x(),4); . Makes a world of difference! Thanks again! And keep them cranking... the more difficult the better!

    • @aklmini-makers4304
      @aklmini-makers4304 2 роки тому

      Thanks for the advice! Will try adding the decimal places.

  • @XxManagedxX
    @XxManagedxX 4 роки тому +11

    I'm still here. I love this series. Keep up the awesome work.

  • @Toucan123
    @Toucan123 9 місяців тому +3

    even 4 years later, this is fire!

  • @russellatkinson5608
    @russellatkinson5608 4 роки тому +7

    Fantastic series Paul! Thank you. It happens to fall right in line with a real life project I am currently working on. Would love more challenging projects too.

  • @aatt3209
    @aatt3209 3 роки тому

    Yes, I am still alive, onto Lesson #22, to and back from quaternion. Thank you so much for spending 6 years to dedicate yourself to break down the w,x,y,z so we can all understand it. Yes, I very much like this type of problems, forcing me to learn new tech and keeping my old brain cells alive.

  • @blaineporter4966
    @blaineporter4966 2 роки тому

    I’ve been an electrical engineering student from 2015 until 2021, and now I’m a full fledged hardware engineer. In that time, I never once saw that we had two more imaginary axes to play with but your explanations illustrate the concepts perfectly. I can follow your videos as if I was watching another Netflix series. You taught me Arduino before I learned my first college microcontroller class and by golly I’m so happy that I landed on your videos. Keep up the most excellent work Paul, you have my eternal respect.

  • @wayneswan3092
    @wayneswan3092 2 роки тому

    What you did at the end of this video, where you took your 3D vpython drawing and put it in your camera view, is the main purpose of my learning vpython and using Arduino in vpython. I have a lot of really cool ideas for building a 3D object and then have it free floating in my camera view! That's why I was asking if I could install Vpython on my Jetson Nano, to implement my 3D drawings into my camera programs.

  • @itsmeintorrespain2714
    @itsmeintorrespain2714 3 роки тому

    I started this course 3 days ago (March 2021) and have just made it here. Fantastic stuff! A pleasure to have had it all explained in plain English. Now I have plans to give that Raspberry Pi Zero IP camera from the Jetson Nano series a gimbal to sit on!

  • @graham6411
    @graham6411 2 роки тому +2

    Let me congratulate you on your success in teaching so much in such little time. You have done a remarkable job of teaching such an all-encompassing series on such a broad range of need-to-know expertise to get us from point x to point z as well as their imaginary compliments. It is the answer to the question of what to do with the 45-degree insensitivity problem of a sine. Now to the next question. How do you maintain sensitivity as the sensors are subjected to centrifugal and centripetal forces?

  • @willibaldkothgassner4383
    @willibaldkothgassner4383 Рік тому

    Thank you, unbelievable how you could explain Quaternions to me, never experienced such exeptionell kind of instruction in my life. Best regards from Austria !!!!!!!!!!

  • @hassangharbi3687
    @hassangharbi3687 3 роки тому

    I'm french speaking mathematician, really i'm impressed about the way you introduce this abject object, the quaternion
    And now what, I change my mind : they are now beautiful object
    Merci beaucoup

  • @edwardchess4671
    @edwardchess4671 4 роки тому

    Paul, I am legend. And you are a good instructor. I've played with quaternions before with some rocketry avionics and failed miserably. I'm feeling much better about trying again now that I've gotten this far in the lessons. Thank for doing this one--you've made quaternions a lot more approachable to a 66 year old.

  • @jktification
    @jktification 4 роки тому

    Paul outstanding teaching. This is about the most satisfying treatment on the subject across the Internet. I followed and played along all 21 lessons

  • @danielbeyer4110
    @danielbeyer4110 2 роки тому

    Dear Paul, I really love the stuff you're doing. Quite a while ago Iordered a different IMU but failed to do anything with it. With your tutorial I again starting to hopefully have success this time. Thanks for the huge amount of work you're putting into your tutorials.
    Thanks.

  • @aklmini-makers4304
    @aklmini-makers4304 2 роки тому

    Hey Paul - another wonderful lesson. I live for this project-led approach. Blinking LEDs, buzzer lessons are great for our newbie/rookie days, but without the "Why" pathway such lessons end up purposeful without a purpose. Glad you didn't stop at Lesson #21. Another step closer to my DIY camera gimbal goal. Fantastic!

  • @BiancaDianaT
    @BiancaDianaT 4 роки тому +1

    Okay FINALLY could finish this and move forward, went through Madgwick/Mahony filters and now it's groovy :)
    Definitely enjoying difficult projects, they're the most fun

  • @ankit1677
    @ankit1677 3 роки тому

    Sir u have not wasted an iota of ur time. U are god send....u have changed my life and so will your work in coming generations....love from india

  • @als.4568
    @als.4568 4 роки тому

    Congratulations Paul. IMU Lesson 21 is your best video lesson yet, bar none! Although I have not been able to work through each of these lessons yet, due to other projects, I did follow along and really want to get the hardware and go back through all the lessons again for the "hands on experience". After 70+ years I not only just became aware of quaternions, but actually understand what they are! One more "new trick" for the "old dog"!
    As far as lowering the bar in future lessons, only do that as necessary to attract new viewers. As for the rest of us, I hope you are willing, and able to continue to lead us "higher and higher". Applying what has been presented so far to future projects/lessons,..... showing us what we could accomplish with this technology,...... would be of great value and would be greatly appreciated! Many thanks for all your efforts!!

  • @SuperAlex5
    @SuperAlex5 4 роки тому

    Hello Paul. I can not stop watching from the first lecture. I already bought all parts and just following everything you showed us. You are making one of the best show I ever seen. Thank you so much!! Anyway, Quaternions are very impressive. Very smooth.

  • @pralaymajumdar7822
    @pralaymajumdar7822 4 роки тому

    Boom...Quaternions make us really crazy. What an outstanding lesson...your every lessons are very much attractive instead of hard topic. Remain alive till you remain alive. Continue your brilliant work. Thank you sir.

  • @jamesludwig3815
    @jamesludwig3815 3 роки тому

    Just discovered your website - what a treasure! You explain things in a way my 78 YO brain can understand. Looking forward to doing more of your projects. I'm glad in this video you confirmed the magnetometer "front" is off to the side.

  • @orndorff52
    @orndorff52 2 роки тому

    I'm in the process of writing an algorithm for a $21k IMU that has a Fiber Optic Gyro, magnetometer, and a MEMS Accelerometer... and once again, every time I need to go back to basics and re-visualize some of this stuff, I dig up your lessons! There is no comparison on your ability to explain this stuff. Thanks Paul!

    • @gregh9237
      @gregh9237 2 роки тому

      hi, have you an example code or a valid link where learn how to implement quaternons on an microcontroller for an imu that doesn't calculate them automatically.
      thanks in advance

  • @TinFoot
    @TinFoot 4 роки тому

    I think the high level math projects are outstanding. Having just finished your cross product lesson, the quaternion math seems to follow the right-hand rule. I.e. i X j = k and j X i = -k. 60 years ago I took a Linear Algebra course and I remember the dot and cross product. However, I never understood how to apply the technique to the real world. Your course just turned on the light bulb. Your 6 years of work on this project sure made my week. Thanks Paul it was a great lesson.

  • @roycas3
    @roycas3 3 роки тому +1

    Thank you for your wonderful lesson! Solved my year-long doubts. You are the real teacher! I watched all of your lessons. Wonderful sir.!

  • @overbeckmusic
    @overbeckmusic Рік тому

    Thank you so much Paul for this series of lessons. It's incredible how I've consolidated a wide variety of skills and knowledge. This series has greatly improved my trigonometric intuition and as I did the whole series in vim editor I got to learn some new vim shortcuts with much joy.
    To answer your question at the end - Yes! :) I would love to see more harder projects like this.

  • @keithemerson9349
    @keithemerson9349 4 роки тому

    Fantastic project. Just Finished it and the IMU is working perfectly. I work at a sixth form College in England and recommend all your videos to both students and teachers doing engineering and electronics. Currently working on a robot for a competition and would have liked to include an IMU but previous results using other IMUs have been variable particular for rotations about the vertical axis. Not sure that I understood all the quaternion stuff but just knowing that the capability is there is a big step forward. The robot work has slowed down my progress on the Jetson nano but hope to get back to it soon. Love the more advanced tutorials. I've recently got hold of a RPILIDAR A1M8 and it would be great if you did a tutorial on this, particularly if it could be combined with the Jetson nano. Thanks again

  • @bradthompson7775
    @bradthompson7775 2 роки тому

    Really enjoyed your description of imaginary numbers and how they relate to quaternions. I've wanted to understand how quaternions work and this project and your excellent explanations have made it possible for me to better grasp this topic. Excellent work overall in all your lessons! I am very appreciative!

  • @lotbotrobotics5026
    @lotbotrobotics5026 3 роки тому

    I found the series of lessons to be outstanding. Even when you get an live issue you make the correction a learning opportunity. You are a terrific instructor and I will put up with the black coffee to learn from you. I will be using this information in one of my future videos and of course reference you as how I learned about the BNO055. I am continuing with the rest of the IMU lessons. But after viewing your discussion on Quaternions I have to say thank you very much for your effort in making these lessons meaningful as well as enjoyable.

  • @NOS187
    @NOS187 2 роки тому

    I stuck all the way through... and WOW i learned a lot. Super appreciated that you took the time to do these lessons.
    Thank you so much!

  • @hansklein4415
    @hansklein4415 4 роки тому

    Hi Paul,
    thank you a lot. Great explanations and great lessons. You are totally not wasting your time. i did the whole course. That you had to make a try and exeption there is because of the calculation of the rollwhen its at -+90°. arcsin isnt defined there. In Wikipedia its standing that this situation ist called gimbal lock. Better solution is in the c++ code implemantation in the article. In Python you had to add
    temproll=2*(q0*q2-q3*q1)
    if (abs(temproll) >= 1):
    roll= copysign(np.pi/2, temproll) # use 90 degrees if out of range
    else:
    roll= asin(temproll)

  • @captjohnny
    @captjohnny 4 роки тому

    We're developing a model rocket performance package and your lessons have both defined and proven that it's possible and, also, how to do it with off-the-shelf hardware.. Thanks for taking the time to explain everything in detail and not rush through things like everyone else does. Where were you 60 years ago when I was an engineering student ;)?? Plus, it's encouraging to see someone in my age group still in the game...thanks a lot...jg

    • @paulmcwhorter
      @paulmcwhorter  4 роки тому

      I would not use the BNO055 in a rocketry application . . . it easily goes into autocalibrate mode, and can give crazy readings. I would not trust it in any type of real system

  • @benfox4736
    @benfox4736 4 роки тому

    I watched every episode and your explanations connected all the dots for me on the math side as well as the programming side. THANK YOU for doing this. If our schools were filled with teachers like yourself the world would be massively better place. Would you mind sharing what your education background is? thanks again.

  • @nedmsuperleggera5038
    @nedmsuperleggera5038 Рік тому

    Made it through the 21 lessons! This has been awesome to follow along, thank you for the effort.
    For this lesson, I had to do some troubleshooting with the python code at line "pitch=asin(2*(q0*q2-q3*q1))". I was getting "ValueError: math domain error."
    As mentioned at 1:01:38, the error seems to have to do with the asin function getting a value that it cannot handle.
    I was able to get the program to run by borrowing from the code provided on lesson 24. Specifically, I modified the arduino code in this lesson to have:
    float q0;
    float q1;
    float q2;
    float q3;
    ....
    q0=quat.w();
    q1=quat.x();
    q2=quat.y();
    q3=quat.z();
    .....
    Serial.print(q0);
    Serial.print(",");
    Serial.print(q1);
    Serial.print(",");
    Serial.print(q2);
    Serial.print(",");
    Serial.print(q3);
    .....
    for some reason that I cannot explain, "catching" the quaternions in python by having the arduino "throw" them this way (instead of Serial.print(quat.N)) was able to resolve immediate ValueError issue.
    I still needed to implement the try and except for the pitch down 90 degrees case.
    Cheers!

  • @oracid
    @oracid 3 роки тому

    I am steel here ! I plan to put this in a quadruped (only the Nano side). I will give you news if I reach the goal. Thank you for all this. From Paris.

  • @graham6411
    @graham6411 2 роки тому

    Paul, This has really been a most excellent series. Of course, for me, quaternions are a magic incantation with absolutely no idea of what it all means or why it fixes things like gyroscope lock. I am still stuck in trying to understand how you can produce valid data beyond 45 degrees with the accelerometer without switching from sine to cosine data. I see that I have a long road ahead after simply seeing the use of quaternions to actually understanding.

  • @littlechay
    @littlechay 6 місяців тому

    Thanks! This is has been an awesome series for me, bringing together a whole bunch of stuff I kinda knew but had never used. I had already wrapped the pitch quaternion to euler conversion in a try except before you wrapped the whole thing so I'm giving myself a pat on the back for that :)

  • @parkerjimmy8626
    @parkerjimmy8626 4 роки тому

    Hi Paul! Thank you for making such high quality tutorial on UA-cam. As a university student doing this kind of project, I know how hard it is to make this simulation smooth and correct from zero. Best tutorial series found online so far!

  • @markhouweling5542
    @markhouweling5542 3 роки тому

    Hi Paul, thank you for all the lessons. I followed all 21. It really helped me in understanding the IMU. Kind regards from the Netherlands

  • @ericsmith7988
    @ericsmith7988 3 роки тому

    Watched the first 21 and will watch the last five in this series. Wish I fully understood the math, but I am picking up a little along the way . Thx

  • @matteorosa2641
    @matteorosa2641 4 роки тому

    Hi Paul, I'm using your lessons to learn about Arduino for my thesis work and I want to thank you!
    I also want to contribute by saying that in order to avoid the gimbal lock you can use the method ".toEuler()" included in the header Adafruit_BNO055/utility/quaternion.h. The conversion from quaternions to Euler angles is done with different formulas, but it works very well! If you use this method you can directly send to Python the Euler angles by using:
    Serial.print(quat.toEuler()[0]); // yaw
    Serial.print(",");
    Serial.print(quat.toEuler()[1]); // pitch
    Serial.print(",");
    Serial.print(quat.toEuler()[2]); // roll
    Obviously the python code need to be adjusted accordingly.

  • @jalopyjones6460
    @jalopyjones6460 3 роки тому

    finally, someone that can actually explain quaternions in a manner that my brain processes the information... thanks Paul!

  • @bkairosh8164
    @bkairosh8164 3 роки тому

    I learned about imaginary numbers back in school and uni, but I never knew about its application in the real world. Now everything makes sense. Thanks Paul.

  • @ronronsen1674
    @ronronsen1674 3 роки тому

    hello.. nice content.. i try to build robust headtracking for flightsim (look over should feature), i just jumped straight into IMU lesson 21 and thats exactly what i needed to know... i ordered BNO055 as usb stick.. iam familar with arduino too but usb version is more straight forward in my project,.. and using python all time.. and bosch manuals... i am sure i will get it to work... Thanks for your time and insides, great stuff.

  • @bluehornet6752
    @bluehornet6752 4 роки тому

    Still here--this quaternion stuff isn't terribly bad, if you understand the concept of a unit vector...and can visualize imaginary numbers. The quaternion stuff sure makes the code a LOT cleaner and easier to understand. Even the python code become easier to follow along with. Great stuff Paul!

  • @quaternion-pi
    @quaternion-pi 4 роки тому

    Brilliant! Love this challenging project. My solution (insignificantly) differs at 53:59 - I substituted np.pi instead of np.pi/2. This aligned the virtual and real world perfectly without needing to change the vPython camera viewpoint as I think you did. I noted no virtual image instability in vertical nose up or down with this code. But try: and except: was a great solution.
    These tutorials take a great deal of your time and are greatly appreciated! Hopefully with adequate 'encouragement' you will make more like this, even at the expense of a slightly smaller but ebullient audience.

    • @paulmcwhorter
      @paulmcwhorter  4 роки тому

      Quaternion, you probably noted that I had to edit the video, and reload it based on the error you pointed out of the missing '2' in the roll equation. I am sort of perplexed at how that made no visible difference at all in the visual. What I conclude is that tangent is a very sharply increasing function, so an error of '2' in the y value leads to a very small error in x, or toll. Hence the 2 did not lead to a perceptible error. Of course, I could not leave the video up with such a glaring error, so I reedited and re-uploaded. Took me all day yesterday to do it, as it was tedious to just redo that part.
      I really enjoy making these videos, and hope I can transition to doing this more. Today, I will make a video on using the sensor to create a self leveling platform.

  • @dr_ned_flanders
    @dr_ned_flanders 3 роки тому

    Great series of tutorials. I have been watching since the start of series. I wouldn't say it was that difficult because you explained it so well. Looking forward to more difficult projects in the future.

  • @nahuel3256
    @nahuel3256 2 роки тому

    You're a gem Paul McWhorter!

  • @jeandeux5012
    @jeandeux5012 4 роки тому

    i'm still here and it's been a wild ride, but I've sat through all 21 lessons, thank you for teaching us sir

  • @BryantAnderson-p8x
    @BryantAnderson-p8x 6 місяців тому +1

    I love it 😊

  • @Kupsberg
    @Kupsberg 4 роки тому

    Awesome series Paul! Just amazed by your talent to express quite problematic things very understandably. Took a few nights to look at the full series of this but boy it paid off! Strongly suggesting to keep working on these more challenging bits. (ie. this last episode!) I like my coffee hot and plenty. BR from Finland! Thumbs up!

  • @codecage9333
    @codecage9333 4 роки тому +1

    Hanging in like Gunga Din! This is great Paul, I'm a little behind you, but gaining fast.

  • @SupernovaSpence
    @SupernovaSpence 3 роки тому +1

    Hey Paul, I'm working on a flight controller. I've followed all of your tutorials this far. And everything has been working perfectly with one exception. When approaching 90° on theta (pitch axis), I'm getting a "value error: math domain error" for the line, "theta = -asin( 2*(q0*q2 + q3*q1))"
    I need to be confident that I'm not going to get errors in the euler angles that could crash the controller when performing computations on board the aircraft when approaching vertical.
    Any suggestions or help you can offer would be great!
    I know I'm not a student... Per se, but I love your videos and I'm hoping that you still monitor your classes comments.
    Thanks Paul!
    Spencer

  • @martinscott5122
    @martinscott5122 8 місяців тому

    Keep up with this project please, now to apply some motor control stuff would be good

  • @VivekGoldsmith
    @VivekGoldsmith 4 роки тому

    I have being following till now. The glitch is due to gimbal lock. It is mentioned in the wikipedia website. Happening because in pitch condition as asin value is becoming greater than 1 which cannot be. We can stop glitch it by limiting asin to 1 using if statement. Thanks for your lessons.

  • @johncorson6599
    @johncorson6599 9 місяців тому

    Well done Paul

  • @sqali8039
    @sqali8039 4 роки тому

    You are a lifesaver Sir ! Thank you very much for this explanation on quaternions

  • @dvaish171
    @dvaish171 3 роки тому

    Thank you Paul,
    Awesome work. Learnt lot of new things.

  • @robjameson7965
    @robjameson7965 4 роки тому

    Love projects like this - they're something to get your teeth into! I'd love to see more (after the Jet Bot/ AI). After this I'm gonna do the old Arduino/ Arduino with Python series GPS/ Tracking stuff - but would still love more projects at this level in the futurel!!!

  • @yoashuain1
    @yoashuain1 3 роки тому

    Thanks for sharing, what seems to be, a long hard thought out bit of info on coding. Always thankful for you teaching us how to do this.🎓😎😁

  • @CRAZYELON
    @CRAZYELON 4 роки тому

    this is amazing i have followed all your lectures and i have done all (thank you sir for this series)

  • @MichaelJohnson-ni4gk
    @MichaelJohnson-ni4gk 4 роки тому

    Great series and explanation of Quaternions.

  • @phillipneal8194
    @phillipneal8194 4 роки тому

    Bravo , made it through all 21

  • @phildunkerley5855
    @phildunkerley5855 4 роки тому

    Paul thanks, excellent following this through with you, it's all starting to make sense at last. :-)

  • @wilddreamer5907
    @wilddreamer5907 4 роки тому

    I'll Make sure to watch all the videos i missed, rly great work and very nice explanations
    Keep up the good work

  • @johnganci933
    @johnganci933 4 роки тому

    Great video! Just pointing out some minor typos in the python code.
    There are 4 occurrences of "lenght" that should be "length": the 3 lines where xarrow, yarrow, and zarrow are defined; the line where nano is defined.

  • @norwegiandud
    @norwegiandud 2 роки тому

    Great! I really like to dig into harder problems!
    Question:
    If you don't have an IMU that reads Quaternions, is it possible to do the math from ACC, Gyro and MAG?
    And I can't go from readings to Euler to Quaternion to Euler that doesn't solve the issue with singularity / glitches, because this solution doesn't stay in the Quaternion real "long enough" as Paul, elegantly, put it.

  • @rocarolan2003
    @rocarolan2003 Рік тому

    Great video. Quick question. When you convert back into Euler angles and I print them to the screen they seem to vary from plus or minus 5. Is this radians? Thanks for your great work by the way.

  • @WereJoebin
    @WereJoebin 2 роки тому

    just found these videos. trying to create a simulation of a 3d object using the bno055 data. thankyou.

  • @Gabriel-iy1zq
    @Gabriel-iy1zq 2 роки тому

    This video was super interesting. I question did pop-up. How exactly does the IMU produce the quaternions? I imagine that it used the accelerometer, gyroscope, magnetometer; but how what method or types of algorithms does it use to produce the quaternion?

  • @geissonrodrigues9128
    @geissonrodrigues9128 4 роки тому

    Thank you so much for all your work on this and for sharing it!

  • @jrohit1110
    @jrohit1110 3 роки тому

    Thanks for the practical demo. Really helped. Altough, you could've gone easy with the coffee 😅

  • @xt1200z1
    @xt1200z1 2 роки тому

    Really good presentation! But, I have a problem. Plan to put this sensor in my Dual Axis Solar Tracker which runs currently on LDRs tracking, which are not very reliable in cloudy WX.
    Problem: No way to calibrate every time the esp32 wakes from sleeping (runs everything on 24vdc battery).
    I am currently saveing initial calibration settings via eePROM and then reloading them with library functions from BNO055. Trouble is the mag does not calibrate with this method. So, yaw is off.

  • @daniellin2002
    @daniellin2002 4 роки тому

    Hi Paul, very helpful video! I have quickly viewed all your videos in this playlist as I have a new project of using only 6DOF (ACC+Gyro). May I use the quaternion concepts for a 6D IMU? I presume the yaw angle is not possible to obtain in this case? Thanks.

  • @linuxranch
    @linuxranch 2 роки тому

    Paul... I have stayed with it this far. And have enjoyed the brain stretch.
    There is a related topic I'd love to follow you in exploring: Kalmann filters, fusing the bno055 data with GPS and pitot/static data leading up to an "autopilot" like the Ardupilot. (Or if not the actual flight control laws, because of the aerodynamics issues, a "glass cockpit display.)
    Any interest?

  • @trevorhunt6083
    @trevorhunt6083 4 роки тому

    Awesome video series Paul.. I personally like the more challenging projects and would love to see you do a project with the pi zero ..

    • @paulmcwhorter
      @paulmcwhorter  4 роки тому

      I would like to do something with the pi zero. Really an amazing little board.

    • @jayjay_yah
      @jayjay_yah 4 роки тому

      Paul, i can't get rgb video 4 to work. Here is two idea. Show the complete code, when done. Or even better could you link each code to each video. PS i think your a super teacher.

  • @rona5945
    @rona5945 Рік тому

    This is a great project!

  • @ctressler02
    @ctressler02 3 роки тому

    Thank you Paul!!!!

  • @stephenremillard9462
    @stephenremillard9462 4 роки тому

    Amazing series! Would it be possible to do a quick addendum to this video to show how to get the quaternions just from the angular velocity of the Gyros? My specific Gyros does sensor fusion "Before" calculating the quaternions and I can't have accelerometer data because it will skewed by intense acceleration. Or maybe just a note on your web site. Thanks again!

  • @emmetray9703
    @emmetray9703 4 роки тому

    Hello Mr. Paul McWhorter.
    Please do not skip this comment and if it's possible answer me.
    I used your code from this tutorial and I have one problem. When Pitch angle is greater than 90 degrees then ROLL and YAW angles changes too , but in your code, seems everything is ok.
    I just copied your Arduino code . I'm just printing roll,pitch, yaw values multiplied by 180/PI .
    I also used Adafruit's "Vector toEuler() const " function, but still have same problem with Pitch.
    I do not have problem with Roll or Yaw, only with Pitch angle > 90.
    also I'm calibrating sensor.
    Please help.

  • @zlackbiro
    @zlackbiro Місяць тому

    Can you please tell me what will happen if you put the board sideways and restart, like roll it 90 degrees? Will it start rolled 90 degrees?

  • @henkoegema6390
    @henkoegema6390 3 роки тому

    I followed Lesson 1 up to Lesson 26. Even I learned a lot as an (old and long time retired) math teacher. Specially about Quaternions. :-)
    I saw in Lesson 21 at position 57:36 and on-words, your virtual breadboard floating around in a transparent background .
    Not the dark or yellow background from vpython. Is there a special way to do that?

  • @eriktruong9856
    @eriktruong9856 2 роки тому

    Thank you for the video. I tried doing the same with Ursina engine/Panda3d but I hit the issue of yaw and roll aligning so that I get a gimbal lock. Wouldn't using Euler angles regardless of wether it came from quaternions and just displaying it cause gimbal lock? Anyways great video

  • @ahmetbingol2966
    @ahmetbingol2966 6 місяців тому

    I love this guy thanks a lot ❤

  • @mattcarleton0
    @mattcarleton0 2 роки тому

    Love the harder lessons. Sorry I'm late to the party

  • @jonallsop7502
    @jonallsop7502 3 роки тому

    Amazing stuff!

  • @andruwilliams841
    @andruwilliams841 4 роки тому

    Great lesson, thank you

  • @ronnygey1363
    @ronnygey1363 3 роки тому

    Hello Paul and teaching lessons school mates,
    i tried the BNO055 as red USB stick version,
    and my findings , problems are
    1. its a good to study the BOSCH bno055 PDF: just google for "BST-BNO055-DS000-12" and you will find that PDF
    2. with the stock calculations , that paul gives us, we can get endless rotation , yeahha
    BUT
    endless rotation is destroyed as
    3. i tried to redefine turning orientations , using -1*(...)
    4. interchanged, remapped axles, using remapping in code
    Paul said, that the BNO Chip orientation on the board isnt documented
    BUT look in the PDF on PAGE-25 and PAGE-24, with that information we can solve that.
    the BNO055 allows us to remap axles in the chip itself (AXIS_MAP_CONFIG) !
    and it allows to define/revert the turn orientation (AXIS_MAP_SIGN) !
    Attention:
    PAGE-30
    here we see Fusion data output format is possible in two ways, in Windows and in Android format,
    that is "only" important for Pitch, see "Table 3-13: Rotation angle conventions" !
    that does NOT affect Quaterions, because we can NOT set UNIT_SEL for Quaterions, see "Table 3-11: unit selection".
    AND
    here we see that Pitch and Yaw have a range with 360degree.. but surprise Roll comes only with 180degree?!
    Quaternions are not delivered in degree (their value range is -1...0...+1)
    BUT
    i see that one quaternion looks always to be only half in size.. i supose its the Roll !
    Checking and adjusting these 3 Features (AXIS_MAP_CONFIG, AXIS_MAP_SIGN, )
    Quaternion value Range and the Pitch calculation -> math domain error
    because math.asin() argument has to be -1 to +1
    and my BNO055 delivered values for q0,q1,q2,q3
    in sharp edge cases only, that result in values smaller -1 and greater +1 .. and math.asin throws exception error
    try:
    pitch = math.asin( 2*(q0*q2 - q3*q1) )
    except:
    pass
    btw, i use:
    BNO055 USB Stick Linux Python Driver, bno055_usb_stick_py, version=0.9.5, from Dr. Konstantin Selyunin,
    with small code changes on windows, python3.
    Greetings from Germany

    • @paulmcwhorter
      @paulmcwhorter  3 роки тому

      If you think too much about 3D rotations, you will go mad. I was able to get my axis oriented with my project, but will admit that I did do a little bit of trial and error.

    • @ronnygey1363
      @ronnygey1363 3 роки тому

      ​Hello Paul,
      now i got it to work on my bench.
      now the physical BNO055 usb stick on my desk
      and the visual representation in VPython move identical.
      I tried all allowed couples of AXIS_MAP_CONFIG + AXIS_MAP_SIGN (PAGE-25),
      ( you have to set OPR MODE into CONFIG (PAGE-21) register 0x3D to x0000b and then back to NDOF xxxx1100b),
      but at the end i went back to default P1 (0x24,0x00).
      I used
      the negativ multiplications -1*YAW and -1*ROLL
      and the addition YAW +np.pi/2
      and BOOOMMMMM the endless rotation on all axles works fine without any edge case side effects.
      now it seems identical to your setup,
      i only had to fiddle the boxes width length of bBoard-GREY and nano-GREEN.
      Nose down is like a Roll left, Nose up is like a Roll right
      and
      Roll left is like a Nose down and Roll right is like Nose up.
      so X and Y in horizontal plane are "virtual" interchangeable,
      we adapt only the visual presentation, the Vpython boxes to our needs,
      the code and formulas are already correct.
      time for a mug of coffee
      BOOOMMMM
      Thank you for your great content Paul
      PS:
      the most stuff, i retyped code while watching your videos IMU-Lesson:15 till 21,
      because i did not found the code snippets and so i enjoyed your teaching style too,
      BOOOMMMM ;o)

  • @vegabs
    @vegabs 3 роки тому

    Awesome lesson! Thank you so much :)

  • @graham6411
    @graham6411 2 роки тому

    Did you get a stabilized accuracy?

  • @aphethdalmeida3711
    @aphethdalmeida3711 4 роки тому

    Thank U paul i made it till 21

  • @IvA_062
    @IvA_062 4 роки тому

    This video saved my life, thanks a lot :')

  • @codecage9333
    @codecage9333 4 роки тому

    If you want to see some strange results, just get one of your q numbers wrong in one of the formulas, I had the first q2 in the yaw formula as q3 and it was causing strange result when changing pitch! Guess I have let my Quaterions spin out of control! :-)

  • @katycrane6266
    @katycrane6266 4 роки тому

    Hey paul. Your program hanging up on pitch approaching 90 degrees is a phenomenon called gimbal lock. You can sort of bypass it by adding a mathmatical exception approaching 90 degrees....id love to talk via email to work it out but yore not answering....

  • @abdussametkaci5795
    @abdussametkaci5795 4 роки тому

    Hello first your video was very helpful to me thanks a lot. But I have a problem I have mpu6050 for gyro sensor can I do the same things with mpu6050 because I am having stabilization problem in my simulation.

  • @thepoordog
    @thepoordog 3 роки тому

    Thanks!

    • @paulmcwhorter
      @paulmcwhorter  3 роки тому +1

      WOW, thanks, really appreciate it!

    • @thepoordog
      @thepoordog 3 роки тому

      @@paulmcwhorter This was honestly one of the best videos I've watched about both math and IMUs in a while. You've explained everything so well and I love the amount of personality you bring to the video!
      One thing did get me though, when you said we were multiplying i, k, and j. I thought you meant we were taking the dot product of them. I haven't had to use linear algebra in a while so it took me a good second before I realized you meant you were using the cross product. 😅

  • @BiancaDianaT
    @BiancaDianaT 4 роки тому

    Damn I'm stuck at having to calculate quaternions because my IMU won't and can't seem to find yet materials on doing that from IMU
    Will try through some filters too

  • @MicEE2998e5
    @MicEE2998e5 4 роки тому

    How come videos from 22 to 25 are private?

  • @CRAZYELON
    @CRAZYELON 4 роки тому

    amazing ^_^ amazing ^_^

  • @kevinshaver5613
    @kevinshaver5613 4 роки тому

    Loved this series! Looking forward to more of them! Thanks Paul, even though you broke my mind with quaternions!

  • @545sytes
    @545sytes 4 роки тому

    You just taught an Accountant, Imaginary Numbers .... The world is coming to its end