Difference between revisions of "Module/infrared"

From PaparazziUAV
Jump to navigation Jump to search
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Modules</categorytree>
To use the IR sensors for attitude estimation add the infrared module and ahrs infrared subsystem:
To use the IR sensors for attitude estimation add the infrared module and ahrs infrared subsystem:
{{Box Code|conf/airframes/myplane.xml|
{{Box Code|conf/airframes/myplane.xml|
<pre>
<source lang="xml">
   <firmware name="fixedwing">
   <firmware name="fixedwing">
     <target name="ap"              board="tiny_2.11"/>
     <target name="ap"              board="tiny_2.11"/>
Line 10: Line 11:
     <load name="infrared_adc.xml"/>
     <load name="infrared_adc.xml"/>
   </modules>
   </modules>
</pre>
</source>
}}
}}


The ADC channels are already default to the correct ADCs for your board, but you can of course change the assignments:
The ADC channels are already default to the correct ADCs for your board, but you can of course change the assignments:
{{Box Code|conf/airframes/myplane.xml|
{{Box Code|conf/airframes/myplane.xml|
<pre>
<source lang="xml">
   <modules>
   <modules>
     <load name="infrared_adc.xml"/>
     <load name="infrared_adc.xml"/>
Line 24: Line 25:
     </load>
     </load>
   </modules>
   </modules>
</pre>
</source>
}}
}}


Line 31: Line 32:


The first definitions are relative to the electronic neutral of the sensors (a sensor here is a '''pair''' of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.
The first definitions are relative to the electronic neutral of the sensors (a sensor here is a '''pair''' of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.
 
<source lang="xml">
<section name="INFRARED" prefix="IR_">
  <section name="INFRARED" prefix="IR_">
  <define name="ADC_IR1_NEUTRAL" value="512"/>
    <define name="ADC_IR1_NEUTRAL" value="512"/>
  <define name="ADC_IR2_NEUTRAL" value="512"/>
    <define name="ADC_IR2_NEUTRAL" value="512"/>
  <define name="ADC_TOP_NEUTRAL" value="512"/>
    <define name="ADC_TOP_NEUTRAL" value="512"/>
 
</source>
These neutrals are tuned with the "cupboard test": Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.
These neutrals are tuned with the "cupboard test": Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.


The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following declarations:
The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must  give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following SIGN declarations:
 
<source lang="xml">
  <define name="IR1_SIGN" value="-1"/>
    <define name="IR1_SIGN" value="-1"/>
  <define name="IR2_SIGN" value="-1"/>
    <define name="IR2_SIGN" value="-1"/>
  <define name="TOP_SIGN" value="-1"/>
    <define name="TOP_SIGN" value="-1"/>
 
</source>
Then, define how the horizontal sensor is connected to the airframe, orientation '''aligned''' or '''tilted'''.
Then, define how the horizontal sensor is connected to the airframe, orientation '''aligned''' or '''tilted'''.
* In the aligned case, ir'''1''' is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir'''2''' along the longitudinal one.
* In the aligned case, ir'''1''' is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir'''2''' along the longitudinal one.
Line 52: Line 53:
For help with orientation of '''Previous Versions of Infrared Sensor Boards''' try here : http://paparazzi.enac.fr/wiki/Previous_Infrared_Sensors
For help with orientation of '''Previous Versions of Infrared Sensor Boards''' try here : http://paparazzi.enac.fr/wiki/Previous_Infrared_Sensors


  <define name="HORIZ_SENSOR_ALIGNED"/>
<source lang="xml">
  or
    <define name="HORIZ_SENSOR_ALIGNED"/>
  <define name="HORIZ_SENSOR_TILTED"/>
</source>
or
<source lang="xml">
    <define name="HORIZ_SENSOR_TILTED"/>
</source>


The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:
The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:
 
<source lang="xml">
  <define name="LATERAL_CORRECTION" value="0.7"/>
    <define name="LATERAL_CORRECTION" value="0.7"/>
  <define name="LONGITUDINAL_CORRECTION" value="0.7"/>
    <define name="LONGITUDINAL_CORRECTION" value="0.7"/>
  <define name="VERTICAL_CORRECTION" value="1."/>
    <define name="VERTICAL_CORRECTION" value="1."/>
</source>
Default values are 1.
Default values are 1.


It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.
It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.
  <define name="ROLL_NEUTRAL_DEFAULT" value="-2.5" unit="deg"/>
<source lang="xml">
  <define name="PITCH_NEUTRAL_DEFAULT" value="6" unit="deg"/>
    <define name="ROLL_NEUTRAL_DEFAULT" value="-2.5" unit="deg"/>
 
    <define name="PITCH_NEUTRAL_DEFAULT" value="6" unit="deg"/>
</source>
An asymmetric (left/right, front/rear) correction can be added with a last set of factors.
An asymmetric (left/right, front/rear) correction can be added with a last set of factors.
  <define name="CORRECTION_UP" value="1."/>
<source lang="xml">
  <define name="CORRECTION_DOWN" value="1."/>
    <define name="CORRECTION_UP" value="1."/>
  <define name="CORRECTION_LEFT" value="1."/>
    <define name="CORRECTION_DOWN" value="1."/>
  <define name="CORRECTION_RIGHT" value="1."/>
    <define name="CORRECTION_LEFT" value="1."/>
</section>
    <define name="CORRECTION_RIGHT" value="1."/>
  </section>
</source>
These corrections are set on the angles.
These corrections are set on the angles.
You don't have to set these as they are set to 1. per default, but adjust them if needed.
You don't have to set these as they are set to 1. per default, but adjust them if needed.


[[Category:User_Documentation]] [[Category:Software]] [[Category:Modules]]
[[Category:User_Documentation]] [[Category:Modules]]

Latest revision as of 03:16, 25 March 2012

To use the IR sensors for attitude estimation add the infrared module and ahrs infrared subsystem:

File: conf/airframes/myplane.xml
  <firmware name="fixedwing">
    <target name="ap"              board="tiny_2.11"/>
     ...
    <subsystem name="ahrs"     type="infrared"/>
  </firmware>
  <modules>
    <load name="infrared_adc.xml"/>
  </modules>

The ADC channels are already default to the correct ADCs for your board, but you can of course change the assignments:

File: conf/airframes/myplane.xml
  <modules>
    <load name="infrared_adc.xml"/>
      <configure name="ADC_IR1"        value="ADC_1"/>
      <configure name="ADC_IR2"        value="ADC_2"/>
      <configure name="ADC_IR_TOP"     value="ADC_0"/>
      <configure name="ADC_IR_NB_SAMPLES" value="16"/>
    </load>
  </modules>

Infrared calibration

The INFRARED section describes the configuration of the infrared sensors.

The first definitions are relative to the electronic neutral of the sensors (a sensor here is a pair of thermopiles). A perfect sensor should give 512 if it measures the same value on both sides.

  <section name="INFRARED" prefix="IR_">
    <define name="ADC_IR1_NEUTRAL" value="512"/>
    <define name="ADC_IR2_NEUTRAL" value="512"/>
    <define name="ADC_TOP_NEUTRAL" value="512"/>

These neutrals are tuned with the "cupboard test": Put the sensor in a close box (a cupboard) and read the values of the IR_SENSORS message (ir1, ir2 and vertical). Set the neutrals (they are subtracted from the measurement) to get null values. E.g. if you read 5 for the ir1 value with ADC_IR1_NEUTRAL equal to 512, change the latter to 517.

The next lines define the installation of the horizontal and vertical sensors. The vertical sensor must give a positive value when the temperature under the aircraft is higher than the temperature above. The two channels of the horizontal sensor must give positive values when it is warmer on the right side and the rear side. To adjust these signs, use the following SIGN declarations:

    <define name="IR1_SIGN" value="-1"/>
    <define name="IR2_SIGN" value="-1"/>
    <define name="TOP_SIGN" value="-1"/>

Then, define how the horizontal sensor is connected to the airframe, orientation aligned or tilted.

  • In the aligned case, ir1 is along the lateral axis (The axis that passes through the plane from wingtip to wingtip) and ir2 along the longitudinal one.
  • In the tilted case, the sensors are tilted by 45 degrees; ir1 is along rear-left -- front-right, and ir2 along rear-right -- front-left.

If the airframe construction allows choose an aligned sensor orientation since this gives the best stabilization response results.

For help with orientation of Previous Versions of Infrared Sensor Boards try here : http://paparazzi.enac.fr/wiki/Previous_Infrared_Sensors

    <define name="HORIZ_SENSOR_ALIGNED"/>

or

    <define name="HORIZ_SENSOR_TILTED"/>

The three axis must give similar values for similar contrasts. The following factors can be used to scale these values. For example with an horizontal tilted sensor, the following ratios are usually needed:

    <define name="LATERAL_CORRECTION" value="0.7"/>
    <define name="LONGITUDINAL_CORRECTION" value="0.7"/>
    <define name="VERTICAL_CORRECTION" value="1."/>

Default values are 1.

It may be hard to align the horizontal sensor with the aircraft. A tuning in flight will be needed to adjust the following neutrals. Adjust the roll neutral to fly straight. Adjust the pitch neutral to fly level with the desired throttle.

    <define name="ROLL_NEUTRAL_DEFAULT" value="-2.5" unit="deg"/>
    <define name="PITCH_NEUTRAL_DEFAULT" value="6" unit="deg"/>

An asymmetric (left/right, front/rear) correction can be added with a last set of factors.

    <define name="CORRECTION_UP" value="1."/>
    <define name="CORRECTION_DOWN" value="1."/>
    <define name="CORRECTION_LEFT" value="1."/>
    <define name="CORRECTION_RIGHT" value="1."/>
  </section>

These corrections are set on the angles. You don't have to set these as they are set to 1. per default, but adjust them if needed.