Arducopter 2.0.25

I'm having a very hard time tuning PID's.

Frame is a MK50 with KDA 20-22L and 10x4,7 APC's.

Frame, motors and props are leveled.

Nevertheless, pid tuning is very hard to tune.

I followed the updated troubleshoot on the wiki.

Increased D for R&P but that was to unstable. SoI lowered it until the quad was stable in leveled flight. But still some small nodges from time to time. When fly around and come to stopthe quad starts to oscillate heavy.Then I decreased P to a degree that it was allmost unflyable. But still have the oscillation when stopping in the air.

I tried the CH6 D tuning and the changes are made so that works. Its really "fine" tuning ;-)

But then again I can't get the quad very stable in flight.

Also yaw seems to vary abit when flying forward and back

 

My Pids for the current most stable flight (still oscillating) are 0.23 / 0.018/ 0.093 int max 50

 

I know everythings fine with the quad because I had very good results with the ardupirate NG code 527.

 

Any suggestions are welcome.

 

 

 

 

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

Join diydrones

Email me when people reply –

Replies

  • Had a very bad week-end.

    My arducopter (standard quad + a GoPro) went crazy while flying.

    Two times it yaw by 180° then go fast forward, then 180° yaw again ; I was able to land then no harm.
    The third time it did the same, yaw 180°, then go fast forward, to the left, to the right, but I was not able to land, throttle was inoperant, I can only go left or right, finally I lost orientation. It then crashed on neighbour's roof and fell down (around 10 meters drop).

    Result : 4 props, 1 motor, 1motor mount and the dome broken, one arm bent, oilpan scratch (some resistors were torn off). I have to carefully check the oilpan before powering up and then I hope I will be able to download the logs. Atm I do not know if it is a hardware of software problem.

    Compass was disabled and I was flying in stabilize mode, 2.0.25 code.


    Did anyone had this kind of behaviour ?

  • Emile, I will test this asap and get back to you.
  • Vincent will you be able to try this in your code?
    I have done it and now I can fly standard PIDs with no oscillations at all.
    I've been working on two fronts, but the result is incredible.
    These are the steps I took:
    I have placed a 1cm silicon foam under the APM (I found it in the old computer stuff as I used it as a noise absorber)
    I have uncommented two lines of code that for me were not correct: in system.pde comment out lines 216 and 217.
    //dcm.kp_roll_pitch(0.2); // higher for quads
    //dcm.ki_roll_pitch(0,00000319); // 1/4 of the normal rate

    Not sure which one of the two had the major effect, maybe both, but as I said the result is impressive. Since you have a similar setup, maybe it will help you too...

    Reset PIDs to default cause yours are a bit too low. (you can save them if you want to return back)
    Recompile, and upload.
    Let me know.
    Cheers,
    Emile
  • btw what is "int max " for?

    please explaint me.. thank's

  • Emile,
    Just checked the value and they change between 0 and 2002.
    The quad is most stable at 0 So I don't think that changingvalue isen't needed.
    There must be something else in the code that prevents me to get it stable.
  • Vincent you can test the values easly using the CLI.
    In CLI--> test --> Tune
    will show actual values for the attached parameter.
    If you move your pot you will see the value changing.
    To get a more precise range you should modify your ArducopterMega.pde and radio.pde with a dividing factor coerent vith the values you need.
    ArducopterMega.pde:
    See line 1420:
    #elif CHANNEL_6_TUNING == CH6_DCM_RP
    dcm.kp_roll_pitch((float)g.rc_6.control_in / 5000.0);
    modify radio.pde after line 45 with something like that:

    /* ADD THIS modifying your range to be coerent with values you need*/
    #elif CHANNEL_6_TUNING == CH6_DCM_RP
    g.rc_6.set_range(100,1000);
    #endif


    I'll leave the Maths to you.... but in this example: min should be 0.02 and max 0.2

    E.
  • Which were your PID's in NG version? I had P=1.1, I=0.12, D=0.7. Wondering if there is any relationship between AC2/NG pids? I revert to NG code, when I frustrated to tune PID's again and again.

     

  • @Chris, I used the latest pid tuning tips as a reference. I can see the difference when changing the pid. Its getting more stable to a certain degree. I think I reached the border where I can't get it any more stable whilst still oscillating a bit. But not as stableas with the NG code.

    @Emile, Thx for the tips. The pids you suggested are unflyable. It wobbles agressive. I hooked up the _kp_roll_pitch to CH6 and there is a difference between low and high with low more stable. At high the quads wonders arround and its very hard to control. Low is much better. I also tried it half way but not better.
    Is there somewhere I can check this value. Maybe the lowest position with the potmeter isen't low enough. In the system.pde its 0.12.

    Yaw I did'nt touch yet because I want to fly stable first.

    Tuning the quad each time costs props.
  • 3D Robotics
    If you haven't seen the new PID troublshooting guide, check it out here:
    http://code.google.com/p/arducopter/wiki/AC2_Tweaks
  • Hi Vincent, I have same problem with similar setup. I think our motors react differently than the ones used by AC2 testers.
    Did you try my PIDs? P 0.38 I 0.025 D 0.17 (or 0.18)? It gest a little slow to react to commands, but at least it looks like stable even in windy conditions.

    Also if you have unstable YAW, try lowering the _kp_yaw to 0.35 in libraries/apm_dcm/dcm.h line 36 and then set in apm_config.h the YAW_OPTION to 0.

    Another think to try, is to tune the _kp_roll_pitch in the system.pde (line 209) or to bind this value to the CH6 tune by changing the #define CHANNEL_6_TUNING from NONE to CH6_DCM_RP.
    This way you can modify this setting without reloading the code.
    I believe this is a too high value for our setup, but I didn't have time to test it.
    The default value I think it should be 0.05967 but it gets overwritten by the value 0.12 in init_ardupilot(). I posted my opinion asking clarification on this setup, but still haven't recieved any valuable feedback.
    As soon as I will be able to fly, I will go through this setting, as I believe it is our source of problems. Like the Yaw, this value is a little too high so the quad overshoots trying to compensate for Gyro drift, thus creating instability.
    Please let me know if you have the chance to try this.
    Cheers,
    Emile
This reply was deleted.

Activity