paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] BMP085 sensor


From: Helge Walle
Subject: Re: [Paparazzi-devel] BMP085 sensor
Date: Wed, 3 Aug 2011 14:28:17 +0200

Got it, thanks for the correction!

Helge.

2011/8/3 Gautier Hattenberger <address@hidden>
I think you're not correct actually.
The main loop is written like this:

init calls
while (true) {
 if (1/60s since last periodic call) { periodic calls }
 event calls
}

So, the event calls are as fast as possible. Only the periodic functions are called with a fixed period.

Gautier

On 03/08/2011 13:50, Helge Walle wrote:
Thanks a lot for your help Gautier!

I did a few trial compilations with different frequencies between 1 and 60, and modules.h was generated in the way I expected.
Please correct me if I am wrong, but I assume that in the case of my TWOG based fixed wing aircraft the continuous polling of event functions always happen at 60hz.

Helge.


2011/8/3 Gautier Hattenberger <address@hidden>
Hi,

i7 is a prescaler mechanism that calls a function (here baro_bmp_periodic) with the correct frequency (specified in the xml file) based on the main loop frequency (60Hz for fixed wing, 512Hz for rotorcraft). You can specify any frequency lower or equal to the main loop, but if it's not a divider of it, the module's periodic function will not be called with the exact frequency.
The event functions are polled continuously when the periodic functions are not called (here, probably much more than 8 times as often as the baro_bmp_periodic...).

Gautier

On 03/08/2011 10:37, Helge Walle wrote:

Hi,

I have studied baro_bmp.c trying to find the reason why readings from the BMP085 sensor seems to wander in steps of up to +/- 0.5 hPa around “center”. This amounts to approx +/- 4m at sea level. No luck so far, however.

The program selects a high resolution setting of the sensor. As far as the BMP085 datasheet goes I would expect values in the SENSOR_SYNC_SEND message to have a higher resolution. I want to look more at this, but a few questions arise.

In .../var/<my_aircraft>/generated/modules.h there is this code:

…..
static inline void modules_init(void) {
   baro_bmp_init();
}
static inline void modules_periodic_task(void) {
   static uint8_t i7; i7++; if (i7>=7) i7=0;
   if (i7 == 0) {
      baro_bmp_periodic();
   }
}
static inline void modules_event_task(void) {
   baro_bmp_event();
}
…..

I suppose this code is based on .../conf/modules/baro_bmp.xml. But what is the effect of i7 and how/where is it generated?
It looks to me as if baro_bmp_event() is run 8 times as often as baro_bmp_periodic(). Is this correct?

Could someone please explain a little about this?

Thanks for any help,

Helge.




_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel


_______________________________________________ Paparazzi-devel mailing list address@hidden https://lists.nongnu.org/mailman/listinfo/paparazzi-devel

_______________________________________________
Paparazzi-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/paparazzi-devel



reply via email to

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