Please help analyse my log - unexplained flip over in loiter

as the title says - trying to get to the bottom of why my quad keeps flipping over in alt hold and loiter modes.

seems to fly fine in stabilize mode.

attached are logs from today - the flip occurred just after 2 minutes in loiter mode after bringing the throttle back to stop it climbing - shortly after it flips over for no reason at all that i can see.

any help appreciated as this thing is un flyable as it is as i cant trust it - things break when it does this closer to the ground.

[attachment=1]2015-04-08 23-54-34.log[/attachment]

Your logging is set to low to get any real information on what happening here.
The fact that it is flips leads me to think the Flip Mode was selected since it does it without crashing.

Mike

yeah logs are too low

It doesn’t appear to be commanded…well desired pitch/roll doesn’t show it. Acro mode is not set for any of the flight modes wither so its not some how that.

neither chan 7 or 8 are set to flip mode though.

I did not initiate any flip mode - only thing i have on channel 7 is auto tune but it was not used during this flight.

what do i need to do to save more meaningful logs

the only reason this didnt crash was because i had plenty of altitude - every other time i have hit the bloody ground and done damage

isnt it the case that turning on extra logging results in higher demands on the cpu and likely to make matters worse… ?

OK - found how to turn on full logging…

Didnt think it was going to flip today - but she didnt disappoint - right near the end of the flight i put it in RTL and a few seconds later she flipped - again luckily plenty of altitude resulted in no damage.

the flip starts at line 62,000

i spent the first few minutes of this flight in stabilize mode giving it absolute welly full throttle clime outs and waggling the stick all over the place… - there is no way this thing is going to flip in stabilize its as solid as a rock so the issue has to be something to do with the gps positioning or altitude hold - my suspition is altitude hold as ive either had a flip or very nearly in this mode too… sorry cant remember for sure as there has been so many !!!

also just another thing to note - the sound of the quad changes quite noticably when in alt hold loiter or rtl compared to stabilize - its like the speed of the motors is over compensating all the time - with lots of faster and slower pulses - when its in stabilize mode - its smooth as silk…

links to log files as they were too big for this site

http://360p.co.uk/media/2015-04-09%2018-11-39.bin
http://360p.co.uk/media/2015-04-09%2018-11-39.log

I haven’t digested your log yet, but your vibrations are terrible. That would explain alt hold being off compared to stab.

heres what im talking about when i say the quad sounds totally different in loiter mode as to stabilize mode

heres the log of the motor outputs…

Why do they need to oscilate so much for gps position hold - the3res no way the thing is moving around in space that fast to need all those corrections - there really must be something drastically wrong with one or more of the autopilot params…

[attachment=0]Untitled.jpg[/attachment]

The outputs are noisy becuase the vibrations are terrible. the throtle is stab mode is controlled by the stick and is not affected by vibrations.

I suggest you fix that as your priority…I havent seen flips before (edit 2…flips that recover and weren’t intended :slight_smile:)…but it may also be vibration related.

EDIT is you cg in the middle? wondering why your motors 1 and 3 are different to 2 and 4

cg might be slightly out as there is a mobius camera hanging from the camera mount and the battery is slightly too long to close the battery door - i figured they would just about cancel each other out though…

correct size batteries are in the post.

dont think its possible to have a twisted motor arm as its a solid plastic exo skeleton not poles.

ill have a tinker with the FC mount and try some different foam and put some new props on - that should get the vibrations down.

My hunch is that it wont be whats causing the flips - but i guess its got to be eliminated first.

Yeah, my first post about twist was incorrect…I edited.

Not sure it will fix the flips either but it needs sorting either way and will make the log a lot easier to read if the flip still occurs.

Latest logs after adding more/different foam anti vibration and also new set of props.

My balancer is broken so ordered another one - but i really dont think im going to be able to get the vibration down on this cheapo chinese quad - even with better dampening there are several short leads going to the flight controller and what ever i do to isolate the vibrations from the frame there is always going to be a certain extent of them getting to the controller via the cables - its a tight space inside the frame and i cant do alot with the cables bette rthan the stock setup…

I fully accept that the vibations are whats causing my high frequency pulsing on my motors when i switch to altitude hold or loiter modes but this all seem unessesary to me.

the vibration levels on the imu readouts are consistent and could so easily be averaged out by the software - its unbelievable that the copter should attempt to altitude hold adjust such high frequency changes.

i have reduced the THR_ACCEL_P and THR_ACCEL_I values to try and reduce the authority the imu z acceleration has on the copter but they cant be set any lower than .5 and 1 and during the attched flight log files i had my usual flip (im now too scared to engage alt hold or loiter or RTL below about 30 to 40 meters as i know its going to slam in if i do)

[attachment=2]2015-04-11 00-28-10.bin[/attachment]

is there any other settings i can use to stop such high frequency variation in the motor speed reaching the ESCs as im 100% sure this is causing the issue and i just cant see an advantage to something as casual as altitude hold (which is the most sluggish of an axis to control due to having to move the entire mass of the copter against or with gravity) needing such high frequency corrections ???

as soon as i engage alt hold the throttle out to the motors goes from relatively stable to NUTS!!!

[attachment=1]alt-hold-being-switched-on.jpg[/attachment]

and as soon as i switch back to stabilize it all calms down again.

[attachment=0]switching-back-to-stabilize.jpg[/attachment]

So i know my copters perfectly capable of flying in a stable way - but the autopilot is not damping out vibrations when making decisions on what to do with the throttle !!!

I read somewhere that DJI phantoms have the flight controller stuck to the quad with a 1mm or less piece of double sided foam that has practically no vibration damping properties at all - yet their controllers just smooth it out in software ?

I think what im trying to ask is this…

If I as a human can maintain a rock steady altitude (and position for that matter) just by observation and minute and no more frequently than once every second or so adjustments to the throttle - why the hell does the autopilot have to make large and violent alterations 100 times a second to try (and fail) to achieve the same thing ??? (i guess thats a question for the developers - or someone who knows the logic flow of the software)

I fully understand why 6 axis stabilization needs to be done 10s or 100s of times a second as its stabilizing the attitude of the quad which is rotating around its centre of gravity and therefore can respond very fast which requires faster reactions than a human could achieve but position holding does not need to be adjusted any more than a few times a second at the most as the inertia involved in moving the whole machine from one place in space to another means the whole thing can be done at a much lower frequency than attitude stabilization (something that the software does extremely well)

Blaming the flight controller for your bad setup is rather unfair but hey ho.

If it was a simple as just averaging of filtering the data to oblivion and it still work properly then it probably would use it already…unfortunately averaging and filtering data enough to fix your issue would just end up flying poorly as well, it basic cintrol theory…delays with in control loops cause instability…filtering adds delay. I bet you would see more posts of people wondering why their quad was drunk and just plowed into the floor in an unresponsive manner or because it was oscillating slowly. You say as a human it flies brilliant in stab…and I am not doubting it!..but try and fly your quad using a camera system that has 1/4 second of delay rather than your own eyes and see how far you get! I bet its no where near as accurate. Your eyes are your feed back and there is minimal delay…that is why you can fly it well. The reason you wobble about when drunk is because of delays in your reactions.

There is a param for filtering you can play with, maybe reducing the cut off freq may gain you something, but if the vibrations you have are very high in frequency it may not fix it, you may have aliasing going on, and no software filter can fix that (well not in the way we need the filter/data to work).

If you had a pixhawk set to EKF you could possible reduce the weighting on the accelerometer and rely on baro…but I doubt it would fly very well, the whole point of the brain reacting quickly to accel to make up for the poor performance baro data (local pressure affects during maneuvering etc).

Any system is only as good as its inputs…and the inputs into your system are poor…its just the way it is.

Im not blaming the controller - this is open source software and as such is getting used on some pretty cheap multi rotors - many of these arnt capable of really low vibrations.

This software is full of parameters - so different people can get the results they need with different setups - and putting in some parameters that dampens down this ridiculous behaviour of rapidly and agressivly varying the prop speeds like this can only be a good thing for everyone.

ive ordered a new prop balancer and im considering drilling through my power board (what the controller is mounted on) and mounting the flight controller on anti vibration balls mounted direct to its case.

but i still think that wires are the main source of vibrations to the controller but i will do all i can to get the vibrations down to below an “acceptable” level

so are you saying i should give up - its not possible to tune this thing to cope with a slightly vibey quad…

i understand what your saying about the accelerometer compensating for drifting and fluctuating pressure but to vary a motor output this rapidly is crazy - variations of this magnitude are not even needed to stop it tipping over where there is little inertia involved - inertia to change altitude is huge compared to inertia to stop rotation so dont need to be handled anywhere near as aggressively

in my mind there is either a setting i have set very wrong - or there is a bug in the importance given to this acceleration reading

why have the THR_ACCEL_P and THR_ACCEL_I values been set up with a minimum of .5 and 1 - it seems that these are used to guage the importance of the acceleratrion readings so i would very much like to try some lower values.

I do have a pixhawk but its in a big hex im building and it wouldnt fit in this quad anyway.

right now - a quad that had shit alt hold and drifted up and down by 10 or more meters would be preferential to one that flipped over every flight

Ive found the parameter INS_MPU6K_FILTER which was set to 0 and im not sure what the default should have been - ive just set it to 20 as this is what i can find on the web

Is this the filtering parameter you were referring to ?

Maybe this will make a difference - will try a flight when i get home after 8pm tonight.

INS_MPU6K_FILTER is the one i was talking about, 0 is the defaultm i think 45hz from memory.

All I am saying is fix the vibes, not to give up.

Ok - flying the quad this evening was a totally different expoerience

First flight ever without an incident and she did a perfect RTL and landed upright with no issues at all.

However it was a windless night - almost completely still air so there was very little for the autopilot to do other than just sit there

loiter was practically staionary with no drift up down or on any axis

So provisionally i would say its fixed but i have a suspicion it might simply be the super calm evening - but i will have to wait to see how much of the behaviour is caused by wind

some very odd things i noticed on the vibrations for instance

[attachment=0]vibrations.jpg[/attachment]

the first part of that was at altitude of about 50m where they may have been some wind - then i decended and the second half of that was at about 3m … so are my vibrations the result of the quad fighting to stay in position when the wind is stronger ???

Hy Roy :slight_smile:
I follow your thread since the page 1 ( I have the same issue with my APM ) , and I would like to know where you find this parameter :[quote]INS_MPU6K_FILTER[/quote] .
I suspect the update of the Firmware to reset this parameter , because my Quad becomes crazy like that just after this update …
.oO( My issue : Loiter => and the quad made “stupid” throtteling at random frequency , and move around it’s position … RTL => never mind , it fly away in a fast drift and throttle peak ).
While you answer I will inspect the conf of my quad :slight_smile:

in mission planner go to config/tuning and then all parameters

then use the find option and just search for ins - theres only a handfull of them that start ins so you should see it in the list.

I have improved vibration dampening in my quad and have increased mine to 42 now and still she is much smoother in alt hold mode and loiter and RTL - but i have no idea what setting gets set with the default of 0 which was what my parameter was set to before I reduced it to 20.

to be sure i will have to set it back to 0 again to see if the erratic throttling of the motors returns

but definitely try 20 and 42 as settings as they are both working fine for me.

you can go as low as 10 or 5 but i think that is pretty much seen as absolute last resort

as a word of warning - i tried mine on 10 and then tried an auto tune - the result was not good (very slugish with overshooting and rocking back and forth) so im assuming that the lower you go with this setting the more you are crippling the controllers ability to do an auto tune.