✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
This project consists of two primary tasks. The first is to use non-linear least squares (NLLS) analysis to find a UAV trajectory given pseudorange data and validating this result by matching them to the true UAV trajectory (also given). The second is to calculate the dilution of precision (DOP) of the calculated UAV trajectory.
The DOP is a measure of the accuracy of any given GPS position data. Five different types of 1 DOPs will be calculated: Geometric DOP, Position DOP, Horizontal DOP, Vertical DOP and time DOP. They are a function of the variances in x,y,z,t (clock bias) components: Vx , Vy , Vz & Vt .Geometric DOP is the error due to the geometric orientation of the satellites in space. Position DOP is the error in the 3D position of the UAV. Horizontal DOP is the error in the horizontal position of the UAV while Vertical DOP is the error in the altitude of the UAV. Time DOP is the error due to the time accuracy.
The lower the DOP values, the better the instantaneous position measurement of the UAV. A good GDOP or PDOP is considered to be <5 while values >10 for PDOP are very poor. HDOP is expected to be between 2-3. VDOP is expected to be higher than HDOP as a result of all the satellites being above the receiver whereas for the horizontal coordinates, data is received from all sides of the UAV.
GPS Positioning Problem
Suppose a receiver is located on a flat 2D earth. Two GPS satellites can be used to pinpoint its location on earth, provided that if the range of the two satellites is represented by a circle there will be two intersections, of which only one will be located on earth. This is given no range error. Suppose there is a range error in GPS gps satellites, the intersection of the two range circles will now have shifted, resulting in an incorrect position estimation of the receiver on the earth.
This issue can be resolved by having a third GPS satellite resolve the location of the receiver. Provided that all GPS satellites have the same clock/range error, all three range circle will intersect at the receiver position. This can be used to calculate the clock bias, hence the range error. Similarly in 3D space, we need four satellites to pinpoint receiver location.
⛄ 部分代码
% Clear workspace, close all open figure & clear the command windowclear allclose all;clc;% Extract the data from the text file% Add other folders to pathaddpath('../data', '../lib/', '../lib/conversion');% Load constantsconstants();% Initialise Ground Station Position% Defining Sydney Ground Station Coordinateslat = deg2rad(-34.76);long = deg2rad(150.03);alt = 680;pos_llh_gs = [lat;long;alt];% File Nameuav_data_fpath = 'UAVPosition_F1.txt';% Import pseudorange datapseudo_data = importdata('GPS_pseudorange_F1.txt');% Load ECEF position values of satellitesload ECEFPos%% Categorising time values% Vernal Equinox timeequinox_time = 7347737.336;% Store time datatimes = pseudo_data(:,1) - equinox_time;% Obtain the unique time values% nTimes is an array containing the total number of occurences of single time% value% timeVal is an array containing all unique timevalues[total_occurences time_values] = hist(times(:),unique(times));% Cummulative Time Arraycummulative_times = cumsum(total_occurences);% Increment time values% timeVal = timeVal + 1;%% Observed UAV Positions% Obtain the polar coordinates of UAV w.r.t Ground Station[pos_UAV_Cart_obs,pos_UAV_Pol_Obs, pos_ECEF_gs, UAVVel, UAVPos] = UAVpolarCoor(time_values,... cummulative_times, pseudo_data, ECEFPos, pos_llh_gs);%% Extract true UAV Position data from text files% % Obtain polar coordinates of true measurements[pos_UAV_Pol_True, pos_UAV_Cart_True] = extractUAVtrue(uav_data_fpath,equinox_time);%% Catalog the position of the satellites during UAV Tracking% Find satellite position w.r.t ground station[pos_Sat_Pol_Obs] = findSatPos(ECEFPos, pos_ECEF_gs, pos_llh_gs);%% Calculate the DOP for each time value% Calculate the best and worst satellite configurations according to DOP[bestSatConfig, worstSatConfig, DOP, maxDOPIndex, minDOPIndex] = findDOP(UAVVel, pos_Sat_Pol_Obs);%% Save relevant data as a structured array for plottingplotData.timeArray = times;plotData.pos_UAV_Cart_obs = pos_UAV_Cart_obs;plotData.pos_UAV_Pol_Obs = pos_UAV_Pol_Obs;plotData.pos_ECEF_gs = pos_ECEF_gs;plotData.UAVVel = UAVVel;plotData.UAVPos = UAVPos;plotData.pos_UAV_Pol_True = pos_UAV_Pol_True;plotData.pos_UAV_Cart_True = pos_UAV_Cart_True;plotData.pos_Sat_Pol_Obs = pos_Sat_Pol_Obs;plotData.bestSatConfig = bestSatConfig;plotData.worstSatConfig = worstSatConfig;plotData.DOP = DOP;plotData.maxDOPIndex = maxDOPIndex;plotData.minDOPIndex = minDOPIndex;plotData.nTimes = total_occurences;plotData.pseudo_data = pseudo_data;plotData.cumArray = cummulative_times;%% Plot graphsplotq1B(plotData)
⛄ 运行结果
⛄ 参考文献
[1] 强明辉,张京娥.基于MATLAB的递推最小二乘法辨识与仿真[J].自动化与仪器仪表, 2008(6):3.DOI:10.3969/j.issn.1001-9227.2008.06.002.
[2] 熊学亮,陈淑娟,汤万龙.应用最小二乘法实现新疆建筑气象参数数据拟合[J].数学学习与研究, 2016(20):2.DOI:CNKI:SUN:SXYG.0.2016-20-130.
[3] 王海鹏,赵莉,王殿生,等.基于MATLAB的均匀设计实验数据多元非线性最小二乘拟合[J].化学工程与装备, 2010(9):4.DOI:10.3969/j.issn.1003-0735.2010.09.011.