Sudden jump in-flight (DIY Quad, HKPilot32, PX4 1.5.5)

I am a embedded SW engineer but a total newbie with PX4. Built my own drone as described in the topic title and it does not fly stable. I need some help to figure it out from the logs.

Problem description: After few minutes of stable flight, I was hovering approximately in 1.5meter height with negligible controls. Suddenly, the battery low beep was triggrered (i was actually testing the beep and thus had set it to trigger very very early) and at the same time the drone jumped approx. 1m higher. I pulled the throttle down to stop the rise, but could not catch it and the drone came down with a few jumps breaking its landing gear (it is heavy). The drone remained level all the time, so i cannot believe it would be a motor/ESC problem.

I am linking the log below. The event starts at 215.640. I do not really know which items I should describe here, but some observations:

  • The RC controls remain stable - not my fault :smiley:
  • The IMU values seem normal and only change at the time of event (cannot judge if reason or result)
  • The ATTC values tell that someone requests attitude change (again cannot judge is this reason or result)
  • The ATT values tell that the attitude is changes at the exact same timepoint with all the other events
  • The OUT values tell that the output changes at the exact same timepoint with all the other events.
  • The BATT values tell that the battery warning kicks in slightly after the other events, so seems to be the result of motors starting to take more power

What could be the issue? I do not dare to fly it atm. There were similar issues earlier but they could’ve been for some bad electrical connections and I do not have log for them. Sure I can upgrade the firmware but I would need to know that something related to this has been fixed and I could not find the changelog anywhere.

Log available at: https://drive.google.com/open?id=0BxykaYXTxO4rQXFIVGM5TnhwV00

I will be thankful for any ideas!

EDIT: Manual flight mode, GPS connected but should not be in any use.

Anything? Is there any way to see from the log if it was sensor or attitude control side which caused the jump?

Log: http://logs.uaventure.com/view/Kw6q2VUDHmNmooGEGzybTQ

I don’t really have much to add on top of your own analysis, but I can confirm according to the autopilot the commanded thrust and motor output didn’t really change. The log doesn’t seem to have valid current, but there’s also no voltage drop during the climb. Could it have been environmental?

Personally I would update to the latest PX4, enable the new logger, and try again with altitude control mode.

Thanks for comments and for the link to logmuncher!

It is true the issue does not come from ATTC.Thrust but instead we can see it in ATTC.Yaw. Seems that it is trying to correct yaw for some reason (why?? should manual flight mode even try controlling yaw?). I think it is pretty usual that high yaw rates may cause unintended thrust also due to motor differences or improper tuning. It is a second topic how could I then tune it so that yaw rates do not affect thrust…

Why exactly do you propose to use altitude control mode? To eliminate environmental effects? I wanted to try first with plain stabilizer to see if even it works properly… isn’t altitude control just an addition and does not replace the attitude algorithms? I really do not believe to the environmental factors in this case, it was not windy at all.

EDIT: Yes I do not have current measurement onboard as the power module was a bit tiny for my cabling and motors…
EDIT2: The plot has 0.001 scaling for the out channels

The jump was something like this here at 0:16-> https://www.youtube.com/watch?v=v7jw4ysZgkY

Continuing the monologue. I updated to 1.6.4 and after 3 test flights it seems rather stable :slight_smile:

I tested the altitude hold and position hold modes too and both work relatively well… How much error i should expect in the altitude, seems that it was fluctuating ±1 meters at least when closer to ground (higher in the air seemed more stable)? Also the GPS hold seems to first make a few loop-arounds before stabilizing to a new location, is there something to tune?