3D Robotics

Major new update for APM:Plane code

3689569417?profile=original

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

Comments

  • 100KM

    Thanks Tridge, at worst telemetry (58k) is 1/2 the speed of USB serial (115k) ?

  • I would love to hear more about the sonar support. Last I heard the sonar was only usable on short grass or pavement. Any developments in that area?

  • Developer

    @Rana, it's at 2.77 now. I suspect your browser cache was showing you old data?

  • Great efforts Trige !

    The firmware version for APM2 is showing 2.76 in the Git version at http://firmware.diydrones.com/Plane/stable/apm2/git-version.txt

    "commit 691eaabe94cf6884b041b6527668624579e84179 Author: Andrew Tridgell <tridge@samba.org> Date:   Tue Nov 5 15:55:08 2013 +1100      Plane: prepare for 2.76 release  APMVERSION: ArduPlane V2.76"



  • One More point, I will use http://123d.circuits.io/ to integrate my project systems . What do you think about have a 3DR Virtual Library ?  

    Congratulations again to all 3DR team, Pixhawk is a incredible product !

  • Developer

    Hi Hein,

    yes, it is possible to download internal logs over a radio now, but it is much better to download them over USB. Downloading logs over a telemetry radio link is very slow - typically 4 kbyte/second or so. Downloading logs from a Pixhawk over USB runs at about 160 kbyte/sec. By default we log a lot more data on PX4 and Pixhawk now than we used to (as we have plenty of space on the microSD card, and plenty of CPU resources to manage the logging), so a log file of 10 MByte is common. That would take over 40 minutes to download over a radio link, but only one minute to download over USB.

    Sometime in the future we may have fast WiFi links into the autopilot and then it will be practical to download large logs wirelessly, but for now a cable is the best option.

    Cheers, Tridge

  • Great News ! A Sonar will be great ! Ps. I am really trying to find 3DR Pixhawk & APM 2.6 ( Technical Drawing   ) or CAD files ! Any Suggestion ? ( And yes, I Know I can buy one and use a paquimeter)

  • That what I was expecting...
    I'd love to get my hand on a pixhawk... but the delivery costs to Europe still hold be back :/

  • 100KM
    Logs over the air! Logs over the air!!!
  • Developer

    Hi Wojciech, the EKF will only run on PX4 and Pixhawk. The resource requirements (both memory and CPU) are far too high for the APM2.

    The APM2 will still work with APM:Plane of course, but it won't get the additional accuracy of the EKF.

    Cheers, Tridge

This reply was deleted.