Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sbgECom driver documentation #3529

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions en/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
- [CubePilot Here+ (Discontined)](gps_compass/rtk_gps_hex_hereplus.md)
- [INS (Inertial Navigation/GNSS)](sensor/inertial_navigation_systems.md)
- [VectorNav](sensor/vectornav.md)
- [sbgECom](sensor/sbgecom.md)
- [Optical Flow](sensor/optical_flow.md)
- [ARK Flow](dronecan/ark_flow.md)
- [PMW3901](sensor/pmw3901.md)
Expand Down
63 changes: 63 additions & 0 deletions en/advanced_config/parameter_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -30048,6 +30048,42 @@ Reboot | minValue | maxValue | increment | default | unit
--- | --- | --- | --- | --- | ---
✓ | | | | 500000 |

### SBG_BAUDRATE (`INT32`) {#SBG_BAUDRATE}

sbgECom serial baudrate.

This parameter defines the baudrate of sbgECom serial.

Reboot | minValue | maxValue | increment | default | unit
--- | --- | --- | --- | --- | ---
✓ | 9600 | 921600 | | 921600 | bit/s

### SBG_CONFIGURATION_EN (`INT32`) {#SBG_CONFIGURATION_EN}

sbgECom driver INS configuration enable.

Enable SBG Systems INS configuration through sbgECom driver on start.

Reboot | minValue | maxValue | increment | default | unit
--- | --- | --- | --- | --- | ---
  | | | | Disabled (0) |

### SBG_MODE (`INT32`) {#SBG_MODE}

sbgECom driver mode.

This parameter defines the mode of sbgECom driver.

**Values:**

- `0`: Sensors Only (default)
- `1`: GNSS
- `2`: INS

Reboot | minValue | maxValue | increment | default | unit
--- | --- | --- | --- | --- | ---
  | 0 | 2 | | 0 |

### SENS_AFBR_HYSTER (`INT32`) {#SENS_AFBR_HYSTER}

AFBR Rangefinder Short/Long Range Threshold Hysteresis.
Expand Down Expand Up @@ -31547,6 +31583,33 @@ Reboot | minValue | maxValue | increment | default | unit
--- | --- | --- | --- | --- | ---
✓ | 0 | 101 | | 0 |

### SENS_SBG_CFG (`INT32`) {#SENS_SBG_CFG}

Serial Configuration for SBG Systems products.

Configure on which serial port to run sbgECom.

WARNING: Depending on the used baudrate, UART RX DMA may be required.

**Values:**

- `0`: Disabled
- `6`: UART 6
- `101`: TELEM 1
- `102`: TELEM 2
- `103`: TELEM 3
- `104`: TELEM/SERIAL 4
- `201`: GPS 1
- `202`: GPS 2
- `203`: GPS 3
- `300`: Radio Controller
- `301`: Wifi Port
- `401`: EXT2

Reboot | minValue | maxValue | increment | default | unit
--- | --- | --- | --- | --- | ---
✓ | | | | 0 |

### SENS_SF0X_CFG (`INT32`) {#SENS_SF0X_CFG}

Serial Configuration for Lightware Laser Rangefinder (serial).
Expand Down
62 changes: 61 additions & 1 deletion en/modules/modules_driver_ins.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,65 @@
# Modules Reference: Ins (Driver)

## sbgecom

Source: [drivers/ins/sbgecom](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/ins/sbgecom)

### Description

Serial bus driver for the SBG Systems products.

Most boards are configured to enable/start the driver on a specified UART using the SENS_SBG_CFG parameter.

Setup/usage information: https://docs.px4.io/main/en/sensor/sbgecom.html

### Examples

Attempt to start driver on a specified serial device.
```
sbgecom start -d /dev/ttyS0
```
Attempt to start driver with a specified baudrate.
```
sbgecom start -b 115200
```
Attempt to start driver with a specified INS configuration file.
```
sbgecom start -f /fs/microsd/custom_settings.json
```
Attempt to start driver with a specified INS configuration string.
```
sbgecom start -s {"output":{"comA":{"messages":{"airData":"onChange"}}}}
```
Stop driver
```
sbgecom stop
```

<a id="sbgecom_usage"></a>

### Usage

```
sbgecom <command> [arguments...]
Commands:

start Start driver
[-d <val>] Serial device
default: /dev/ttyS0
[-b <val>] Baudrate device
default: 921600
[-f <val>] Config JSON file path
default: /etc/extras/sbg_settings.json
[-s <val>] Config JSON string

status Driver status

stop Stop driver
```

## vectornav
Source: [drivers/ins/vectornav](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/ins/vectornav)

Source: [drivers/ins/vectornav](https://github.com/PX4/PX4-Autopilot/tree/main/src/drivers/ins/vectornav)

### Description

Expand All @@ -23,7 +81,9 @@ vectornav stop
```

<a id="vectornav_usage"></a>

### Usage

```
vectornav <command> [arguments...]
Commands:
Expand Down
3 changes: 2 additions & 1 deletion en/sensor/inertial_navigation_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ However PX4 can also use some INS devices as either sources of raw data, or as a
Systems that can be used in this way include:

- [VectorNav](../sensor/vectornav.md): IMU/AHRS, GNSS/INS, Dual GNSS/INS systems that can be used as an external INS or as a source of raw sensor data.
- [SBG Systems](../sensor/sbgecom.md): IMU/AHRS, GNSS/INS, Dual GNSS/INS systems that can be used as an external INS or as a source of raw sensor data.

## Glossary

Expand All @@ -20,7 +21,7 @@ The magnetometer, if present, provides sensor data that can be used to provide t

An AHRS system that includes both an IMU and a processing system that can provide attitude and heading information from the IMUs raw data.

### Inertial Navigation System (INS)
### Inertial Navigation System (INS)

An INS is a navigation device that uses accelerometers, gyroscopes, possibly magnetometers, and a computer to calculate the attitude, position, and velocity of a moving object without the need for external references.
Essentially it is an AHRS that also includes position/velocity estimation.
Expand Down
148 changes: 148 additions & 0 deletions en/sensor/sbgecom.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# SBG Systems

[SBG-Systems](https://www.sbg-systems.com/) designs, manufactures, and support an extensive range of state-of-the-art inertial sensors such as Inertial Measurement Units (IMU), Attitude and Heading Reference Systems (AHRS), Inertial Navigation Systems with embedded GNSS (INS/GNSS) …

![Ellipse](../../assets/hardware/sensors/inertial/ellipse-inertial-navigation-system.png)

SBG Systems products provide a range of benefits to PX4 users and can be integrated for:

- Higher accuracy heading, pitch, and roll estimates
- More robust and reliable GNSS positioning
- Improved positioning and attitude performance in GNSS-contested environments
- Performance under challenging dynamic conditions (e.g. catapult launches, VTOL operations, high-g or high angular rate operations)

The sbgECom PX4 Driver is streamlined to provide a simple plug-and-play architecture, removing engineering obstacles and allowing the acceleration of the design, development, and launch of platforms to keep pace with the rapid rate of innovation.

PX4 can use these as an [external INS](../sensor/inertial_navigation_systems.md), bypassing/replacing the EKF2 estimator, or as a source of raw sensor data provided to the estimator.

The driver supports [all SBG Systems products](https://www.sbg-systems.com/products/).
In particular the following systems are recommended:

- **Pulse:** Recommended for fixed-wing systems without hovering, where static heading is not necessary.
- **Ellipse:** Recommended for multicopter systems where hovering and low dynamics requires the use of static heading.

## Where to Buy

SBG Systems solutions are available directly from [MySBG](https://account.sbg-systems.com/realms/sbg/protocol/openid-connect/auth?client_id=my-sbg-sso&redirect_uri=https%3A%2F%2Fmy.sbg-systems.com%2Foidc%3Ftarget%3D%252F&response_type=code&scope=openid+email+profile&state=93af390a93994b6c89162e080c431df9&code_challenge=1ZGBaGQhWuu5_v68vKVUaxlQqqh8UTqsV_8HwcsJrBg&code_challenge_method=S256) (FR) or through their Global Sales Representatives. For more information on their solutions or for international orders, please contact [email protected].

## Hardware Setup

### Wiring

Connect any unused flight controller serial interface, such as a spare `GPS` or `TELEM` port, to the SBG Systems product MAIN port (required by PX4).

### Mounting

The SBG Systems product sensor can be mounted in any orientation, in any position on the vehicle, without regard to center of gravity.
All SBG Systems product sensors default to a coordinate system of x-forward, y-right, and z-down, making the default mounting as connector-back, base down.
This can be changed to any rigid rotation using the sbgECom Reference Frame Rotation register.

If using a GNSS-enabled product, the GNSS antenna must be mounted rigidly with respect to the inertial sensor and with an unobstructed sky view. If using a dual-GNSS-enabled product (Ellipse-D), the secondary antenna must be mounted rigidly with respect to the primary antenna and the inertial sensor with an unobstructed sky view.

For more mounting and configuration requirements and recommendations, see the relevant [SBG SUPPORT CENTER](https://support.sbg-systems.com/sc).

## Firmware Configuration

### PX4 Configuration

To use the sbgECom driver:

1. Include the module in firmware in the [kconfig board configuration](../hardware/porting_guide_config.md#px4-board-configuration-kconfig) by setting the kconfig variables: `CONFIG_DRIVERS_INS_SBGECOM` or `CONFIG_COMMON_INS`.
2. [Set the parameter](../advanced_config/parameters.md) [SENS_SBG_CFG](../advanced_config/parameter_reference.md#SENS_SBG_CFG) to the hardware port connected to the SBG Systems product (for more information see [Serial Port Configuration](../peripherals/serial_configuration.md)).

::: warning
Disable or change port of other sensors that are using the same one, for example [GPS_1_CONFIG](../advanced_config/parameter_reference.md#GPS_1_CONFIG) if using GPS1 port.
:::

3. Set [SBG_BAUDRATE](../advanced_config/parameter_reference.md#SBG_BAUDRATE) to the desired default baudrate value.
4. Allow the sbgECom driver to initialize by restarting PX4.
5. Configure driver to provide IMU data, GNSS data and INS :

1. Set [SBG_MODE](../advanced_config/parameter_reference.md#SBG_MODE) to the desired mode.
2. Make sensor module select sensors by enabling [SENS_IMU_MODE](../advanced_config/parameter_reference.md#SENS_IMU_MODE).
3. Prioritize SBG Systems sensors using [CAL_GYROn_PRIO](../advanced_config/parameter_reference.md#CAL_GYRO0_PRIO), [CAL_ACCn_PRIO](../advanced_config/parameter_reference.md#CAL_ACC0_PRIO), [CAL_BAROn_PRIO](../advanced_config/parameter_reference.md#CAL_BARO0_PRIO), [CAL_MAGn_PRIO](../advanced_config/parameter_reference.md#CAL_MAG0_PRIO), where _n_ is the instance number of the IMU component (0, 1, etc.).

::: tip
In most cases the external IMU (SBG) is the highest-numbered.
You can get a list of the IMU components available using [`uorb top -1`](../middleware/uorb.md#uorb-top-command), you can differentiate between them using the [`listener`](../modules/modules_command.md#listener) command and looking through the data, or just the rates.

Alternatively, you can check [CAL_GYROn_ID](../advanced_config/parameter_reference.md#CAL_GYRO0_ID) to see the device id.
The priority is 0-255, where 0 is entirely disabled and 255 is highest priority.
:::

::: warning
When configuring both SBG Systems and Pixhawk sensors to have non-zero priority, if the selected sensor is errored (timeout), it can change during operation without being notified.
In this case, MAVLink messages will be updated with the newly selected sensor.

If you don't want to have this fallback mechanism, you must disable unwanted sensors.
:::

4. If using the sbgECom as an INS, disable EKF2 using [EKF2_EN](../advanced_config/parameter_reference.md#EKF2_EN)

6. Restart PX4.

Once enabled, the module will be detected on boot.
IMU data should be published at 200Hz.

## SBG Systems Configuration

All High Performance and Ellipse 3.0 and higher SBG Systems INS can be configured directly from PX4 firmware:

1. Enable [SBG_CONFIGURATION_EN](../advanced_config/parameter_reference.md#SBG_CONFIGURATION_EN)
2. Provide a JSON file `sbg_settings.json` containing SBG Sysytems INS settings to be applied in your PX4 board `extras` directory (ex: `boards/px4/fmu-v5/extras`). The settings JSON file will be installed in `/etc/extras/sbg_settings.json` on the board.

::: tip
The settings can be retrieved using [sbgEComAPI](https://github.com/SBG-Systems/sbgECom/tree/main/tools/sbgEComApi) or [sbgInsRestApi](https://developer.sbg-systems.com/sbgInsRestApi/1.3/#tag/Settings) and then modified as a JSON file.
:::

::: tip
The settings file can be provided in the SD card in q`/fs/microsd/etc/extras/sbg_settings.json` to avoid rebuilding a new firmware to change JSON settings file.
:::

3. For testing purpose, it's also possible to modify SBG Systems INS settings on the fly:

- By passing a JSON file path as argument when starting sbgecom driver (ex: `sbgecom start -f /fs/microsd/new_sbg_settings.json`)
- By passing a JSON string as argument when starting sbgecom driver: (ex: `sbgecom start -s {"output":{"comA":{"messages":{"airData":"onChange"}}}}`)

For older Ellipse SBG Systems INS or to configure any SBG Systems INS directly, all commands and registers can be found in the [SBG SUPPORT CENTER](https://support.sbg-systems.com/sc).

::: warning
When changing SBG Systems INS settings, if the baudrate of the serial port used to communicate with PX4 autopilot is changed, the parameter [SBG_BAUDRATE](../advanced_config/parameter_reference.md#SBG_BAUDRATE) must be changed in accordance after settings change.
:::

## Published Data

Upon initialization, the driver should print the following information to console (printed using `PX4_INFO`)

- Unit model number
- Unit hardware version
- Unit serial number
- Unit firmware number

This should be accessible using the [`dmesg`](../modules/modules_system.md#dmesg) command.

The sbgECom driver always publishes the unit's data to the following uORB topics:

- [sensor_accel](../msg_docs/SensorAccel.md)
- [sensor_gyro](../msg_docs/SensorGyro.md)
- [sensor_mag](../msg_docs/SensorMag.md)

if configured as a GNSS, publishes:

- [sensor_gps](../msg_docs/SensorGps.md)

and, if configured as an INS, publishes:

- [estimator_status](../msg_docs/EstimatorStatus.md)
- [vehicle_local_position](../msg_docs/VehicleLocalPosition.md)
- [vehicle_global_positon](../msg_docs/VehicleGlobalPosition.md)
- [vehicle_attitude](../msg_docs/VehicleAttitude.md)

::: tip
Published topics can be viewed using the `listener` command.
:::

## Hardware Specifications

- [Product Briefs](https://www.sbg-systems.com/products/)
- [Datasheets](https://www.sbg-systems.com/contact/#products)
Loading