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: Hector Garcia de Marina
Subject: Re: [Paparazzi-devel] airspeed_adc with Ardupilot airspeed sensor
Date: Mon, 2 Jul 2012 17:29:58 +0200



On Mon, Jul 2, 2012 at 5:18 PM, Tilman Baumann <address@hidden> wrote:
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?

Yes,

airpressure_raw = ((float)analogRead(AIRSPEED_PIN) * .10) + (airpressure_raw * .90);

is a first order low pass filter. You must be careful here, as the coefficients are hard coded, if you change the
sample time, the cut frequency changes. You should put this coefficients as functions of the sample time.

Take a look at wikipedia (Discrete time realization): http://en.wikipedia.org/wiki/Low-pass_filter

Héctor



reply via email to

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