GPS in motion or stationary



  • @Martinnn said in GPS in motion or stationary:

    ... If you have an android phone, you can use the "GPS test" app https://play.google.com/store/apps/details?id=com.chartcross.gpstest to check signal strength and see where the satellites are. ...

    My phone does not show the SBAS satelites on GPS test, I am not sure whether my Samsung Galaxy Note 9 has SBAS capabi;lity. It shows an accuracy of 8 meters (horizontal), which is normal for a signal without SBAS. Including SBAS I would expect 1 - 3 meteres accuracy



  • @PeterB Some time ago I was working with a ublox GPS module and sometimes could not even get a fix (cold start) inside a building. I had to use an active antenna to make this work. Maybe take your setup and go outside to verify it is not a signal strength issue. If you have an android phone, you can use the "GPS test" app https://play.google.com/store/apps/details?id=com.chartcross.gpstest to check signal strength and see where the satellites are.
    BTW the ublox eval kit software shows an insane amount of detail on GPS operation, so if you want to learn the finer points, this might be worth looking into.



  • @shaunix said in GPS in motion or stationary:

    @PeterB

    I get the speed from get_speed() I've noticed that in some testing locations I get better results so I need to start testing out on the road before I find a comfortable threshold to work with.

    I use the Haversine method to calculate distance in meters between 2 locations based on the previous read coordinates. Example: Haversine([lon1, lat1], [lon2, lat2]).meters

    I realize that the distance isn't going to be super accurate but 185m is way too high. I'm hoping I can get within 15 meters.

    I am testing inside a building but I'm right next to large windows with a clear view of the Northern sky. I get better results when near a window that faces South.

    Can you shed any light on the HDOP score? How can I use this to discard inaccurate results? discard and try again if HDOP > 2 (for example)

    Are you sure you have the correct input for the haversine function, i.e. fully decimal degrees or radians (depending on what the function expects on input).
    You can test your Haversine function with some test input: a distance of 1 degree in North-South should lead to a distance of 60 NM, or 1 minute (0.016666666 degree) in North-South direction should be 1 NM = 1852 m.

    If you are inside a building that could be an issue. Being near a window does not really matter for the normal GPS satelites as they can be anywhere around you and might be masked by the non window side of the buidling, including multipath reflections.
    For the geostationary SBAS sattelites being near a window on the south side (@Northern Hemisphere) will help. Then you can expect a much better result.

    For HDOP the next article might be interesting: https://web.archive.org/web/20140222000521/http://www.crowtracker.com/hdop-gps-position-errors/



  • @PeterB

    I get the speed from get_speed() I've noticed that in some testing locations I get better results so I need to start testing out on the road before I find a comfortable threshold to work with.

    I use the Haversine method to calculate distance in meters between 2 locations based on the previous read coordinates. Example: Haversine([lon1, lat1], [lon2, lat2]).meters

    I realize that the distance isn't going to be super accurate but 185m is way too high. I'm hoping I can get within 15 meters.

    I am testing inside a building but I'm right next to large windows with a clear view of the Northern sky. I get better results when near a window that faces South.

    Can you shed any light on the HDOP score? How can I use this to discard inaccurate results? discard and try again if HDOP > 2 (for example)



  • @shaunix said in GPS in motion or stationary:

    @PeterB Thanks for your reply! It helped me a lot.

    I started to use the library you suggested: https://github.com/andrethemac/L76GLNSV4/blob/master/L76GNSV4.py

    I love how I now have access to more information but now I'm experiencing dramatic spikes.

    Most of the time the data appears to be within expected ranges but I'm now seeing distances as high as 185 meters (using the haversine method for calcs) and speeds as high as 7.93km/h when stationary. And everything in between.

    This is difficult to rely on.

    I'm trying to figure out how to use HDOP to determine an acceptable level of accuracy so I can decide to throw away the result and try again until I get something acceptable but I'm not sure what time number represents. I've read that 1 is good. I seem to get under 1 a lot.

    Do you have any other insight that may help me on my journey to achieve accurate GPS results for my pytrack?

    Distances, speed? I hope you do not calculate speed bases on distance and time but get the direct speed signal from the chip via get_speed(). Only that one can be Doppler based as it is an internal calculation on the raw GPS signals.
    Also changes in location of 185 m is very high. Are you inside a building? That could cause some issues with reflections in the building. Do you have some free sight to south (supposing you live on the Northern Hemisphere) to receive SBAS signals of geostationary satelites. That woud increase accuracy a lot.



  • @PeterB Thanks for your reply! It helped me a lot.

    I started to use the library you suggested: https://github.com/andrethemac/L76GLNSV4/blob/master/L76GNSV4.py

    I love how I now have access to more information but now I'm experiencing dramatic spikes.

    Most of the time the data appears to be within expected ranges but I'm now seeing distances as high as 185 meters (using the haversine method for calcs) and speeds as high as 7.93km/h when stationary. And everything in between.

    This is difficult to rely on.

    I'm trying to figure out how to use HDOP to determine an acceptable level of accuracy so I can decide to throw away the result and try again until I get something acceptable but I'm not sure what time number represents. I've read that 1 is good. I seem to get under 1 a lot.

    Do you have any other insight that may help me on my journey to achieve accurate GPS results for my pytrack?



  • @shaunix Normally a good GPS chip calculates speed based on Doppler, not by dx/dt. By Doppler is much more accurate than dx/dt due its noise on dx.
    The library https://docs.pycom.io/pytrackpysense/apireference/pytrack.html does not seem to provide the speed signal from the GPS chip. Even other basic GPS infomation is not available from the standard library. But there are alternatives available reading NMEA data from the chip, including speed which will be Doppler based, as shown below. For the alternative libraries:
    https://github.com/inmcm/micropyGPS
    https://github.com/andrethemac/L76GLNSV4/blob/master/L76GNSV4.py

    The chip seems to be very modern: https://www.quectel.com/product/l76.htm
    including SBAS (WAAS/ EGNOS/ MSAS/ GAGAN) capability making it more accurate than the standard GPS
    The specification https://www.quectel.com/UploadFile/Product/Quectel_L76_GNSS_Specification_V1.5.pdf shows an accuracy of velocity of 0.1 m/s (0.36 km/h), that is only possible with Doppler based speed measurement.

    So if you use one of the libraries to read the speed signal from the chip and you see more than 0.36 km/h you can be quite sure the systm is on the move.



  • @shaunix It probably depends on the accuracy you need.

    Even when not moving, GPS coordinates will usually vary quite a bit. Not sure how the GPS on the Pytrack behaves in this respect, but I've routinely seen GPS receivers showing variations of over 10 meters while being perfectly still.

    If you want something more precise, the accelerometer is probably a better choice, but you'll either need to poll it more often or set it up to signal on movement, otherwise you may miss actually movement between polls.

    Also, you need to properly pick your thresholds, even in a car at standstill, there may be a bit of movement from passengers moving in the car for instance. Possibly even from vibrations from the engine, depending on the car and where the Pytrack is placed.

    As usual, YMMV and nothing beats actual testing.



  • Depends.

    The accelerometer consumes less power and will not need a GPS fix to work, so it can be used faster.

    TO detect the motion, you can either parse the matching NMEA sentence or calculate the distance between two points. Calculating the distance can be tricky, but you can assume a perfect ball for simple motion detection. Don't forget to use a delta dor comparing the distance. GPS will be allway in motion, if you compare only points.


Log in to reply
 

Pycom on Twitter