openxsensor with BMP280

Development & General Chat for the superb openxvario project.

Moderator: rainer

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Mon Jan 16, 2017 10:06 pm

Good tests.
Indeed, oXs MS5611 performs better than the 2 others.
I think that Frsky high precision uses also a MS5611 but the filter being used is not has good as oXs.
For Altitude, Frsky uses probably less filtering on the raw values provided by the sensor. Therefore it reacts faster than oXs but I do not think that it is usefull having a shorter reaction time on Altitude.

For Vspeed, MS5611 oXs reacts even fast as the other sensors but with less noise.

Note : oXs can also support an IMU and it will them combine the raw altitude from baro sensor with the vertical acceleration provided by IMU.
I think that this solution is even better and reduce the reaction lag of the vario by about 0.5 sec.
This solution is not much more expensive because a GY-86 module (with baro and imu) is only a few euro more than a Gy-63 (mS5611) on aliexpress.

User avatar
kalle123
Posts: 684
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: openxsensor with BMP280

Post by kalle123 » Tue Jan 17, 2017 9:55 am

maisky wrote:I tried to use a cordless screwdriver with a belt pulley to raise and lower the sensor. To control the motor I used a ESC.
So I have a chance to synchronize the measurements (with additional FrSKY High precision Sensor).
So you moved 3 sensors simultaneously in vertical or did you test one sensor after another? Over what height?

And please explain the scaling on the axis in the diagram, you posted.

br

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Tue Jan 17, 2017 6:22 pm

Hi kale123,

I moved the BMP280 and MS5611 simultaneously. Both sensors are connected to the same Arduino. and both sensors are logged simultaneously by the Taranis.
The FrSKY high precision Vario I moved in a second test run.
To synchronize both data series I controlled the cordless screwdriver by a free channel of the Taranis. This channel is also logged in the data series.
So I can synchronize both data series (with Excel) and generate this diagram.
The movement height is around 2m. (upper diagram)
The lower diagram shows Vspeed, measured in meters per second.

User avatar
kalle123
Posts: 684
Joined: Sat Mar 29, 2014 10:59 am
Country: -
Location: Moenchengladbach

Re: openxsensor with BMP280

Post by kalle123 » Wed Jan 18, 2017 6:49 am

@maisky.

Thank you. That explains .......

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Wed Jan 18, 2017 7:57 pm

Hi,
Yesterday I did two more tests with different values for Sensitivity.
Maybe this is also interesting for you.
The first tests were with sensitivity = 50. Yesterday I measured with sensitivity = 25 and Sensitivity = 100.
In the height measurement I can see no big differences (compare_Alt).
But for speed the influence of the filter is good to see.

regards
Attachments
compare_Vsped_Sensitivity.JPG
compare_Alt.JPG


mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Wed Jan 18, 2017 8:07 pm

in oXs, the sensitivity parameter is used only for Vspeed.
So, it is normal that changing the sensitivity has no impact on Altitude.

About Vspeed, you can see that when sensitivity decreases, noise decreases too but reaction time increases.
That is the principle of the filter.
Best is having less noise for the same reaction time.
Your previous tests show that MS5611 performs better.
Combining a baro sensor with an IMU allows (I think) to get even better performance. This has been added to oXs in version 7.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Wed Jan 18, 2017 9:02 pm

Hi mstrens,
I ordered an MPU6050 (GY-521) 10 minutes ago. :D

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Wed Jan 18, 2017 9:10 pm

I am not sure that gY-521 is the best module.
I think it does not have level converter for the SDA/SCK signals (I2C).
It is safier to use a module like GY-86 if your arduino is running under 5 Volt.

Carbo
Posts: 248
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: openxsensor with BMP280

Post by Carbo » Thu Jan 19, 2017 6:50 am

maisky wrote:Hi,
Yesterday I did two more tests with different values for Sensitivity.
Maybe this is also interesting for you.
Nice setup! If you are still testing, i would be interested in a comparison between MS5611 amd BMP280 both with high sensitivity. I have increased the MS5611 sensitivity meanwhile to 200. I still do not hear disturbing vario noise when flying my gliders (-5/+5m/s OpenTX vario setup). It seems from your tests, that the BMP280 has so much noise, that it is maybe not usable with higher sensitivity.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Thu Jan 19, 2017 6:22 pm

Hi carbo,
you are right. I think for the BMP280 is a sensitivity of 100 the maximum.
Larger values I have not tested yet. Normally I switched off the vario in the range of -0.5 to +0.5 m/s (with logical switches on Taranis).
But in case of Sensitivity=100 I can sometimes hear vario tones.
In the next days I have vacation (not at home). If the MPU6050 arrived, I will do more test.

@ mstrens
Yes I know, the GY-521 has no level shifters.
My target hardware should be an Arduino mini pro 3,3V.
At the moment I use a Arduino nano with level shifter on the Breadboard. (for BMP280)

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Thu Jan 19, 2017 6:32 pm

I forgot the diagram of comparison BMP280 and MS5611 for sensitivity=100.
Attachments
compare_BMP280_MS5611_sensitivity_100.JPG

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Thu Jan 19, 2017 8:23 pm

Hi mstrens,
the GY-86 module also has an HMC5883L.
Does oXs supports this Digital Compass IC?

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Thu Jan 19, 2017 8:30 pm

Currently oXs does not read the HMC5883L.
Do you see a need for it.
Usually, it is used to realign the gyro on the yaw axis.
For the vario, it is not useful.
The problem is that oXs reachs the limit of the capacity of AVR328P when you add all sensors.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Thu Jan 19, 2017 8:44 pm

For my gliders I see no need for it.
Maybe it is interesting for FPV. But for FPV is only helpful if the data is displayed in the monitor.
Do you know a module with only MPU6050 and MS5611 (or BMP280)?

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Thu Jan 19, 2017 9:14 pm

I do not know a module with only MPU6050 and a baro.
I think compass chip is so cheap that it is always added on standard board.

Carbo
Posts: 248
Joined: Fri Aug 02, 2013 6:55 pm
Country: -

Re: openxsensor with BMP280

Post by Carbo » Fri Jan 20, 2017 12:12 pm

maisky wrote:I forgot the diagram of comparison BMP280 and MS5611 for sensitivity=100.
That is the information, i was asking for, thank you. Even with a sensitivity of 200 and without deadband for the vario i do not hear any, or very little noise. Mstrens has additionally established an option, to calculate the average of two pressure sensors, to reduce the noise. I do not know, if it works with other sensors than MS5611, but if, it is maybe worth to test it. I never used it in flight, because i have no noise with one MS5611 :D

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Fri Jan 20, 2017 1:18 pm

When there are 2 baro sensors connected to Arduino, oXs can calculate the average Vspeed.
This should work even if the 2 baro does not have the same type of sensor.
Still I am not sure someone uses this functionality. Not sure it is really usefull.

There could be something else that could be useful when using 2 baro sensors:
In order to reduce noice on Vspeed, oXs reads the baro sensor as fast as possible (about 50 hz).
One drawback of this is that the temperature of the baro increases and changes in the temperature has an impact of the raw pressure.
This generates a drift of altitude when calibration is not right.
For altitude only, I think it should be possible to read the sensor at a lower rate. I expect it would reduce the altitude drift.
I could make an oXs version to test this.

AndreasD
Posts: 3
Joined: Sat May 14, 2016 11:54 am
Country: -

Re: openxsensor with BMP280

Post by AndreasD » Sun Feb 19, 2017 9:47 pm

Thanks for uploading version 8.0 to github. You are doing a great job for the community.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Mon Feb 20, 2017 9:52 pm

Hi mstrens,
it is much time elapsed, there were a lot of other things to do...
Now I have done some tests with IMU and MS5611 / BMP280.
The results of IMU + MS5611 looks very good.
The response of Vspeed is 0.3 to 0.4 seconds faster than without IMU.
The noise is slightly more than without IMU, but at very low level.
In contrast, the results are bad with BMP280.
I see much more noise with IMU than without.
The noise is so great that one can not interpret the Vspeed.
I had hoped that the IMU improves the Vspeed signal but it still worsens it.
Do you have an idea why this is so?
Another question:
It is possible to get the values for ACCX, ACCY and ACCZ (not PITCH, ROLL,YAW)?
Attachments
IMU_BMP280.JPG
IMU_MS5611.JPG

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Tue Feb 21, 2017 9:00 am

First a question: In your chart, you have e.g. the Altitude for IMU+BMP280. How did you get that data?
If you get it from the normal Alt telemetry field as I expect, it is in fact calculated exactly in the same way with or without an IMU. The IMU changes only the way Vspeed is calculated.
If so, we clearly see that Alt from BMP280 is much more noisy than from MS5611.
Note : oXs calculates also an Altitude in the Kalman Filter when IMU is used but this Altitude is stored in the variable Ztrack which is normally not sent to Tx.
It would be possible to send it in a field like TEST_1, TEST_2 or TEST_4 but it requires a minor change of code.


I have no idea why the results are so strange with BMP280 + IMU while being good with MS5611.
When Vspeed is caculated by IMU+baro, oXs does not take care of the parameters about vario sensitivy.
In this case a special filter is used (Kalman filter) that is based on other filtering parameters defined in KalmanFilter.cpp file.
#define Z_VARIANCE 50.0f // initially 500
#define ZACCEL_VARIANCE 0.1f // initially 1
#define ZACCELBIAS_VARIANCE 1.0f
I had to play a little with those parameters when I tested with the MS5611+IMU. I am even not sure that the values that I finally defined are the best one for MS5611.
Perhaps could you try to change the values for BMP280.
I do not have a 100% understanding of Kalman filtering to say how to change the parameters.
I just know that the kalman filter tries to combine 2 types of information provided by sensor (Alt from baro and Acc provided by imu) in a model in order to get the most probable results (Ztrack, Vtrack). The parameters defined how much the model must trust the raw data from each sensor. I expect (still not sure) that if a parameter has to be increased when his sensor is more noisy. So here, Z_VARIANCE should be increased for BMP280+IMU.
This is just an assumption. So best is to experiment.

It is possible to transmit ACC (X,Y,Z) to Tx but you must say which acceleration you want. There are several accelerations available:
- raw accelerations provided by the sensor. In this case e.g. when sensor is flat on a table AccZ will be -9.81m/sec (= gravity) while AccX and AccY will be 0. Still if the sensor is rotated by 90° AccZ will be 0 and X or Y (depending the orientation) will be 9.81.
- worldwide
- linear_acceleration : those are similar to the raw acceleration (meaning the direction refers to the sensor it self) but gravity is substracted. So in therory, all 3 Acc should be 0 when the sensor does not move
- world_linear_acceleration_z : this value takes Earth as reference (instead of the sensor it self) and gravity is substracted too. It is calculated only for Z axis (vertical). It should be 0 when the sensor does not move up/down (even if it is rotated).
It is this world_linear_acceleration_z that oXs uses to calculate Vspeed when IMU is used.
So if you want to know some Acc, please let me know which one you want.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Tue Feb 21, 2017 10:11 pm

you're right, the Altitude for IMU+BMP280 comes from Vspeed.
I would say this noise on the altitude is no problem.

OK I understand, then I will play something with the parameters of the Kalman filter.
I do not know the Kalman filter so far. Perhaps I find suitable parameters.

In the accelerations I am interested in the "linear_acceleration".
That should be the correct values to measure the load of the model e.g. when flying a looping.
Thanks for the detailed answer.

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Wed Feb 22, 2017 8:14 am

I just put a minor charge in the master branch on git hub in order to let you send the linear acc.
In the ino file, you have to uncomment the line
//#define SEND_LINEAR_ACC
and in the oXs_config.h file you have to ask for sending TEST_1, TEST_2, TEST_3 as AccX,AccY,AccZ

Note: the IMU set up does not allow to get Accelerations that exceed 4g.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Wed Feb 22, 2017 8:56 pm

Great it works.

OK 4g is not very much. Then I have to fly carefully ;)
What is the unit of values. If I move the sensor fast I get values of over 15.

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Wed Feb 22, 2017 9:14 pm

I think that the acc are in cm/sec2 but I expect that value is divided by 100 on Tx side.
So, 15 would be 15 m/sec2 = about 1.5 g.
still I am not 100% sure.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Sun Mar 05, 2017 8:38 pm

Hi mstrens
I wanted to report after a long break again.
The last activity was the combination of BPM280 and IMU.
I have made some experiments with these two parameters (what you have recommended):
#define Z_VARIANCE 50.0f // initially 500
#define ZACCEL_VARIANCE 0.1f // initially 1
I would say the best combination is:
#define Z_VARIANCE 5000.0f
#define ZACCEL_VARIANCE 1.0f

The response time is much better than without IMU and the noise is also much lower.
If there is good weather again, I will try this combination in the model.
Many thanks for your support.
Attachments
BMP280_IMU_2.JPG
BMP280_IMU_1.JPG

mstrens
Posts: 1066
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: openxsensor with BMP280

Post by mstrens » Mon Mar 06, 2017 4:12 pm

Good results.
Probably that with those parameters, the filter gives more priority to the values from Accelerometer than from raw altitude (from baro) and that Accelerometer is less noisy than baro sensor.
It would be good to test if those parameters are also better than the original one when using a MS5611 instead of a BMP280.
If so, I can change the code for all types of baro sensor.

maisky
Posts: 20
Joined: Sun Jan 08, 2017 5:22 pm
Country: -

Re: openxsensor with BMP280

Post by maisky » Mon Mar 06, 2017 8:46 pm

I believe the original values are good for the MS5611. The MS5611 does not need such a strict filter.
Ok, I will also test the changed values with the MS5611 in compare to the original values.
But this will take a few days.

Post Reply

Return to “OpenXVario - an open source vario supported by the open source firmwares!!”

Who is online

Users browsing this forum: No registered users and 8 guests