GY-86 in oXs arduino pro mini 16MHz

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Thu Jan 21, 2021 2:53 am

Hi guys I have difficulties to setup GY-86 to OxS. the same work fine with GY-521!
with GY-86, in serial monitor it says mpu 6050 initializing failed and the message keep looping .
so to make sure if my GY-86 working or not; I scan the device with i2cscaner it find 0x77 and 0x68 address.
only when I disable mpu6050 in oxs "basic config.h" my horus TX shows telemetries of cause not gyro, but ms5811 seems working 0x77 i2c.
but no gyro 0x68.
if I enable mpu 6050 then no telemetry in TX. in serial monitor mpu not initializing error message comes.
then I check mpu6050 with "MPU6050_raw" and "MPU6050_DMP6" sketches the raw works and bring values in serial monitor. DMP6 says MPU6050 initiating fail and press any key to program dmp when I do so, the gyro works fine and it react to the yaw pitch roll movements. screen shots attached

why it is not running in oxs?

any body could help me please !?

Thanks
nesan :P
Attachments
OXSrunning.jpg
(116.2 KiB) Not downloaded yet
MPU6050RAW running.jpg
(100.11 KiB) Not downloaded yet
mpu6050DMP6running.jpg
(89.26 KiB) Not downloaded yet
Last edited by nesan on Thu Jan 21, 2021 2:45 pm, edited 2 times in total.


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

Re: GY-86 in oXs arduino pro mini 16MHz

Post by kalle123 » Thu Jan 21, 2021 7:34 am

You should also post both config files as attachment ...

oXs_config_basic.h and oXs_config_advanced.h

br KH

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Thu Jan 21, 2021 2:39 pm

kalle123 wrote:
Thu Jan 21, 2021 7:34 am
You should also post both config files as attachment ...

oXs_config_basic.h and oXs_config_advanced.h

br KH
Hi
I have now attached the config files as you request. Thanks for answer the post!

Nesan :P
Attachments
oXs_config_basic.h
(11.7 KiB) Downloaded 46 times
oXs_config_advanced.h
(16.82 KiB) Downloaded 44 times

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

Re: GY-86 in oXs arduino pro mini 16MHz

Post by kalle123 » Fri Jan 22, 2021 10:12 am

Nesan, so, made a short test here. ;)

Image

GY-86 to Arduino Uno.

I skiped the 'voltage things' in your configuration.

You have VOLTAGE YES

// ***** 6.2 - Voltage parameters ***** see oXs_config_advanced.h for additionnal parameters when YES
#define ARDUINO_MEASURES_VOLTAGES YES


Don't set a ref voltage

// ***** 6.1 - Voltage Reference to measure voltages and current *****
//#define USE_INTERNAL_REFERENCE // uncomment this line if you use 1.1 volt internal reference instead of Vcc (voltage divider mst be used to reduce voltages to 1.1 volt max)
//#define USE_EXTERNAL_REFERENCE // uncomment this line if you use an external reference instead of Vcc
//#define REFERENCE_VOLTAGE 4970 // set value in milliVolt; if commented, oXs will use or 1100 (if internal ref is used) or 5000 (if internal ref is not used)

and then define voltage pins

// ***** 6.2 - Voltage parameters *****
// Each of following lines contains 6 parameters, the first value is for VOLT_1, the second for VOLT_2, ... up to the sixth for VOLT_6
#define PIN_VOLTAGE 0 , 1 , 2 , 3 , 6 , 7 // Fill all 6 values; set to 0 up to 7 for analog pins A0 up to A7 ; set the value to 8 for the voltage(s) not to be measured.
#define RESISTOR_TO_GROUND 0 , 0 , 0 , 0 , 0 , 0 // set value to 0 when no divider is used for a voltage; can contains decimals
#define RESISTOR_TO_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0 // set value to 0 when no divider is used for a voltage; can contains decimals
#define OFFSET_VOLTAGE 0 , 0 , 0 , 0 , 0 , 0 // optionnal, can be negative, must be integer, in principe in mv
#define SCALE_VOLTAGE 1 , .008 , 204.6 , 204.6 , 204.6 , .008 // optionnal, can be negative, can have decimals


I used those config files attached and I see normal behavior ..... (Moved the GY-86 a little to see diff. values)

Image

br KH
Attachments
oXs_config_basic.h.txt
(557 Bytes) Downloaded 41 times
oXs_config_advanced.h.txt
(897 Bytes) Downloaded 39 times

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Fri Jan 22, 2021 8:36 pm

HI thanks for your effort to my problem.
I try your config files with no success. in Arduino uno and nano 5v as well.
do I miss any libraries for gy-86? or could it be the pull up resistor issue for i2c bus Arduino 5v gy-86 3v?
do I need to disable sleep mode and activate pass through in gy-86. I do not find any .cpp in the name of GY-86 is that ok in this case?
or could it be defective GY-86. I ordered some it may take months to come.

Nesan


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

Re: GY-86 in oXs arduino pro mini 16MHz

Post by kalle123 » Fri Jan 22, 2021 10:13 pm

Nesan, to my knowledge Arduino IDE and oXs ships with all the necessary files. (I am using Arduino IDE1.8.13 and oXs 8.2.15, but it also worked with earlier versions ....)

About your GY-86. I don't have it on the table here, so don't ask me.

The GY-86 is available locally here in Germany (~20€) and if I order one, would be here beginning next week. Would do the tests and if it does not work too, it goes back and I would start to look for other causes.

If this GY-86 does work, then I would blame the #1 GY-86. Then claim the seller of that #1 GY-86.

br - KH

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Fri Jan 22, 2021 10:53 pm

Hi I am thanking your help! as I have ordered from aliexpress few gy-86 + 3.3v Arduino mini pro as well. lets wait until it arrive.
the puzzle is when i run dmp sketch it throw the yaw pitch roll values after the initiating failed sequence.
I will update here once I try with new GY-86.
Thanks for your kind help.

Nesan

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

Re: GY-86 in oXs arduino pro mini 16MHz

Post by kalle123 » Sat Jan 23, 2021 7:38 am

nesan wrote:
Thu Jan 21, 2021 2:53 am
"MPU6050_raw" and "MPU6050_DMP6" sketches
Link to those sketches please.

"MPU6050_raw" doesn't say anything to me and "MPU6050_DMP6", I find something, but is that the sketch, you are using?

By the way. why not use GY-63 in combination with GY-521? Has the advantage, that, when one sensor fails, this one can easily be replaced, which is not possible with GY-86 .....

br KH

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Sun Jan 24, 2021 5:56 pm

kalle123 wrote:
Sat Jan 23, 2021 7:38 am
nesan wrote:
Thu Jan 21, 2021 2:53 am
"MPU6050_raw" and "MPU6050_DMP6" sketches
Link to those sketches please.

"MPU6050_raw" doesn't say anything to me and "MPU6050_DMP6", I find something, but is that the sketch, you are using?

By the way. why not use GY-63 in combination with GY-521? Has the advantage, that, when one sensor fails, this one can easily be replaced, which is not possible with GY-86 .....

br KH
Hi Here are the files.
I try to make the OxS compact so that want to use GY-86.

Thanks
nesan :P
Attachments
MPU6050.rar
(58.52 KiB) Downloaded 41 times

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Tue Jan 26, 2021 1:01 pm

Hi today I tried the same GY-86 in 3.3v Arduino mini pro with same result. so pull up resistors are not the issue. still waiting for the new GY-86.
nesan

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

Re: GY-86 in oXs arduino pro mini 16MHz

Post by kalle123 » Tue Jan 26, 2021 2:28 pm

kalle123 wrote:
Sat Jan 23, 2021 7:38 am
By the way. why not use GY-63 in combination with GY-521?
I am waiting with you :D

br KH

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Fri Feb 12, 2021 9:15 pm

today after long time waiting I received few GY-86. try with same configuration not working.
I do not find GY-86.cpp, GY-86.h if needed in my OxS .
So if it is the case can any one kindly send me the files plese.
thank you

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Sat Feb 20, 2021 2:59 am

seems like no help..!

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

Re: GY-86 in oXs arduino pro mini 16MHz

Post by kalle123 » Sat Feb 20, 2021 7:19 am

Simply I don't know how ...

GY-86 works here and I did not read about issues in other forums about oXs and GY-86.

And here is also nothing to be found.

https://github.com/openXsensor/openXsensor/issues.

cu KH

nesan
Posts: 31
Joined: Thu Nov 09, 2017 2:05 am
Country: -

Re: GY-86 in oXs arduino pro mini 16MHz

Post by nesan » Sun Feb 21, 2021 4:29 pm

kalle123 wrote:
Sat Feb 20, 2021 7:19 am
Simply I don't know how ...

GY-86 works here and I did not read about issues in other forums about oXs and GY-86.

And here is also nothing to be found.

https://github.com/openXsensor/openXsensor/issues.

cu KH
Hi could you share the complete OxS files in rar or zip form. that work for GY-86.
I am limited in knowledge so asking you the complete pack. "if I miss something or version issues"
Thank you
Nesan

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

Re: GY-86 in oXs arduino pro mini 16MHz

Post by kalle123 » Mon Feb 22, 2021 7:33 am

Nesan, the general oXs files from here

https://github.com/openXsensor/openXsensor

and the two configuration files from here

https://openrcforums.com/forum/viewtopi ... 73#p152928

cu KH

ChrisOhara
Posts: 16
Joined: Mon Feb 01, 2021 11:56 am
Country: Germany

Re: GY-86 in oXs arduino pro mini 16MHz

Post by ChrisOhara » Mon Apr 05, 2021 6:44 pm

Hello
I'm not sure but you could have the same problem that I had with a GY-87 (which was in fact a HW-290, but with a original MPU-6050)
In my case the problem was the this:

In routine inv_mpu.c there is a check for a hard-/firmware revision of the MPU-6050.
When the software was written, there where only 2 known Revisions.
But mine was a revision 4. So the routine aborted.
I put in revision 4 in the file myself. (and opened an issue at githup).
Best to put a print there to see in the serial monitor what revision you have.

/* Check product revision. */ // saving : this code could omitted if accel_half is not used. To check ; My mpu return 0
if (i2c_read( INV6050_addr, GYRO_REG_accel_offs, 6, data))
return -1;
rev = ((data[5] & 0x01) << 2) | ((data[3] & 0x01) << 1) | (data[1] & 0x01);
if (rev) {
/* Congrats, these parts are better. */
if (rev == 1) chip_cfg.accel_half = 1;
else if (rev == 2 || rev == 4) chip_cfg.accel_half = 0; // #### rev04 insert by ChrisOHara for HW-290 ######
else {
log_e("Unsupported software product rev %d.\n", rev);
return -1;
}

You could give it a try.

regards Chris

PS: you could also try:
else if (rev > 1) chip_cfg.accel_half = 0;

Bruchpiloten
Posts: 5
Joined: Tue Jan 30, 2018 7:41 pm
Country: Europe

Re: GY-86 in oXs arduino pro mini 16MHz

Post by Bruchpiloten » Sat Apr 17, 2021 8:11 pm

Dear all,

Maybe I have also this problem. When I have in the configuration the GY86 as first baro and the MPU is off, then the
Vario works, that means, the data go's to the TX.

When is switch the MPU on, then I don't have any telemetrie values from the baro.

On the Seriell Monitor I see that the vario is up, but no data from the MPU6050.

Is this maybe the same storry ?

One small question: What is the way to find the revision of the GY86 ?

Kind regards
Willi

ChrisOhara
Posts: 16
Joined: Mon Feb 01, 2021 11:56 am
Country: Germany

Re: GY-86 in oXs arduino pro mini 16MHz

Post by ChrisOhara » Sun Apr 18, 2021 5:32 am

Hello
Could be the same problem.
I dont't know how familiar you are with programming in arduino.

The way i did it:
made a copy of the two files inv_mpu.c and oXs_imu.cpp to have the original files as a backup
opened the file inv_mpu.c
looked for the routine: int mpu_init()
I changed the return values (which are all -1, for routine aborts) to values like -11. -22, -33, -44 ,.........
(Serial.print() didn't work here probably because it is a C file)
The positions were it returns -1 because of revision check I changed to "return -rev"
Now I opened oXs_imu.cpp
looking for this line: result = mpu_init(); // initialize MPU with default values
As next line I inserted something like this. Serial.print("\nresult = "); Serial.print(result);
The you flash your arduino.
If the routine mpu_init returns a value (result), then you know at which point it returns and if it's one of wrong revisons it says ( -4 - one digit)

If you do not get a return value, then mpu_init very likely hangs at resetting the MPU.
In this case I would first check whether the I2C addresse is found with an I2C-scanner (simple Arduino program - use google)
The correct address should be 0x68

regards Chris

ChrisOhara
Posts: 16
Joined: Mon Feb 01, 2021 11:56 am
Country: Germany

Re: GY-86 in oXs arduino pro mini 16MHz

Post by ChrisOhara » Mon Apr 19, 2021 5:05 am

HI
It just crossed my mind that with my GY87 there was also an other problem.
The chip for the magnetic sensor HMC5883 is no longer produced by Honneywell.
So my GY87 had a QMC5883 instead which needed a modified software (I wrote myself).
If you use I2C-Scanner the address of the HMC5883 is (0x1E) the address of the QMC5883 is (0x0D). (But there are also other types.)
What have you defined for CALCULATE_YAW_WITH_HMC5883 in for oXs_config_basic file?
Regards Chris

You could also try this combination:

#FIRST_BARO_SENSOR_USE MS5611
#define A_MPU6050_IS_CONNECTED YES
#define CALCULATE_YAW_WITH_HMC5883 No
(in theory this would be like two simple boards and no HMC5883 instead of a GY86)

Bruchpiloten
Posts: 5
Joined: Tue Jan 30, 2018 7:41 pm
Country: Europe

Re: GY-86 in oXs arduino pro mini 16MHz

Post by Bruchpiloten » Mon Apr 19, 2021 4:33 pm

Dear all, good evening,

Now, to day I have spend more time in this problem.

1. I have put in as 1. Baro GY86
->>>>>> Baro works, no problem.

2. Then I put in that the MPU6050 is connected
->>>>>> Baro not works, no telemetrie data to the TX

3. Then I change in "INV_MPU.C" File the part to "else if (rev > 1) chip_cfg.accel_half = 0;"
->>>>>> Baro works with the configuration MPU6050 "YES"

4. Then I change the configuration form the VSpeed to "Baro and MPU" in the oXS config
->>>>> Baro works, but VSpeed is missing, the TX say "Sensor missing"

5. No, i have scan the I2C adresses, The Arduini see the adresses 1E, 68 and 77
->>>> This is what oXs will have

6. Then I look with a other Sketch, if the MPU 6050 works
->>>>> Yes perfect, look to the screenshot

7. Then I have uncement the line for the offset calibration, but on the Seriell Monitor I can't see the values
->>>>> Maybe this can be normal, when oXs don't see the MPU6050

Sorry, I'm not a arduino "Guru", I have no idee more. Is this maybe a other part of
the oXs software that not works ?

I have put the Screenshots / my oXs Dir to the Attachments, maybe this can help by
the fault finding.

Thanks to all of you for the help to all.

Kind regards
Willi
Attachments
Offset.jpg
Offset.jpg (68.64 KiB) Viewed 630 times
IC2-Scanner.jpg
IC2-Scanner.jpg (51.82 KiB) Viewed 630 times
6050.jpg
(141.73 KiB) Not downloaded yet
2021-2.zip
(26.08 MiB) Downloaded 17 times

ChrisOhara
Posts: 16
Joined: Mon Feb 01, 2021 11:56 am
Country: Germany

Re: GY-86 in oXs arduino pro mini 16MHz

Post by ChrisOhara » Mon Apr 19, 2021 5:49 pm

Hello
Your I2c addresses look fine.
I've looked at the oXs_config_basic file.
At the moment there is FIRST_BARO_SENSOR_USE MS5611.

Could you now try FIRST_BARO_SENSOR_USE GY86 again . (with rev >1 and MPU YES).

I myself have never tried BARO_AND_IMU and PPM.
I would recommend to start with a simple configuration without BARO_AND_IMU and without PPM.
And if that works switch on the other two things step by step.
Regards.

Bruchpiloten
Posts: 5
Joined: Tue Jan 30, 2018 7:41 pm
Country: Europe

Re: GY-86 in oXs arduino pro mini 16MHz

Post by Bruchpiloten » Wed Apr 21, 2021 8:18 pm

Dear Chris,

I have try your configuration, but it don't work. It is the same situation.

I can't see the MPU6050 data.

Maybe as idee, gives in the code of the openXsensor an other part, there not can work with all
version of the MPU6050 ?

This was the question, then:

1. With the line by the INV_MPU.C to >1 work the Baro
2. I can't see the MPU6050 data when i uncomment the line for the Offset calibration
3. When I say: BARO_AND_IMU, the the VSpped don't work and the TX say "missing sensor"
4. I have all the PPM configuration commendet.

Gives a easy way that I can see if the MPU6050 and openXsensor software works correct by
the seriell monitor? I think a other was as by the offset calibration.

Mybe there is a other problem, but, soory i'm not a Arduino "GURU" and can't find a fault.

Kind rergards
Willi

ChrisOhara
Posts: 16
Joined: Mon Feb 01, 2021 11:56 am
Country: Germany

Re: GY-86 in oXs arduino pro mini 16MHz

Post by ChrisOhara » Thu Apr 22, 2021 8:25 pm

Hello Willi
I wrote you I private message.
Please read it. If you send me your email address (as private message) I will send you some code for better analyse.
regards Chris


Post Reply

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