Autotune crash

My attempt at autotuning resulted in a crash this morning.

I fiew the quadcopter previously with a 2S battery. It was quite stable but underpowered.

After upgrading to a 3S battery I set the PIDs to what I believe is the default values:

Stabilize P: 4.5

Rate P: 0.15

Rate I: 0.1

Rate D: 0.004

Taking off and switching to Alt Hold went smooth. I then switched to Autotune and nothing happened. I believe this is because I had the throttle still a tad above hover. Closing the throttle down slightly to get it in the hover range started autotuning and on the first or second autotune roll it started oscillating ending in a crash. I was way too slow to recover it.

The way I read the log file, theses values were used for autotune:

Stab P: 4

Rate P: 0.2

Rate D: 0.005

Dataflash log attached. No CoG issues. Props and motors tuned recently, so low vibrations.

2016-01-24%2007-19-01.log

My primary question is:

What caused this crash?

My theory is that the motors may now even be slightly overpowered and I guess that an average PID settings may caused it to respond too violently. But I would appreciate if anyone else can confirm that from the log or share their own experiences.

Secondary question:

Is there a way to tell autotune to cool things down a bit and use a range of lower PID values?

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

    • A 650 Sport is a much better (and more expensive) frame.  I looked at the Flamewheel style frames for my first build, and I could see right away the arms were going to be problematic, so I settled for an X-525 instead.  Its not a beauty queen, but its rugged, its cheap, and it is easy to assemble.

      I used that frame to learn on and then I used it as a test bed for a camera, a gimbal, and an APM (I started with a KK 2.1.5).

      The quad is now my FPV trainer.  It still has the APM.  The camera and gimbal are riding on a Tarot 680 Pro with a Pixhawk..  But I still hear a 650 Sport calling....

    • Thanks guys,

      The Tarot 650 looks good. And I wouldn't mind upgrading to that. But it think it would essentially be a complete rebuild for me. It looks a bit heavier, and I don't think my current motors will handle that. I think it would be a fairly expensive upgrade for me.

      I was searching for a carbon fibre arm replacement for the 450 frame and saw this.

      Does anyone have any experience with this kit?

    • Cool kit but how much?! o_O

      Try the original flamewheel arms just, they only cost a few bucks each and they're pretty solid - I never had any problems autotuning with them.

      http://www.goodluckbuy.com/genuine-quadcopter-replacement-frame-arm...

      Or you can get a 650sport for nearly the same price :)

      http://www.goodluckbuy.com/tarot-650-sport-cf-pcb-center-plate-quad...

  • I was about to reply until I read Leonardo's answer, which is pretty solid. Listen to him!

  • @Fnoop,

    Good idea. Will try that out, thanks.
  • Developer

    Hi Jack,

    Sorry to hear about your crash. Autotune is only operating during the first half of the twitch and at all other times it is using exactly the same controllers as Alt_Hold (identical to Stabilize for roll, pitch and yaw). This type of crash happens because the pids you are flying with are not stable. Autotune assumes that the pids you have selected are capable of correcting the attitude after a minor disturbance (Autotune asks for a maximum of 90 degrees per second during its rate tests and 20 degrees during its angle tests). With the pid values you had set you would have had a very similar crash if you had attempted any quick attitude change in roll.

    You have set your PID's for roll and pitch to:

    Stab P: 4

    Rate P: 0.2

    Rate I: 0.01

    Rate D: 0.005

    I think the defaults are (it depends on your frame):

    Stab P: 4.5

    Rate P: 0.1

    Rate I: 0.1

    Rate D: 0.004

    Before attempting autotune you should ensure the copter can be flown around in Alt Hold and is capable of recovering after you hit the sticks to any side.

    If you are increasing your cell count you should scale your pids by the ratio (old_number_of_cells/new_number_of_cells), especially if you are increasing the cell count.

    Again, sorry to hear about your crash. I hope this post has explained what happened.

    • Thanks Leonard,

      That make perfect sense to me. 2 questions from this:

      1. Where do I get good default values? I didn't want to use the PIDs that I used for the 2S system because I was worried about this exact problem. What I ended up doing is starting the SITL, went to the config advanced menu and restored all the defaults. I then used those PIDs values for my frame as I thought the defaults would be a fairly conservative starting point. Obviously I was wrong and it is frame / power setup dependant. So is there any good source for conservative starting PID values?

      2. Thanks for the scaling function based on cell count. Do I scale all PID values this values?  Rate and stab?

      Also my 2S setup used these values:

      Stab P:    3

      Rate P:    0.3

      Rate I:     0.01

      Rate D:   0.035

      Scaling them down by 30% would put some values below the values allowed in 'Extend Tuning'.

      But thanks for your input. I didn't realise the current PID values are used between autotune commands. I will tune things down a bit and try again once I've repaired the damage.

    • Hi Jack

      One tip is to assign Rate Roll/Pitch P value with channel 6 dial - I always do this when flying a new frame or motor type as if it starts oscillating or doesn't respond enough then you can very quickly adjust the values to something that works, hopefully before it crashes!

      http://copter.ardupilot.com/wiki/ac_rollpitchtuning/

      I use this and then adjust the values inflight until I find the most stable, then start autotune.

    • Developer

      Hi Jack,

      The defaults are good for most quads but I have a number of 250 quads that require much lower pids. The first flight is the scariest as if the quad oscillates it can fly into the air and need to be shut down followed by a crash. A very short tether can reduce the risk of this process.

      If the default pids cause oscillation I will reduce them until there is no oscillation. I do this by reducing P and D with 50% steps.

      I then do a flight and I test for stability at approximately 1m of the ground. I give the roll and pitch axis a poke (one at a time). I start with about 5 degrees and work up to 45 degrees (I increase the hight as my confidence improves). If at any time I see wobbling as it returns to level I reduce the pids. I am looking for a mushy but very stable tune that I feel confident will always level after an input.

      Then I do autotune on roll and pitch, then yaw. I then repeat the autotune on all axis.

      After that I back of the ATC_Accel_XXX (XXX is RLL, PIT, YAW) and RC_FEEL to taste. 

      This seems a little long winded but it gives very good results.

      Based on your 2s results I would set:

      Stab P:    3

      Rate P:    0.2

      Rate I:     0.2

      Rate D:   0.02

      But looking at your Stab P value and the fact that Rate P is not equal to Rate I, I suspect your 2s tune isn't very good to start with.

    • @Leonardthall,

      Ok, so my second attempt flew well with my manual settings, but ended in a second (and third crash) as soon as I started the autotune process again.

      So this is what happened since last time:

      I first wanted to understand the effect of each PID parameter, so I made a bench test setup that allows it to only rotate in the pitch axis.

      I then tested different ways of creating a disturbance: using control inputs, using a wooden stick to bump the copter and using a fan. Turned out that the control inputs and external stick bumps resulted in the same behaviour. A quick gust from the fan was fairly similar to a small control input and a constant fan tested a constant positional error condition fairly well. Result: I mainly used control inputs for further testing and the fan to test the final setup.

      I then tested every parameter individually and graph them out to see the effect and then settled on this manual tuning strategy:

      1. Start with the minimum allowed setup in 'Extended Tuning':

      StabP: 3

      RateP: 0.08

      RateI: 0.01

      RateD: 0.001

      2. Tune RateP up to where I get 2 or 3 oscillations that attenuates.

      3. Tune RateD up to where the oscillations are eliminated.

      4. Dialed in a little bit of RateI to allow it to settle back to the zero point quickly and handle a constant error (fan).

      I ended with this parameters:

      StabP: 3

      RateP:0.20

      RateI: 0.1

      RateD: 0.01

      The results for the manual tuning looked good on the test bench. (File attached).

      So I felt brave enough to do the auto tuning in real flight.

      Went outside and flew around a bit. Handled well with no problems. I also tried to gradually increase the control stick movements and could flick the control to the limits and had no control issues.

      So I started with a new fresh battery and tried autotuning again. (log file included).

      The section with line numbers 503114 - 535000 Shows good following of control inputs.

      The section line numbers 557218 - 578261 shows autotuning starting again and the oscillations started again causing a crash. Although I anticipated it, I was still to slow to save it.

      Sections 583204-664705 shows the next crash. I should have terminated the flight at this point to check out everything, but I thought the impact wasn't too bad and I would go up a bit higher and give myself more time to react and switch back to Alt hold if anything goes wrong. As soon as I started autotune again the oscillation started and one of the props came off resulting in a big crash causing broken frame arms, broken GPS stand and possibly some motor damage - still need to test this.

      Can you please review my log file and see if you can spot anything.

      Obviously I am getting fairly frustrated especially since I enjoyed flying it with the manual tuning settings and though the autotune should be a formality now.

      But I see the value in autotune and I realise it's working for a lot of other people. So I would really like to get to the bottom of this.

      Any ideas?

      ManualTuning.jpg

      https://storage.ning.com/topology/rest/1.0/file/get/3702807436?profile=original
This reply was deleted.