User position from GPS Satellite position ? - Page 1
Forum section: electronics / beginners

author: ammjy
author_rank: Regular Contributor
timestamp: June 24, 2019, 09:29:52 am
content: Hello, EEVblog peoples ! always thanks you for your kind help.I have a question about define user position from GPS Satellite positions.Now, I have following data.GDOP1st Satellite X, Y, Z coordinates and Pseudo Range of 1st Satellite.2nd Satellite X, Y, Z coordinates and Pseudo Range of 2nd Satellite.3rd Satellite X, Y, Z coordinates and Pseudo Range of 3rd Satellite.4th Satellite X, Y, Z coordinates and Pseudo Range of 4th Satellite.I have tried already for one week. but, Still I couldn't define and calculate the user position.I have used following information to calculate.pr = sqrt( (x-X)^2 + (y-Y)^2 + (z-Z)^2 )(https://www.math.tamu.edu/~dallen/physics/gps/gps.htm)might be, only with these information, define user position is impossible ?Please, let me know !

author: hamster_nz
author_rank: Super Contributor
timestamp: June 24, 2019, 09:31:54 am
content: Yes, it is possible.How did you go from the time of transmission.to pseudoranges if you don't know your location (or at least a rough approximation).Have a look at....https://github.com/hamsternz/Full_Stack_GPS_ReceiverAnd instant message me!

author: ammjy
author_rank: Regular Contributor
timestamp: June 24, 2019, 10:12:10 am
content: Hello, Mr. Hamster_nz !Thanks you for your time. and I really appreciate it for your kind, Open help !Mr. Hamster_nz, If you don't mind, Could you explain it to me in more detail ?"How did you go from the time of transmission.to pseudoranges if you don't know your location (or at least a rough approximation)."I have recorded at a fixed position.Again, Thanks you for your time and kind help, Mr. Hamster_nz.

author: hamster_nz
author_rank: Super Contributor
timestamp: June 24, 2019, 10:31:40 am
content: Quote from: ammjy on June 24, 2019, 10:12:10 amIf you haven't been handed the data from somebody else, when you are tracking the Space Vehicle (SVs) you will end up with their orbital elements (ephemeris), and be able to compute the time on the SV.Using the time, you can calculate the Earth Centered, Earth Fixed (ECEF) position of each of the SVs, at the time of transmission.You can treat these as a set of linear equations, and work out approximately where you are.Only then can you calculate your pseudoranges - (and yes, it is the XYZ of the SV less the XYZ at the approximate position). This should be within about 100m of the position. And yes, you can verify them by checking that the distance between the SV and position divided by the speed of light is close to the difference in time from the fix and the space vehicle.Code:Location is ( 10796441.72686, -11059550.95575, 21468769.87626) @ 466786.68844515Location is ( 25624920.03297, 5493913.05874, 6376813.14970) @ 466786.68314817Location is ( 17562608.84385, 17600783.06751, 9306656.31975) @ 466786.68228779Location is ( 12436678.35329, 8851464.38357, 21813028.15234) @ 466786.68876178Location is ( 18466438.20510, 6615544.19174, 17512994.82941) @ 466786.69042944Location is ( 20893698.98803, -8968194.45015, 14090804.00502) @ 466786.68741330Solved is ( 3851785.003462, -78309.097013, 5066312.772752) @ 0.003504 (alt 6364739.204313)Lat/Lon/Alt : 52.934773, -1.164697, 176.8You can then tweak the pseudoranges to make up for ionosphere delays and other known errors, as you now can calculate how high the SVs are in the sky, so the distance that the GPS signal has traveled through the ionosphere and troposphere (that slow the GPS signals down a small amount).You can then solve again to get the more accurate fix.

author: hamster_nz
author_rank: Super Contributor
timestamp: June 24, 2019, 10:47:48 am
content: I've made a Google Sheet that verifies the data in the repo's README file (and I corrected the formatting of the data in the README too - opps!).It uses exactly the method you suggest. Sadly the time numbers in the README are only shown to 4 decimal places (or about 30km at the speed of light), but shows the method works. If really important to you, I can run some more data through it and change the formatting.https://docs.google.com/spreadsheets/d/1-Zr-zA_fjM5zkbI52VVZSKTwKG9y_nBK9lxuGVhszeQ/edit?usp=sharing

author: ammjy
author_rank: Regular Contributor
timestamp: June 24, 2019, 10:58:50 am
content: Thanks you for your kind help, Mr. Hamster_nz.I have no words to express my gratitude for your kind help, Mr. Hamster_nz.Thanks to you, I can try solve this work again.I will leave my result here for another person's.Again, Thanks you for your time, and hlep. I appreciate it !!

author: hamster_nz
author_rank: Super Contributor
timestamp: June 24, 2019, 11:06:51 am
content: Quote from: ammjy on June 24, 2019, 10:58:50 amYou are very welcome.The math in GPS is a house of cards if you make one wrong step in your math along the way things go very bad very fast, with no workable solution. All you need is a '-' where you should have a '+' (e.g. mix up East and West, or get the phase of a correction value inverted) and everything becomes unsolvable.If you need my help to verify any of your intermediate calculations let me know. It took me ages to get my code working, and would not have been able to without the breadcrumbs and hints that others had left - most notably Andrew Holme & his project athttp://www.aholme.co.uk/GPS/Main.htm

author: ammjy
author_rank: Regular Contributor
timestamp: June 24, 2019, 11:25:44 am
content: Thanks you again, Mr. Hamster_nz !Yes, I will ask to Mr. Hamster_nz !