I thought it would be fun to have an 'inverted flight' switch on my transmitter. With an APM, it's easy! I just added a check for a PWM value above 1700 on channel 7 in read_control_switch(), and when it is above 1700 it sets a inverted_flight boolean. That adds 180 degrees to the nav_roll, which is the target roll for the stabiliser, and it switches the sense of the elevator stabilisation in the main stabilize() code. The result is this patch to the current ArduPilotMega code.
I tried this out a few times with HIL simulation using FlightGear first, then took it flying today with my SkyWalker. There was a lot of wind, so not exactly ideal conditions to be trying experimental patches, but I didn't want to wait for next weekend so I took a chance. It works perfectly!
I setup a spring loaded switch on my transmitter to set channel 7 to 1900 while I held the switch. That allows me to takeoff normally, then whenever I hold the switch in the on position the plane immediately flips over and holds nicely stable flight upside down. You can direct it reasonably well while inverted, although it certainly isn't as responsive as with upright flight (a glider like the SkyWalker isn't really designed for this sort of thing!). The manual mixing of elevator is inverted while upside down (just like it is when you flight upside down manually), which makes this patch good for practising inverted flight, as you can get used to the controls.
The only tricky part of the patch was the change to stabilize() to handle wrap of nav_roll at plus and minus 180 degrees. I originally wrapped it just based on the value, but the HIL simulation showed there was a discontinuity in the stability control at exactly 180 degrees, so the plane would suddenly try to flip over again while upside down as you passed the 180 degree mark. This turned out to be an interaction between the wrapping of the dcm roll_sensor and the nav_roll wrap. The fix was to wrap the nav_roll variable based on the sign of the dcm.roll_sensor variable, and that leads to really nice inverted flight with no crazy behaviour near 180 degrees.
This patch works with any of the stabilised flight modes (ie. anything but manual), which means you can flick the switch for inverted flight while flying a mission, or while in any of the other autopilot modes. It should add a bit of interest to longer missions!
(thanks to Stan for taking the video and coping with the gale blowing at the time)
Comments
I have tried this and at least on the bench, I notice no change in the MissionPlanner's horizon even though the APM is still upright and level on the bench....is this normal?I would have thought it would indicated that the APM was upside down when the switch was activated?
I've added a wiki page on how to setup inverted flight
I've just pushed the inverted flight patch to the master svn repository, so everyone can use it. It is enabled using a config parameter INVERTEDFLT_CH which you can set with your ground control station. You set it to the channel number you will use to trigger inverted flight from your transmitter. When that channel goes above 1750, APM will engage inverted flight. The default is zero, meaning no inverted flight trigger.
@Darren: That's what I was thinking. This might let you fix the board inverted in your airframe, which is a feature APM sorely misses!
@Joel
A flying wing was just the first thing that popped into my head. It could just as well be a purpose designed UAV, using midsection mounted symmetrical profile wings like aerobatic airplanes use.
Or you could take it a step further and design the wing profile so that the plane has better efficiency inverted, but still can perform takeoff/landing in normal flight.
Taking your idea one step further, in the case of a flying wing you could program the controls so that they would respond the same way regardless of the airframe's orientation.
The quadcopter build has a version of this already where they can point north, and the quad goes north regardless of which rotor is "front".
The only fly in this ointment is that most wings don't have a fully symmetrical airfoil for stability reasons.
-
1
-
2
of 2 Next