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
- Gain altitude - up the throttle for 1 second
- Roll hard until we go past 90°
- Maintain 400°/s roll until we are 90° from level
- 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.