Developer

Arducopter 2.7 Auto-Flip

 

A while back Jose Julio built a simple state machine for doing copter flips. I integrated it into AC 2.x a long time ago but never flew it. Then, once I built the Flash simulator I could finally test it without doing too much damage or loosing my quad to a fly away.

 

The original code was quick and dirty which lead to a few issues, one of which was a tendency to turn the my quad into an air to ground missile. The new code which is in 2.7 added a few items:

  • an emergency exit from the state machine (roll or pitch hard to exit)
  • a rate controlled loop rather than a using momentum for the second half of the roll

 

The state machine takes control of the throttle, roll and pitch until the flip is complete. It breaks up the flip into 4 main steps

 

  1. Gain altitude - up the throttle for 1 second
  2. Roll hard until we go past 90°
  3. Maintain 400°/s roll until we are 90° from level
  4. Stabilize with a desired angle of 0° for a nice controlled return to level

 

3689471366?profile=original

The mode is enabled by setting the CH 7 option to Flip. Bringing CH 7 high while flying any mode will trigger the flip, but you must be armed and flying to get the flip code to trigger. You must return CH 7 low, then high again to reset the state machine and do another flip.

Jason

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Not quite an acrobatic but I would love to see a fast/stable descent feature. The PIDs for stable hover and climb are much lower than the PIDs for stable descent. 

  • Developer
    The current build has broken auto flip. It will return soon.
    Jason
  • hmm. I tried this today with my 3dr quad. It gained altitude correctly and slowly started rolling in the direction to start a flip but it never rolled hard enough for it to go past 90 degrees. Do I need to change some values?

  • Developer
    Cool. I love the new flip code that is on the trunk right now (2.7.2). It's far more advanced and lets you pitch independently, and flip right or left based on initial entry angle. You can do all sorts of fun new rolls now.
    BTW, your gains for rate_roll_P /rate_pitch_P are too high and you have that tell-tale fast wobble. You can lower them by 20% and you should be good. You can also raise rate_roll_D a hair and it might remove some of the wobble.
    Jason
  • Developer

    Anyone know some other acrobatics we can automate? 

  • Distributor

    Just think it should be said that you need your copter to be tuned... must be ok to fly in alt hold / loiter before even trying this... Dont use that function on a copter that is not stable to start with! (I know it seems obvious but I have seem people trying to start a mission without a good alt hold setup... not always pretty!)

    Dany
    www.CanadaDrones.com

    CanadaDrones.com
  • 3D Robotics

    We have been playing with flip at 3DR for a couple of weeks now and it is flawless. Works great , good job Jason!

  • Developer

    CH7 going high will trigger the flip. It won't flip again until you toggle it. And it will finish the flip regardless of the switch position.

    It's only a 15% boost in throttle.

    It's pretty bullet proof if you are high enough. I've had a few instances were it were it didn't flip, but just started rising. A quick roll right and it exited the state machine.

    Jason

  • Developer

    That is fantastic!  Love the video with the 3 different angles!

This reply was deleted.