paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] airspeed_adc with Ardupilot airspeed sensor


From: Tilman Baumann
Subject: Re: [Paparazzi-devel] airspeed_adc with Ardupilot airspeed sensor
Date: Mon, 02 Jul 2012 16:18:31 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120614 Thunderbird/13.0.1

On 02/07/12 15:56, Gareth Roberts wrote:
Hi Tilman,

It's the same sensor as the ardupilot classic - it's not great.
but cheap. :D


From http://code.google.com/p/ardupilot/source/browse/ArduPilot_2_8/sensors.pde

// in M/S * 100
void read_airspeed(void)
{
        #if GCS_PROTOCOL != 3
airpressure_raw = ((float)analogRead(AIRSPEED_PIN) * .10) + (airpressure_raw * .90);
        airpressure     = (int)airpressure_raw - airpressure_offset;
        airpressure     = max(airpressure, 0);
I suppose up until here it's all filtering?
airspeed = sqrt((float)airpressure / AIRSPEED_RATIO) * 100;

Have to put my thinking cap on for a while. Calculation looks similar enough that I could turn that into ppz style
  float airspeed = (adc_airspeed_val - AIRSPEED_BIAS);
  airspeed = sqrtf(airspeed) * AIRSPEED_QUADRATIC_SCALE;


#endif


        airspeed_error = airspeed_cruise - airspeed;
}

#define AIRSPEED_RATIO 0.1254 // If your airspeed is under-reporting, increase this value to something like .2

Cheers,
Gareth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]