Switching to NMEA
Thanks to the open binary protocol, our solutions have high performance at the lowest hardware cost. Below is a screenshot from the KoggerApp that demonstrates a superbly detailed Echogram of the underwater world using a compact binary protocol. However, the original binary protocol is difficult for human perception and is not always compatible with existing solutions. As a solution, support has been added to output Rangefinders information in NMEA-0183 format (SDDBT message) for easy integration with supporting devices. For understanding, Rangefinder only provides distance information (red dots in the screenshot) and does not provide a complete image. Below is an example of sonar setup for NMEA compatibility.
Dataset
This block defines the period and dataset parameters that sonar will regularly send to the receiving equipment. Next, there are two basic things that need to be configured in this block:
- “Period” (for example: 100 ms or 10 Hz) – sets the measurement period for a set of flags.
- “Rangefinder” (for example: NMEA) – turns on data processing by the Rangefinder module to determine the distance and sets the packet format. If NMEA format is selected, it is recommended to disable all messages without NMEA tagging (Echogram, etc.), as binary protocol messages may not be supported by your equipment.
Rangefinder
This block defines the parameters of the rangefinder module.
- “Max distance” (for example: 50000 mm or 50 m) – sets the maximum distance to search for an object. The maximum distance determines the time it takes for the sonar to collect backscattered data. The measurement time can be calculated as the ratio of twice the measurement distance to the average speed of sound. For example, to measure a distance of 50 meters, it will take about 66 ms.
- “Dead zone” (for example: 100 mm or 0.1 m) – sets the minimum distance to detect an object.
- “Confidence threshold” – allows to exclude objects with low detector confidence, if necessary (in general, set 0 to disable the function).
Save and check
As a final step, you need to press the “Flash settings” button to write the settings to the non-volatile memory. Then, check the settings after restarting the sonar. An easy way to check is to view the sonar output through a text terminal. There should only be NMEA messages ($ SDDBT). It should be noted that the Rangefinder module may provide erroneous distance values due to interference in small containers or other difficult conditions.
Пример настройки Ardupilot
The test boat had the following set: Pixhawk 1 with ArduRover 3.5.2
The sonar can be connected to any available serial/uart port on the autopilot. In the diagram below the sonar is connected to SERIAL2 (TELEM2).
- SERIAL2_BAUD = 115 (115200 baud)
- SERIAL2_OPTIONS = 0
- SERIAL2_PROTOCOL = 9 (Lidar or Rangefinder)
Then the following range finder related parameters should be set:
- RNGFND_TYPE = 17 (NMEA)
- RNGFND_MIN_CM = 10 (i.e. 10 cm). This is the distance in centimeters that the rangefinder can reliably read.
- RNGFND_MAX_CM = 5000 (i.e. 50m). This is the distance in centimeters that the rangefinder can reliably read.
- RNGFND_ORIENT = 25 (i.e. down) if mounted on a boat.
NMEA-0183 Sentence Format
All NMEA 0183 data is sent in the form of text sentences, each beginning with a ‘$’ (or ‘!’) symbol, and use commas to separate each part of the sentence. Maximum sentence length, including the ‘$’ and is 82 bytes. NMEA sentences are plain printable ASCII text, and have the following format:
$YYXXX,……… *hh
- A 2-letter ‘YY’ code follows, giving the talker id (e.g. ‘GP’ for GPS, and for a depth sounder this should be ‘SD’) and a 3-letter ‘XXX’ code follows, giving the sentence data type (e.g. ‘RMC’ is a “Recommended Minimum Navigation Information” sentence, and ‘DBT’ is a “Depth Below Transducer” sentence).
- A comma follows, then the contents of the sentence data, which changes depending on the data type and the current values of what is being monitored.
- ‘hh’ is checksum and preceded by the ‘*’ character and is calculated by taking the 8-bit exclusive-OR of all characters in the sentence, including ‘,’ delimiters, between but not including the ‘$’ (or ‘!’) and ‘*’ delimiters.
- The string always ends with a carriage return and linefeed combination (Hex 0x0D 0x0A, ASCII ‘rn’ ()).
Our solutions support the standard sentence ($SDDBT) from the NMEA-0183 for easy integration with common flight controllers (on Ardupilot and PX4 autopilot) and many other data acquisition systems. Additionally, other formats can be added upon request.
$SDDBT has the following format: $SDDBT,FEET,f,METRES,M,FATHOMS,F*hh
- DBT – Depth Below Transducer
- FEET – Water depth, fee
- METRES – Water depth, meters
- FATHOMS – Water depth, Fathoms
For examples: $SDDBT,7.8,f,2.4,M,1.3,F*0D