Difference between revisions of "Subsystem/imu"

From PaparazziUAV
Jump to: navigation, search
(added some more imu calib stuff)
Line 1: Line 1:
 
Currently possible IMU subsystems are
 
Currently possible IMU subsystems are
* "[[AspirinIMU|aspirin]]"
+
* ''[[AspirinIMU|aspirin]]''
* "b2_v1.0"
+
* ''b2_v1.0''
* "b2_v1.1"
+
* ''b2_v1.1''
* "b2_v1.2"
+
* ''b2_v1.2''
* "crista"
+
* ''yai''
* "analog"
+
* ''crista''
* "ppzuav"
+
* ''analog''
 +
* ''ppzuav''
  
 
Other IMUs can be used through modules or you can just add a subsystem makefile for your own. Also see the [[ImuCalibration|IMU calibration]] page.
 
Other IMUs can be used through modules or you can just add a subsystem makefile for your own. Also see the [[ImuCalibration|IMU calibration]] page.
Line 17: Line 18:
 
</pre>
 
</pre>
 
}}
 
}}
Paparazzi has a [[ImuCalibration#Body_to_IMU_rotation|parameter]] to define the orientation of the IMU with respect to the body of the vehicle:  
+
 
 +
=== Defining the calibration ===
 +
In the IMU section the [[ImuCalibration|IMU calibration]] is defined and looks something like this:
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<pre>
 +
  <section name="IMU" prefix="IMU_">
 +
    <define name="GYRO_P_NEUTRAL" value="32362" />
 +
    <define name="GYRO_Q_NEUTRAL" value="32080" />
 +
    <define name="GYRO_R_NEUTRAL" value="32096" />
 +
 
 +
    <define name="GYRO_P_SENS" value="1.1032765" integer="16" />
 +
    <define name="GYRO_Q_SENS" value="1.1360802599" integer="16" />
 +
    <define name="GYRO_R_SENS" value="1.1249874614" integer="16" />
 +
 
 +
    <define name="ACCEL_X_SENS" value="2.45932966" integer="16"/>
 +
    <define name="ACCEL_Y_SENS" value="2.45106376" integer="16"/>
 +
    <define name="ACCEL_Z_SENS" value="2.47825717" integer="16"/>
 +
 
 +
    <define name="ACCEL_X_NEUTRAL" value="31886"/>
 +
    <define name="ACCEL_Y_NEUTRAL" value="32162"/>
 +
    <define name="ACCEL_Z_NEUTRAL" value="32941"/>
 +
 
 +
    <define name="MAG_X_SENS" value="3.17378921476" integer="16"/>
 +
    <define name="MAG_Y_SENS" value="3.14663275967" integer="16"/>
 +
    <define name="MAG_Z_SENS" value="3.26531022727" integer="16"/>
 +
 
 +
    <define name="MAG_X_NEUTRAL" value="2059"/>
 +
    <define name="MAG_Y_NEUTRAL" value="1944"/>
 +
    <define name="MAG_Z_NEUTRAL" value="2099"/>
 +
  </section>
 +
</pre>
 +
}}
 +
 
 +
See the [[ImuCalibration|IMU calibration]] page for the actual calibration instructions.
 +
 
 +
==== 45deg Mag hack ====
 +
If your magnetometer axes are rotated by 45deg around z. (e.g. with external mag on booz imu v1.0)
 +
 
 +
{{Box Code|conf/airframes/myplane.xml|
 +
<pre>
 +
  <section name="IMU" prefix="IMU_">
 +
    ...
 +
    <define name="MAG_45_HACK" value="1" />
 +
    <!--define name="MAG_X_SENS" value="5.14821844457 * sqrt(2)/2" integer="16"/-->
 +
    <!--define name="MAG_Y_SENS" value="5.11810156597 * sqrt(2)/2" integer="16"/-->
 +
    <define name="MAG_X_SENS" value="3.640340173" integer="16"/>
 +
    <define name="MAG_Y_SENS" value="3.619044324" integer="16"/>
 +
    <define name="MAG_Z_SENS" value="5.07618333556" integer="16"/>
 +
  </section>
 +
</pre>
 +
}}
 +
 
 +
=== Defining the orientation of the IMU ===
 +
Paparazzi has a [[ImuCalibration#Body_to_IMU_rotation|parameter]] to define the orientation of the IMU with respect to the body of the vehicle.
 +
 
 +
Not defining these values is the same as setting them to zero:
 
{{Box Code|conf/airframes/myplane.xml|
 
{{Box Code|conf/airframes/myplane.xml|
 
<pre>
 
<pre>
     <define name="BODY_TO_IMU_PHI"  value="RadOfDeg( 0. )"/>
+
  <section name="IMU" prefix="IMU_">
     <define name="BODY_TO_IMU_THETA" value="RadOfDeg( 0. )"/>
+
    ...
     <define name="BODY_TO_IMU_PSI"  value="RadOfDeg( 0. )"/>
+
     <define name="BODY_TO_IMU_PHI"  value="RadOfDeg(0.0)"/>
 +
     <define name="BODY_TO_IMU_THETA" value="RadOfDeg(0.0)"/>
 +
     <define name="BODY_TO_IMU_PSI"  value="RadOfDeg(0.0)"/>
 +
  </section>
 
</pre>
 
</pre>
 
}}
 
}}
 +
  
 
[[Category:Software]] [[Category:User_Documentation]] [[Category:Subsystems]]
 
[[Category:Software]] [[Category:User_Documentation]] [[Category:Subsystems]]

Revision as of 06:52, 24 November 2011

Currently possible IMU subsystems are

  • aspirin
  • b2_v1.0
  • b2_v1.1
  • b2_v1.2
  • yai
  • crista
  • analog
  • ppzuav

Other IMUs can be used through modules or you can just add a subsystem makefile for your own. Also see the IMU calibration page.

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

Defining the calibration

In the IMU section the IMU calibration is defined and looks something like this:

File: conf/airframes/myplane.xml
  <section name="IMU" prefix="IMU_">
    <define name="GYRO_P_NEUTRAL" value="32362" />
    <define name="GYRO_Q_NEUTRAL" value="32080" />
    <define name="GYRO_R_NEUTRAL" value="32096" />

    <define name="GYRO_P_SENS" value="1.1032765" integer="16" />
    <define name="GYRO_Q_SENS" value="1.1360802599" integer="16" />
    <define name="GYRO_R_SENS" value="1.1249874614" integer="16" />

    <define name="ACCEL_X_SENS" value="2.45932966" integer="16"/>
    <define name="ACCEL_Y_SENS" value="2.45106376" integer="16"/>
    <define name="ACCEL_Z_SENS" value="2.47825717" integer="16"/>

    <define name="ACCEL_X_NEUTRAL" value="31886"/>
    <define name="ACCEL_Y_NEUTRAL" value="32162"/>
    <define name="ACCEL_Z_NEUTRAL" value="32941"/>

    <define name="MAG_X_SENS" value="3.17378921476" integer="16"/>
    <define name="MAG_Y_SENS" value="3.14663275967" integer="16"/>
    <define name="MAG_Z_SENS" value="3.26531022727" integer="16"/>

    <define name="MAG_X_NEUTRAL" value="2059"/>
    <define name="MAG_Y_NEUTRAL" value="1944"/>
    <define name="MAG_Z_NEUTRAL" value="2099"/>
  </section>

See the IMU calibration page for the actual calibration instructions.

45deg Mag hack

If your magnetometer axes are rotated by 45deg around z. (e.g. with external mag on booz imu v1.0)


File: conf/airframes/myplane.xml
  <section name="IMU" prefix="IMU_">
    ...
    <define name="MAG_45_HACK" value="1" />
    <!--define name="MAG_X_SENS" value="5.14821844457 * sqrt(2)/2" integer="16"/-->
    <!--define name="MAG_Y_SENS" value="5.11810156597 * sqrt(2)/2" integer="16"/-->
    <define name="MAG_X_SENS" value="3.640340173" integer="16"/>
    <define name="MAG_Y_SENS" value="3.619044324" integer="16"/>
    <define name="MAG_Z_SENS" value="5.07618333556" integer="16"/>
  </section>

Defining the orientation of the IMU

Paparazzi has a parameter to define the orientation of the IMU with respect to the body of the vehicle.

Not defining these values is the same as setting them to zero:

File: conf/airframes/myplane.xml
  <section name="IMU" prefix="IMU_">
    ...
    <define name="BODY_TO_IMU_PHI"   value="RadOfDeg(0.0)"/>
    <define name="BODY_TO_IMU_THETA" value="RadOfDeg(0.0)"/>
    <define name="BODY_TO_IMU_PSI"   value="RadOfDeg(0.0)"/>
  </section>