Airspeed sensor

From PaparazziUAV
Revision as of 00:49, 26 July 2010 by Markgriffin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

By default, airspeed is estimated by measuring the GPS ground speed. This gives reasonable results particularly in calm conditions. Airspeed sensors measure actual airspeed resulting in better performance especially in windy conditions.

Connecting the EagleTree Airspeed Sensor

The module is low cost and comes with a very good pitot tube (Prandtl style, pitot-static tube) that includes static and dynamic ports. The autopilot code has been modified to regulate the throttle in order to keep the airspeed constant (and a minimum ground speed).


The EagleTree Airspeed sensor is quite easy to connect to the Tiny/TWOG . The sensor has an I2C interface that connects directly to the Tiny/TWOG I2C port. I was able to figure out the slave address and decode the raw output of the sensor. The results are quite good,

Note that Vassilis developed and tested the code (see http://vrhome.net/vassilis/).

First, connect the sensor directly to the TWOG (J6). The sensor module wires are: Red wire: 5V White wire: Ground Yellow wire: SDA Brown wire: SCL

Then, in the airframe file (near the end of the file), you have to add:

  1. EagleTree airspeed sensor

ap.CFLAGS += -DUSE_AIRSPEED_ETS -DUSE_AIRSPEED -DUSE_I2C0 -DAGR_CLIMB ap.srcs += airspeed.c airspeed_ets.c i2c.c $(SRC_ARCH)/i2c_hw.c

At the end of the "VERTICAL CONTROL" section of the airframe file, you have to add:

   <define name="AUTO_AIRSPEED_SETPOINT" value="15.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="6.0" unit="m/s"/>
   <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
   <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>    

Note that the SETPOINT values may need to be modified.

See paparazzi3/conf/airframes/easystar2.xml for an example airframe configuration.