Accumulative drift

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Accumulative drift

Post by cardboard »

As per title I have drift on my tricopter. It's a very odd situation that gets progressively worse over time.
I can start out flying (in level mode as I always fly) and trim it so it doesn't drift, then after about 20s it starts to drift (normally backwards) then i trim fwd a little and a few more seconds latter its drifting backwards again. This can go on until I have my trim maxed out and i have my stick all the way fwd to counter the drift.
It is as if something is causing my tri to forget what level is or something.

part 2 of my problem is similarly related (and i think the root of all my issues) in that if i fly in one direction, say left, then level out again, the copter wants to tilt (and drift) and drift to the right. This happens only on roll and pitch. fly fwd level out it wants to tilt back. It wants to level to the opposite way to what it was flying basically.

Is there a setting I haven't quite got dialed in correctly or a hardware issue that is stopping my efforts at flying that I tracked down yet?

I have checked the GUI and all movements are present there.
ACC has been calibrated.
CG is correct.
PID's are default and work just fine as far as i can tell.
All sensors are mounted on foam, and main board is mounted with foam.
And all motors/props are balanced.

Hellllllppppppppp :?

Image

Image

Image

Image

User avatar
c2po
Posts: 22
Joined: Fri Jun 24, 2011 7:31 pm
Location: Atlanta, GA

Re: Accumulative drift

Post by c2po »

My guess would be temperature drift. What sensors do you use and where are they on those pictures? I can't really tell from the pictures what is where...

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

Temperature drift??
Interesting idea. This happened throughout my 30min of flying today so by the end of the flight I would have imagined that all the boards/ sensors would have equalized to air temp.
I was flying right after sundown, in a valley so sun just went behind the hills. So no direct sunlight and it was about 10-12°C with a light wind of 2-3kmph.
All sensors are in the middle part, on the 2nd photo the WMP is just to the left of the right most post and the NK is above/on the RX.
How to combat temperature drift? or at least a way to test to see if it is the problem??

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

This imagine should help, its an older photo but more or less nothing much has changed.

Image

oyibox
Posts: 5
Joined: Fri Aug 05, 2011 9:05 pm

Re: Accumulative drift

Post by oyibox »

cardboard wrote:it starts to drift (normally backwards) then i trim fwd a little and a few more seconds latter its drifting backwards again. This can go on until I have my trim maxed out

i didn't know that one can TX-trim its Acc while in the air but gyros.
try to trim your Acc on the ground with the max trotthle and roll/pitch sticks movements.

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

By trim I just mean the normal TX trim on the axes that is being effected.
The ACC trim, how much effect does each click have? I tired doing 4-5 trims in the manner you suggested with little success before I posted here. Does it need allot more, say 10-20 to make a reasonable impact??
Iv'e looked but the ACC trim procedure is only briefly covered in the FAQ, any more info would be great.

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: Accumulative drift

Post by captaingeek »

have you tuned it in acro only mode?

User avatar
c2po
Posts: 22
Joined: Fri Jun 24, 2011 7:31 pm
Location: Atlanta, GA

Re: Accumulative drift

Post by c2po »

Well, looking at the picture that shouldn't be much of an issue then, seems to be enough airflow around sensors... don't know what else to suggest.
You can check the drift by connecting it to GUI and just leave it running for a few minutes watching the graphs/values. Also you can just put your finger on the sensor, that will heat it up a little bit, and see if the values will change. If you have a drift in level mode then it should be Nunchuk accelerometer that gives you that drift.
Other thing to check is the sensors power voltage with a digital voltmeter. Looks like you are using original Motion+ which should have 3.3V onboard voltage regulator, maybe the voltage changes a little bit. And I'm not sure how do you power the Nunchuk, from a Motion+ 3.3V or from a separate source.

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

captaingeek wrote:have you tuned it in acro only mode?


I cant fly in acro mode..... Iv'e only every flown fixed wing aircraft so level mode was an easy step up. Should I learn this skill and will it help weed out my particular issue?

Ive run the gui, and watched it during flight and stationery. If I get it to a hover and lightly hold it so it doesn't float away from me you can watch the tri rotate backwards in my hands and the blue line (acc vert axes) starts dropping. The acc says its not level yet keeps on going further from level 0.o

I recently did remove the execs amount of circuit board from my NK, were the joystick used to be. I didn't see any visible circuitry but would this have an adverse effect? I also changed from mounting it with velcro to mounting it with foam tape. Could it be getting more vibration interference with the foam over the Velcro? I will change back and see if it helps.
Both are original and the NK gets its voltage from the WMP. I will also try putting my fingers on the sensors and watching the GUI to see if there are any changes.
Ill also look at the voltages, might be a dry joint somewhere or a comportment may have been damaged on a "rough" landing

PatrikE
Posts: 1964
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Accumulative drift

Post by PatrikE »

A few ide's.
check ACC-Z value. turn it upsidedown. should be the same but inverted.
If not adjustthe acc_1G.
Iw'e changed acc_1G = 200 to acc_1G = 220 for my NB original.

Lower the Level-Pvalue to around 5-6.
Lower the Level-I value to around 20.

This helps for me.

I havn't tried yet but test to activate.

Code: Select all

 #define LEVEL_PDF



/Patrik

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

Thanx Patrik I'll try these out when I get home and let you know how i get on.

PatrikE
Posts: 1964
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Accumulative drift

Post by PatrikE »

It seems that my MAG (HMC5883) it causin the drift for me.... :o

If i Enable MAG in the code i get drift in same compassdirection after 10-30 sec flying. (NE-E)

When i Disable in code The drift dissapears.
Flies as on rail with this LEVEL PID:s P:5 I:0.022 :!:

Can this be a Bug :?:

/Patrik

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

So I got a chance to test out all the advice i have been getting and wooow some very interesting results.
Leaving tri sitting for a few minutes on the desk, no change in any sensor but put my thumb on the acc and it jumps from 196 to 230, never knew that could happen. Gyro has no thermal effect.
ACC z value is an interesting one though, upright it reads 196, upside down it is 240?!?! i tried calibrating multiple times and same effect.

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

i just uploaded 1.81 to my board and although my acc still reads 196, hovering in the lounge seems ok. I did remove the 100g of fpv gear and i think the reduction in weight made it more twitchy then normal.
I Tweaked the level pids and managed to make the correction time lower so im happy with that, i will have to wait for the wind to ease up in a few days until i can go in test in the feild.
Ill take my laptop with me and if the problem occours again i will change my acc_1G value to 220 as you have. to see if it fixxes the problem then and there.
#define LEVEL_PDF was very mushy and i did not enjoy it at all, nice to have options but i like to fly semi aggressively
:P

oyibox
Posts: 5
Joined: Fri Aug 05, 2011 9:05 pm

Re: Accumulative drift

Post by oyibox »

cardboard wrote:By trim I just mean the normal TX trim on the axes that is being effected.
The ACC trim, how much effect does each click have? I tired doing 4-5 trims in the manner you suggested with little success before I posted here. Does it need allot more, say 10-20 to make a reasonable impact??
Iv'e looked but the ACC trim procedure is only briefly covered in the FAQ, any more info would be great.


for me, Acc trims work only if i keep the stick for 2 or 3 second, and i have to do it several times, then i can see a difference but i don't know how how many click it does represent.

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

oyibox wrote:
cardboard wrote:By trim I just mean the normal TX trim on the axes that is being effected.
The ACC trim, how much effect does each click have? I tired doing 4-5 trims in the manner you suggested with little success before I posted here. Does it need allot more, say 10-20 to make a reasonable impact??
Iv'e looked but the ACC trim procedure is only briefly covered in the FAQ, any more info would be great.


for me, Acc trims work only if i keep the stick for 2 or 3 second, and i have to do it several times, then i can see a difference but i don't know how how many click it does represent.


i can normaly just quickly move the stick to full extent then back to centre. the led on the arduino blinks to confirm input but ill try holding it there a bit longer to see if it makes a difference.

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

not worrying about my drift issue I do not like the over shot level mode gives in normal working conditions.
The worst example is in fast flight, when the sticks are released my tri does not go to level but over shots. so if im flying fpv and get a decent forward angle/speed then when i level out the sticks the nose , and view, pitches up for an unsettlingly long time before going to true level again. ive played with the pdf level mode but the mushiness is not particulery enjoyable for me.

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: Accumulative drift

Post by marbalon »

I need to confirm this problem to. I have L3G4200D gyro and ADXL345 acc in my setup, and if I fly in acro mode It is stable and can hover it, but when I enable ACC it start drifting in random direction.
Maybe this is problem with ADXL345 only ? Does anyone have this problem on a different acc ? I need to make some other tests:

- Set I=0 for Level
- Enable deadband
- check version 1.8p1
- I'm not sure but I remember that in v1.7 it was better

I will post results after tests.

btw. I've checked temperature drift for ACC and don't see any changes. And after calibration I have about 253 for ACC-Z and -240 if quadro you upside down.

User avatar
SoundMTB
Posts: 37
Joined: Tue Jul 26, 2011 8:17 am
Location: Germany Osnabrueck
Contact:

Re: Accumulative drift

Post by SoundMTB »

Hi

I can confirm that the problem wasn't there in Soft. 1.7

I have the Problem with BMA020 and soft 1.8

It seams to me that it has somethink to do with the MAG, becouse a friend of my has the same copter (build by me) without MAG and he says his copter work perfect.

regards
Oliver

User avatar
Hamburger
Posts: 2560
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Accumulative drift

Post by Hamburger »

SoundMTB wrote:I can confirm that the problem wasn't there in Soft. 1.7
dunno
I have the Problem with BMA020 and soft 1.8
+1
It seams to me that it has somethink to do with the MAG, becouse a friend of my has the same copter (build by me) without MAG and he says his copter work perfect.
no, same problem without MAG; only WMP+bma020
Hamburger

PatrikE
Posts: 1964
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Accumulative drift

Post by PatrikE »

V1.8 soft
Orignal WM+ & NB
HMC5843

Stable mode works fine without HMC5843.
When i activate HMC5843 the Quad starts to drift.

I only have problem with MAG.

Patrik

marbalon
Posts: 107
Joined: Thu Aug 18, 2011 10:59 am

Re: Accumulative drift

Post by marbalon »

I've checked two things, port everything to 1.8p1, but this not solve the problem, and then I set I=0 for Level and now everything is OK. No problem with drift. But what for is I for level ? In my situation drifts come from cheap transmitter (HK-6A) middle position is around 1500 but never equals 1500 (1498 to 1502) and can't be trimmed. I browse the codes and find that roll/pitch data is multiply by I-Level so understand why it is accumulative. So It can be resolved in two ways: Enable deadband - but I don't like it, or set I to 0. Now I have P-Level set to 4.5 and have no problem with oscillation.

Here is all my setup:
PID for roll/pich: 1.7/0.014/17
PI for level: 4.5/0
ACC: ADXL345
Gyro:L3G4200D
KDA 20-22L + 10x4,7prop
Mystery: 18A
and about 10cm between propellers (50cm motor to motor diagonal)

Now it is stable in both modes stable and level.

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

marbalon wrote:I've checked two things, port everything to 1.8p1, but this not solve the problem, and then I set I=0 for Level and now everything is OK. No problem with drift. But what for is I for level ? In my situation drifts come from cheap transmitter (HK-6A) middle position is around 1500 but never equals 1500 (1498 to 1502) and can't be trimmed. I browse the codes and find that roll/pitch data is multiply by I-Level so understand why it is accumulative. So It can be resolved in two ways: Enable deadband - but I don't like it, or set I to 0. Now I have P-Level set to 4.5 and have no problem with oscillation.

Here is all my setup:
PID for roll/pich: 1.7/0.014/17
PI for level: 4.5/0
ACC: ADXL345
Gyro:L3G4200D
KDA 20-22L + 10x4,7prop
Mystery: 18A
and about 10cm between propellers (50cm motor to motor diagonal)

Now it is stable in both modes stable and level.


Sounds to me like this might be the ticket for normal flight again. Will try it out and get back to you with the results.

User avatar
SoundMTB
Posts: 37
Joined: Tue Jul 26, 2011 8:17 am
Location: Germany Osnabrueck
Contact:

Re: Accumulative drift

Post by SoundMTB »

Hi

Dear marbalon, very good solution I fully agree to your analysis.
I will test today if your setting, I in Level Mode to Zerro will help me.

regards
Oliver

User avatar
SoundMTB
Posts: 37
Joined: Tue Jul 26, 2011 8:17 am
Location: Germany Osnabrueck
Contact:

Re: Accumulative drift

Post by SoundMTB »

HI

I've tested the sutiation with I in Level Mode to zero.
After 3 Akku's flying and a lot of trim work it looks likt taht is now working.
An interesting effekt is that the trim work is much much more as in Soft 1.7
I not 100% sure that the drift is gone, it feels sometime that the trim setting are not working in ACC mode or the
trim setting are lose after change akku.

I think we have to look to the code changes vs. soft 1.7 becouse in that Soft version it was working.
I found another Post where someone has a similar problem.

oliver

User avatar
SoundMTB
Posts: 37
Joined: Tue Jul 26, 2011 8:17 am
Location: Germany Osnabrueck
Contact:

Re: Accumulative drift

Post by SoundMTB »

Hi it's me again

I've looked to the code 1.7 vs 1.8 and I found that in 1.7 the Trim in ACC is done by one variable accZero for all axis.
In 1.8 I found to variable accTrim and accZero boout the accTrim is set on some places to 0.
Can someone help me to understand the funktions in the code.

Oliver

User avatar
SoundMTB
Posts: 37
Joined: Tue Jul 26, 2011 8:17 am
Location: Germany Osnabrueck
Contact:

Re: Accumulative drift

Post by SoundMTB »

I think in tese two line are the fould??
accTrim[ROLL] = 0;
accTrim[PITCH] = 0;

can someone check an verify?

Oliver

Code: Select all

// ****************
// ACC common part
// ****************
void ACC_Common() {
  static int32_t a[3];
 
  if (calibratingA>0) {
    for (uint8_t axis = 0; axis < 3; axis++) {
      // Reset a[axis] at start of calibration
      if (calibratingA == 400) a[axis]=0;
      // Sum up 400 readings
      a[axis] +=accADC[axis];
      // Clear global variables for next reading
      accADC[axis]=0;
      accZero[axis]=0;
    }
    // Calculate average, shift Z down by acc_1G and store values in EEPROM at end of calibration
    if (calibratingA == 1) {
      accZero[ROLL]  = a[ROLL]/400;
      accZero[PITCH] = a[PITCH]/400;
      accZero[YAW]   = a[YAW]/400-acc_1G; // for nunchuk 200=1G
      accTrim[ROLL]   = 0;
      accTrim[PITCH]  = 0;
      writeParams(); // write accZero in EEPROM
    }
    calibratingA--;
  }
  accADC[ROLL]  -=  accZero[ROLL] ;
  accADC[PITCH] -=  accZero[PITCH];
  accADC[YAW]   -=  accZero[YAW] ;
}

PatrikE
Posts: 1964
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Accumulative drift

Post by PatrikE »

This seems to be the calibrate ACC part of the code.
It will only be executed when calibrating ACC via Gui Or stickCommand.
All Acctrims will be removed.

User avatar
SoundMTB
Posts: 37
Joined: Tue Jul 26, 2011 8:17 am
Location: Germany Osnabrueck
Contact:

Re: Accumulative drift

Post by SoundMTB »

yes your right now i see

regards
oliver

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

I havnt had a chance to go out to the park ye, stupid weather, but cursing round the lunge with level I set to 0 does seem to solve the particular issue i was having

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

I havnt had a chance to go out to the park ye, stupid weather, but cursing round the lunge with level I set to 0 does seem to solve the particular issue i was having

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Accumulative drift

Post by Noctaro »

hey,
i got the same problems here. In acro mode quadro seems to perfom really fine, except when loosing height, it starts to woobble. I use the standart PID settings, should i reduce P?
But the wobble isnt the main problem. If i switch to stable mode, drift seems to start depending to my flightstyle. Hovering, no speedups, takes the drift longer to start. If speeding up or by using a more agressive flight style drift starts faster and quad gets uncontrollabe, so i have to switch back to acro mode to get it back to level. Had already a crash using 1.6 or 1.7 dont remember exactly, caused by this error while flying fpv. So it seems not to be an problem with the newest firmware i guess. My config is quad x with bmp085, bma180, hmc5883, original wii wmp and a paris v3 board. I tried to reduce I of Level to zero, but it does not really fix my problem. Right now i only can trust my quad when flying in acro mode. Hope someone finds my experience helpfull and can solve this problem. I am not really used to C so i do not dare to touch the firmware. Btw. my board is mounted on rubber screw buffers, and sensors are mounted with foam. Props are not very loud so, they seem to be well balanced.

cheers noc

User avatar
Rob
Posts: 77
Joined: Sun Apr 03, 2011 4:40 pm

Re: Accumulative drift

Post by Rob »

@noctaro

if I read your post, ik think the problem is your ESC ,
if you decrease the P the problem is less but still there (try it)

Rob

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Accumulative drift

Post by Noctaro »

@rob

Ah ok, thats a point, i am using cheap 30A Dys ESCs, i dont know the exact timings of them. That would explain the wobbles, but not the drift, right?
Could the drift have something to do with wrong alignment of + or - values of xyz? I am not sure wich values i should use for the hmc. Right now i use

Code: Select all

 #define MAG_ORIENTATION(X, Y, Z)  {magADC[ROLL]  = -Y; magADC[PITCH]  = X; magADC[YAW]  = -Z;}
in the config and added this to my senors firmware ->

Code: Select all

i2c_writeReg(0X3C ,0x01 ,0x60 );  //decrease sensor gain to avoid overflow. ---- 0x60 = wirkungsgrad

for the hmc 5883l in sensors module. But i think this value will not be able to cause a drift... :shock: this seems to work fine when testing in the gui. I dont think the drift really is based on the hmc5883, because i already had this kind of drift without the mag. Can this be a problem of the bma180?

cheers
noc

User avatar
Rob
Posts: 77
Joined: Sun Apr 03, 2011 4:40 pm

Re: Accumulative drift

Post by Rob »

Yes only by wobbles or short time drift.......

If its uncontrollable Esc,s reacting not right to slow or wrong internal filtering.

long time drift is controllable by the control sticks.

and I think it should be the esc,s because thats the only difference. not everybody have this problem.

you can test the short time drift by moving fast from left to right etc. if it become uncontrollable you have wrong esc software.

you can get the control back if you moving the sticks the same direction as the quad/tri etc wobbles.



Rob


and if you want to be sure its not the HMC disable it and check.........

I dont have a BMA180 so I dont know........ :roll:

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Accumulative drift

Post by Noctaro »

i understand, but the short time drift is not my problem. The wobbles only occur when dropping height.
If i fly in stable mode first my quad performs just fine. Then drift starts for example a bit to the left, no problem, its controllable. But over time i got to move my stick to the half of its available way to get the copter backt to level. If i switch back to acro mode, i am able to get it back to level without any problem. I will test the quad tomorrow again without the hmc and will give some feedback. Sorry for my sloppy english... Giving my best

thx

noc

btw. i right now found this -> http://www.multiwii.com/faq#How_should_ ... directions and will recheck the directions, maybe this is causing the problem... :?

User avatar
Rob
Posts: 77
Joined: Sun Apr 03, 2011 4:40 pm

Re: Accumulative drift

Post by Rob »

sloppy.. no problem, my English is sloppy as well..

Ok switching to acro and then back to level resets the drift.

that is not the Esc

I have to think about this, its easyer if i can have the same problem but i dont have muliwii software board.
I use my own board not compatible with ardueno or multiwii. ( lynxshop.nl )

to help solve this problem Im making a compatible board.

Rob

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Accumulative drift

Post by Noctaro »

Ok, thats great, thank you very much for your intrest in solving my problem.
Once again just to proof you did understand what i wanted to say.

In acro mode my quad will never drift. The drift will only start in stable mode. I can rescue it from that drift by switching back to acro. But if i afterwards switch back to stable the drift is still there, or even worse. Disconnecting from the batterie will reset the drift from stable mode. I could read something about the register of BMA180, there is the possibility to change the adress from 0x80 to 0x82 ->

Code: Select all

// I2C adress: 0x80 (8bit)    0x40 (7bit) (SDO connection to VCC) 
// I2C adress: 0x82 (8bit)    0x41 (7bit) (SDO connection to VDDIO)

at the moment i use 0x80, i dont know if it can cause problems, i will check that

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Accumulative drift

Post by Alexinparis »

Assuming the sensor is in the right direction.
Could you try the patch 2 here ? :
http://code.google.com/p/multiwii/downloads/list

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Accumulative drift

Post by Noctaro »

@Alexinparis
Of course! Thank you for that feedback. I will check the sensor directions and upload this new patch. I will give you a feedback as soon as i tested my quad in air.

-------------
OK update, i uploaded 1.8 patch 2 and by trial and error found out that the right settings are

Code: Select all

 #define MAG_ORIENTATION(X, Y, Z)  {magADC[ROLL]  = -Y; magADC[PITCH]  = X; magADC[YAW]  = Z;}

instead of

Code: Select all

#define MAG_ORIENTATION(X, Y, Z)  {magADC[ROLL]  = -Y; magADC[PITCH]  = X; magADC[YAW]  = -Z;}

keeping an eye on the faq -> http://www.multiwii.com/faq#How_should_ ... directions helped me out.

I am looking forward to a test flight!
If these settings work out well with patch 2 i will reupload patch 1 to give a feedback on the changes i could register during flight.
---------------

Update:
I had two testflights today, one with no wind at all. Have to say i am impressed....i never saw anything flying that stable. :shock:
Secound flight was in heavy wind and i got big wobbles, i will try to work out better PID settings.
However patch2 performs perfect, no drift at all! Thank you very much!
I did not test patch1 since i corrected the orientation of mag, so i cant say how patch 1 performs right now, but i will reupload and go for a test, to get a conclusion of the differences between the two versions.

cheers
noc
Last edited by Noctaro on Thu Sep 15, 2011 3:05 am, edited 1 time in total.

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Accumulative drift

Post by Alexinparis »

Ok, it's good to know the patch eliminates the drift problem most encountered.

cardboard
Posts: 183
Joined: Tue Mar 15, 2011 9:40 am

Re: Accumulative drift

Post by cardboard »

with new sensors--was adc accel ADXL335 and ITG3200 gyro--now original nunchuck and WMP and 1.8P2 everything is amazing again, I have a felling the old sensor combo was not playing nice.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Accumulative drift

Post by ziss_dm »

Hi Alex,

What was a problem? ;)

regards,
ziss_dm

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Accumulative drift

Post by Alexinparis »

Hi Dmitry,

This was not really a bug, but the condition to cancel the integration of ACC was maybe too restrictive.
The consequence was a lack of ACC in the attitude estimation leading to an angle drift.

If the neutral value for ACC Z is different of aac1G, accMag could be quite far from 100.
So I added a less restrictive condition, like in the 1.7:

Code: Select all

if ( ( 36 < accMag && accMag < 196 ) || (  abs(accSmooth[ROLL])<accLim  && abs(accSmooth[PITCH])<accLim ) ) {

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Accumulative drift

Post by ziss_dm »

Hi Alex,

If the neutral value for ACC Z is different of aac1G, accMag could be quite far from 100.
So I added a less restrictive condition, like in the 1.7:


This part I'm trying to understand. ;) Because magnitude of the acceleration vector should be always be 1g at any angle (without acceleration). (The altitude hold also relaying on this). I have only BMA180 and ADXL345 to test with, but this is true for my sensors. Was this problem reported for some specific sensor types? Or maybe just wrong sign of AccZ? ;)

BTW: With NK clones I always had to adjust acc1G (as PatrikE suggested earlier)

EDIT: With wrong sign of AccZ I was able to reproduce described symptoms. ;)

regards,
ziss_dm
Last edited by ziss_dm on Mon Sep 19, 2011 12:13 pm, edited 1 time in total.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Accumulative drift

Post by ziss_dm »

Hi cardboard,

ACC z value is an interesting one though, upright it reads 196, upside down it is 240?!?! i tried calibrating multiple times and same effect.


In your case AccZ has wrong sign. You need to adjust ACC_ORIENTATION macro. ;)

regards,
ziss_dm

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Accumulative drift

Post by Alexinparis »

Was this problem reported for some specific sensor types? Or maybe just wrong sign of AccZ? ;)


I think this problem was reported:
- with every ACC sensors, but not on every config
- and also with predefined sensors config (like the Quadrino board with the BMA180).

So, the sensors orientation is not the single cause.

Noctaro
Posts: 280
Joined: Thu Sep 08, 2011 11:15 am
Contact:

Re: Accumulative drift

Post by Noctaro »

I think this problem was reported:
- with every ACC sensors, but not on every config
- and also with predefined sensors config (like the Quadrino board with the BMA180).

So, the sensors orientation is not the single cause.


Yes, i have to confirm that. I am able to reproduce the drift by using firmware 1.8 patch one without using mag.


Was this problem reported for some specific sensor types? Or maybe just wrong sign of AccZ? ;)

My Acc Z Axis seems to perform like described in F.A.Q. -> http://www.multiwii.com/faq#How_should_ ... directions
I never changed the sing of ACC and never put the sensor to a other position on the board. So the drift seems not depend only on the direction, but i will try to reverse the sign of Z and report if that eliminates the drift.

cheers noc

mr.rc-cam
Posts: 457
Joined: Wed Jul 27, 2011 11:36 pm

Re: Accumulative drift

Post by mr.rc-cam »

I cant fly in acro mode..... Iv'e only every flown fixed wing aircraft so level mode was an easy step up. Should I learn this skill and will it help weed out my particular issue?

You need some basic skills to fly for a short time in acro mode so you can use the Tx's trims to level the model. Once you have the acro trims dialed in, you can turn on ACC level mode and use the stick calibration method to calibrate it for level hovers.

The ACC trim, how much effect does each click have? I tired doing 4-5 trims in the manner you suggested with little success before I posted here. Does it need allot more, say 10-20 to make a reasonable impact??

The number of clicks needed to see an impact will vary with the sketch release you are using. I have 1.8 and it takes about 20 trim inputs to see small changes. One fellow mentioned he needed 50 trim inputs to level his model, so it will require a bit of experimentation. For sure, 4-5 trim inputs is probably not going to do much for you.

I also changed from mounting it with velcro to mounting it with foam tape.

The best mount I've seen are those silicone pads that feel like freshly made Gummy Bear Candy. A cheap source for them is in the shoe department since they are sold as stick-on pads to make your shoes feel better. Also, I've found that the wires that connect to the gyro sensor should be very small gauge (lightweight & VERY flexible) to help ensure their mass does not affect the "floating" gyro board. Not that this will fix your immediate problem, but it will provide best performance when you fix your drift problem.

ziss_dm
Posts: 529
Joined: Tue Mar 08, 2011 5:26 am

Re: Accumulative drift

Post by ziss_dm »

Hi Noctaro,

Could you also please post some additional information about your case?

1) Could you describe symptoms of your drift.
2) What is your HW config Gyro/Acc
3) GUI Gyro readings
4) GUI Acc readings:
- flat
- upside down
- 90 degrees
- 45 degrees


regards,
ziss_dm

Post Reply