Barometer question - Current location altitude error

Hi!

I’m writing because I have some problems with the barometer readings of the APM v.1 hardware (sensor BMP085). I'm using the ArduPlane code version 2.32.

When I tried to do automatic landings I saw that the autopilot had problems with getting the correct altitude to  turn off the motor or was coming to hight or to low. After checking the logs I concluded that the problem was the initialization of the home altitude.In each log I saw the same pattern:

During the first 15-20 executions of the main loop program, the home altitude is 0 and then is set to the current_loc.alt value. The problem is that at that moment the current_loc.alt had accumulated an error of approximately 22 meters as is shown in the next graphic. I'm using altitude_mix = 1 (barometric altitude).

3690952190?profile=originalcurrent_loc.alt graphic - [m]

I founded that this error in the current_loc.alt value responds to a difference between the ground pressure (estimated in the init_barometer() function) and the pressure that the barometer sense during the main loop execution as is shown in the next graphic.

3690952115?profile=originalpressures [hPa]

It can be seen that in the first execution of the main loop, the ground pressure and the pressure sensed by the barometer are equal, but after 20-25 execution of main loop the pressure sensed by the barometer differs from the ground_press in approximately 300 Pa. I have made different test to check this error and I always get a difference between the “ground pressure” and the “current pressure” at approximately the same number of executions. It seems to be a systematic error in my case.

I tried different solutions to solve this problem but without any successful:

  • getting more readings from the barometer in the init_barometer() function.
  • calling the init_barometer() after the init_ardupilot() function so the time between the barometer calibration and the first lecture in the main loop is equal to the time between barometer readings in the main loop.

Had anyone experienced this situation? Does anyone had an idea of what can be the problem? Could be a communication problem of the barometric sensor BMP085 when it is running with another sensors? (In the init_barometer() function the barometer is call “alone” while when is running the main loop, the barometer is call between calls to another sensor like airspeed sensor or magnetometer).

I'll appreciate any comments on this problem. If it is needed a more detailed explanation, just let me know.

I post some logs with the barometric measurements. There is a special section call “BAR” in which is logged the next data:

  • home.alt ([cm])
  • gps->alt ([cm])
  • current_loc.alt ([cm])
  • ground_press (ground pressure estimated in the function init_barometer [Pa])
  • current_press (pressure sensed by the barometer in each execution of main loop [Pa])
  • ground_temp (barometer calibration temperature [10·C])
  • delta_t_baro (time between calls to method barometer.read() [ms])

Regards,

               Diego.

20120803-BaroTest-1-w.log

20120803-BaroTest-3-w.log

You need to be a member of diydrones to add comments!

Join diydrones

Replies

  • I repetead the test with the ArduPlane version 2.50. It performed much better than the version 2.32. In the next graphics are shown the current_loc.alt and the barometer readings.

    3692484036?profile=originaltest 2 - pressure [hPa]

     

    3692484304?profile=originaltest 2 - current_loc.alt [m]

    I have marked in the pressure graphic with a yellow ellipse a small pressure drop that happen during de firsts executions. This pressure variation is the same that I had noted in the code v2.32 but now in version 2.50 is smaller. In the next graphic is shown this pressure drop for another log. Regardless the current_loc altitude error is very small.

    3692484226?profile=originaltest 3 - pressure [hPa]

    Regards,

                 Diego.

    20120806-test2-siGPS-w.log

    20120806-test3-siGPS-w.log

    https://storage.ning.com/topology/rest/1.0/file/get/3692484321?profile=original
  • 3D Robotics

    ArduPlane 2.32 is very old and there have been many changes, including to the baro library, since then. Please upgrade to 2.50 and see if the issue goes away. 

  • Developer

    Very detailed analysis.  We really need some ArduPlane people to look at this.  I'm mostly arducopter and we haven't seen this issue.

This reply was deleted.

Activity

DIY Robocars via Twitter
yesterday
DIY Robocars via Twitter
yesterday
DIY Drones via Twitter
Thursday
DIY Robocars via Twitter
RT @Heavy02011: @diyrobocars : A Home-brew computer club* for Connected Autonomous Driving on Jan 23rd, 2021 https://www.meetup.com/Connected-Autonomous-Driving/events/275728684/ #Meetu…
Thursday
DIY Robocars via Twitter
Thursday
David Hori liked Isabella Domi's profile
Wednesday
DIY Robocars via Twitter
RT @Heavy02011: ⁦@diyrobocars⁩ Autonomous Driving Assembly at #rC3. join us at https://rc3.world/rc3/assembly/diyrobocars-f1tenth/ ⁦@f1tenth⁩ ⁦@DAVGtech⁩ ⁦@DWalmroth⁩…
Monday
DIY Robocars via Twitter
RT @chr1sa: New car designs coming for our next @DIYRobocars @donkey_car virtual race on the 23rd. Choose any one you want at race time Le…
Monday
DIY Robocars via Twitter
RT @RoboticMasters: Thanks to @EllerbachMaxime and the Sydney Uni Capstone Students the @donkey_car @diyrobocars simulator is getting a ma…
Monday
DIY Robocars via Twitter
Jan 6
DIY Robocars via Twitter
Dec 28, 2020
DIY Robocars via Twitter
An interesting line-following simulator to use with with your robocars: https://github.com/ron-grant/LFS
Dec 23, 2020
DIY Robocars via Twitter
Dec 23, 2020
DIY Robocars via Twitter
An improved version of the @IntelAIResearch OpenBot: https://diyrobocars.com/2020/12/14/an-improved-version-of-the-intel-openbot/
Dec 14, 2020
DIY Drones via Twitter
An improved version of the Intel OpenBot https://ift.tt/2KkHT8Q
Dec 14, 2020
DIY Robocars via Twitter
Dec 10, 2020
More…