Difference between revisions of "Airspeed sensor"

From PaparazziUAV
Jump to navigation Jump to search
 
Line 1: Line 1:
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.  
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
=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 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).
Line 7: Line 7:


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,  
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:
First, connect the sensor directly to the TWOG (J6). The sensor module wires are:
Line 17: Line 15:
   
   
Then, in the airframe file (near the end of the file), you have to add:
Then, in the airframe file (near the end of the file), you have to add:
# EagleTree airspeed sensor
ap.CFLAGS += -DUSE_AIRSPEED_ETS -DUSE_AIRSPEED -DUSE_I2C0 -DAGR_CLIMB
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
ap.srcs += airspeed.c airspeed_ets.c i2c.c $(SRC_ARCH)/i2c_hw.c
Line 30: Line 26:
     <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
     <define name="AUTO_GROUNDSPEED_PGAIN" value="0.75"/>
     <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>     
     <define name="AUTO_GROUNDSPEED_IGAIN" value="0.25"/>     
Note that the SETPOINT values may need to be adjusted to suit your airframe.
Note that the SETPOINT values may need to be modified.
   
   
See paparazzi3/conf/airframes/easystar2.xml for an example airframe configuration.
See paparazzi3/conf/airframes/easystar2.xml for an example airframe configuration.
Thanks to [http://vrhome.net/vassilis/ Vassilis] for developing and testing the code.

Revision as of 02:03, 26 July 2010

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,

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: 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 adjusted to suit your airframe.

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

Thanks to Vassilis for developing and testing the code.