GPS module showdown do-over with full precision and two more modules (Neo-6M and BN880Q)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello i made a video last week where i tested a bunch of gps modules and made some charts to see how well they performed compared to each other but unfortunately i made a bit of an oopsie uh quite a large oopsie actually like two orders of magnitude oopsie and i first started to think something might be a little bit odd when i saw these values uh coming in from the gps and there weren't very many unique values so you can see this is for the 7m i think it was or the bn220 maybe but this is the entirety of the unique values that we got and also when we look at these heat maps they are pretty coarse there's not much fine detail in them the fact that these pixels let's call them were elongated i wasn't too surprised that they were elongated but i didn't expect them to be that elongated uh and another thing that was a little bit weird was that when we look at the difference in fluctuation between latitude and longitude so that's latitude there it sees moving a lot i mean it's moving often by small values and then if we look at the longitude it's moving not so often but by slightly larger values so there were a number of things that didn't quite sit right but mostly i put it down to the fact that i'm down here at the bottom of the world in new zealand where there are less meters per longitude degree and in fact i mentioned something about that but i also mentioned what's up with that uh in the fact that um the elongation was the other way around like basically this difference in fluctuation was the opposite to what i would expect if this was caused simply by the fact that we are down here in new zealand so there were some suggestions in the comments on that video um about things like maybe satellites moving around could cause it or something like that but it wasn't until i saw this post by wizard tim something to do with monty python maybe uh that put me on to the correct answer which was that i should not have been using single point floating uh single precision floating point numbers i should have been using doubles and i don't know why this slipped my mind because i came across this problem when i was using the rtk modules a few years ago i had to use doubles instead of floats but for some reason this time it just completely slipped my mind so i figured i should probably make a follow-up video using some real results which is what this video is about and along the way i improved a few things like we're using 10 hertz data now instead of one hertz i added two more gps modules so there's eight in total the new ones are the neo6m and the bn80q so we have four microblocks and four bayesian modules sort of competing in teams against each other and the charts that i made now show using units of meters instead of just a lat long number because there were some comments saying that uh would be more useful to see in meters the distances but before we look at the results i wanted to dive into the details of what went wrong with the floating point number stuff because it might help somebody to avoid that problem in future so i'll put a little time uh thing on the screen here where you can skip to if you don't want to hear about this but the first thing i saw here that uh really set off the the warning bells in my brain was this mention here from tim about 100 thousandths of a degree not really being that much and he's perfectly right of course if we look at the information provided to us from the gps module we'll see that it is a value scaled by 10 to the power of 7 which is uh 10 million not a hundred thousand so there's the two orders of magnitude inaccuracy that i was talking about so this uh this value is not a floating point number it's an integer um this means it's a signed four byte integer or 32 bit integer and so let's take a look a bit of source code here so these two values here would be what you get directly from the gps and to look at that in what we would call decimal degrees uh would it those would be the numbers that it's actually representing but it's scaled by one two three four five six seven digits and the reason it does that is because if it was to give us a 32-bit floating point number like that it would lose a whole lot of precision um now i'm a computer science graduate so i really should have been keeping this thing in mind a lot better than i was but what happens when you use a floating point number is you only get it says the total precision available is only 24 bits because you're using up eight bits with this exponent and i think this is also used to represent not a number and special numbers like that but you only got this 23 bits here and then the sign is effectively used as well but if we look at some numbers that you can represent with that let's just get my source code example so let's say this was the number that the the two numbers that the gps module gave us so let's put these in here on a spreadsheet which is this is how many bits we have and this is the maximum value that can be represented with that number of bits and if we take the two numbers here that we were looking at for our example there we see that this one's going to require somewhere between 28 and 29 bits to represent and the other one because it's larger it's further away from zero it's going to take actually 30 to 31 bits to represent so neither of these numbers can be represented with the 24 bits that are available to us in the floating point precision single point single precision floating point number it just can't be done so we're throwing away some of the precision and it how much of it we're throwing away depends on how large the number is so here in new zealand we're dealing with numbers like this where the longitude is quite a bit more uh quite a bit larger number in degrees than the latitude like this so that's why the latitude seem to be a little bit more accurate than the longitude and what happens here if we take this float and we divide it by 10 million we'll get something actually like that so i've just made this six just to exaggerate the problem a little bit i've just just taken six significant digits there and also this one significant digits it's not quite that bad you don't lose that much precision because one bit of data can represent two values but whereas one decimal place can represent 10 values so just because you've lost one bit doesn't mean you've lost one decimal place it's not that bad but anyway you'll lose a significant amount of data there and the other thing that's kind of confusing i just put this bit here at the bottom if you take this floating point number and you print it out to say 15 decimal places you'll get a number like that and this is a bit misleading for newbies and me too apparently just because you don't see the number stop there like it doesn't go it doesn't go like zero zero zero after that that doesn't mean that that number is actually an accurate number of high precision it just means that you're looking at the closest floating point value that could be mapped at that resolution anyway so that was a bit long-winded but the simple fix is you just do this you just use doubles instead that's maybe not quite so simple on some architectures where it slows everything down a lot but for stm32 that doesn't seem to be a problem at all so that's all i really had to do uh actually there was one other thing i'll just look at the the sketches that are running on the s bus mixes for this so now that we have eight gps's i had to drop the speed value so we're only looking at uh lat long satellites and altitude so i've got four values times eight is 32 so there's 32 floating point numbers traveling down this daisy chain between all of the four s bus mixes and i had to change or i had to add an option here so that as well as the normal latitude and longitude which is what i was using before which will give us the floating point number with some precision lost i added these options so that it would just give you the raw integer value that the gps was providing so that you wouldn't lose any precision it makes things a little bit awkward for the way the system's set up because each of these nodes outputs a single floating point number so if i turn this live value on well there's nothing connected at the moment but if there was a board connected this would be updating in real time showing us the value and when you're using this integer version it just shows you some messed up number so you can't use this live feedback but it's going to have to be necessary if we want to get the full resolution of things so this this one here is the first board in the daisy chain so we've got the uh the four values there or eight values sorry and then this is board number four but at the bottom is all same and then we just have 24 values coming in from the other modules that have all been passed along we saw this in the last video so i won't really go into too much detail about that it's just that we have four boards instead of three now so after making that change i did just a quick little five minute test the result on the left here is one of the ones from before this is like i think two maybe four hours of results the one on the right i think is less than five minutes uh at 10 hertz so you can see where i've been walking around like this and when i saw that i thought oh i'm really going to have to do this again properly aren't i see this is how the weather works in new zealand 30 minutes ago i went out there and i put the test subject on the fence with a bit of plastic over it can you believe i was thinking i might not even need to put the plastic over it because there was barely a cloud in the sky everything was fine sunny and then like 30 minutes later we got this it's getting really annoying it's hard to find a break of more than about 40 minutes or so without rain it makes a nice rainbow doesn't it look at that looks it doesn't look very nice on camera it looks quite nice in person yeah so this time instead of racing out there and trying to rescue it i thought i'll just leave it i'm getting sick of it i'm just gonna see how it rides out this rain with that little bit of plastic on there not really holding my hopes up but i'm just getting so sick of it let's see what happens and the other thing is i know it's only going to rain for about 10 minutes at most it's really annoying it's not proper rain it's just the rain that comes around to annoy you see what i mean three minutes later it's gone everything's okay now eventually the weather cooperated enough that i could do a 10 hour test so that's what we're going to look at for the remainder of this video this is the satellites used and the 6m is not picking up really that many and as we saw in the last video it didn't really seem to make a whole lot of difference although as you'll see in the rest of the results the 6m really didn't perform very well compared to the other ones this is the altitude i'm using height above sea level this time instead of the ellipsoid so that's why it's changed from about 100 and something down to 80 but otherwise than that it shouldn't really matter too much and again the 6m has a few altitude spikes fairly frequently actually um and the other one what's that one bn180 also not performing too well in altitude and since these are on top of each other i'll separate them out and i've listed the micro box modules at the top and then the bn ones at the bottom again and now we can see yeah bn 180 is not too great and 6ms not too great all the other ones not bad actually now we have latitude fluctuation once again 6m is probably the least accurate by the looks of it uh what's the light blue one bn220 doesn't do so great and sometimes some points as well and then if we separate those vertically like we did before now the comparison that we want to make here is with longitude so this is longitude fluctuation and latitude fluctuation i'll just flip between these a little bit but notice that now that we're using the proper precision they look about the same like one of them like we don't have the situation where one of them is more stable looking than the other they both look about the same so that's good now that i'm measuring or calculating the distances in meters rather than just showing that long numbers i was able to look at the average distance from true now the true is what i'm calling the average of every single measurement across the whole 10 hours and as i mentioned in the previous video we don't really know if that's exactly the the perfect number but given that we've sampled i think it's 2.7 million values across 10 hours from 8 different gps's i think it's pretty safe to say that this is a good estimate of the true that long anyway so the average distance from the true for that eight hours in meters is shown here and all of these graphs actually they're separating into two distinct levels so we've got the m8n m8p and 7m all perform quite well on the same level or similar level and then all the other ones are in a different level so all of the beijing modules are not so good and the 6m is in with them as well actually the 6m is kind of worse than the beijan modules in a lot of respects over here we have the longest distance from true that was recorded during the whole 10 hours so the m8p does very well here about 3 meters and the 6m up to 10 meters away in some cases uh others similar very similar actually the bayesian modules in this one and then we have latitude standard deviation and longitude standard deviation um in meters this time like not just the long degrees so moving on we have the heat maps now we've got way way more resolution in these heat maps this time um and i improved my procedure for processing these results so that i could do this stuff a lot quicker and much of it was automated now it's really nice having everything in one file so that i can just hit one command and all of these maps will be generated with different parameters anyway um so this what we're seeing here is a perfect white pixel for any location that was ever measured across the whole 10 hours and as before we've got microblocks in one row on the top and basin modules along the bottom and the most noticeable point about this for me is that the 6m is not really at all in the same class as the seven and eight modules from microblocks the basin modules are all pretty similar except the 880s do overall a fair bit better than the 180 in the 220. oh and i should mention that the crosshairs here show the average of all of the measurements for all of the gps's for the whole test so this is like the true location there and these little green markers on the graph axis they are in meters now and you'll notice they're pretty much equal now we don't have any elongation and moving on to the actual heat map so this is scaled so that the point with the highest value is going to be white in every case so there should be one point in each of these maps that's pure white and then the rest of it scales down to black where there was nothing recorded and we can also see now that we have some kind of vertical lines appearing a little bit in some places and i don't mind that i think that's okay it's it doesn't seem out of the question that some values would be preferred more than others when it comes to these floating point precisions but now we do have every every pixel shown here is a unique value that was reported by the gps uh yeah anyway so these these elongations are going vertical now which also makes sense before they were going horizontal which i think i just mixed up like long when i was drawing those graphs but this graph here doesn't really show you much of the full travel of the values that reported so i made this other one like this which is the same as the heat map except it's lifting the floor of the values so any point that ever had a gps recorded is not allowed to be pure black it has to be i think 0.1 brightness and then all of the values are scaled between 0.1 and 1. so we can we can still see the heat map but we can also see the full travel of everything as well and i think this one's probably if you were to summer sum it up in one graph this is probably the easiest one to visualize what's going on okay we finally got some nice weather and i've set up all of the eight modules there with the 6m support now and i'm just going to do a little walk down there which i think is about east as east as i can get it and then up there and what i've noticed is that just by holding this out at my arms length like that so that the modules are probably about a meter away from my chest i can turn around like that and we can actually see the um circle that it draws so let's go yeah i think this should be about east and i'm not walking very fast here so the 10 hertz rate at least in the tests that i did the other day was enough to draw a continuous line so let's stop here for a second and i'll hold it out as far as i can get it and we'll just do a nice circle on the spot like that and seems like even the 180 can keep up like i mean it can it draws that circle reasonably well oh yeah and i found yeah you can do this too swing it around a bit not a full circle but let's uh stop over this little thistle unlike the last farm i lived on there's hardly any of this stuff here that other place they really didn't look after very well but this uh this farm keeps on top of things okay i'll just stop there because i'm gonna come back to that in a minute and i can like turn around stop and oops let's just go a little bit over here so i can clear away from that spirally bit that i did and turn this way a little bit faster and then i'll go back to the thistle approach it from this side a bit and see how well we can stop exactly on there we're kind of doing that with the the point where we put it on the gate anyway aren't we all right that'll do let's now approach it from actually i don't wanna i don't wanna walk over where i did the other circle so let's just let's just go back to the gate i think that's good enough and i am of course going to put the plastic on again because we saw what happened yesterday you never know it could be raining in another i wouldn't be surprised if it's raining in another 20 minutes okay hopefully that was a fun little demo now i'll just keep that playing and watch as it continues here there's a couple of interesting things to note one is that the bn220 and the bn880 after the movement stopped those two seem to spread away it's almost like the movement helped them be more accurate and the rest of the modules they don't seem to really be affected that much and in particular look at the m8p it's just really sitting there really nice and accurate isn't it and just in case it wasn't clear these little dots that are shown in the trail here these are the actual measurements that were received for each module and i've just connected these with lines to show the trail and faded it out over i think like 50 measurements or something 30 i don't know but you may have noticed that they're not always coming in equal spacings and in particular this white one here is a good demonstration of that so these points here are spaced out more than those ones whereas some of the other modules are keeping up a much better pace so this pace here the one at the bottom there that's the full 10 hertz speed and it looks like the white was only transmitting at five hertz for a while there but that's not the fault of the gps i think that's just to do with the way this daisy chain works so remember we've got a bunch of uh connections going all through like that before they get to the sd card and the connections between each one of these s bus mixes is going at 25 hertz but the value from the one in the beginning of the daisy chain has to get through three other modules to get to the last one so i think it's just something to do with that timing that it's just a little bit delayed or the time that it's passed getting passed from one to the other it hasn't quite received the one coming in or something like that i think if we were to measure these all on separate s-plus mixes so that they were going directly into the sd card from the same module they would all be showing at a proper 10 hertz speed like that one at the bottom okay let's have a look at some plots for that little adventure and i've taken away the crosshairs in the center because we're not really interested in the relation of this to the so-called true value for the full 10 hours but i've left the axis markers on the side here so these are one meter markers and as we expected those little circles i drew i was expecting those to be about two meters or so given the length of my arms and then a little bit extra for that piece of wooden board that i was holding it's about one meter or so so it seems to match up fairly well with that and they are nice and circular there's no elongation so that kind of confirms that i've got these axis ratios correct also down here nice and circular and this is the m8p that we're looking at this is overall by far the most accurate and we can see that in two points one is that the start and finish location which was the same place on the top of the gate is matching up very very nicely there for this one and also the fact that the line going through these circles is right in the middle of it which is exactly how i walked because i was holding the board in front of me and then i stopped and turned around and did a 360 like that and also here i did that as well this point where i stopped over the thistle we did go back there but it's not it's not really that easy to tell how well it matched up there fortunately this one here i wasn't thinking about it at the time but that point on the gate was a good reference to see how well it goes back to the same point that it was before all right let's have a look at some of the others this is uh m8n i'll just i'll just go through these one by one um none of the other ones are even well i was going to say not even close but they are close to the m8p but they're all off a little bit anyway that's m8n doesn't quite manage to go back to the beginning the circles are nice uh then we have the 7m this one does seem to go back to where it started but the circles are not so nice and if we look at the m8p in comparison this circle down here in particular is in a fairly different place let's look at the 6m doesn't go back to where it started this is looking a bit wonky here so now we can see this is the point over the thistle where i went back to so this is this on the first second pass and then i'm not really oh it's probably here actually this is the first time i stopped over the thistle so those didn't even match up for the 6m whereas it looks like they they pretty much did for most of the other ones yeah so the 6m overall um it's coming out the loser in this comparison really isn't it bn 180 not too flash i'll just pop the m8p back on again like that all right uh in 220 and i'll just briefly flash up the m8p again as like a reference because we need to sort of have something to compare it against otherwise it's just sitting out there in open space uh well we can see that this doesn't match too great the spot over the thistle is okay by the looks of it circles are a bit off this is strange isn't it like we didn't get the line going through the middle of the circle there at all like it's like way off the side that one's okay um next one is being 880 bit of a wonky circle there this'll point not quite on another wonky circle no match there this is the one with the active antenna so i would have thought that this would do a little bit better um considering that it has a nicer antenna and let's look at the 880q now this one does not have an active antenna but from what i can see oh that circle's a bit wonky this one's okay almost went back there thistle point looks alright compare it with m8p it's actually pretty good the the 880q did the best of all the beijing mod modules at matching up with the m8p in fact i think it might have done the best of all of them yeah i think it did actually this kind of strange isn't it actually there was a comment on my last video saying that the 880 uses the same like engine as the u-blox m8ns and i wasn't sure about that but now that i look at this maybe it does you know um actually let's look at the other 880 because it wasn't so great yeah that's the 880 with the active antenna looks like it's done much worse than the q which does not have the active antenna anyway um so let's have a look at just how these putting i put them in teams here so we've got the microbox modules are like ready red pink colors like that they match fairly well with each other apart from the six and oh no oh it's the seven m that's off there isn't it i was going to say 6m huh interesting the 6am is actually not doing too bad there oh no then it's over here it seems like they match in some places but then they don't match in other places so it's sort of skewed the 6m is way off up there um let's have a look at how well the bear shun modules match each other now none of these really match each other very well so for overall consistency the the green team is losing this comparison and just finally to put them all on it gets a bit difficult to see but just to show you what they look like all on the same screen together well that's it for this test sorry for the screw-up last week but all we can do is try and fix our mistakes right so in this test we didn't really learn a whole lot about relatively speaking which one of these is better we well we did see that the 6m is not really that good i was expecting the 6m to be better considering that the 7m was pretty good but it's not really fair the way i did it last time to the modules that do provide very accurate results because we're taking those accurate results and we're just smudging them around and messing them up it actually makes the good ones look not so good and the bad ones look not so bad i think but overall the the sort of the ranking hasn't really changed that much i think from these new results and the question of which one do you want to use on a radio control plane or a drone or whatever that that doesn't really change that much either i'd say probably the best all-rounder for the money looks like the m8n anyway thanks for watching and i'll just let the rest of this thing play out here i have not actually made this animation yet as i'm recording this voiceover so i don't know how many hours of animation this is going to be um probably about four hours or so it's probably not going to be the whole thing because there's a lot of data to process so whatever it is i'll just put on the screen how many hours it was or there'll be a timer showing yeah thanks for watching bye
Info
Channel: iforce2d
Views: 17,481
Rating: undefined out of 5
Keywords:
Id: abMoRJ-1ynY
Channel Id: undefined
Length: 29min 59sec (1799 seconds)
Published: Sat Jun 19 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.