3D Robotics

Major new update for APM:Plane code


Good news from Andrew Tridgell and the rest of the APM:Plane (ArduPlane) dev team: they've pushed out a major new release (2.77). Major changes include: lots of updates for PX4 and Pixhawk, dual sensor support on Pixhawk and new throttle arming code.

The following is from Tridge's release announcement. Please post any questions or comments there. 

Pixhawk updates

The biggest set of changes are for the PX4 and Pixhawk boards. The Pixhawk production boards started shipping a few weeks ago and include some nice hardware features that didn't make it into the 2.76 release. The most important of these is dual sensor support. The Pixhawk has two gyros and two accelerometers, and (if you have an external GPS/compass combo) dual compass as well. In the 2.76 release only one of each of these sensors could be used. With the 2.77 release the health of each sensor is monitored and if one sensor fails the second sensor can take over. In addition to failover support the code logs both sets of sensor values both to MAVLink and to the logs on the microSD card, which is very useful for diagnostics. We are also working on dual GPS support which we hope to get into the next release. I have test flown the dual-GPS code a few times, but I didn't consider it complete enough for the 2.77 release, so I have left it out for now.

Arming support
The most user visible change in this release is a great contribution by Michael Day adding new arming code. For those of you who have flown APM:Copter you will know that you need to arm the copter before you can fly using the rudder stick on your transmitter. That can be a great safety feature for electric aircraft, and now APM:Plane has the option of the same type of arming code.

For the plane arming code we decided to make arming optional so as not to surprise existing users too much. Have a look at the documentation for the arming parameters for how to setup arming in APM:Plane 2.77.

Parameter storage
Another major change for this release is the way parameters are stored on PX4 and Pixhawk. In previous releases we stored parameters on a file on the microSD card. That usually worked fine, but recently there have been a few too many issues with FAT filesystem corruption of microSD cards, especially when powering off while writing to the SD card. For this release we have moved all parameters to the EEPROM on the PX4 and the FRAM chip on the Pixhawk. This makes parameter storage independent of the microSD card, avoiding parameters becoming corrupt due to microSD card problems. Parameters from a microSD card will be automatically copied to EEPROM/FRAM when you upgrade to APM:Plane 2.77.

Improved relay code
The relay and servo set code has had a major overhaul, with up to 4 relays now supported for MAVLink control and much better support for the DO_SET_SERVO, DO_SET_RELAY, DO_REPEAT_SERVO and DO_REPEAT_RELAY MAVLink commands. Along with these changes is a new parameter BRD_PWM_COUNT which allows you to specify how many auxillary PWM outputs to enable, with the remaining outputs being available as digital relays. This allows you to re-assign some of the aux servo outputs on Pixhawk for use as relays, by setting the RELAY_PIN, RELAY_PIN2, RELAY_PIN3 and RELAY_PIN4 parameters. The pin numbers for these pins start at 50 for the first aux servo pin, and go to 55 on Pixhawk.

Improved logging
There have been logs of logging improvements in this release. Apart from the dual sensor logging, we can now transfer on-board log files to the ground station over MAVLink, which makes it much easier to get detailed logs without having to pull a microSD card out, or boot to the CLI. We're hoping to remove the need for the CLI completely in a future release, doing everything over MAVLink.
The new logging code also includes the git version number of APM and (if needed) the PX4Firmware and PX4NuttX repositories used to build the firmware in the logs. This makes it easier to track down any issues to the exact code used.
Another important logging change when used with the new ARMING_REQUIRE option is that logging won't start until you arm. This prevents lots of small log files from accumulating, wasting space on the APM2 and cluttering up your microSD card on PX4 and Pixhawk. 

Loiter change
A small change in the loiter code now makes it possible to change the direction of loiter while loitering, by setting the loiter radius to a negative number. This is mostly useful for testing, but it was also requested by one user.
Health reporting
The reporting of sensor health to the ground station is much improved, allowing the operator to know more quickly when a sensor has failed. This includes the health of a digitial airspeed sensor, as well as inertial sensors and the compass.

Initial Sonar Support
This release includes the beginning of sonar support for landing. This is still experimental, and thus far it can't actually be used to control landing, but you can configure a sonar and log the recorded sonar distance and voltages for analysis.

Reverse throttle fix
A bug was fixed in the handling of throttle failsafe for internal combustion aircraft with reversed throttles. If you fly IC and have throttle reveral then you need this fix!

HIL improvements
Lots of improvements were made to HIL support, including better handling of slow HIL connections, plus much faster HIL servo updates. It now flies a lot better in HIL. Another useful feature is that the SIMSTATE MAVLink message is now included in HIL MAVLink messages, which makes it possible to compare the true attitude with the attitude that APM has calculated from the sensor input. This is very useful when diagnosing HIL issues.

More telemetry ports
On Pixhawk and PX4 you can now have a 3rd telemetry port, allowing USB and two serial telemetry ports to be active at the same time, which is very useful when you have an onboard computer.

Geo-fence return altitude
Another improvement from Michael Day is the inclusion of the FENCE_RETALT parameter which allows better control over the return altitude on fence breach.

Airspeed fixes
There have been a few fixes related to airspeed handling. One is to handle the case where airspeed reading too low due to the ARSPD_RATIO being too low. The airspeed autocal code didn't fix this as it only ran when airspeed was above the minimum airspeed. We now run the airspeed autocal code if either GPS groundspeed or airspeed is above the minimum airspeed.
A second airspeed related but was to fix a scaling factor for true airspeed in the pitch controller (thanks to Paul Riseborough for the fix!).

Upcoming Changes
There are a lot more changes in the pipeline for APM:Plane! The biggest thing being worked on right now is the new Extended Kalman Filter (EKF) code from Paul Riseborough for attitude estimation and inertial navigation. It is producing great results, but we decided to hold off on releasing it as we want a bit more testing first. 

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Can I use the digital airspeed sensor with the APM2 board ?

  • Developer

    Hi Frejus,

    Adding a topic in the forum or submitting an issue is usually the best way.

    Cheers, Tridge

  • Where can we suggest improvements for next releases ? Thanks

  • Developer

    Does v2.77 not work on APM 1 or is something else amiss?

    yep, it was my mistake. I managed to break APM1 support and didn't notice as my APM1 had died prior to release. I should have asked someone else to test APM1.

    I've fixed it in git master, so if you try the 'latest' build you should find it works again. I'll probably do a new release soon that has this and a couple of other fixes in it.

    Cheers, Tridge

  • Moderator

    Tried to load v2.77 on APM 1 (2560) board just now but it won't connect properly via USB.

    All I get is "Getting params... (sysid 1 compid 1)" then "Done" but then no params load and the HUD does not move.

    Went back to v2.76, no problem at all, connects and loads all the parameters perfectly. Tried v2.77 again, erase and reset but still it won't connect.

    Likewise for 3DR radio telemetry but even worse, get no connection at all.

    Does v2.77 not work on APM 1 or is something else amiss?

  • ok good i'll order that one from digikey today...

    could you post a pic of the circuit that you used ? or did you just directly connect its outputs to the the i2c port ?

  • Developer

    Hi Julian,

    yes, the eagletree I2C airspeed sensor does work, although in my tests it wasn't actually very good and has quite high drift. The one I reviewed here is much better, and I've been told it should be available from 3DR very soon.

    Cheers, Tridge

  • can i use the digital air speed sensors (like the eagle tree) with my pixhawk using this release ?

  • Moderator

    Tridge, we achieved 2.5m/s vertical speed in FBW_A at 20° and 60% throttle with airspeed ~9m/s. In Manual climb rate was ~6.1m/s at 100% throttle at an angle of ~45°. I've PM'd Paul and yourself the log links.

  • Developer

    @Merik, yes, copter will get these features too. It already has them in git master now, it is just a matter of them propagating to a stable release after appropriate levels of testing. If you want the features now you could fly the 'latest' code from firmware.diydrones.com.

    Cheers, Tridge

This reply was deleted.