Вы находитесь на странице: 1из 3

ASEN 5090 Introduction to GNSS Fall 2010

ASEN5090_Expected_Range_UPDATED.doc (10/29/10) 1
COMPUTING EXPECTED RANGE - UPDATED FOR CLARITY
(HOPEFULLY)

This assignment takes the next few steps in putting together the codes for a least squares position solution. It
accomplishes three main things:
Correctly computes the expected geometric range from the GPS satellite at the time of transmission to the
receiver at the time of reception.
Computes the pseudorange correction for relativity. It is based on the ephemeris data and will be used in the
next assignment to correct the measured pseudoranges.
Reads observation data directly from a real RINEX observation file. In the previous homework you used pre-
digested observations that were already converted from the RINEX obs format to a MATLAB loadable matrix.

GEOMETRIC RANGE CALCULATION
In the previous homework you computed the expected geometric range based on the distance between the GPS
satellite position and the receiver position, at the time of reception. The time of reception (also called receive time)
is the measurement time reported in the RINEX observation file. The GPS satellite positions in Earth-fixed WGS-
84 coordinates were computed using the broadcast ephemeris data. In this assignment you are to calculate the
expected range more carefully, accounting for two additional factors - namely, the actual time of transmission of the
signal and the rotation of the WGS-84 coordinate system during the time of flight. The algorithm for computing
geometric range was given in the lecture notes and is included at the end of this assignment.
1. Write a function compute_range.m that takes as input the ephemeris data, a PRN, the receive time in
GPS seconds of the week, and the assumed receiver position coordinates in WGS-84, and returns the
expected geometric range (in meters).
[range] = compute_range(eph, PRN, t, userpos);

This function should implement the geometric range algorithm by calling the get_GPS_pos function
that you wrote for the previous assignment. Remember that get_GPS_pos computes the position of
the GPS satellite at the requested time in the WGS-84 coordinate frame at that time. To compute the
geometric range correctly you will need to use get_GPS_pos to compute the position at the time of
transmission, then, rotate this position from the WGS-84 frame at time of transmission to the WGS-84
frame at the time of reception.

2. Use your new function to compute the geometric range for PRN 6 at a receive time of 543390 s and the
receiver coordinates from the previous homework. Give your answer to millimeter precision. Do the same
calculation with your old function from last week and compare the results. (If you had an error in last
week's assignment, please correct it first.) Does the difference in the results make sense?

RELATIVISTIC CORRECTION
3. Write a function compute_relativity.m that takes as input the ephemeris data, a PRN, and a time of
interest and returns the relativity correction (in meters).
[relativity_correction] = compute_relativity(eph, PRN, t);
(Hint: Start with your get_GPS_pos code - all you need is the eccentricity and the eccentric anomaly
for the requested time t.)

4. Use your new function to compute the relativistic correction in meters for PRN 6 at time =543390. Give
your answer to millimeter precision.

READING RINEX OBS FILES

Review the notes on RINEX files and use a text editor to see what the sample observation file looks like.
In this section you will write a script to read in 100 epochs from the observation file and create a matrix containing
the time and P1 value for a specified satellite. You can check your results by comparing to the pre-digested file we
gave you for the last assignment.
ASEN 5090 Introduction to GNSS Fall 2010
ASEN5090_Expected_Range_UPDATED.doc (10/29/10) 2

5. To read data from a file you first open it and create a pointer to the file. This pointer keeps track of where
you are in the file, and as you read things from the file, the pointer is advanced. When you close the file
the pointer is lost. If you open it again, the pointer will reset back to the beginning of the file.

Use fopen to open the RINEX file, storing the file ID (fid). In this assignment we are reading the file called
"usn32860.edit".
fid = fopen('usn32860.edit')

6. RINEX files start with a special header. A function called ReadObsHeader.m is provided to help you
read this. It returns the receiver position given in the header and a list of the observations that are included
in the file:
[rec_pos, ObsTypes] = ReadObsHeader(fid);

How many types of observations are available in the sample file? Which one is P1?
You can use these commands to answer these questions (check your results by looking at the header in a
text editor):
numobs = length(ObsTypes);
P1loc = strmatch('P1', ObsTypes);

You can use similar commands to find the right columns for any other observables of interest (C1, L1, etc.)

7. Read in the first epoch of data and output the P1 pseudorange for the first satellite. What PRN is it?
To read one epoch of data, use the function we provided: ReadObsRecord.m:
[Epoch, Data] = ReadObsRecord(fid, numobs);
This will read in all the observations for all the satellites at one epoch (time).
"numobs" is the number of observation types on the file as specified in the header.
If you only want to read data for a specific PRN you can use this:
[Epoch, Data] = ReadObsRecord(fid, numobs,PRN);
Look at the outputs. Epoch is the time of the observation. Data is a structure containing the PRN, the
observation values, and two other things that we are not interested in.

To pull out the PRN for the kth satellite you do this:
PRN = Data(k).PRN;
To pull out the P1 data for the kth satellite you do this:
P1 = Data(k).Val(P1loc);
8. To work with the observations we need to find their time in GPS week and TOW. Convert the Epoch from
the RINEX file to GPSWeek and TOW using the GPSweek function that was included in an earlier
homework. (You'll need to modify the year to be the full 4 digit year.) Output the GPS time for the first
epoch on the file.

PUTTING SOME OF IT TOGETHER
9. Using the functions & script sections you wrote above, write a script to do the following:
- Read the first 100 epochs of data in the observation file and extract the GPS time and P1 measurements
for PRN 6.
- Compute the expected geometric range for each of the observation times.
- On one graph, plot P1 (red) and the expected geometric range (blue) as a function of time.
- On a separate graph, plot P1- the expected geometric range (blue) as a function of time. (This should look
pretty similar to what you got in the previous homework, but now you've done the work to actually read the
RINEX file directly.)
- Output the mean value of P1 - expected range.
Computing the geometric range:
The geometric range of interest is the distance between the position of the GPS satellite at the time of transmission
(Tt) and the GPS receiving antenna at the time of reception (Tr). To compute this distance, both positions must be
represented in the same coordinate frame - we use the ECEF coordinate frame at the time of reception (Tr).

ASEN 5090 Introduction to GNSS Fall 2010
ASEN5090_Expected_Range_UPDATED.doc (10/29/10) 3
STEPS FOR COMPUTING GEOMETRIC RANGE

1) Compute the GPS satellite position in ECEF at Tr based on the broadcast ephemeris (get_GPS_pos).

2) Use an a priori value for the receiver coordinates (RX) to find geometric range R =|r
GPS
r
RX
|.

3) Compute the time of transmission: Tt =Tr R/c (use the real speed of light, NOT 3e8)

4) Compute the satellite position at Tt in ECEF at Tt based on the broadcast ephemeris (get_GPS_pos).

5) Rotate the satellite position to ECEF at Tr. (
E
is the rotation rate of the Earth)


x
y
z
|
|
|
|
|
|
|
|
|
|
|
|
ECEF@t
R
=
cos sin 0
~sin cos 0
0 0 1
|
|
|
|
|
|
|
|
|
|
|
|

x
y
z
|
|
|
|
|
|
|
|
|
|
|
|
ECEF@t
T
where
= c
E
t
R
~ t
T
( )


6) Compute a new geometric range using this position for r
GPS
, R =|r
GPS
r
RX
|.

7) Repeat steps 3-6 until convergence. (If it takes more than two iterations, something is wrong).

Вам также может понравиться