9-Axis IMU LESSON 1: Introduction to Nine Axis Sensors and Inertial Measurement Units with Arduino

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is polemic order from top tech boy calm and we are here today with lesson number one in our incredible new series of Arduino tutorials where you are going to learn how to use an on axis sensor to create an inertial measurement unit so what I am going to need you to do is for a nice enormous mug of iced coffee you will not need any sugar in it it is delicious just the way it is and then I need you to pay attention because I am going to be outlining what we are going to be doing in this series of lessons first of all let me ask you a question from our longtime subscribers what's different today if you can see what's different today leave a comment down below for the rest of you you'll just have to check the comments to find out what's going on so let me start by kind of introducing you to the hardware that we are going to be using in this series of lessons I will scoot out of your way a little bit what we are going to be using is we are going to be using an Arduino Nano and the reason we like the Nano is because it's very easy to put on a board and you see what a nice clear simple build that we have here and it's we're moving this thing around the chances of having a wire come loose are much much less we've got a non-secure build which is really needed when you're going to do a complicated project like an IMU and then secondly we are using the B in oh the Adafruit B in Oh 0:55 non-access sensor alright and I've got links down below to Amazon for these two components now I can hear you yelling and screaming already that this BN oo 55 sensor is relatively expensive compared to a lot of the non-access sensors a lot of the known access sensors maybe you could get for 9 to 15 bucks and this one's a little bit more than 30 and I can see the comments coming already oh well can I do this with a different sensor guys we need to be using identical hardware and what I will say is of all the projects that I've ever done on Arduino neural measurement units are the most challenging and therefore we need to be using the same hardware and the other reason for using the bno o 55 is it does some of the math for you it has some helper applications where some of the hard things you have the ability to have the chip itself do and then that makes our job over on the arduino side a lot easier and so guys don't start putting comments down below asking me oh when i do this on the blah blah blah blah blah blah then i'm not getting the same result well this is designed for us going along together using identical hardware and if you go through this series of lessons with me it looks like i have about 20 lessons planned you will you will not only understand how non-access sensors work you will be able to use them and incorporate them into your projects ok so that is kind of where we're going with this thing let me show you in the end what we are actually going to end up with here if you follow me through these lessons ok what do we have here we have the arduino hooked up to the B&O Oh 55 in this this is the real world ok this is the real world and then over here over here we have the virtual world and what I want you to watch is like imagine that this is an airplane ok here's the nose of the airplane and imagine that we have an airplane the nose lifts up in the real world what happens in the virtual world the nose lifts up the airplane taxis and turns it taxis in turns ok the airplane takes off and then banks left and then banks right ok let me show you you see we can yaw this is a yaw 90 degrees 180 degrees 270 degrees and then all the way back to zero okay nose-up nose-down roll left now let's see roll left roll right airplane going away from us nose up and Bank left nose up bank right we got a jet fighter and he's gonna go into a nosedive straight down do you see the yellow vector the yellow vector represents kind of this direction where the pin is so you can see the yellow vector kind of represents the the green pen here let me show you this is what's really really hard and if you guys have not played around with one of these you probably can't appreciate how hard this is to to do but look at this I'm going to roll all the way to 90 degrees and then as I am rolled 90 degrees I am going to change my heading okay and do you see how this is working perfectly that my animation is following absolutely what is happening in the real world how about we do a roll and turn all the way upside down do you see all the way upside down all the way back and then coming back so guys this is the direction we're going I'll also show you I did this just so that you could sort of have an animation that that you can see the X Y z axis and just a quick introduction to Euler angles three angles that kind of describe where it where an airplane is going yaw or heading it's just the direction you're going and so like this would be north let's let's say that this was north east south and then west okay that that's a direction well you also have a pitch and so the airplane might want to the airplane might want to take off and the nose comes up or it might want to dive and the nose goes down like that okay so this is pitch this is yah CI sometimes called heading and then also like we pitch up like we're take hang off and then you want to turn and so you bank the airplane and this is called roll okay and so you have yaw you have pitch and you have row okay and weak even roll upside down I think this is just super cool let me give you another quick example of what we're going to be doing I hope I can make this work okay let's see I might need to kill this other one first just showing you that once you get the math taken care of you can do all types of different things and I believe this is the one that I'm going to want okay and then let me spin it around this piano Oh 55 to kind of get it oriented you've got to sometimes spin it around a little bit to get it to know which direction okay there it is I believe we've got it now okay so you see now my simulation instead of something arbitrary my simulation looks a lot more like what we are really dealing with we got our breadboard and then we have our Arduino and then we have our Bao 55 and same thing I can roll I can pitch I can yah and whatever this board does in the real world the simulation does in the virtual world now man can you imagine how obsessive-compulsive we could get and start putting the little the little fine details start putting the little fine details in our simulation can you imagine putting these red lines and blue lines on our simulation can you imagine going in and putting all the holes sometimes when I have students they get completely obsessive-compulsive about making their simulations get more and more accurate but for now what I need you guys to do is I need you to go away and order your gear you're going to get the Arduino Nano you're going to get the BNO Oh 55 and then let me kind of give you a rundown of what we are going to be doing in these next lessons I am going to go back to that other simulation because I just actually like it a little bit better even though this one looks more real let's do this one okay yeah I like I like this one a little bit better just because I think it is so so cool and I gotta get it oriented again by spinning it around a little bit get those gyros working right there I think it's snapped you can kind of see it pop when it gets gets its orientation figured out okay so what we're gonna do in this series of lessons today was just an introduction that sort of showed you this is the endpoint that we're going to if you'll go through these series of lessons you're gonna figure this out but again you're not going to just go in and copy my code you're gonna understand how the things work and so next week what we're gonna do is we're gonna hook up the bno Oh 55 in the circuit you can see it's just two wires it's an i2c so you use the SCL and SDA lines very very simple to hook up and then we're going to write our first program and basically we're just going to show that we can talk to the BN oo 55 in that we can pull the data off of it that'll be the second lesson in the third lesson we're going to talk a little bit about how you get calibration on this thing the VN Oh Oh 55 doesn't just spit out raw data it spits out calibrated data so you've got to kind of help it find its calibration we're then going to show you basically there's a lot of numbers we're gonna be using and simply watching numbers stream by on the serial monitor you need to get a little bit more of an early visualization so I'm going to show you some software that allows you to very elegantly graph data that's coming off the sensor and so we'll get that installed we're gonna then talk about how does an accelerometer work you've got this little chip and you got magic happening but how does an accelerometer physically work what does it look like like if we pop the lid off of this thing and looked under a microscope what would it look like then we're going to talk about gyros how do the gyros work this is an on axis sensor right what are the nine axis it has three accelerometers an X a Y and a Z accelerometer it has three gyros an X a Y and a Z gyro and it has three magnetometers an X a Y and a Z magnetometer the accelerometer measures acceleration but what we're gonna find out is I'll give you a little heads up an accelerometer does not really measure acceleration the accelerometer it really measures the forces that are acting on a suspended mass we'll get into that in a later lesson well we'll learn what an accelerometer actually looks like how it works and then how we can use the numbers coming off of it we'll learn how the gyros worked and then we'll learn how the magnetometers work all right so we're gonna peel back the hood on this scene understand how those components actually work we're then going to show how you can start you know this is really complicated stuff I'm showing you but we're gonna show you how to start with just using the accelerometer you can make a simple tilt sensor where you're just measuring tilt you might not always need to be do this full-blown simulation you just might want to know if your Jeep or your RC car is tilting at a certain angle maybe we'll do a two axis tilt sensor where you can see are you tilting side to side are you tilting those up or nose down so we're gonna learn how to do the math behind doing a tilt sensor simply by using accelerometer then we're gonna see that you can do a little bit better if you fuse the accelerometer and the charity together how you kind of use the the limitations of the accelerometer the accelerometer have pros and cons that gyro has pros and cons and how you can take the advantage of the accelerometer and the advantage of the gyro and bring them together to get more stable and more accurate results we're then going to look at how to make a compass where you can see what direction you are spinning like that we're gonna then start understanding these Euler angles it's built EUL er common mistake is to call them Euler angles but they are actually pronounced Euler angle after the man oiler we're then going to get kind of a brief introduction to quaternion x' and quaternions or these magical numbers that help you actually solve this problem so on this one where you can go upside down and it works in all these strange orientations actually had to use quaternions to make this work and we'll get we'll get into that you'll learn it okay then we're gonna talk about how to get the data from the arduino into the python visual python so you can start doing these 3d simulations and do these really neat really really neat graphics and these will my friend impress your girlfriend you show your girlfriend these and these these simulations we're doing she's gonna say that's the guy for me okay pressure girlfriend by the time you get to the end of this alright then we're going to talk about some of the warnings and limitations of I am used in some of the particular limitations of the bno oh 55 and the other disclaimer I want to give you in this whole series of lessons this is for demonstration purposes if you're gonna do something like put an IMU on an unmanned aerial drone which is basically a flying blender you have to go into this way way way deeper than what I'm showing you here I'm showing you how to use it for a simple simulation if you're gonna use this to control a flying blender that could fly into someone's face you have to go into it a lot more deeply than what I am in these series of lessons but what I'm going to do I'm gonna introduce you to the topic where you can get started and one of the problems is man it's just like all this stuff very few people understand how these I am use work it's like everybody's running around copying code from other people and there's like a handful of people out there that kind of really understand what's going on and so what we want to do is we want to we want to instead of just going in and using libraries we want to really dig in understand how those sensors work and understand how the math works and I promise you I will take you through it step-by-step I promise you if you will follow along through these lessons that you will learn how to do this okay leave your comments down below let me know whether you like this lesson if you kind of want to do this give me a thumbs up Sam in or if you look at it and don't want to be a part of it let me know I need to kind of get some feedback if this is the type of thing that you're interested in in the future but as you know this first lesson says first 65 Series or 68 series of Arduino tutorials it was just the very fundamentals the very basics now we're getting into the real kind of Big Boi and big girls stuff to start doing start doing projects like this let me know if you the guys think you're ready for something like this if this seems like way over your head and you haven't done those earlier lessons go back and do the earlier lessons before you jump in and do this one okay guys I'd appreciate your comments down below would appreciate if you would give me a thumbs up be sure and subscribe to this channel when you do hit the bell so you'll get notifications for for these lessons palma quarter from top tech boy comm i will talk to you guys later
Info
Channel: Paul McWhorter
Views: 49,222
Rating: undefined out of 5
Keywords: IMU, Intertial Measurement, Arduino, 9-Axis
Id: 2AO_Gmh5K3Q
Channel Id: undefined
Length: 16min 20sec (980 seconds)
Published: Thu Aug 15 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.