Skip to content

Commit

Permalink
ubx: reduce update rate for M9N to 5Hz (instead of 10Hz)
Browse files Browse the repository at this point in the history
Apparently a 10Hz update rate restricts the number of used satellites to
16, and as soon as the update rate is reduced, the number of used
satellites increases.

The datasheet only mentions that the navigation rate can go up to 25Hz.
  • Loading branch information
bkueng committed Apr 27, 2020
1 parent 77c4493 commit 4d51e53
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/ubx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,10 @@ int GPSDriverUBX::configureDevice()
cfgValset<uint8_t>(UBX_CFG_KEY_ODO_OUTLPCOG, 0, cfg_valset_msg_size);

// measurement rate
cfgValset<uint16_t>(UBX_CFG_KEY_RATE_MEAS, 100 /* 10 Hz update rate */, cfg_valset_msg_size);
// In case of F9P we use 10Hz, otherwise 5Hz (receivers such as M9N can go higher as well, but
// the number of used satellites will be restricted to 16. Not mentioned in datasheet)
const int rate_meas = (_board == Board::u_blox9_F9P) ? 100 : 200;
cfgValset<uint16_t>(UBX_CFG_KEY_RATE_MEAS, rate_meas, cfg_valset_msg_size);
cfgValset<uint16_t>(UBX_CFG_KEY_RATE_NAV, 1, cfg_valset_msg_size);
cfgValset<uint8_t>(UBX_CFG_KEY_RATE_TIMEREF, 0, cfg_valset_msg_size);

Expand Down Expand Up @@ -1330,6 +1333,15 @@ GPSDriverUBX::payloadRxAddMonVer(const uint8_t b)
if (buf_index == sizeof(ubx_payload_rx_mon_ver_part2_t) - 1) {
// Part 2 complete: decode Part 2 buffer
UBX_DEBUG("VER ext \" %30s\"", _buf.payload_rx_mon_ver_part2.extension);

// in case of u-blox9 family, check if it's an F9P
if (_board == Board::u_blox9) {
if (strstr((const char *)_buf.payload_rx_mon_ver_part2.extension, "MOD=") &&
strstr((const char *)_buf.payload_rx_mon_ver_part2.extension, "F9P")) {
_board = Board::u_blox9_F9P;
UBX_DEBUG("F9P detected");
}
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/ubx.h
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,8 @@ class GPSDriverUBX : public GPSBaseStationSupport
u_blox6 = 6,
u_blox7 = 7,
u_blox8 = 8, ///< M8N or M8P
u_blox9 = 9, ///< F9P
u_blox9 = 9, ///< M9N, or any F9*, except F9P
u_blox9_F9P = 10, ///< F9P
};

sensor_gps_s *_gps_position {nullptr};
Expand Down

0 comments on commit 4d51e53

Please sign in to comment.