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

 

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

Views: 5137


Developer
Comment by Randy on August 2, 2012 at 3:46am

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

Comment by Jonek on August 2, 2012 at 5:22am

Do you have to keep Ch7 high until the end of the maneuver? Will low-high trigger the next flip on the high immediately or will the high only trigger the reset and another low-high is required for the next flip?

Comment by Craig Burden on August 2, 2012 at 7:24am

I was just wondering if this is by any chance the most awesome thing I have ever seen? Just wondering what the failure to success ratio is using this feature? I really want to try this, but I don't want to trash my quad.

Comment by Mike R. on August 2, 2012 at 9:39am

This is really amazing work - and a wonderful video with the angles to boot! I might have to try this with a hexa...

Comment by Mike R. on August 2, 2012 at 9:46am

Jason - when you say that step one in the code is to up the throttle to gain altitude for one second, is that 100% throttle? Being that I have a hexa with 880 motors, neighbors may think I'm sending up an ICBM :)


Developer
Comment by Jason Short on August 2, 2012 at 10:03am

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

Comment by Kevin Schumacher on August 2, 2012 at 10:13am

That's awesome!  Can't wait to try it on my quad.

How easy is it to run code through your Sim? :)

My thoughts on how to do a forward moving backflip/loop:

Pitch forward at 10°/sec until 40 until - Gain ~5m altitude during forward pitch.
Gain altitude - up the throttle for 1 sec - Throttle +???%
Hard pitch at -400°/s until we go past 90°
Throttle @ ??? (not sure about this one)
Maintain -400°/s pitch until we are 40° from level
Pitch back at 10°/sec until 0° - Throttle or down to gain / lose altitude (objective = Match starting altitude)
Mode change to Stabilize for controlled return to level

I haven't looked at the flip.pde code yet, but I probably will.  I also need to get a simulator working so I can test myself.


3D Robotics
Comment by Alan Sanchez on August 2, 2012 at 10:33am

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


Distributor
Comment by Dany Thivierge on August 2, 2012 at 7:27pm

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


Developer
Comment by Jason Short on August 4, 2012 at 9:27pm

Anyone know some other acrobatics we can automate? 

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service