Difference between revisions of "Subsystem/ins"

From PaparazziUAV
Jump to navigation Jump to search
(added ekf2 section on INS)
 
(20 intermediate revisions by 6 users not shown)
Line 3: Line 3:
The INS (Inertial Navigation System) subsystem specifies which position and velocity estimation algorithm you are using.
The INS (Inertial Navigation System) subsystem specifies which position and velocity estimation algorithm you are using.


Most of the INS filters are only providing position and speed, and they need to be used together with an AHRS filter for attitude. Currently, only the experimental invariant filter is a full INS.
Most of the INS filters are only providing position and speed, and they need to be used together with an [[Subsystem/ahrs|AHRS (Attitude and Heading Reference System) filter]] for attitude. Currently, only the experimental invariant filter is a full INS.
 
Currently possible INS subsystem types are:
 
{| class="wikitable" style="text-align:center" border="1"
! Type !! Point Type !! Firmwares !! Notes
|-
|'''[[Subsystem/ins#ekf2|ekf2]]''' || floating || all || external
|-
|'''[[Subsystem/ins#alt_float|alt_float]]''' || floating || fixedwing ||
|-
|'''[[Subsystem/ins#GPS passthrough (gps_passthrough)|gps_passthrough]]''' ||  || all ||
|-
|'''[[Subsystem/ins#xsens|xsens]]''' ||  || all || external
|-
|'''[[Subsystem/ins#xsens700|xsens700]]'''  ||  || all || external
|-
|'''[[Subsystem/ins#no_type|no_type]]''' ||  || all ||
|-
|'''[[Subsystem/ins#Horizontal Filter Float (hff)|Horizontal Filter Float (hff)]]''' || floating ||  ||
|-
|'''[[Subsystem/ins#extended|extended]]''' || floating? || all ||
|-
|'''[[Subsystem/ins#vectornav|vectornav]]''' ||  || all || external
|-
|'''[[Subsystem/ins#float_invariant|float_invariant]]''' || floating || all ||
|}


Currently possible AHRS subsystem types are
* alt_float
* gps_passthrough
* xsens
* xsens700
* no_type
* hff
* extended
* ardrone2
* float_invariant


e.g. for the extended filter:
e.g. for the extended filter:
Line 27: Line 43:


== Implementations ==
== Implementations ==
=== ekf2 ===
ekf2 is an Extended Kalman Filter based on the Estimation and Control Library (ECL) from PX4. This filter is able to estimate at best:
* Quaternion defining the rotation from North, East, Down local earth frame to X, Y, Z body frame
* Velocity at the IMU - North, East, Down (m/s)
* Position at the IMU - North, East, Down (m)
* IMU delta angle bias estimates - X, Y, Z (rad)
* IMU delta velocity bias estimates - X, Y, Z(m/s)
* Earth Magnetic field components - North, East, Down (gauss)
* Vehicle body frame magnetic field bias - X, Y, Z (gauss)
* Wind velocity - North, East (m/s)
More information on the filter can be found at: https://docs.px4.io/master/en/advanced_config/tuning_the_ecl_ekf.html
'''Compatible sensors'''
The most complete INS available on Paparazzi can be interfaced with a high number of sensors, to increase robustness and accuracy. Messages that can be fused in the filter are obtained from:
* AGL sensor (e.g. mateksys_3901_l0x)
* Barometer (e.g. MS5611 (SPI))
* IMU (e.g. MPU6000)
* Magnetometer (e.g. ST IST8310)
* GPS (e.g. Ublox)
* Optical Flow (e.g. mateksys_3901_l0x)
'''Optical Flow'''
Optical flow interface allows for robust and velocity estimation when the necessary conditions are met (close to ground, good lighting, good texture, no excessive speed etc.). Optical flow usage is ideal in combination with GPS as it takes over inaccurate dead reckoning when GPS signal is lost. To be sure that optical flow fusion is enabled when the sensor can perform optimally, the user can set several parameters that match the specifications of the used sensor. These parameters are:
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
  <firmware name="any">
    ...
    <subsystem name="ins" type="ekf2">
      <define name="INS_SONAR_MIN_RANGE"  value="0.08" description="AGL sensor minimum range in meters"/>
      <define name="INS_SONAR_MAX_RANGE"  value="3"    description="AGL sensor maximum range in meters"/>
      <define name="USE_RANGE_AID"        value="1"    description="If enabled uses radar sensor as primary AGL source, if possible"/>
      <define name="INS_FLOW_SENSOR_DELAY" value="0"    description="flow/radar message delay in ms"/>
      <define name="INS_MIN_FLOW_QUALITY"  value="110"  description="Minimum quality of the optical flow message accepted [0 to 255]"/>
      <define name="INS_MAX_FLOW_RATE"    value="0"    description="Maximum flow rate the sensor can perceive [in rad/sec]"/>
    <subsystem>
  </firmware>
</source>
}}
Additional information for a correct sensor reading from the module are:
* The interface expects flow values in deg/sec
* The IMU output is used to compensate for rotation. To increase the accuracy of the compensation, an optical flow sensor with mounted IMU should be used (see https://docs.cubepilot.org/user-guides/flow-senor/here-flow)
* Matching the expected flow rotation of the EKF2 with the output of the sensor can be tricky: this guide (https://docs.px4.io/master/en/sensor/optical_flow.html) from PX4 gives a good overview on how the sensor should be mounted on the vehicle for correct functioning.


=== alt_float ===
=== alt_float ===
Line 33: Line 100:
A 2-state Kalman filter that estimates vertical position and vertical velocity from GPS and barometric data.
A 2-state Kalman filter that estimates vertical position and vertical velocity from GPS and barometric data.


When USE_BAROMETER is true:
When ''USE_BAROMETER'' is defined to ''TRUE'':
* GPS horizontal position and horizontal velocity is directly passed through
* GPS horizontal position and horizontal velocity is directly passed through
* GPS vertical position sets the altitude for the barometric reference pressure (QFE)
* GPS vertical position sets the altitude for the barometric reference pressure (QFE)
* Vertical position and velocity is a filtered based on barometric pressure with respect to the reference pressure and GPS vertical velocity readings.
* Vertical position and velocity is a filtered based on barometric pressure with respect to the reference pressure and GPS vertical velocity readings.


When USE_BAROMETER is false or undefined:
When ''USE_BAROMETER'' is not defined, ''FALSE'' or ''0'':
* GPS velocity is directly passed through to the vehicle's state.
* GPS velocity is directly passed through to the vehicle's state.
* GPS horizontal position is directly passed through.
* GPS horizontal position is directly passed through.
Line 48: Line 115:


DEBUG_ALT_KALMAN - Enables debug messages from the subsystem (Default: not defined)
DEBUG_ALT_KALMAN - Enables debug messages from the subsystem (Default: not defined)
e.g. to use with barometer:
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
  <firmware name="fixedwing">
    ...
    <subsystem name="ins" type="alt_float">
      <define name="USE_BAROMETER" value="TRUE"/>
    <subsystem>
  </firmware>
</source>
}}


=== GPS passthrough (gps_passthrough) ===
=== GPS passthrough (gps_passthrough) ===
"dummy" INS that does no filtering whatsoever. It directly passes GPS position and velocity through.
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
  <firmware name="fixedwing or rotorcraft">
    ...
    <subsystem name="ins" type="gps_passthrough"/>
  </firmware>
</source>
}}


=== xsens ===
=== xsens ===
XSens Mti-G
XSens Mti-G
 
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
<source lang="xml">
     <subsystem name="ins" type="xsens">
     <subsystem name="ins" type="xsens">
Line 60: Line 149:
     </subsystem>
     </subsystem>
</source>
</source>
}}


=== xsend700 ===
=== xsens700 ===
XSens Mti-G
XSens Mti-G
 
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
<source lang="xml">
     <load name="ins_xsens_MTiG_fixedwing.xml">
     <load name="ins_xsens_MTiG_fixedwing.xml">
Line 69: Line 159:
     </load>
     </load>
</source>
</source>
}}


=== no_type ===
=== no_type ===
simple INS with float vertical filter
Vertical filter (in float) estimating altitude, vertical velocity and accelerometer bias.


If USE_GPS, horizontal position and velocity is set directly by GPS.
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
<source lang="xml">
   <subsystem name="ins"/>  
   <subsystem name="ins"/>  
</source>
</source>
}}


=== Horizontal Filter Float (hff) ===
=== Horizontal Filter Float (hff) ===
simple with float vertical and horizontal filters for INS
simple with float vertical and horizontal filters for INS
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
  <firmware name="fixedwing or rotorcraft">
    ...
    <subsystem name="ins" type="hff"/>
  </firmware>
</source>
}}


=== extended ===
=== extended ===
Line 88: Line 190:
* accelerometer bias
* accelerometer bias
* barometric offset
* barometric offset
{{Box Code|conf/airframes/myplane.xml|
<source lang="xml">
  <firmware name="fixedwing or rotorcraft">
    ...
    <subsystem name="ins" type="extended"/>
  </firmware>
</source>
}}


'''Parameters'''
'''Parameters'''
Line 93: Line 203:
INS_PROPAGATE_FREQUENCY - Defines the frequency (Hz) of the propagation model (Default: PERIODIC_FREQUENCY)
INS_PROPAGATE_FREQUENCY - Defines the frequency (Hz) of the propagation model (Default: PERIODIC_FREQUENCY)


=== ardrone2 ===
=== vectornav ===
simple INS with float vertical filter for use with ardrone2_sdk
Driver for the Vectornav VN-200 INS, see also [[Sensors/imu#Vectornav_VN-200]].


=== float_invariant ===
=== float_invariant ===
attitude and speed estimation for fixedwings via invariant filter
A full INS estimating attitude, velocity, position and biases via [[invariant filter]]


[[Category:User_Documentation]] [[Category:Subsystems]]
[[Category:User_Documentation]] [[Category:Subsystems]]

Latest revision as of 14:28, 15 March 2021

INS subsystem

The INS (Inertial Navigation System) subsystem specifies which position and velocity estimation algorithm you are using.

Most of the INS filters are only providing position and speed, and they need to be used together with an AHRS (Attitude and Heading Reference System) filter for attitude. Currently, only the experimental invariant filter is a full INS.

Currently possible INS subsystem types are:

Type Point Type Firmwares Notes
ekf2 floating all external
alt_float floating fixedwing
gps_passthrough all
xsens all external
xsens700 all external
no_type all
Horizontal Filter Float (hff) floating
extended floating? all
vectornav all external
float_invariant floating all


e.g. for the extended filter:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="ins" type="extended"/>
  </firmware>

Implementations

ekf2

ekf2 is an Extended Kalman Filter based on the Estimation and Control Library (ECL) from PX4. This filter is able to estimate at best:

  • Quaternion defining the rotation from North, East, Down local earth frame to X, Y, Z body frame
  • Velocity at the IMU - North, East, Down (m/s)
  • Position at the IMU - North, East, Down (m)
  • IMU delta angle bias estimates - X, Y, Z (rad)
  • IMU delta velocity bias estimates - X, Y, Z(m/s)
  • Earth Magnetic field components - North, East, Down (gauss)
  • Vehicle body frame magnetic field bias - X, Y, Z (gauss)
  • Wind velocity - North, East (m/s)

More information on the filter can be found at: https://docs.px4.io/master/en/advanced_config/tuning_the_ecl_ekf.html

Compatible sensors

The most complete INS available on Paparazzi can be interfaced with a high number of sensors, to increase robustness and accuracy. Messages that can be fused in the filter are obtained from:

  • AGL sensor (e.g. mateksys_3901_l0x)
  • Barometer (e.g. MS5611 (SPI))
  • IMU (e.g. MPU6000)
  • Magnetometer (e.g. ST IST8310)
  • GPS (e.g. Ublox)
  • Optical Flow (e.g. mateksys_3901_l0x)

Optical Flow

Optical flow interface allows for robust and velocity estimation when the necessary conditions are met (close to ground, good lighting, good texture, no excessive speed etc.). Optical flow usage is ideal in combination with GPS as it takes over inaccurate dead reckoning when GPS signal is lost. To be sure that optical flow fusion is enabled when the sensor can perform optimally, the user can set several parameters that match the specifications of the used sensor. These parameters are:


File: conf/airframes/myplane.xml
  <firmware name="any">
     ...
    <subsystem name="ins" type="ekf2">
      <define name="INS_SONAR_MIN_RANGE"   value="0.08" description="AGL sensor minimum range in meters"/>
      <define name="INS_SONAR_MAX_RANGE"   value="3"    description="AGL sensor maximum range in meters"/>
      <define name="USE_RANGE_AID"         value="1"    description="If enabled uses radar sensor as primary AGL source, if possible"/>
      <define name="INS_FLOW_SENSOR_DELAY" value="0"    description="flow/radar message delay in ms"/>
      <define name="INS_MIN_FLOW_QUALITY"  value="110"  description="Minimum quality of the optical flow message accepted [0 to 255]"/>
      <define name="INS_MAX_FLOW_RATE"     value="0"    description="Maximum flow rate the sensor can perceive [in rad/sec]"/>
    <subsystem>
  </firmware>

Additional information for a correct sensor reading from the module are:

alt_float

Filters altitude and climb rate for fixedwings.

A 2-state Kalman filter that estimates vertical position and vertical velocity from GPS and barometric data.

When USE_BAROMETER is defined to TRUE:

  • GPS horizontal position and horizontal velocity is directly passed through
  • GPS vertical position sets the altitude for the barometric reference pressure (QFE)
  • Vertical position and velocity is a filtered based on barometric pressure with respect to the reference pressure and GPS vertical velocity readings.

When USE_BAROMETER is not defined, FALSE or 0:

  • GPS velocity is directly passed through to the vehicle's state.
  • GPS horizontal position is directly passed through.
  • Altitude is filtered based on GPS height and vertical velocity data.

Parameters

USE_BAROMETER - Enables the use of barometric data

DEBUG_ALT_KALMAN - Enables debug messages from the subsystem (Default: not defined)

e.g. to use with barometer:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
     ...
    <subsystem name="ins" type="alt_float">
      <define name="USE_BAROMETER" value="TRUE"/>
    <subsystem>
  </firmware>


GPS passthrough (gps_passthrough)

"dummy" INS that does no filtering whatsoever. It directly passes GPS position and velocity through.

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="ins" type="gps_passthrough"/>
  </firmware>

xsens

XSens Mti-G

File: conf/airframes/myplane.xml
    <subsystem name="ins" type="xsens">
      <configure name="XSENS_UART_NR" value="0"/>
      <configure name="XSENS_UART_BAUD" value="B115200"/>
    </subsystem>

xsens700

XSens Mti-G

File: conf/airframes/myplane.xml
    <load name="ins_xsens_MTiG_fixedwing.xml">
      <configure name="XSENS_UART_NR" value="0"/>
    </load>

no_type

Vertical filter (in float) estimating altitude, vertical velocity and accelerometer bias.

If USE_GPS, horizontal position and velocity is set directly by GPS.

File: conf/airframes/myplane.xml
  <subsystem name="ins"/>

Horizontal Filter Float (hff)

simple with float vertical and horizontal filters for INS

File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="ins" type="hff"/>
  </firmware>

extended

Extended vertical filter (in float).

A 4-state Kalman filter that estimates:

  • vertical position
  • vertical speed
  • accelerometer bias
  • barometric offset
File: conf/airframes/myplane.xml
  <firmware name="fixedwing or rotorcraft">
     ...
    <subsystem name="ins" type="extended"/>
  </firmware>

Parameters

INS_PROPAGATE_FREQUENCY - Defines the frequency (Hz) of the propagation model (Default: PERIODIC_FREQUENCY)

vectornav

Driver for the Vectornav VN-200 INS, see also Sensors/imu#Vectornav_VN-200.

float_invariant

A full INS estimating attitude, velocity, position and biases via invariant filter