Index: NoPi.h =================================================================== RCS file: /home/CVS/GPSTools/NoPi/NoPi.h,v retrieving revision 1.59 diff -u -r1.59 NoPi.h --- NoPi.h 6 Jul 2020 16:39:26 -0000 1.59 +++ NoPi.h 4 Nov 2020 16:55:43 -0000 @@ -44,7 +44,7 @@ /* Maximum number of signal combos which can be processed. * Only really used to lower memory usage and file handles */ -#define MAX_SIGNAL_COMBOS 20 +#define MAX_SIGNAL_COMBOS 30 /* Reference satellite selection modes */ #define USE_REF_ONLY -1 @@ -597,7 +597,7 @@ /* Functions in NoPi_Eph_Handling.c */ void initialise_ephemeris_data( DATA_t *p_data ); -U8 check_sv_eph_loaded( U8 sat_type, U8 sv_id ); +U8 check_sv_eph_loaded( U8 sat_type, U8 sv_id, U8 chk_errs ); void check_stored_eph_validity( DATA_t *p_data, CONFIG_t *p_config ); U8 store_new_ephemeris( DATA_t *p_data, CONFIG_t *p_config, Index: NoPi_Combos.cfg =================================================================== RCS file: /home/CVS/GPSTools/NoPi/NoPi_Combos.cfg,v retrieving revision 1.11 diff -u -r1.11 NoPi_Combos.cfg --- NoPi_Combos.cfg 21 Jan 2020 22:18:25 -0000 1.11 +++ NoPi_Combos.cfg 4 Nov 2020 16:55:43 -0000 @@ -43,6 +43,7 @@ # ambiguity is required SAT_TYPE_GPS, SUBTYPE_L1CA +SAT_TYPE_GPS, SUBTYPE_L1C SAT_TYPE_GPS, SUBTYPE_L2E SAT_TYPE_GPS, SUBTYPE_L2C #SAT_TYPE_GPS, SUBTYPE_L1E @@ -63,3 +64,10 @@ SAT_TYPE_BEIDOU, SUBTYPE_B1C SAT_TYPE_BEIDOU, SUBTYPE_B2A SAT_TYPE_BEIDOU, SUBTYPE_B2B +SAT_TYPE_QZSS, SUBTYPE_L1CA +SAT_TYPE_QZSS, SUBTYPE_L1C +SAT_TYPE_QZSS, SUBTYPE_L1SAIF +SAT_TYPE_QZSS, SUBTYPE_L2C +SAT_TYPE_QZSS, SUBTYPE_L5 +#SAT_TYPE_QZSS, SUBTYPE_LEX +SAT_TYPE_IRNSS, SUBTYPE_L5CA Index: NoPi_Default.cfg =================================================================== RCS file: /home/CVS/GPSTools/NoPi/NoPi_Default.cfg,v retrieving revision 1.7 diff -u -r1.7 NoPi_Default.cfg --- NoPi_Default.cfg 10 May 2017 22:02:14 -0000 1.7 +++ NoPi_Default.cfg 4 Nov 2020 16:55:43 -0000 @@ -5,3 +5,9 @@ #-ic* #-ce #-cc +# Don't use Galileo 20 as reference while there are false locks +# on E5AltBOC +-xe20 +# Need to ignore health for Beidou to process B1C and B2A data +# All of the Beidou-III SVs are currently unhealthy +-gc Index: NoPi_Eph_Handling.c =================================================================== RCS file: /home/CVS/GPSTools/NoPi/NoPi_Eph_Handling.c,v retrieving revision 1.43 diff -u -r1.43 NoPi_Eph_Handling.c --- NoPi_Eph_Handling.c 25 Jun 2020 16:38:34 -0000 1.43 +++ NoPi_Eph_Handling.c 4 Nov 2020 16:55:43 -0000 @@ -37,6 +37,10 @@ #pragma message( "WARNING: Check that the Beidou GEO SV list is up-to-date" ) #endif +#if mDATE_CHECK( 2020, 1, 2 ) +#pragma message( "WARNING: Is the Beidou ephemeris check still needed?" ) +#endif + #define WEEK_MS ( 7 * 86400 * 1000 ) #define DBL_WEEK_SEC (DBL)( 7.0 * 86400.0 ) @@ -137,6 +141,9 @@ static int glonass_changeCount[ N_GLONASS_SVS + 1 ]; +#define dBEIDOU_EPH_ERRS 50 +static U8 beidou_eph_errs[ N_BEIDOU_SVS + 1 ]; + static eBDS_EPH beidou_eph_is_geo[ N_BEIDOU_SVS + 1 ]; /****** STATIC DATA DECLARATIONS - END ******/ @@ -156,6 +163,9 @@ p_data->base.eph_data = &base_eph_data; p_data->rovr.eph_data = &rovr_eph_data; + for ( sv = 1; sv <= N_BEIDOU_SVS; sv ++ ) + beidou_eph_errs[ sv ] = 0; + for ( sv = 0; sv <= N_BEIDOU_SVS; sv ++ ) { beidou_eph_is_geo[ sv ] = eBDS_EPH_UNKNOWN; @@ -168,7 +178,7 @@ // this SV can be processed (dependent on zero-baseline and clock steering // requirements). //***************************************************************************** -U8 check_sv_eph_loaded( U8 sat_type, U8 sv_id ) +U8 check_sv_eph_loaded( U8 sat_type, U8 sv_id, U8 chk_errs ) { U8 ret = FALSE; @@ -176,6 +186,14 @@ { // NoPi only uses the ephemeris data from the base file at the moment ret = base_eph_data.have_eph[ sv_id ][ sat_type ]; + + if ( chk_errs + && sat_type == SAT_TYPE_BEIDOU + && beidou_eph_errs[ sv_id ] > dBEIDOU_EPH_ERRS + ) + { + ret = FALSE; + } } return ret; @@ -804,7 +822,7 @@ ); } else if ( p_rec28->subtype == 14 // CNAV Ephemeris Record - || p_rec28->subtype == 15 ) // BDS-CNAV Ephemeris Record + || p_rec28->subtype == 15 ) // B1C/B2A Ephemeris Record { // Placeholder to suppress NoPi processing warnings } @@ -1047,6 +1065,9 @@ p_stat_data->eph_data->broadcast_beidou_eph[ sv_id ] = is_broadcast_eph; + // New ephemeris, reset the ephemeris error counter + beidou_eph_errs[ sv_id ] = 0; + // Newer records include flags to indicate if the Beidou ephemeris is // for a GEO satellite if ( p_rec21->flags & 0x02 ) @@ -1173,7 +1194,9 @@ DBL dpos[3][2], true_range[2]; U32 tow; - if ( ! check_sv_eph_loaded( sat_type, sv_id ) ) + NAV_INFO *p_eph = NULL; + + if ( ! check_sv_eph_loaded( sat_type, sv_id, FALSE ) ) { fprintf( p_config->f_status, "WARNING: " @@ -1289,7 +1312,7 @@ } else { - NAV_INFO *p_eph; +// NAV_INFO *p_eph; DBL sek; U8 is_beidou_geo; @@ -1386,6 +1409,70 @@ *p_sdiff_corr = true_range[ IND_BASE ] - true_range[ IND_ROVR ]; + if ( sat_type == SAT_TYPE_BEIDOU && p_eph ) + { + DBL prange = GET_R27_MEAS_NUM( base, ind, 0, range ); + DBL err; + DBL sysclk = 0.0; + U8 i; + + if ( beidou_eph_errs[ sv_id ] > dBEIDOU_EPH_ERRS + && p_eph->subframe1.SV_health == 0 + ) + { + // Too many errors, 50 @ 10Hz = 5s + // Ignore the ephemeris and wait for a new one + fprintf( p_config->f_status, + "PSRGEOIGNORE %d %d\n", + sv_id, + p_data->base.timetag_ms + ); + + return( FALSE ); + } + + for ( i = 0; i < (P_BASE_R27)->offset.numSystems; i ++ ) + { + if ( (P_BASE_R27)->offset.rt_clktype[i] == RT_ClkType_BEIDOU ) + { + sysclk = (P_BASE_R27)->offset.systemClockOffset[i]; + } + } + + err = prange + - true_range[ IND_BASE ] + - 299792458.0 * 0.001 * P_BASE_R27->epoch.clockOffset + + 299792458.0 * sv_clock[ IND_BASE ] + + 299792458.0 * 0.001 * sysclk + ; + + if ( fabs( err ) > 1000 && p_eph->subframe1.SV_health == 0 ) + { + p_data->num_warnings ++; + + fprintf( p_config->f_status, + "PSRGEOERR %d %d %le %le %le %le %le %le %le %d %le %le %le\n", + sv_id, // 1 + p_data->base.timetag_ms, // 2 + prange, // 3 + tprop[ IND_BASE ], // 4 + dpos[ ECEF_X ][ IND_BASE ], // 5 + dpos[ ECEF_Y ][ IND_BASE ], // 6 + dpos[ ECEF_Z ][ IND_BASE ], // 7 + true_range[ IND_BASE ], // 8 + p_eph->ephemeris.t_oe, // 9 + p_eph->ephemeris.IODE, // 10 + P_BASE_R27->epoch.clockOffset, // 11 + sysclk, // 12 + sv_clock[ IND_BASE ] // 13 + ); + + beidou_eph_errs[ sv_id ] ++; + + return( FALSE ); + } + } + if ( need_dopp_corr ) { DBL sv_dopp[2]; Index: NoPi_Main.c =================================================================== RCS file: /home/CVS/GPSTools/NoPi/NoPi_Main.c,v retrieving revision 1.25 diff -u -r1.25 NoPi_Main.c --- NoPi_Main.c 15 Jun 2018 00:28:47 -0000 1.25 +++ NoPi_Main.c 4 Nov 2020 16:55:43 -0000 @@ -192,4 +192,7 @@ bits ); printf( "Copyright (c) 2009 - 2017 Trimble Inc.\n" ); + printf( "\n\n" ); + printf( "CAUTION : HACK FOR BEIDOU EPHEMERIS CHECK\n" ); + printf( "\n\n" ); } Index: NoPi_Reference_Satellite.c =================================================================== RCS file: /home/CVS/GPSTools/NoPi/NoPi_Reference_Satellite.c,v retrieving revision 1.23 diff -u -r1.23 NoPi_Reference_Satellite.c --- NoPi_Reference_Satellite.c 10 Dec 2019 01:40:23 -0000 1.23 +++ NoPi_Reference_Satellite.c 4 Nov 2020 16:55:43 -0000 @@ -243,7 +243,7 @@ if ( p_data->base.common_svs_quality[ sv_id ][ ref_tst ] == DATA_REF_QUALITY && p_data->rovr.common_svs_quality[ sv_id ][ ref_tst ] == DATA_REF_QUALITY && ( ! need_eph - || check_sv_eph_loaded( sat_type, sv_id ) + || check_sv_eph_loaded( sat_type, sv_id, TRUE ) ) ) {