Electronic Navigation

kojoyirrah
  • 2 years ago
  • 50
files (2)

GPS_Project_Data_and_Functions3.zip

GPS Project - Data and Functions/ECEF2ENU.m

function enu = ECEF2ENU(ece,orgece,orgllh) %ENU = ECEF2ENU(ECEF,orgECEF,orgLLH) % % EC2ENU: Convert ECEF coordinates to East-North-Up with % respect to orgECEF and orgLLH (orgECEF is the same % location as orgLLH, orgLLH in radians). % % VARIABLES: % % OU-ECE-AEC Oct. 1988 FvG % WJP2011: Vectorized. Now accepts ece as a 3x1, a 3xM, 3xMxN, etc matrix % Rotate the difference vector into ENU coordinates sla = sin(orgllh(1,1)); cla = cos(orgllh(1,1)); slo = sin(orgllh(2,1)); clo = cos(orgllh(2,1)); C = [ -slo clo 0 ; ... -sla*clo -sla*slo cla; ... cla*clo cla*slo sla]; if size(ece,2)==1 && ndims(ece)==2; %3x1 vector % enu = [ -slo clo 0 ; ... % -sla*clo -sla*slo cla; ... % cla*clo cla*slo sla] * difece; difece = ece - orgece; % difference between coordinate origins enu= C * difece; else %3xM or 3xMxN etc %Vectorized ECEF2ENU function: enu=NaN(size(ece)); %reshape ece to 3xN matrix %ece=reshape(ece,3,size(ece,2)*size(ece,3)*size(ece,4)); ece=reshape(ece,3,[]); difece=zeros(size(ece)); difece(1,:)=ece(1,:)-orgece(1); difece(2,:)=ece(2,:)-orgece(2); difece(3,:)=ece(3,:)-orgece(3); for i=1:3 enu(i,:)=C(i,1)*difece(1,:)+C(i,2)*difece(2,:)+C(i,3)*difece(3,:); end end

__MACOSX/GPS Project - Data and Functions/._ECEF2ENU.m

GPS Project - Data and Functions/ECEF2LLH.m

function wgs = ECEF2LLH(xyz) %wgs = ECEF2LLH(xyz) % % This function converts cartesian (x,y,z) coordinates of a reference % point in ECEF to lat, lon, height coordinates in the WGS 84 system % % VARIABLES: % wgs - 3 by 1 array containing position lat, lon, height % (rad, rad, m) % xyz - 3 by 1 array containing position as x,y,z % (m, m, m) % % a - semi-major axis % f - spheroidal flattening % esq - eccentricity squared % sp - sine of lattitude % cp - cosine of latitude % sl - sine of longitude % cl - cosine of longitude % gsq - intermediate temp variable % x - cartesian coordinte in feet % r - intermediate temp variable % % This function is based on one developed by the % National Geodetic Survey, Rockville, Maryland. % % WJP2010: Vectorized. Now accepts xyz as a 3x1, a 3xM, 3xMxN, or a 3xMxNxO matrix wgs=zeros(size(xyz)); f=1/298.257223563; esq=f*(2-f); a=6378137; x = xyz(1,:,:,:); y = xyz(2,:,:,:); z = xyz(3,:,:,:); rsq = (x.*x) + (y.*y); h = esq.*z; for i = 1:6; zp = z + h; r = sqrt(rsq + (zp.*zp)); sp = zp./r; gsq = 1.0 - (esq.*sp.*sp); en = a./sqrt(gsq); p = en.*esq.*sp; %if abs(h-p) < 0.0005,break,end h = p; end; p = atan2(zp,sqrt(rsq)); h = r - en; wgs(2,:,:,:) = atan2(y, x);%*180/pi; wgs(1,:,:,:) = p;%*180/pi; wgs(3,:,:,:) = h; % wgs=zeros(3,1); % f=1/298.257223563; % esq=f*(2-f); % a=6378137; % x = xyz(1); % y = xyz(2); % z = xyz(3); % rsq = (x*x) + (y*y); % h = esq*z; % for i = 1:6; % zp = z + h; % r = sqrt(rsq + (zp*zp)); % sp = zp/r; % gsq = 1.0 - (esq*sp*sp); % en = a/sqrt(gsq); % p = en*esq*sp; % if abs(h-p) < 0.0005,break,end % h = p; % end; % p = atan2(zp,sqrt(rsq)); % h = r - en; % wgs(2) = atan2(y, x);%*180/pi; % wgs(1) = p;%*180/pi; % wgs(3) = h;

GPS Project - Data and Functions/EE4853-5853_GPS_PR.mat

L1PSR:[9x1 double array]

L2PSR:[9x1 double array]

PRNs:[1x9 double array]

SatPPP:[1x1 struct array]

  • [3x9 double array]
  • [9x1 double array]

SatBC:[1x1 struct array]

  • [3x9 double array]
  • [9x1 double array]

TruthLLH:[3x1 double array]

GPS Project - Data and Functions/ENU2ECEF.m

function ecef = ENU2ECEF(enu,orgece,orgllh) % ecef = ENU2ECEF(enu,orgece,orgllh) % % ENU2EC: Convert ENU coordinates to ECEF with respect to % the origin (orgece is the same location as orgllh). % % OU-ECE-AEC Oct. 1988 FvG sla = sin(orgllh(1)); cla = cos(orgllh(1)); slo = sin(orgllh(2)); clo = cos(orgllh(2)); ROT = [-slo clo 0; -sla*clo -sla*slo cla; cla*clo cla*slo sla]; difece = inv(ROT) * enu; % add the difference between the enu and ecef origins ecef = orgece + difece;

GPS Project - Data and Functions/LLH2ECEF.m

function ecef = LLH2ECEF(llh) % % LLH2EC: Convert lat/lon/height coordinates to Earth-Centered % Earth-Fixed (ECEF) coordinates (WGS72). % % Input: llh = lat,long,height location (rad,rad,user units) % Output: ecef = x,y,z (user units) % % OU-ECE-AEC Oct. 1988 FvG % WJP2010: Vectorized. Now accepts llh as a 3x1, a 3xM, 3xMxN, or a 3xMxNxO matrix %A = 6378135.0; % Earth's radius (m), old number from 1997 A = 6378137.0; % Earth's radius (m) per WGS84, CB %E = 8.181881066e-02; % Eccentricity, old number from 1997 E = 8.18191908e-2; % Eccentricity per WGS84, CB ESQ = E * E; % ecef=zeros(3,1); % % SP = sin(llh(1)); % CP = cos(llh(1)); % SL = sin(llh(2)); % CL = cos(llh(2)); % GSQ = 1.0 - (ESQ*SP*SP); % EN = A / sqrt(GSQ); % Z = (EN + llh(3)) * CP; % ecef(1) = Z * CL; % ecef(2) = Z * SL; % EN = EN - (ESQ * EN); % ecef(3) = (EN + llh(3)) * SP; ecef=zeros(size(llh)); SP = sin(llh(1,:,:,:)); CP = cos(llh(1,:,:,:)); SL = sin(llh(2,:,:,:)); CL = cos(llh(2,:,:,:)); GSQ = 1.0 - (ESQ.*SP.*SP); EN = A ./ sqrt(GSQ); Z = (EN + llh(3,:,:,:)) .* CP; ecef(1,:,:,:) = Z .* CL; ecef(2,:,:,:) = Z .* SL; EN = EN - (ESQ .* EN); ecef(3,:,:,:) = (EN + llh(3,:,:,:)) .* SP;

ENAV_Modules12and13_GNSS_Project_GPS_Positioning_ver012.pdf

PROJECT

GPS POSITIONING

EE4853-5853 ENAV Module 13 – GNSS – Part 2: User Equipment

In this project, you will be determining the receiver position based on GPS pseudorange measurements. You are provided with the satellite positions (corrected for earth rotation, in the ECEF coordinate frame at the time of reception), dual-frequency GPS code-phase measurements, and the position truth of the user. First, you are going to calculate the position without taking ionosphere and troposphere into consideration. Next, you determine the ionosphere delay using the dual frequency measurements, and apply the appropriate ionosphere correction to get a better positioning accuracy. Then you will calculate and apply the approximate troposphere delay based on the satellite elevation and user height. Finally, you will be further enhancing positioning performance by applying precise clock and orbit corrections.

Provide write-up and Matlab code Task 1: GPS error sources (10%) List all relevant GPS error sources, and their mitigation strategies (maximum 2 lines per error source) For the remaining questions, use Matlab. Load the attached EE4853-5853_GPS_PR.mat into Matlab. You should now have the following variables:

PRNs List of the PRNs in the datasets L1PSR GPS L1 pseudorange measurements [m] L2PSR GPS L2 pseudorange measurements [m] SatBC Satellite clock and orbit – from broadcast ephemeris. SatPPP Satellite clock and orbit – from precise ephemeris TruthLLH Truth position in [Lat;Lon;Height]. Lat and Lon are in radians,

Height in meters The following constants may be useful: Speed of light: 299792458.0 m/s GPS L1 frequency: 1575.42e6 Hz GPS L2 frequency: 1227.60e6 Hz See also the following m-files for coordinate transformations: LLH2ECEF ECEF2LLH

Michael Braasch
NOTE: This project is submitted in two parts. Tasks 1 & 2 are due before Tasks 4 - 6. See the class schedule for details.

ECEF2ENU ENU2ECEF

Task 2: Position calculation using ILS (20%) Calculate the GPS position using the measured pseudoranges (L1PSR), and the broadcast ephemeris satellite clock and orbit (SatBC.ECEF and SatBC.Clock)

- Add the satellite clock correction SatBC.Clock to the measured pseudorange. Note: this correction is already in meters.

- Do not apply any iono and tropo corrections to the pseudoranges yet. - Use the Iterative Least Squares (ILS) method as explained in Module 13 to solve

for user position and receiver clock error. Implement the following function for this:

[EstPos,Residuals,H]=CalcGPSPos(PR,SatECEF) with

PR = [Nx1] pseudoranges, for example from L1PSR SatECEF = [3xN] sat positions in ECEF, for example from SatBC.ECEF

Provide the following: a) User position in Lat (degrees), Lon (degrees), Height (meters, ellipsoidal) b) Error in user position with respect to truth in meters c) The norm of the range residuals d) The HDOP, PDOP, and VDOP of the solution. Note: The DOP calculations need

to be with respect to the locally-level frame. For this, you need to calculate the H- matrix for the satellites in an ENU frame, with the user at (0,0,0).

Hint: in your newton iteration, your pseudorange residuals are calculated by subtracting the estimated pseudorange from the measured pseudorange. The estimated pseudorange is the estimated range + the estimated receiver clock offset. Next, we are going to mitigate some of the GPS error sources. Fill in the following table using your calculations in the next tasks: PRNs 26 2 5 4 25 29 10 13 12 Elevation Iono delay Tropo delay Satellite Clock error Satellite Orbit error Task 3: Iono correction (20%) Using the L1 and L2 pseudorange measurements, calculate the iono delay (expressed in meters) for all satellites.

a) Calculate the Iono delays and fill them into the table

Michael Braasch
Michael Braasch
35%
Michael Braasch
Michael Braasch
15%

b) Correct the L1 pseudorange measurements with the iono delays, and recalculate the user position. Provide

i. The improved user position in Lat, Lon, Height ii. Error in user position with respect to truth in meters

iii. The norm of the range residuals Task 4: Tropo correction (20%) To calculate the tropo corrections, you first need the satellite elevation angles. For this, convert the satellite ECEF coordinates into an ENU coordinate frame, with the position found at 3 as the origin. Using the satellite coordinates in the local-level ENU coordinate frame you now can calculate the satellite elevation angles.

a) Calculate the satellite elevation angles and fill them into the table b) Calculate the satellite tropospheric delays, and put those in the table as well c) Correct the L1 pseudorange measurements with the iono and tropo delays, and

recalculate the user position. Provide i. The improved user position in Lat, Lon, Height

ii. Error in user position with respect to truth in meters iii. The norm of the range residuals

Task 5: Precise clock and orbit (20%) Using an extensive network of ground-based reference stations it is possible to calculate the satellite clock and orbit parameters much more precisely than those provided in the GPS broadcast message. See for example http://igscb.jpl.nasa.gov/components/usage.html. The struct SatPPP contains those precise clock and orbit parameters for this time epoch.

a) Calculate the error of the broadcast ephemeris clock, compared to the precise ephemeris. Put your result in the table.

b) Calculate the error of the broadcast ephemeris orbit, compared to the precise ephemeris, projected on the Line-Of-Sight vector. Put your result in the table.

c) Calculate the improved position using iono and tropo corrections, and the precise clock and orbit (SatPPP). Provide:

i. The improved user position in Lat, Lon, Height ii. Error in user position with respect to truth in meters

iii. The norm of the range residuals Task 6: Remaining errors & Conclusions (10%) The position solution is still not perfect. What remaining errors do you expect there to be in the measurements, and how do you suggest they can be mitigated? Draw your conclusions about the magnitude of the various errors, and how easy or hard it is to mitigate them. Take into consideration the potential receiver complexity (for example dual frequency vs single frequency), required ground infrastructure, communication, etc.

Michael Braasch
Michael Braasch
15%
Michael Braasch
Michael Braasch
15%