Developer

Arducopter 2 stability patch

Hey, I had a little brainstorm last night after watching the DJI Wookong video. It's a sweet little system, but I wondered if AC2 could do that? So I put a battery on the end of one arm and it couldn't hold level. It came close but 3-4° error meant that it couldn't fly perfectly still. So during the ride in to work I thought of a way to rework the controller so it replicates my hand on the stick rather the the PI>PI rate controller we have now. 

 

3690901743?profile=original

I've never been happy with the Outer I term. It never really seemed to be very effective. I started thinking that my hand is putting a constant bias to the stick to get the perfect stability, so I could easily replicate that with the outer loop's I-term. I re-routed the Integral to directly sum with the rate controller output. I flew it tonight and it does work. I can hold perfectly level with a 22003S battery dangling from the arm. I think this is exactly what is needed for better Hexa/Octa redundancy.

 

Enclosed is the patch that works with 2.0.54. Just replace attitude.pde with the linked file. Then set your STB_PIT_I and STB_RLL_I to .1, and your limit to something high like 30° or 40°

 

Let me know how it goes for you and please let me know how you might improve it.

Jason

 

 

Attitude.pde

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

Join diydrones

Email me when people reply –

Replies

  • The outside loop (the bottom I) may need a boundary so the above loop does not get wound up over time.

  • Is it possible to use this stability patch with 2.0.50 ? If so lots of problem is gone!

  • Developer

    The angles are degrees * 100

    the omega term is an adjusted version of the gyro output in radians per second

    Jason

  • Jason, good work.  I think it's sort of along the lines of what I was thinking.

     

    Have you ever tried completely un-nesting them?  Use angle error into an angle PI.  Then rate error into a rate PI.  Then sum them both to the controller.  The only thing I'm not sure about is the rate PI would need to be smart enough to know when rate is being commanded by the angle PI, so that it doesn't fight it.

     

    For a while I've thought (if I understand how it works) that a big part of the problem is the quad can't respond to rate (pitch and roll) changes until it manifests itself as an angle problem.

     

    Something more like this (crude drawing).

     

    3692310824?profile=original

     

    I'm thinking along the lines of electronically recreating in the quad, what my flybarred heli is already doing.  The flybar acts like a super sensitive, infinitely fast rate PI system, and the only thing the AC2 code has to do is keep it level (angle error).  That's why it flies so well.

     

    I think the way you had it set up before, with the nested PI controllers, it was destined to wobble.

  • Developer

    Jason,

     

    Any idea when this will make it into a release?

     

    Thanks! -Adam

  • Developer

    Hello,

    I have just done a quick tests flight outdoor bewteen the rain and in spite of the windy and gusty weather (25 to 30 km/h...) the firwmare 2.0.54 (with the latest Jason attitude.pde patch) is really stable as a rock in air... Woow... good work Jason.

    In attached my tested setup file.

    Regards, Jean-Louis

    PID_ArduCopter2054_ALT_HOLD_LOITER_OK.param

  • Developer

    This is a very exciting enhancement. Thank you sincerely for your hard work.

  • Well, I don't understand anymore. My hexa has suicidal tendencies. It keeps crashing. 4 props dead. 1 landing gear. I must say I'm starting to give up. Don't know why it does it. 

    Well, I will try again.

  • Developer

    Hello Jason and all,

    I have just done some tests flights of my QRO with your firmware v2.0.54 and your latest stability patch and it seems working well. I have done only some indoor tests flights due to the bad weather outdoor, all seems OK... Below my setup parameters previously tested successfully with the v2.0.51 in LOITER and ALT_HOLD mode (see the video).

    3692310796?profile=original

    Regards, Jean-Louis

  • Jason, I have something strange with mine. Sometimes it tries to come to me even I told him not, just for a glith. Then normal. And a problem with my logs. look at this:

     

    3692310778?profile=originalI'm going to do some more test.

     

This reply was deleted.

Activity

Jose Araujo liked Jose Araujo's profile
Aug 29
spencer harvey liked spencer harvey's profile
Jul 9
More…