Skip to content

Commit badb126

Browse files
committed
Add Multipath Mitigation. Move HAS configuration into Rover/Base config.
Upon the exit of GNSS menu, Rover/Base config is run. Previously, HAS would not be set unless unit was reset.
1 parent 1b99e16 commit badb126

File tree

3 files changed

+118
-47
lines changed

3 files changed

+118
-47
lines changed

Firmware/RTK_Everywhere/UM980.ino

Lines changed: 104 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,14 @@ void um980Begin()
3333
if (settings.debugGnss == true)
3434
um980EnableDebugging();
3535

36-
// In order to reduce UM980 configuration time, the UM980 library blocks the start of BESTNAV and RECTIME until 3D fix is achieved
37-
// However, if all NMEA messages are disabled, the UM980 will never detect a 3D fix.
36+
// In order to reduce UM980 configuration time, the UM980 library blocks the start of BESTNAV and RECTIME until 3D
37+
// fix is achieved However, if all NMEA messages are disabled, the UM980 will never detect a 3D fix.
3838
if (um980IsGgaActive() == true)
39-
//If NMEA GPGGA is turned on, suppress BESTNAV messages until GPGGA reports a 3D fix
39+
// If NMEA GPGGA is turned on, suppress BESTNAV messages until GPGGA reports a 3D fix
4040
um980->disableBinaryBeforeFix();
4141
else
42-
//If NMEA GPGGA is turned off, enable BESTNAV messages at power on which may lead to longer UM980 configuration times
42+
// If NMEA GPGGA is turned off, enable BESTNAV messages at power on which may lead to longer UM980 configuration
43+
// times
4344
um980->enableBinaryBeforeFix();
4445

4546
if (um980->begin(*serialGNSS) == false) // Give the serial port over to the library
@@ -169,48 +170,6 @@ bool um980ConfigureOnce()
169170
}
170171
}
171172

172-
// Enable E6 and PPP if enabled and possible
173-
if (settings.enableGalileoHas == true)
174-
{
175-
// E6 reception requires version 11833 or greater
176-
int um980Version = String(um980->getVersion()).toInt(); // Convert the string response to a value
177-
if (um980Version >= 11833)
178-
{
179-
if (um980->isConfigurationPresent("CONFIG PPP ENABLE E6-HAS") == false)
180-
{
181-
if (um980->sendCommand("CONFIG PPP ENABLE E6-HAS") == true)
182-
systemPrintln("Galileo E6 service enabled");
183-
else
184-
systemPrintln("Galileo E6 service config error");
185-
186-
if (um980->sendCommand("CONFIG PPP DATUM WGS84") == true)
187-
systemPrintln("WGS84 Datum applied");
188-
else
189-
systemPrintln("WGS84 Datum error");
190-
}
191-
}
192-
else
193-
{
194-
systemPrintf(
195-
"Current UM980 firmware: v%d. Galileo E6 reception requires v11833 or newer. Please update the "
196-
"firmware on your UM980 to allow for HAS operation. Please see https://bit.ly/sfe-rtk-um980-update\r\n",
197-
um980Version);
198-
}
199-
}
200-
else
201-
{
202-
// Turn off HAS/E6
203-
if (um980->isConfigurationPresent("CONFIG PPP ENABLE E6-HAS") == true)
204-
{
205-
if (um980->sendCommand("CONFIG PPP DISABLE") == true)
206-
{
207-
// systemPrintln("Galileo E6 service disabled");
208-
}
209-
else
210-
systemPrintln("Galileo E6 service config error");
211-
}
212-
}
213-
214173
if (response == true)
215174
{
216175
online.gnss = true; // If we failed before, mark as online now
@@ -253,6 +212,10 @@ bool um980ConfigureRover()
253212

254213
response &= um980SetMinElevation(settings.minElev); // UM980 default is 5 degrees. Our default is 10.
255214

215+
response &= um980SetMultipathMitigation(settings.enableMultipathMitigation);
216+
217+
response &= um980SetHighAccuracyService(settings.enableGalileoHas);
218+
256219
// Configure UM980 to output binary reports out COM2, connected to IM19 COM3
257220
response &= um980->sendCommand("BESTPOSB COM2 0.2"); // 5Hz
258221
response &= um980->sendCommand("PSRVELB COM2 0.2");
@@ -308,6 +271,10 @@ bool um980ConfigureBase()
308271
// um980BaseAverageStart().
309272
response &= um980SetModel(settings.dynamicModel);
310273

274+
response &= um980SetMultipathMitigation(settings.enableMultipathMitigation);
275+
276+
response &= um980SetHighAccuracyService(settings.enableGalileoHas);
277+
311278
response &= um980EnableRTCMBase(); // Only turn on messages, do not turn off messages. We assume the caller has
312279
// UNLOG or similar.
313280

@@ -586,6 +553,97 @@ bool um980SetModel(uint8_t modelNumber)
586553
return (false);
587554
}
588555

556+
bool um980SetMultipathMitigation(bool enableMultipathMitigation)
557+
{
558+
bool result = true;
559+
560+
// Enable MMP as required
561+
if (enableMultipathMitigation == true)
562+
{
563+
if (um980->isConfigurationPresent("CONFIG MMP ENABLE") == false)
564+
{
565+
if (um980->sendCommand("CONFIG MMP ENABLE") == true)
566+
systemPrintln("Multipath Mitigation enabled");
567+
else
568+
{
569+
systemPrintln("Multipath Mitigation failed to enable");
570+
result = false;
571+
}
572+
}
573+
}
574+
else
575+
{
576+
// Turn off MMP
577+
if (um980->isConfigurationPresent("CONFIG MMP ENABLE") == true)
578+
{
579+
if (um980->sendCommand("CONFIG MMP DISABLE") == true)
580+
systemPrintln("Multipath Mitigation disabled");
581+
else
582+
{
583+
systemPrintln("Multipath Mitigation failed to disable");
584+
result = false;
585+
}
586+
}
587+
}
588+
return (result);
589+
}
590+
591+
bool um980SetHighAccuracyService(bool enableGalileoHas)
592+
{
593+
bool result = true;
594+
595+
// Enable E6 and PPP if enabled and possible
596+
if (settings.enableGalileoHas == true)
597+
{
598+
// E6 reception requires version 11833 or greater
599+
int um980Version = String(um980->getVersion()).toInt(); // Convert the string response to a value
600+
if (um980Version >= 11833)
601+
{
602+
if (um980->isConfigurationPresent("CONFIG PPP ENABLE E6-HAS") == false)
603+
{
604+
if (um980->sendCommand("CONFIG PPP ENABLE E6-HAS") == true)
605+
systemPrintln("Galileo E6 service enabled");
606+
else
607+
{
608+
systemPrintln("Galileo E6 service failed to enable");
609+
result = false;
610+
}
611+
612+
if (um980->sendCommand("CONFIG PPP DATUM WGS84") == true)
613+
systemPrintln("WGS84 Datum applied");
614+
else
615+
{
616+
systemPrintln("WGS84 Datum failed to apply");
617+
result = false;
618+
}
619+
}
620+
}
621+
else
622+
{
623+
systemPrintf(
624+
"Current UM980 firmware: v%d. Galileo E6 reception requires v11833 or newer. Please update the "
625+
"firmware on your UM980 to allow for HAS operation. Please see https://bit.ly/sfe-rtk-um980-update\r\n",
626+
um980Version);
627+
// Don't fail the result. Module is still configured, just without HAS.
628+
}
629+
}
630+
else
631+
{
632+
// Turn off HAS/E6
633+
if (um980->isConfigurationPresent("CONFIG PPP ENABLE E6-HAS") == true)
634+
{
635+
if (um980->sendCommand("CONFIG PPP DISABLE") == true)
636+
systemPrintln("Galileo E6 service disabled");
637+
else
638+
{
639+
systemPrintln("Galileo E6 service failed to disable");
640+
result = false;
641+
}
642+
}
643+
}
644+
return (result);
645+
}
646+
589647
void um980FactoryReset()
590648
{
591649
um980->factoryReset();

Firmware/RTK_Everywhere/menuGNSS.ino

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,12 @@ void menuGNSS()
124124
systemPrintln("Disabled");
125125
}
126126

127+
if (present.gnss_um980)
128+
{
129+
systemPrintf("15) Multipath Mitigation: %s\r\n",
130+
settings.enableMultipathMitigation ? "Enabled" : "Disabled");
131+
}
132+
127133
systemPrintln("x) Exit");
128134

129135
int incoming = getUserInputNumber(); // Returns EXIT, TIMEOUT, or long
@@ -291,6 +297,12 @@ void menuGNSS()
291297
restartRover = true;
292298
}
293299

300+
else if ((incoming == 15) && present.gnss_um980)
301+
{
302+
settings.enableMultipathMitigation ^= 1;
303+
restartRover = true;
304+
}
305+
294306
else if (incoming == INPUT_RESPONSE_GETNUMBER_EXIT)
295307
break;
296308
else if (incoming == INPUT_RESPONSE_GETNUMBER_TIMEOUT)

Firmware/RTK_Everywhere/settings.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1381,6 +1381,7 @@ struct Settings
13811381
float loraCoordinationFrequency = 910.000;
13821382
bool debugLora = false;
13831383
int loraSerialInteractionTimeout_s = 30; //Seconds without user serial that must elapse before LoRa radio goes into dedicated listening mode
1384+
bool enableMultipathMitigation = true; //Multipath mitigation. UM980 specific.
13841385

13851386
// Add new settings to appropriate group above or create new group
13861387
// Then also add to the same group in rtkSettingsEntries below
@@ -1898,7 +1899,7 @@ const RTK_Settings_Entry rtkSettingsEntries[] =
18981899
{ 0, 1, 1, 0, 0, 0, 0, 1, _float, 3, & settings.loraCoordinationFrequency, "loraCoordinationFrequency", },
18991900
{ 0, 0, 0, 0, 0, 0, 0, 1, _bool, 3, & settings.debugLora, "debugLora", },
19001901
{ 0, 1, 1, 0, 0, 0, 0, 1, _int, 3, & settings.loraSerialInteractionTimeout_s, "loraSerialInteractionTimeout_s", },
1901-
1902+
{ 1, 1, 1, 0, 0, 0, 0, 1, _bool, 3, & settings.enableMultipathMitigation, "enableMultipathMitigation", },
19021903

19031904
// Add new settings to appropriate group above or create new group
19041905
// Then also add to the same group in settings above

0 commit comments

Comments
 (0)