First ArduPlane flights with APM2

By Andrew Tridgell [ http://diydrones.com/profile/AndrewTridgell ]
DIYDrones.com

December 3, 2011

I've been working on the ArduPlane code for the new APM2 boards for a while now, so I was delighted to watch it loitering above my local flying field today for the first time. I'd flown it once before two weeks ago, but that was a very short flight as I had the aileron controls reversed (I don't have much experience with elevon planes!), so it was quite tricky to steer. It 'landed' in a tree that time. I also had no telemetry for that flight as we hadn't yet worked out the MUX switching needed for the telemetry UART in the APM2.

Pat and I fixed the MUX switching problem last weekend, so this weekend was my first chance to fly APM2 with a ground station and full telemetry. The weekend started off with an interesting problem. I took it out to the field yesterday and got it ready to fly, then waited for GPS lock. It takes a while to get GPS lock in Canberra, so I was waiting a few minutes. As soon as it got GPS locked I was surprised when the ground station reported that the board was rebooting! Time to take it back home for more bench testing.

I added a patch [ http://code.google.com/p/ardupilot-mega/source/detail?r=6f340b3b124a8356ade1d646db2f1368af7c8772 ] that faked up GPS lock after a specified period of time, which allowed me to reproduce the bug on my bench, and after a couple of hours of false starts I finally found and fixed [ http://code.google.com/p/ardupilot-mega/source/detail?r=55b65f923b0fbedce35a817e09fc028479a9e000 ] the bug this morning. Time to flight test it!

Since I'd last flown my SkyFun (with an APM1 board) I had replaced the hinges, put in a bigger motor and a new ESC, so I was expecting the tuning to be a bit off. It sure was! I only switched to manual once in the flight and it dived hard - it looks like my CoG is a bit off with the new setup. I did the rest of the flight with the APM2 stabiliser enabled, letting the code take care of the trim. It's easy to get lazy with trim when you have an autopilot :-)

I did two flights today, of about 10 minutes each. It can probably fly for 20 minutes or more, but I don't have a current sensor fitted, so I didn't want to push it. In both flights I did a few minutes of LOITER, which is a good test that everything is working well in the code, as it needs all the sensors and logic to be working to keep it going around in circles in one place.

As you can see, the LOITER went perfectly, despite quite a strong wind and poor tuning.

The APM2 really is a great board, and the smaller size makes it perfect for little foam planes. I also like the fact that the inputs and outputs are at opposite ends of the board, making wiring neater.

Of course, best of all, the APM2 can fly!

5:33pm

Copyright 2011 http://diydrones.com/