Welcome to Multi-Rotor UK. Please login or sign up.

Thursday,April 25, 2024, 21:55:29

Login with username, password and session length

Shoutbox

Gaza07:
23 Apr 2024 08:09:45
The Domain expires for the forum in 60 days, I'm not going to renew it this time unless I see any activity  :beer2:
Gaza07:
20 Apr 2024 18:02:50
Is there anyone who would like to see this forum stay open ? :shrug:
hoverfly:
17 Apr 2024 17:15:13
 :rolleyes:
Bad Raven:
26 Mar 2024 08:41:05
 :(
Andy7:
25 Mar 2024 14:49:21
An excess of work and rain.  :thumbdown:
Bad Raven:
23 Mar 2024 18:12:38
Almost a personal Blog, it would seem. LOTS of members, but NO posts.  :-/   :shrug:
Gaza07:
06 Mar 2024 16:59:49
Anyone still here  :shrug:
ched:
24 Dec 2023 11:48:48
Hope you all have a Great Christmas and a happy New Year.
Bad Raven:
20 Dec 2023 06:17:47
 ~~   :beer2: 
Gaza07:
19 Dec 2023 22:20:27
Merry Christmas All  :beer2:
Members
  • Total Members: 8,195
  • Latest: lokloks
Stats
  • Total Posts: 201,427
  • Total Topics: 20,261
  • Online today: 31
  • Online ever: 530
  • (Tuesday,June 26, 2012, 08:34:46 )
Users Online
Users: 0
Guests: 14
Total: 14

Theme Changer





3d - Printworx

Paris V3 With MPU6050 Gyro / Acc

Started by Gaza07, Saturday,June 23, 2012, 00:10:38

Previous topic - Next topic

Gaza07

I decided to upgrade one of my old Paris v3 Multi Wii boards with the new Mpu6050 combined gyro and accelerometer, I ordered the new Mpu6050 break out board from one of the Chinese ebay traders, The board turned up and I promptly fitted it to the Paris shield and thought this should be a good improvement over the old wii motion plus and nun chuck,
Hmmm that didn't quite work out, in the GUI the Acc seemed to be fine but the Gyro seemed to be mixed up on the X / Y, I decided to edit the Multi Wii code there is a simple part you can alter to mess with the orientation of the sensors, so I swapped the X / Y over on the Gyro and it was then working in the same sense as the Acc, I then noticed that the Acc was reversed as in right was left / up was down,
So I also altered the code to set this right, every thing in the GUI now moves as it should and a power up while holding the copter out at arms length shows every thing is operating as it should so Im hoping to do a test flight tomorrow

[attach=1]

Below is a copy of the code I edited

//if you want to change to orientation of individual sensor
      #define ACC_ORIENTATION(X, Y, Z)  {accADC[ROLL]  =  -X; accADC[PITCH]  = -Y; accADC[YAW]  = Z;}
      #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = Y; gyroADC[PITCH] =  -X; gyroADC[YAW] = -Z;}
      //#define MAG_ORIENTATION(X, Y, Z)  {magADC[ROLL]  = X; magADC[PITCH]  = Y; magADC[YAW]  = Z;}


[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

Do you have a diagram of how you wired your MPU6050 to your PARIS board, or a close up photo? I'm wondering which of the pins on the MPU6050 go where, as there are a few I've not seen before.

So far my sensor wiring experience consists of wiring the barometer and compass to my Free Flight controller, but I'll be giving this a go at some point in the new few weeks so I'm very interested to hear how you get on.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

Gaza07

#2
If you click the image above it will expand to a full size picture, you can probably see what goes where on the bigger version

I put the Vcc on the sensor board to 4v5 on the paris
The bottom 4 connections on the sensor boar arent used I don't have a clue what they are
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

Ah yeah that's pretty clear thanks.

Without really understanding these things at all, it seems strange that only half of the 8 pins are used. I assume there is a reason for that but if you've got it working using those four I'll not worry about the others.

One circlip short of a quadcopter.
 1 lobe short of an antenna.

Gaza07

From what Ive read they are aux connections of the original ones

I have had a chance to do a test hover with the Paris V3 and Mpu6050,  it seems fine in acro and stabilise (auto level) but I did notice every now and then it would yaw 90 degrees although this might be the old twisted wooden frame that I used to test it on, although it seemed to fly ok, Im not sure I can trust this setup because the gyro / acc should of been working correctly without altering the code,
I have looked every where to see if other people have had the same issues as me but cant find anything, these are quite new sensors so maybe in time more info might be available

http://youtu.be/_9q_sJTuwAs
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

MadMax

Have i got this right they have made a new sensor with gyro / acc built in together and they have mixed up the x/y on each sensor ?,
Looking at the code above you have had to alter the x on the gyro to y to get it to match the acc,
and also minus reverse some of the direction of sense,
seems weird why they would produce it like that  :o

Gaza07

I looked at the PDF file for this sensor and it shows both as working in the same sense, it must be something in the code we use that needs the changes (I think)  ~~
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

jmellipse

This is interesting, I was just looking true the code and looking on the net for the same problem.

I'm using the mpu6050 board from flyduino.net. I didn't notice the problem at first and tried to fly as it is. The second the quad comes from the ground it becomes extremely violent and flips. Yesterday I noticed in the gui that the gyro x and y are mixed up.

I did read about some different versions of the mpu6050. Maybe it is a wrong batch chips ? I will keep on looking.

Thanks for sharing.

Gaza07

Hi jmellipse and welcome to the forum the alterations I made above make every thing work as they should, Iam using the latest dev version 20120622, did you buy just the gyro break out from flyduino or the full 10 doff ?
If you bought the 10doff the GY-86 there is a define for this board in the new MultiWii_dev_20120622  ~~

You can get the it from here  http://code.google.com/p/multiwii/downloads/list
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

jmellipse

I just came here to tell you that there is indeed a fix in 20120622 ;-) I never noticed the change in the latest code. Looks like that also fixes it for you !

#if defined(FLYDUINO_MPU)
  #define MPU6050
  #define ACC_ORIENTATION(X, Y, Z) {accADC[ROLL] = X; accADC[PITCH] = Y; accADC[YAW] = Z;}
  #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = -Y; gyroADC[PITCH] = X; gyroADC[YAW] = -Z;}
#endif


Thanks !

Gaza07

Thanks for the reply jmellipse the flyduino define doesn't match the code I ended up with, my board is a GY-521 from china, I will check my board with the flyduino define but It doesnt look like it going to work , I will post back later what happens  ~~
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

Gaza07

#11
Ive just been looking through the defines in the new dev and the Chinese GY-86 seem to have the Mpu6050 setup the same as mine

#if defined(GY_86)
  #define MPU6050
  #define HMC5883
  #define MS561101BA
  #define ACC_ORIENTATION(X, Y, Z)  {accADC[ROLL]  = -X; accADC[PITCH]  = -Y; accADC[YAW]  =  Z;}
  #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] =  Y; gyroADC[PITCH] = -X; gyroADC[YAW] = -Z;}
  #define MAG_ORIENTATION(X, Y, Z)  {magADC[ROLL]  =  X; magADC[PITCH]  =  Y; magADC[YAW]  = -Z;}
  #define MPU6050_I2C_AUX_MASTER // MAG connected to the AUX I2C bus of MPU6050
  #undef INTERNAL_I2C_PULLUPS
#endif


The alterations I made

//if you want to change to orientation of individual sensor
      #define ACC_ORIENTATION(X, Y, Z)  {accADC[ROLL]  =  -X; accADC[PITCH]  = -Y; accADC[YAW]  = Z;}
      #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = Y; gyroADC[PITCH] =  -X; gyroADC[YAW] = -Z;}


So a define for my board should look like this

#if defined(GY_251)
  #define MPU6050
  #define ACC_ORIENTATION(X, Y, Z)  {accADC[ROLL]  = -X; accADC[PITCH]  = -Y; accADC[YAW]  =  Z;}
  #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] =  Y; gyroADC[PITCH] = -X; gyroADC[YAW] = -Z;}
  #undef INTERNAL_I2C_PULLUPS
#endif


Maybe I should log on to the multi wii forum see if they agree and will add it to future releases  ~~
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

#12
Well I've just soldered up my PARIS board with the new MPU6050 sensor. Not tested it properly yet or even got it into a quadcopter but it seems to be responding as it should in the MultiWiiConf program so I'm happy :)

I'm using 20120622 so I'm guessing i don't need to worry about changing the code like you did Gaza?

All i did was install the multiwii code as normal using arduino 1.0 and commented in the bit for '#define MPU6050       //combo + ACC' and it seems to have worked.

So far the only difference I've noticed between the new MPU6050 sensor board and the old nunchuck based sensors (and the ones that came on my free flight board too) is that i am getting a less random variation in readings from the accelerometers. With previous sensors I've always noticed the numbers seems to jump up and down by a couple of digits or so whereas the MPU6050 seems to vary by only a single digit at ,ost when at rest on my bedroom floor. I'm guessing this might be a result of less sensor noise? Probably a good sign if so.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

teslahed

#13
Well the front of the flight controller as far as the sensors are concerned is not the same direction as the printed arrows on the board. I must have fitted the sensor board the wrong way around.

I can't be bothered taking the sensor board off to turn that around (with all the resoldering involved) so i guess i can fix the problem either in code somehow or else just by ignoring the printed arrows and installing the PARIS board in the quadcopter based on the direction of the sensor board rather than the flight controller?

edit - just looking at your code fix in the first post


in terms of direction, rotate clockwise is positive on the roll gyro which makes sense. Pitch down seems to be positive on the pitch gyro too now - is that right? Positive with yaw is clockwise when looking down on the board which would also seem to make sense.

With the accelerometers I'm now getting a positive increase in Z when i accelerate upwards which makes sense, Pitch increases in value when i pitch downwards and roll again increases in value when i roll clockwise and decreases when i accelerate in the anticlockwise direction which seems right.

Is this what you get with yours?
One circlip short of a quadcopter.
 1 lobe short of an antenna.

Gaza07

Hi Chris if you have the sensor board fitted the same as I do in the picture above its the correct direction, I also used the mpu6050 define in dev20120622 and it is wrong,
What I did was use that define then alter the 2 lines shown above to swing the gyro back around and also change some of the sensing to the right direction, you make the alterations in the section just under the mpu6050 define  ~~
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

#15
I altered the part right at the top of the 'Sensors' tab in the code;

// ************************************************************************************************************
// board orientation and setup
// ************************************************************************************************************
//default board orientation
#if !defined(ACC_ORIENTATION)
  #define ACC_ORIENTATION(X, Y, Z)  {accADC[ROLL]  = -X; accADC[PITCH]  = -Y; accADC[YAW]  = Z;}
#endif
#if !defined(GYRO_ORIENTATION)
  #define GYRO_ORIENTATION(X, Y, Z) {gyroADC[ROLL] = Y; gyroADC[PITCH] = -X; gyroADC[YAW] = -Z;}
#endif


and that seems to have swung things around in a way that looks a lot better now. I'm not 100% sure what i should be seeing in terms of positive and negative though. Also I'm not sure if this is the same place you modified your code or not - what you've quoted looks a bit difference to anything i can find in mine.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

Gaza07

That looks like it does the job I think the one I altered in the config.h over rides that one

In my Gui

Tipping forward gyro and acc number increase +

Rolling right gyro and acc numbers increase +

left yaw number in gyor goes down -

when testing just tip forward and look at the numbers dont tip back and then read because it will go negative when returning back to level also when tipping right just tip it and hold see what way the numbers move hope you can follow this
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

Quote from: Gaza07 on Friday,June 29, 2012, 15:33:56 In my Gui

Tipping forward gyro and acc number increase +

Rolling right gyro and acc numbers increase +

left yaw number in gyor goes down -

Yeah that's what i was seeing. I'm guessing the convention is clockwise = positive.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

MadMax

Interesting thread so what you guys are saying is that the mpu6050 can vary depending who supplies it ?
I find it quite strange that the gyro and acc can be out of wack with each other so much  ::)

Gaza07

I think they vary because different boards have the chip oriented on the board differently which is why they have to have there own define in multi wii, as for the out of wack bit that may well just be the way the multi wii code uses the chip it doesnt mean the chip is wrong  ;)
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

I've just been testing my PARIS board hooked up to my quadcopter with the motors and speed controllers (without props).

I'm having a few issues with my Rear_R (rear right) motor lagging behind the others. In the wingui program I can see that it's about '100' down on the others. My first thought was to see if the motor or speed controller were faulty but I've swapped both of those out and it's made no difference. Any suggestions would be welcomed at this point.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

Gaza07

I think I might have the same problem as on a test flight mine some times yaws right for no reason but not all the time, I have seen a video some where about settings the motors equal in the Gui,
I will have a look for it but I have never had to do this before  :o
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

#22
I'm getting the front right motor leading slightly and the rear right motor lagging behind. Both left motors go up and down in perfect sync.

It's definitely a problem with MultiWii of the PARIS board somewhere, not the motors or speed controllers, as I've swapped both of those out and it's still doing the same thing.

One circlip short of a quadcopter.
 1 lobe short of an antenna.

teslahed

The issue was to do with my sub trims. I needed to sort the Roll and Yaw settings - if you look in the above screen shot I've scribbled over the relevant section but the Roll and Yaw channels are each 13 and 14 'blips' away from the 1500 centre value. I altered the sub trim on the aileron and elevator channels on my transmitter to get these back to centre and the problem went away.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

Gaza07

Glad you sorted it out I have re-test flown mine and it flew ok and Im pretty sure I just need to re-calibrate the esc's  ~~

http://youtu.be/9N9S5lfliXU
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

Quote from: Gaza07 on Tuesday,July 03, 2012, 16:53:34
Glad you sorted it out I have re-test flown mine and it flew ok and Im pretty sure I just need to re-calibrate the esc's  ~~

http://youtu.be/9N9S5lfliXU

That looks very stable, how does it feel in comparison to the nunchuck sensors you had before?

It's funny the way you can calibrate all your escs then wire then up, find one motor is sticking, recalibrate again, then the problem goes away. You'd think once would be enough but apparently sometimes it isn't.

Also it's obvious to me that you've got your stable mode working much better than I've ever managed to get mine. For me stable mode has always been less stable than acro mode, even after I've trimmed the accelerometers.
One circlip short of a quadcopter.
 1 lobe short of an antenna.

Gaza07

It is more locked in than the old wii sensors and the acc seems quicker. the nunchuck would often loose its settings or just drift badly, I always set my acc (calibrate) it while its on the bench and set with a spirit level  ~~
The frame is prob a bit heavy but it handles ok and is very cheap from rctimer and is prob going to be smashed as Im going to flip this one  :o ~~
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

MadMax

I just made a post in the build thread for this copter wondering if you had tested it yet, looking good nice and stable, looks like one motors starts after the rest though  ;D

Quote from: Gaza07 on Tuesday,July 03, 2012, 16:53:34
Glad you sorted it out I have re-test flown mine and it flew ok and Im pretty sure I just need to re-calibrate the esc's  ~~

http://youtu.be/9N9S5lfliXU

Gaza07

Good point I will also post the video in the build thread  ~~
[url="https://www.youtube.com/channel/UCN6zN99iLCIJea5FCQPKf_g"]YouTube[/url]   [url="https://www.printing-3d.co.uk"]printing-3d[/url]  [url="https://www.thingiverse.com/Gaza07/about"]Thingiverse[/url]  [url="https://www.3d-printworx.co.uk"]3d-printworx[/url]

teslahed

#29
I've just got the full (GY_86) 10 degrees of freedom version of this board working with my PARIS flight controller;

http://www.ebay.co.uk/itm/251091073121?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1497.l2649

It was pretty easy to set up. I connected the 3.3 volt line up to the 4.5 volts from the PARIS board, which should be ok as the sensor states 3-5 volts.

I commented in the section of the Multiwii code;

#define GY_86              // Chinese 10 DOF with  MPU6050 HMC5883L MS5611, LLC

And it seems to be working fine.
One circlip short of a quadcopter.
 1 lobe short of an antenna.