Module/Airspeed ETS

From PaparazziUAV
Revision as of 02:51, 7 March 2012 by Flixr (talk | contribs) (Created page with "<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Modules</categorytree> To use it load the airspeed_ets modul…")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


To use it load the airspeed_ets module:

File: conf/airframes/myplane.xml
  <modules>
    ...
    <load name="airspeed_ets.xml"/>
  </modules>

and add the aggressive climb flag, define which I2C device you are enabling and enable airspeed control:

File: conf/airframes/myplane.xml
  <target name="ap" board="twog_1.0">
    <define name="AGR_CLIMB"/>
    <define name="USE_I2C0"/>
    <define name="USE_AIRSPEED"/>
  </target>

Configuration

You can also set some optional parameters to change the default configuration. For example to use i2c1 instead of i2c0, a scale of 2 (default is 1.8) and offset of 50 (default is 0):

File: conf/airframes/myplane.xml
  <modules>
    <load name="airspeed_ets.xml">
      <define name="AIRSPEED_ETS_SCALE"   value="2"/>
      <define name="AIRSPEED_ETS_OFFSET"  value="50"/>
      <define name="AIRSPEED_ETS_I2C_DEV" value="i2c1"/>
    </load>
  </modules>

Airframe configuration

Now to use real airspeed values for adjusting your aircraft autopilot behavior, add the following to the end of the "VERTICAL CONTROL" section of your airframe file:

File: conf/airframes/myplane.xml
  <section name="VERTICAL_CONTROL" prefix="V_CTL_">
    ....
    <!-- auto airspeed and altitude inner loop (for airspeed sensor) -->
    <define name="AUTO_AIRSPEED_SETPOINT" value="13.0" unit="m/s"/>
    <define name="AUTO_AIRSPEED_PGAIN" value="0.060"/>
    <define name="AUTO_AIRSPEED_IGAIN" value="0.050"/> 
  
    <define name="AUTO_GROUNDSPEED_SETPOINT" value="7.0" unit="m/s"/>
    <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
    <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>
  </section>

Note that the SETPOINT values may need to be adjusted to suit your aircraft.

Note that depending on whether you set the AIRSPEED setpoint or the GROUNDSPEED setpoint higher, either constant airspeed or constant groundspeed, respectively, will be the goal of the controller.

See paparazzi/conf/airframes/easystar_ets_example.xml for an example airframe configuration.

Seeing the speed values

To debug or log the raw values from the ETS airspeed sensor define SENSOR_SYNC_SEND in your airframe file to send the message AIRSPEED_ETS on every sensor reading. Note that defining this sends the AIRSPEED_ETS message at the sensor read rate as defined in conf/modules/airspeed_ets.xml. This does not have any bearing on the AIRSPEED message (if both SENSOR_SYNC_SEND and USE_AIRSPEED are defined, then both messages are sent).

File: conf/airframes/myplane.xml
  <modules>
    <load name="airspeed_ets.xml">
      <define name="SENSOR_SYNC_SEND"/>
    </load>
  </modules>

The general airspeed can be displayed in the Messages tool by adding the AIRSPEED message to /conf/telemetry/default.xml as follows:

 <process name="Ap">
   <mode name="default">
     <message name="AIRSPEED"   period="1.0"/>
     ...

The AIRSPEED_ETS message does NOT need to be added to the telemetry configuration since it is sent directly by the module if SENSOR_SYNC_SEND is defined.

NOTES

  1. In the GCS, the strip displays ground speed and **not** airspeed by default. In order to display airspeed, drag-and-drop the airspeed message field from the Messages tool onto the 2D map of the GCS.
  2. The telemetry name AIRSPEED" should actually be called SPEED and contains Groundspeed and airspeed return values.