Difference between revisions of "Subsystem/ahrs"

From PaparazziUAV
Jump to navigation Jump to search
m
(added ahrs_float_cmpl_rmat)
Line 16: Line 16:
</pre>
</pre>
}}
}}
== Implementations ==


There is a test program ( sw/airborne/test/ahrs/compare_ahrs.py ) to compare different AHRS implementations on simple test cases.
There is a test program ( sw/airborne/test/ahrs/compare_ahrs.py ) to compare different AHRS implementations on simple test cases.
Line 35: Line 37:


=== Complementary Quaternion (fixed point) ===
=== Complementary Quaternion (fixed point) ===
Currently not recommended for fixedwings, as this filter doesn't compensate for centrifugal force when flying turns.
The capability for this is already there (with AHRS_GRAVITY_UPDATE_COORDINATED_TURN), but it isn't fed with the necessary data yet.
Other flags of interest are:
*AHRS_PROPAGATE_LOW_PASS_RATES : apply a low pass filter on rotational velocity
*AHRS_MAG_UPDATE_YAW_ONLY : use mag to update yaw only
For the latest integer complementary quaternion filter (int_cmpl_quat):
{{Box Code|conf/airframes/myplane.xml|
<pre>
  <firmware name="rotorcraft">
    ...
    <subsystem name="ahrs" type="int_cmpl_quat"/>
  </firmware>
  <section name="AHRS" prefix="AHRS_">
    <define name="H_X" value=" 0.51562740288882"/>
    <define name="H_Y" value="-0.05707735220832"/>
    <define name="H_Z" value=" 0.85490967783446"/>
  </section>
</pre>
}}
Also see the [[Subsystem/ahrs#Local_Magnetic_Field|Local Magnetic Field]] section.
=== Complementary Rotation Matrix (floating point) ===
If you are '''NOT''' using the dev branch, this is currently not recommended for fixedwings, as this filter doesn't compensate for centrifugal force when flying turns.
If you are '''NOT''' using the dev branch, this is currently not recommended for fixedwings, as this filter doesn't compensate for centrifugal force when flying turns.
In the dev branch this is fixed (but untested) and the needed AHRS_GRAVITY_UPDATE_COORDINATED_TURN already set by default for a fixedwing firmware.
In the dev branch this is fixed (but untested) and the needed AHRS_GRAVITY_UPDATE_COORDINATED_TURN already set by default for a fixedwing firmware.
Line 43: Line 72:




For the latest integer complementary quaternion filter (int_cmpl_quat):
{{Box Code|conf/airframes/myplane.xml|
{{Box Code|conf/airframes/myplane.xml|
<pre>
<pre>
   <firmware name="rotorcraft">
   <firmware name="rotorcraft">
     ...
     ...
     <subsystem name="ahrs" type="int_cmpl_quat"/>
     <subsystem name="ahrs" type="float_cmpl_rmat"/>
   </firmware>
   </firmware>


Line 57: Line 85:
   </section>
   </section>
</pre>
</pre>
}}  
}}


Also see the [[Subsystem/ahrs#Local_Magnetic_Field|Local Magnetic Field]] section.


=== DCM (floating point) ===
=== Infrared ===
== Local Magnetic Field ==
To calculate the normalised local magnetic field insert the relevant location coordinates [http://www.ngdc.noaa.gov/geomagmodels/IGRFWMM.jsp here]and calculate.
To calculate the normalised local magnetic field insert the relevant location coordinates [http://www.ngdc.noaa.gov/geomagmodels/IGRFWMM.jsp here]and calculate.


Line 72: Line 106:
Screenshot of scilab page.
Screenshot of scilab page.
[[Image:Normalised_mag_fields.png|240px]]
[[Image:Normalised_mag_fields.png|240px]]
=== DCM (floating point) ===
=== Infrared ===




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

Revision as of 13:29, 7 December 2011

AHRS subsystem

The AHRS subsystem specifies which attitude estimation filter you are using.

Currently possible AHRS subsystems are

  • int_cmpl_quat
  • int_cmpl_euler
  • float_dcm

e.g. for the latest complementary filter:

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

Implementations

There is a test program ( sw/airborne/test/ahrs/compare_ahrs.py ) to compare different AHRS implementations on simple test cases.

Complementary Euler (fixed point)

Not recommended for fixedwings, as this filter doesn't compensate for centrifugal force when flying turns.

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

  <section name="MISC">
    <define name="FACE_REINJ_1" value="1024"/>
  </section>

Complementary Quaternion (fixed point)

Currently not recommended for fixedwings, as this filter doesn't compensate for centrifugal force when flying turns. The capability for this is already there (with AHRS_GRAVITY_UPDATE_COORDINATED_TURN), but it isn't fed with the necessary data yet.

Other flags of interest are:

  • AHRS_PROPAGATE_LOW_PASS_RATES : apply a low pass filter on rotational velocity
  • AHRS_MAG_UPDATE_YAW_ONLY : use mag to update yaw only


For the latest integer complementary quaternion filter (int_cmpl_quat):

File: conf/airframes/myplane.xml
  <firmware name="rotorcraft">
     ...
    <subsystem name="ahrs" type="int_cmpl_quat"/>
  </firmware>

  <section name="AHRS" prefix="AHRS_">
    <define name="H_X" value=" 0.51562740288882"/>
    <define name="H_Y" value="-0.05707735220832"/>
    <define name="H_Z" value=" 0.85490967783446"/>
  </section>

Also see the Local Magnetic Field section.

Complementary Rotation Matrix (floating point)

If you are NOT using the dev branch, this is currently not recommended for fixedwings, as this filter doesn't compensate for centrifugal force when flying turns. In the dev branch this is fixed (but untested) and the needed AHRS_GRAVITY_UPDATE_COORDINATED_TURN already set by default for a fixedwing firmware.

Other flags of interest are:

  • AHRS_PROPAGATE_LOW_PASS_RATES : apply a low pass filter on rotational velocity
  • AHRS_MAG_UPDATE_YAW_ONLY : use mag to update yaw only


File: conf/airframes/myplane.xml
  <firmware name="rotorcraft">
     ...
    <subsystem name="ahrs" type="float_cmpl_rmat"/>
  </firmware>

  <section name="AHRS" prefix="AHRS_">
    <define name="H_X" value=" 0.51562740288882"/>
    <define name="H_Y" value="-0.05707735220832"/>
    <define name="H_Z" value=" 0.85490967783446"/>
  </section>

Also see the Local Magnetic Field section.

DCM (floating point)

Infrared

Local Magnetic Field

To calculate the normalised local magnetic field insert the relevant location coordinates hereand calculate.


Screenshot of noaa page. Noaa mag data.png


Copy the north(x),east(y),vertical(z) component values into scilab and execute "X/norm(X)".


Screenshot of scilab page. Normalised mag fields.png