The Factory | Calibrating Magnetometers & Raw Data Applications

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome back to the factory we're in the makeover studio today because there's a bit of construction happening outside and i'm joined by peter who is working on the latest picot of modulate picodev 3-axis magnetometer what is what's a magnetometer what is this thing yeah so um a magnetometer is a sensor that can measure the magnetic field strength in the x direction the y direction and the z direction this is based around a qmc 6310 chip and it is tiny but so i've got that here to show you amazing and each of those pads is 0.2 millimeters in diameter they're circular pads and um i haven't worked with pads that tiny before i bet um assembling this must have been quite a challenge even just like even just like the size of the pad and the thickness of the stencil like that it was a challenge in fact uh i had one failure out of out of three of my tests so um yeah what i found is that i just had to show an extra special bit of care around that um getting making sure that that uh solder paste got through into the to the chip and i sort of showed it the same amount of care that i might have shown um a one millimeter pad you're right okay so you've got something that can measure magnetic field strength in three axes but what what do you actually do with that information what's that useful for okay so the the most obvious use case is a compass to measure the um your bearing on the earth's crust so we're going to just for now ignore the z component of the magnetic field and we're going to point this magnet magnetometer into different directions and we can see that using some trigonometry we can get a bearing and that is that is like surprisingly smooth that is impressively like free of like any kind of jitter or or noise it's a very very flat line yeah it's satisfying isn't it yeah so at the moment we can point this around to what is true north and we can see that this office has got a bit of magnetic um disturbances in it yes we got this little pair of tweezers here i wonder if i wonder if they you know yeah just moving those tweezers around the sensor is is changing that heading there's clearly something happening where if you have some like metal around it will it will interfere with that reading so if moving just this pair of like they're not magnetized but they are ferromagnetic just moving this pair of tweezers around is affecting the reading like there's there's metal on this board there's like metal in these connectors and these capacitors and resistors surely surely they're going to have some effect as well what's going on with those yeah so i mean all capacitors have got trace elements of i that you just um have to live with so how do you how do you calibrate a sensor like this like what what's the what's the procedure okay well let's just look at the procedure for for an x and y direction and we'll forget about the z direction okay so we're calibrating for a for a compass you know you hold your compass flat on earth so that's yeah that's fine that's right um so what you would do is is you grab your magnetometer and rotate around slowly so we're getting all readings of both the x and the y component and we do a full 180 and if we were in calibration mode then then the sensor then the raspberry pi pico logs all of that data and then runs a calculation and it runs a calculation where it looks at the maximum and minimum values that it just observed and stores the average auto file on the raspberry pi pico so this is a reading that we took when doing a few rotations in the x y plane of our magnetometer and the top one is the is the x reading for the magnetic field strength and the bottom one is the y reading and as you can see one lags the other in phase by about 90 degrees well it looks like 90 degrees that makes sense yeah so on on this data you can see zero is right down the middle of that plot and these readings are heavily offset heavily offsets so like in an ideal in an ideal world these would both have like a zero dc offset that would both be just oscillating about that zero point that's right and we designed this carefully so that we don't have these offsets right off the bat so out of the box these capacitors these decoupling capacitors are spaced a little bit further away than you might normally space them for decoupling an ic right with decoupling you want to get the capacitor as close as possible to the chip that's right so on this particular case well there's little bits of iron in those capacitors and we wanted this thing to be the best experience out of the box without calibration so they're spaced a little bit back the tracks are a little bit thicker but those readings on that graph look like it's shocking yeah that's that's that's seems quite poor like the the x-axis it doesn't even make it to zero at its lowest point that's right so i was um so what's going on there well in our lab brenton came up and got this magnet and just mashed the back of it with it for only about two or three seconds this is um it did a little damage and you can see that by a complete uh like huge dc offsets there on the magnetic field strength so this raw data where you're taking it through a few full revolutions once you once you take those max that maximum and minimum value of each axis you wind up with that that's right so the for the end user using this device after they've calibrated then the readings just come out exactly like that without them without having to think twice right but this this is still just raw like x y like magnitude data like x y field strength data this isn't a heading yet that's right so it's corrected first so we've added this correction and then we could do it through the magic of trigonometry the magic of trigonometry yeah we can get a bearing so what are we looking at here so this is uh the same data of us rotating the sensor around um but this is post calibration so this is this is actually the same data set that we started with right but we're using the same algorithms that the user of this device would use but we've just simulated it in octave right so when the when the user calls like get heading or compass.getheading without calibration they'll get they would have got this like pretty shocking red line which goes from i don't know what positive 25 to negative 80 or so so and that that was a full revel that was a full revolution so answer and then by by performing that offset you've now got this like this beautiful 180 to negative 180 sweep as you rotate it around that's right so um we're in the library we're adding um the normal reading which is the calibrated reading um option but also you can get the raw readings if you want as well to see just just to experiment and yeah see what the performance is without calibration and you can compare and play this is me moving the in here that is awesome you're moving like 10 millimeters and you've got resolution across that whole 10 millimeters yep and i'm all and i'm about what about um 150 millimeters away from the sensor right now yeah like at least at least a 100 mil that is amazing so this has got a really cool use case or a bunch of use cases you weld your oyster you could um sense things that are a non-line of sight proximity sensor yeah how far out how far can you take it on this side let's drag it away there we go look at this so we're about what about 20 i'd say we're getting 200 mil we're getting close to 150. oh hurry up let's just go faster that's okay so look at this we're sensing about 200 ml no more so you're moving like the width the width of the nut that's on the end of that stack of magnets and you're able to to detect that yeah that's fun isn't it i guess that answers the question like why might you want raw data because you know like oh magnetometer like of course you just want to use it as a compass but this is actually this is pretty cool you could use this as you know a really really smart hall effect sensor with like tunable in in and out points yeah that's right you could have a whole bunch of thresholds and you could yeah you could almost use it like an analog situation you'd have to um take the earth around any field into account when you're setting up your project a little bit what happens if you turn the magnet around let's have a look look at that so you could you could detect you could detect a rotating shaft yeah from that far away i think we're about 300 mil now that away that's pretty cool yeah pretty cool identity and magnets but uh you know you could uh but that's that's a sweep of like let's just try with one i'll have to take that away yeah i have to put them on the other side of the office that's just with one of those something something that kind of makes intuitive sense but it's like pretty amazing to see is when the magnet is sideways so it's like coplanar with the sensor you can move that magnet around and nothing happens but then when you flip it up you get that disturbance yeah that is i mean of course that makes sense like the field lines are going through the axis that we're not reading that like what a what a great demonstration of how well isolated the axes are like the cross coupling between the axes is that's right and you can experiment by reading x y and z all separately and seeing what values you get for the for various positions of magnets and it's going to have some ideas for the tutorials yeah thanks for joining us for that little fireside chat about probably more than you wanted to know about a magnetometer thanks for joining me theater it's been fun if you if you have any questions or if you just want to see something a little bit closer hit us up on the core electronics forums until next time thanks for watching [Music]
Info
Channel: Core Electronics
Views: 6,122
Rating: undefined out of 5
Keywords: How To Use A QMC6310 Magnetometer To Detect Bearing, How To Use A QMC6310 Magnetometer As A Compass, How To Use A QMC6310 Magnetometer, Digital Compass, Electronic Compass, How To Detect Magnetic Fields, Reed Switch, Electronic Reed Switch, Raspberry Pi Pico Compass, Raspberry Pi Pico Magnetometer, Raspberry Pi Compass, Raspberry Pi Magnetometer, Micropython Compass, Micropython Magnetometer, Compass, Magnetometer
Id: 5S36KBI_TpI
Channel Id: undefined
Length: 11min 9sec (669 seconds)
Published: Thu Oct 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.