I've flown a lot of different planes while working on ArduPlane, but it wasn't till yesterday that I first flew what is perhaps the most popular plane for new ArduPlane users - the Bixler2.
While setting it up on Saturday evening I had a bit of a look through some Bixler build logs in the forums, and I was surprised to find that none of the suggested ways of mounting the APM were really convenient. Some people put it in the bottom of the fuselage, which makes it difficult to get cables to, and hard to work on. Some used custom or commercial mounting systems for putting the APM on the top at the front, but that makes the Bixler less aerodynamic, and trying to cram all the accessories like telemetry radio and GPS in makes it a tricky fit.
The solution I came up with is to mount the APM upside down on the underside of the canopy. ArduPlane has supported the AHRS_ORIENTATION option for a few releases now, which allows you to have your APM mounted in a lot of different orientations. In this case it seemed perfect to use AHRS_ORIENTATION=8 and mount it upside down on the bottom of the canopy. The advantages are:
- it is easy to get at the APM for programming it, or accessing the pins, as you just pull the canopy off, and the APM comes with it
- when you remove the canopy it makes it easy to get to the battery space, as the APM is out of the way
- it leaves plenty of room for the receiver and GPS on the top part of the canopy
- it is clear of any wind effects, well shielded in the fuselage
I also used a pin through the plastic top of the canopy to hold the canopy on more firmly, as I don't really trust the magnets. You will also notice a couple of pins stopping the wings coming loose - those fuselage screws are rather loose and one came loose on the first flight.
This mounting system is also ideal for a PX4. I happened to use an APM2.5 for this build as I was doing bench tests on my PX4, but either one works with the AHRS_ORIENTATION option.
One thing to watch for with AHRS_ORIENTATION is that you need to reboot and then re-level your plane after setting it. It is best to use the CLI full accel calibration, so it can properly adjust for the slight pitch of the canopy bottom surface.
Cheers, Tridge
Comments
Hi Shane,
I always use MANUAL_LEVEL=1, which means it doesn't do accel calibration before each flight. You do it once on the bench at home.
It does do gyro cal each time, but for gyro cal it doesn't matter what angle the gyros are at, as long as they aren't moving. So in my case I connect the battery and leave the canopy hanging over the side of the plane (with the APM at a weird angle!) until the calibration has finished. Then I put it in place on top of the plane.
Alternatively you can put it all together and then use the ground station to remotely ask the APM to reboot. That will redo the gyro cal.
Note that I've actually removed the MANUAL_LEVEL option for the next release - it will always use manual levelling from 2.73 onwards. The "redo accel cal on each boot" is something I don't think is a good idea.
The "CLI full accel calibration" is a more accurate accel calibration that you can get to via the CLI interface via the "accel" command in the setup menu. It asks you to hold the plane upright, nose down, right side down etc and then works out more exact scaling and offsets than is possible with just plain levelling. It helps get that bit of extra precision in attitude.
Cheers, Tridge
Hi Shane,
I have two Bixler 2 APM setup and i am flying with both orientation.
I am also using manual leveling and never get any problem with calibration so far.
Cheers
I-Tech (Aytek)
Can anyone help me with this?
I am really interested in using this configuration (APM 2.5 upside down with AHRS_ORIENTATION set to roll 180), but I'm now sure how it works. Normally I would hit reset on the board after I have installed it in the aircraft to ensure it performs its calibration, but with this configuration that does not seem to be possible (i.e. once the canopy in on the aircraft you can't get to the reset button to reboot it).
I assume Andrew is using manual levelling to calibrate the accelerometers, but how do the gyros get calibrated? Would you connect up the APM then really quickly slap the canopy onto the aircraft while it is starting up? Or do you think he has some way of rebooting the APM after it has been fitted to the aircraft that is not obvious to me?
Also, Andrew said that "It is best to use the CLI full accel calibration". Can anyone explain exactly what he might have meant by this? It sounds like he does ~not~ use manual levelling, but I am not sure.
Any help would be much appreciated.
Shane.
Hi Andrew,
Your mounting looks really neat, but how do you reset the board? Don't you reset the APM just before each flight to make sure it is calibrated correctly?
Shane.
@Mark I designed it around my recently purchased Bixler 1.1 (That's the name according to HobbyKing order history).
I don't have a Bixler 2 available to measure the canopy so I'm not sure if it would fit.
Hi Andrew,
I am surprised. I never imagine it has a software bug instead of hardware design issue.
Thank you for the update. I will try it this weekend.
In the mean time i got an idea: Engin failure detection ( if not implemented or exist yet :)
I think we can detect engin failure trough the current draw of aircraft ( via power module reading ) If there is an engine failure it should drain less power than expected.
In case of engin failure pilot can be warned over telemetry or maybe APM will try glide to home.
PS: Some how i deleted my orginal comment.
Thanks
Aytek
@James, is that for a Bixler 1 or Bixler 2? Or do they share the same canopy?
Hi again Aytek,
I've found the cause of the magnet problem with PX4. It was a compass driver bug for the PX4, which I've now pushed a fix for.
The bug was that the APM PX4 compass driver wasn't handling the error from the NuttX driver when the compass saturated (which happened when a strong magnet was very close). The driver looped waiting for a valid value from the compass, which caused the main loop to stop until the compass was healthy again.
The fix is in git master now, and will be in the next release.
Cheers, Tridge
I could print it for anyone if you don't have access to a printer.
Hi Aytek,
Thanks for noticing that! I've been doing some testing of the PX4 and strong magnets today, and there is an interaction with magnets, but I haven't yet narrowed down exactly what is happening. After I work it out I'll post something.
Cheers, Tridge