You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Firmware/RTK_Everywhere/Tilt.ino
+21-9Lines changed: 21 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,10 @@ void tiltUpdate()
60
60
}
61
61
62
62
if (tiltState != TILT_STARTED) // If we failed to begin, disable future attempts
63
+
{
63
64
tiltFailedBegin = true;
65
+
tiltState = TILT_DISABLED;
66
+
}
64
67
break;
65
68
66
69
case TILT_STARTED:
@@ -260,8 +263,8 @@ void printTiltDebug()
260
263
// Start communication with the IM19 IMU
261
264
voidbeginTilt()
262
265
{
263
-
tiltSensor = newIM19();
264
266
267
+
tiltSensor = newIM19();
265
268
if (SerialForTilt == nullptr)
266
269
SerialForTilt = newHardwareSerial(1); // Use UART1 on the ESP32 to receive IMU corrections
267
270
@@ -292,8 +295,15 @@ void beginTilt()
292
295
result &= tiltSensor->sendCommand("NAVI_OUTPUT=UART1,ON");
293
296
294
297
// Set the distance of the IMU from the center line - x:6.78mm y:10.73mm z:19.25mm
295
-
if (present.imu_im19 == true)
298
+
if (productVariant == RTK_TORCH)
296
299
result &= tiltSensor->sendCommand("LEVER_ARM=-0.00678,-0.01073,-0.0314"); // From stock firmware
300
+
elseif (productVariant == RTK_FLEX)
301
+
{
302
+
result &= tiltSensor->sendCommand("LEVER_ARM=-0.0282,-0.000,-0.0237"); // -28.2, 0. -23.7mm
303
+
304
+
//Send AT+INSTALL_ANGLE=180,0,0 if the IM19 module is mounted on the back of the GNSS receiver (so the IM19 faces downward instead of upward), before sending the save command.
305
+
result &= tiltSensor->sendCommand("INSTALL_ANGLE=180,0,0"); //IMU is mounted facing down
306
+
}
297
307
298
308
// Set the overall length of the GNSS setup in meters: rod length 1800mm + internal length 96.45mm + antenna
299
309
// POC 19.25mm = 1915.7mm
@@ -309,7 +319,10 @@ void beginTilt()
309
319
result &= tiltSensor->sendCommand(clubVector);
310
320
311
321
// Configure interface type. This allows IM19 to receive Unicore-style binary messages
312
-
result &= tiltSensor->sendCommand("GNSS_CARD=UNICORE");
322
+
if (productVariant == RTK_TORCH)
323
+
result &= tiltSensor->sendCommand("GNSS_CARD=UNICORE");
324
+
elseif (productVariant == RTK_FLEX)
325
+
result &= tiltSensor->sendCommand("GNSS_CARD=OEM");
313
326
314
327
// Configure as tilt measurement mode
315
328
result &= tiltSensor->sendCommand("WORK_MODE=408"); // From stock firmware
@@ -324,7 +337,7 @@ void beginTilt()
324
337
// Unknown new command for v2
325
338
result &= tiltSensor->sendCommand("CORRECT_HOLDER=ENABLE"); // From stock firmware
326
339
327
-
// Trigger IMU on PPS from UM980
340
+
// Trigger IMU on PPS from GNSS
328
341
result &= tiltSensor->sendCommand("SET_PPS_EDGE=RISING");
329
342
330
343
// Enable magnetic field mode
@@ -1017,7 +1030,7 @@ void tiltDetect()
1017
1030
if (present.tiltPossible == false)
1018
1031
return;
1019
1032
1020
-
//Start test if not previously detected
1033
+
//Skip test if previously detected as present
1021
1034
if (settings.detectedTilt == true)
1022
1035
{
1023
1036
present.imu_im19 = true; // Allow tiltUpdate() to run
@@ -1053,6 +1066,7 @@ void tiltDetect()
1053
1066
{
1054
1067
present.imu_im19 = true; // Allow tiltUpdate() to run
0 commit comments