Great day of flight testing ArduPilot today. Jordi and I were joined by Jack Poller, and we spent the whole day debugging code, tweaking gains and otherwise building towards the aim of the day, fully autonomous flight. Good news: ArduPilot works great in the air, we now have an officially flight-tested autopilot!
Here's how the day went:
--Arrived at the BARCS field and set up all the equipment. Beautiful day in the Bay Area--warm, sunny and no wind. Today we were going to test ArduPilot with the Superstar EP as the main platform, with the EasyGlider and EastStar with EasyGlider wings as secondary platform.
--First hitch: we realized that in the last code rev we introduced a bug. Although the ArduPilot board is working fine, the navigation isn't working at all. Lots of debugging and looking at variables on the Arduino serial monitor. Eventually Jordi finds the bug (two variables got reversed).
--While he's debugging, I get the EasyStar with Easy Glider wings ready to fly. I get it up a few times but it's really a dog. The ailerons generate as much inverse drag as they do tilt and it's just a struggle to keep it in the air. I crash land once, then again, then after some repairs, a catastrophic nose dive under power. Bye-bye FrankenStarGlider!
--Second hitch: FMA Co-pilot (the version with the built in Rx) is acting flakey. Lots of wiggling of wires before we realize that the crystal is falling out! Scary. Put it back in and tape it for safety.
--Lots of flying and watching ArduPilot data and GPS telemetry on the ground via the Xbee wireless module on the FTDI pins of the autopilot board. FMA working great, but when the autopilot is on we're getting inexplicable behavior. This isn't the way it worked in the sim! Keep landing and tweaking gains but it still isn't going in the direction it's supposed to go. Switch to "sneaker sim". Jack walks around with the plane and we watch the rudder and telemetry.
--We've been flying in RTL mode but to make the debugging easier decide to switch to "NE mode"--when the autopilot is switched on the plane should always fly NE (that just happened to be the way the wind was coming and wasn't into the sun).
--Eventually we figure out what's wrong. The way I've got the Superstar set up, both Channel 3 and 4 are reversed at the Tx to suit the servo configuration. D'oh! Reverse the sign of the servo commands in the code, and now it seems to be working right in sneaker sim. Realize that we need to write a checklist for people using ArduPilot with basics like watching out for reversed channels and remembering to disconnect the GPS before uploading new code.
(Jordi and Chris. All photos by Jack Poller. Full gallery of the day here).
--Back to the air. Better, but still not there. It's losing too much altitude in turns. Land, reduce the gains so full rudder is just 15 degrees. Switch from a 7.4V battery to an 11.1v battery to give the plane more power (it's really struggling to climb).
--While Jordi is tweaking gains and charging up laptops, Jack and I fly the EasyGlider Pro with FMA stabalization. It's a lovely plane and flies so well. Jack, who's never flown before, gets about ten minutes of air time and proves a natural. Jordi takes it a few times and achieves his best landing ever. Yay EasyGlider Pro!
--Laptops recharged and new code loaded. Now we're getting there! The plane flies much better with the extra power. The FMA is dialed in just right. And ArduPilot is rock solid. Tight turns, tracks straight and good altitude hold. Success!
It's the end of the day and we're delighted--mission accomplished. Videos coming later but in the meantime, here's the new code. Also check out Jack's photo gallery of the day.