paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] BMP085 sensor temperature wiht large error


From: Martin Mueller
Subject: Re: [Paparazzi-devel] BMP085 sensor temperature wiht large error
Date: Fri, 05 Aug 2011 22:15:58 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11

Hi Helge,

yes, should be like you said. Committed. Seems they try to get some extra accuracy if the resulting number would still fit in 32 bits.

Thanks,
Martin

On 05.08.2011 21:47, Helge Walle wrote:
Hi Martin,

Thank you very much, that really made a difference! I am not sure if I
would have found that one.

While trying to analyze the code I noticed something in:

void baro_bmp_event( void ) {
.....
/* compensate pressure */
.....
if (bmp_b7 < 0x80000000)
    bmp_p = (bmp_b7 * 2) / bmp_b4;
else
    bmp_p = (bmp_b7 * bmp_b4) * 2;
.....

According to the BMP085 datasheet, should the last statement rather be:
bmp_p = (bmp_b7 / bmp_b4) * 2;     ?

Thanks again,
Helge.




2011/8/5 Martin Mueller <address@hidden <mailto:address@hidden>>

    Hi Helge,

    the extra noise is from reading the lower three bits of the pressure
    result wrongly. They are in the higher bits of the XLSB, not the
    lower, fixed in master:

    @@ -130,7 +130,7 @@ void baro_bmp_event( void ) {
           /* get uncompensated pressure, oss=3 */
           bmp_up = (bmp_trans.buf[0] << 11) |
                    (bmp_trans.buf[1] << 3)  |
    -                bmp_trans.buf[2];
    +               (bmp_trans.buf[2] >> 5);
           /* start temp measurement */
           bmp_trans.buf[0] = BMP085_CTRL_REG;
           bmp_trans.buf[1] = BMP085_START_TEMP;

    Thanks for looking into that.

    As the max conversion time is 25.5ms it could be run at 30Hz without
    changes, maybe having the temp reading only once per second as
    suggested in the spec. Some averaging could be done depending on the
    frequency you need.

    Martin

    http://paparazzi.enac.fr/wiki___images/Bmp085_scp1000.png
    <http://paparazzi.enac.fr/wiki_images/Bmp085_scp1000.png>
    http://paparazzi.enac.fr/wiki___images/Bmp085_scp1000_fixed.__png
    <http://paparazzi.enac.fr/wiki_images/Bmp085_scp1000_fixed.png>


    On 04.08.2011 11:36, Helge Walle wrote:

        Hi,
        To make sure that the sample rate is not set so high that it
        interferes
        with the conversion time of the BMP sensor, I would need to
        check the
        data flow with my logic analyzer.
        I did not do that yesterday evening. However, Increasing freq
        from "8"
        to "20" in .../paparazzi/conf/modules/__baro_bmp.xml increased
        the data
        flow and did not create any problems.
        The code I used with my Arduino board that made better results
        was from
        Sparkfun. I am quite determined to work through the code since I
        feel
        sure that this is the right way to go.

        Regards,
        Helge.


    _________________________________________________
    Paparazzi-devel mailing list
    address@hidden <mailto:address@hidden>
    https://lists.nongnu.org/__mailman/listinfo/paparazzi-__devel
    <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]