Help with mpu6050 connections

Development & General Chat for the superb openxvario project.

Moderator: rainer

Post Reply
antlerhanger
Posts: 158
Joined: Tue Dec 25, 2018 3:19 am
Country: United States

Help with mpu6050 connections

Post by antlerhanger » Sat Sep 14, 2019 5:08 pm

So I have searched and I have read a bunch but I still have a question . I have built 6 vario's with pro mini's 5v 16mhz and ms5611 with gps . I have 5 mpu6050 boards (gy-86 would have been better ). Can and I use these with my setup and if I can what is the correct way to hookup and do I have to use resistors . I know I have to go into config basic and advanced files . I'm just confused with the physical connections . I have also built current sensors but have not added them yet..Knowing me I will have questions on that too..Another time tho :D

Thanks
Allen


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

Re: Help with mpu6050 connections

Post by mstrens » Sat Sep 14, 2019 5:18 pm

Did you read the file config_description.h
Normally physical connections are explained in this file.

antlerhanger
Posts: 158
Joined: Tue Dec 25, 2018 3:19 am
Country: United States

Re: Help with mpu6050 connections

Post by antlerhanger » Sat Sep 14, 2019 5:27 pm

Yes I did . And I am pretty sure That I can install it without added resistors ...But being pretty sure usually gets me in trouble .

Thanks
Allen

antlerhanger
Posts: 158
Joined: Tue Dec 25, 2018 3:19 am
Country: United States

Re: Help with mpu6050 connections

Post by antlerhanger » Thu Sep 26, 2019 7:11 pm

I installed a mpu6050 on one of my vario's ...I can run a sketch for 12c and get addresses 77 and 68..When i go into advanced config and set #define DISPLAY_ACC_OFFSET . when I try to get the values I get nothing displayed .On my radio vario altitude is working..A4 and A5 ..sda scl ..INT to pin 2 of course vcc and ground .. Is there something in the advanced setup I need to change to get it to display the values ?

Thanks
Allen

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

Re: Help with mpu6050 connections

Post by mstrens » Fri Sep 27, 2019 6:26 am

when you uncomment #define DISPLAY_ACC_OFFSET, the values are sent to the Serial bus and not to the receiver.
So, to view the data, you have to connect oXs with a USB/Serial module (e.g. FTDI) and look on the arduino IDE terminal (activated pressing CTRL+SHIFT+M)


antlerhanger
Posts: 158
Joined: Tue Dec 25, 2018 3:19 am
Country: United States

Re: Help with mpu6050 connections

Post by antlerhanger » Fri Sep 27, 2019 6:36 am

Yes that is what I am doing. I just need to know what lines I need to uncomment to get Test fields to display values for azzx,accy,accz.. Anyway thank you so much for helping me

Thanks as always
Allen

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

Re: Help with mpu6050 connections

Post by mstrens » Fri Sep 27, 2019 7:19 am

It is not clear for me what you want:
1 do you want to calibrate your mpu6050; if so, follow the instructions below
* In order to get best results from IMU, it is required to calibrate the accelerometer offsets. To do so, please :
* - upload a version of oXs firmware whith the line #define DISPLAY_ACC_OFFSET uncommented
* - let oXs runs while connected to the PC (via USB serial interface = FTDI)
* - open Arduino IDE terminal (press CTRL + SHIFT + M simultaniously)
* - take care to set the baud rate to 115200 (or 38400 if GPS is activated too)
* - after startup, terminal should, every 2 or 3 sec, display Acc followed by 3 numbers being respectively AccX, AccY and AccZ. Please note that those numbers change when mpu6050 moves.
* - ensure that the mpu6050 (on GY86,GY87) is perfectly horizontal and does not move (e.g. put on a table)
* - notice the 2 first numbers ( = AccX and AccY ) ; Don't take care of the 3rd number because when the sensor is in this position, it will reflect the gravity and will be around 16384.
* - rotate mpu6050 in order to get X or Y axis perfectly vertical and do not move. Now, the 3rd number would become much lower (because it does not measure gravity anymore)
* - notice the 3rd number ( = Accz )
* - update oXs_config.h file filling the 3 numbers in lines #define ACC_OFFSET_X , #define ACC_OFFSET_Y and #define ACC_OFFSET_Z
* - set line #define DISPLAY_ACC_OFFSET as comment (adding "//" in front)
* - upload again oXs firmware in arduino

2 do you want to display on the Tx (using a FRSKY TX/RX) the accelerations
If so you have to:
- uncomment this line (in config_advanced): #define FILL_TEST_1_2_3_WITH_LINEAR_ACC // uncomment this line if oXs has to fill TEST_1, TEST_2, TEST_3 with linear Acc
- uncomment the 3 lines (in config_basic) in order to let oXs send the 3 data (to a Frsky Tx)
#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

antlerhanger
Posts: 158
Joined: Tue Dec 25, 2018 3:19 am
Country: United States

Re: Help with mpu6050 connections

Post by antlerhanger » Fri Sep 27, 2019 12:20 pm

I'm sorry that I was clear as mud ...LOl..I want to calibrate my mpu6050.. With DISPLAY_ACC_OFFSET uncommented and uploaded , when I press CTRL + SHIFT + M simultaniously the window pops up but nothing happens set the baud rate to (115200) . So do I need to go into advanced and define a fill test for test 1,2,3 ? I actually did this and I am getting numbers , Just want to make sure the numbers are the right ones for calibration

Thanks again
Allen

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

Re: Help with mpu6050 connections

Post by mstrens » Fri Sep 27, 2019 12:58 pm

for calibration you do not have to define a fill for test 1,2,3.
Just look at the 3 numbers (X, Y, Z offsets) that you get on your PC (in arduino IDE) when you hold your sensor in 2 positions (see instructions in config_description.h).
Then copy the 3 values you get in your config file ((instead of 0) in
#define ACC_OFFSET_X 0 // fill here the first value reported when DISPLAY_ACC_OFFSET is activated (eg. -160)
#define ACC_OFFSET_Y 0 // fill here the second value reported when DISPLAY_ACC_OFFSET is activated (eg. -150)
#define ACC_OFFSET_Z 0 // fill here the third value reported when DISPLAY_ACC_OFFSET is activated (eg. -1100)

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

Re: Help with mpu6050 connections

Post by Carbo » Fri Sep 27, 2019 1:08 pm

Eventually one of my boring german beginner videos is helpful. This one handles IMU calibration:
https://www.youtube.com/watch?v=44Z3-T_d_f8

antlerhanger
Posts: 158
Joined: Tue Dec 25, 2018 3:19 am
Country: United States

Re: Help with mpu6050 connections

Post by antlerhanger » Fri Sep 27, 2019 1:21 pm

I just figured it out ..I wasn't using capitol letters to answer yes and no ....#define A_MPU6050_IS_CONNECTED YES . I will watch your videos tho

Thank you so much for your help

Allen

antlerhanger
Posts: 158
Joined: Tue Dec 25, 2018 3:19 am
Country: United States

Re: Help with mpu6050 connections

Post by antlerhanger » Sat Sep 28, 2019 1:07 pm

Carbo...The video helped me !! I was able to get calibration done and it works great !! Between yours and jhsa videos I have been able to get stuff working
Thanks again
Allen


Post Reply

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