GY-521 and NO_BARO : MPU-6050 setup freeze

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
cfsix50
Posts: 6
Joined: Sun Apr 08, 2018 9:46 pm
Country: France

GY-521 and NO_BARO : MPU-6050 setup freeze

Post by cfsix50 »

Hi,
Sorry to have given up so long.
Months ago we discussed of an issue I got with a GPS and GY-521 installation : freezing of the MPU-6050 during setup.
I rebuild a new project with a new Arduino mini-pro and one GY-521 alone.
And get ..... the same issue !
openXsensor starting..
milli=0
freeRam=1281
FRSky Output Module: TX Pin=4
Sport protocol= 1
Initializing MPU...
I check all three or more times without success.

I download a fresh sketch and decide to proceed step by step.

In oXs_config_basic.h :
The MPU-6050 setup freeze when #define FIRST_BARO_SENSOR_USE MS5611 is set to NO_BARO

FIRST_BARO_SENSOR_USE is used to define the variable VARIO if its value is not NO_BARO.
But I don't find a link between VARIO and the IMU set up.

It seems that I did not get this issue whith the GPS alone and NO_BARO ...

Thank you for helping.
Henri
Attachments
oXs_config_basic.h
cfsix50
(11.21 KiB) Downloaded 304 times
oXs_config_advanced.h
cfsix50
(19.01 KiB) Downloaded 302 times

Carbo
Posts: 467
Joined: Fri Aug 02, 2013 6:55 pm
Country: Germany
Location: Freinsheim RP

Re: GY-521 and NO_BARO : MPU-6050 setup freeze

Post by Carbo »

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

Re: GY-521 and NO_BARO : MPU-6050 setup freeze

Post by mstrens »

First it would be good to know if your mpu-6050 can be detectd on the I2C bus.
One easy way to test it is the folowing:
- in the config_basic, declare that you have a first baro sensor = MS5611 (but do not connect a MS5611)
- in oXs_MS5611, activate the option #define DEBUGI2CMS5611
- in oXs_config_advanced, activate the option #define DEBUG

I expect that in this case, when oXs perform the setup of MS5611, it will run some code to detect all I2C sensors on the bus and it will report the last one that it founded. In your case, it should be a MPU6050 (the only one sensor you have) and it should be at adress 0x68.

Please make the test ant let me know the result.
cfsix50
Posts: 6
Joined: Sun Apr 08, 2018 9:46 pm
Country: France

Re: GY-521 and NO_BARO : MPU-6050 setup freeze

Post by cfsix50 »

Hi mstrens,

Thank you for your answer.

MPU6050 works well with MPU6050_DMP6 and MPUTeapot.

This is the result of the test :
openXsensor starting..
milli=0
freeRam=1017
vario setting up..
begin I2C scan
last I2C scan adr: 68
vario is up..
FRSky Output Module: TX Pin=4
Sport protocol= 1
End of general set up
acc -11668 -3478 -11619
.......
As you expect the MPU6050 address is 0x68.

With NO_BARO selected, the I2C scan is not performed :
openXsensor starting..
milli=0
freeRam=1336
FRSky Output Module: TX Pin=4
Sport protocol= 1
mstrens
Posts: 1435
Joined: Fri Dec 27, 2013 7:49 pm
Country: -

Re: GY-521 and NO_BARO : MPU-6050 setup freeze

Post by mstrens »

I2C scan is only performed in the MS5611 part of the code. That is the reason why I asked to activate the MS5611 even if it was not connected.
This test shows that your mpu6050 is working.
You are even getting the acceleration offsets on pc terminal.

It could be that there are some conflicts when debug is activated.

Could you try again with
- FIRST_BARO_SENSOR_USE set on NO_BARO
- #define DISPLAY_ACC_OFFSET set as comment (in config_advanced)
- DEBUG being set as comment (in config_advanced).

Please note that your config files does not seem to request oXs to send any telemetry data.
By default oXs does not send Acc and Gyro data.
If you want to check oXs, you should ask oXs for sending some data.
E.g. if you want to get acc, you should
- activate //#define FILL_TEST_1_2_3_WITH_LINEAR_ACC in config_advanced
- ask oXs to transmit TEST_1_2_3 by activating the 3 folowing lines in config_basic
//#define ACCX_SOURCE TEST_1 // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define ACCY_SOURCE TEST_2 // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4
//#define ACCZ_SOURCE TEST_3 // select between TEST_1, TEST_2, TEST_3, GLIDER_RATIO , SECONDS_SINCE_T0 ,AVERAGE_VSPEED_SINCE_TO , VOLT_1, VOLT_2, VOLT_3, VOLT_4, VOLT_5, VOLT_6, PITCH, ROLL , YAW, ADS_VOLT_1, ADS_VOLT_2, ADS_VOLT_3, ADS_VOLT_4

cfsix50
Posts: 6
Joined: Sun Apr 08, 2018 9:46 pm
Country: France

Re: GY-521 and NO_BARO : MPU-6050 setup freeze

Post by cfsix50 »

Hi,

I try with :
- FIRST_BARO_SENSOR_USE set on NO_BARO
- #define DISPLAY_ACC_OFFSET set as comment (in config_advanced)
- DEBUG being set as comment (in config_advanced).
but the sensor is not discovered by my Taranis QX7.

By replacing NO_BARO by MS5611, the ACC numbers are displayed on the QX7.

There is a light error in openXsensor line 1013 :
test3.value = linear_acceleration_Z * 981;
letter "Z" might be a lower case "z"

How to get the attitude angles ?

Best regards
Henri

Post Reply

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