The Ardupilot development team has released version 3.2.2 of APM:Plane. This is a bugfix release for some important bugs found by users of the 3.2.1 release.

The changes in this release are:
  • fixed a bug that could cause short term loss of RC control with some receiver systems and configurations
  • allowed for shorter sync pulse widths for PPM-SUM receivers on APM1 and APM2
  • fixed HIL mode altitude
The most important bug fix is the one for short term loss of RC control. This is a very long standing bug which didn't have a noticeable impact for most people, but could cause loss of RC control for around 1 or 2 seconds for some people in certain circumstances.

The bug was in the the AP_HAL RCInput API. Each HAL backend has a flag that says whether there is a new RC input frame available. That flag was cleared by the read() method (typically hal.rcin->read()). Callers
would check for new input by checking the boolean hal.rcin->new_input() function.

The problem was that read() was called from multiple places. Normally this is fine as reads from other than the main radio input loop happen before the other reads, but if the timing of the new radio frame
exactly matched the loop frequency then a read from another place could clear the new_input flag and we would not see the new RC input frame. If that happened enough times we would go into a short term RC
failsafe and ignore RC inputs, even in manual mode.

The fix was very simple - it is the new_input() function itself that should clear the flag, not read().

Many thanks to MarkM for helping us track down this bug by providing us with sufficient detail on how to reproduce it. In Marks case his OpenLRSng configuration happened to produce exactly the worst case timing needed to reproduce the issue. Once I copied his OpenLRS settings to my TX/RX I was able to reproduce the problem and it was easy to find and fix.

A number of users have reported occasional glitches in manual control where servos pause for short periods in past releases. It is likely that some of those issues were caused by this bug. The dev team would like to apologize for taking so long to track down this bug!

The other main change was also related to RC input. Some receivers use a PPM-SUM sync pulse width shorter than what the APM1/APM2 code was setup to handle. The OpenLRSng default sync pulse width is 3000 microseconds, but the APM1/APM2 code was written for a minimum sync pulse width of 4000 microseconds. For this release I have changed the APM1/APM2 driver to accept a sync pulse width down to 2700 microseconds.
This release also fixes HIL mode altitude. I am hoping this will be the last release where you need to have a separate firmware for HIL mode and normal flight mode. In the future we will have a HIL_MODE parameter, and if that is set at boot then the board will run in HIL mode. That will make it easier to run HIL on all boards (eg. Pixhawk, NavIO, Erle etc) without having to recompile and reload firmware.
Happy flying!

Views: 2351

Comment by Cala on February 9, 2015 at 4:23pm

Thank's Andrew, great work!!!, it's nesesary to recalibrate or reconfigure something or only update?


Admin
Comment by Thomas J Coyle III on February 9, 2015 at 4:28pm

Nice work Tridge, much appreciated!

Regards,

TCIII AVD


Developer
Comment by Andrew Tridgell on February 9, 2015 at 4:35pm

@Cala, just update. We haven't needed any recalibration for a new release in a very long time.

Comment by Cala on February 9, 2015 at 5:49pm

Thank's Andrew

Comment by Jean-Marie PRIGENT on February 10, 2015 at 3:07pm

Thanks very much for debug the OpenLRS and changing the sync pulse.

Having a parameter for using HIL or FLY mode is an excellent idea  !  I'm using HIL mode a lot.

I would like to suggest a different Elevon Output parameter in HIL mode. In fact, I'm using wing (fx61, ritewing) and my elevon output is set to '1'|'2'|'3'|'4'.

If I want to use HIL mode with X-plane, I always must change it each time to '0'.

Having the working mode (FLY | HIL) and Elevon Output will be a must ! 

Learning APM/Pixhawck with HIL MODE and X plane is so pleasant !

Thanks again for all the great work...and article in SD... 

Comment by Rana on February 10, 2015 at 6:45pm

Hats off to you Tridge for such a great contribution !

Comment by MarkM on February 11, 2015 at 5:12pm

Flew this today and it went reasonably well.

Only problem's I had were down to me. I put a mobius too close to the compass and it caused a few issues with random yawing (148% compass field change, fixed by moving the mobius) and then I got carried away and ran out of battery.... and even then the plane just floated in flat to the field which it never did before. If not caught in time it used to nose dive hard in and a being 1400mm Cessna it can make a big mess.

Anti stall code does a fantastic job, even when I tried to stall the plane in FBWA with 0% throttle it just carried on banking/pitching. Before hand it would get into a full down elevator full left aileron spin so a MASSIVE improvement there.

One very happy pilot.


Developer
Comment by Andrew Tridgell on February 11, 2015 at 5:16pm

good to hear, thanks Mark!

Comment by TropicalJet on February 12, 2015 at 6:25am

Hi,Andrew, just to know if this new release is usefull for APM 2.6 to, or improvement only for Pixhawk?
Many thanks for your works !

Regards,

Laurent

Comment by MarkM on February 12, 2015 at 6:59am

This release works very well on the APM.

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Groups

Season Two of the Trust Time Trial (T3) Contest 
A list of all T3 contests is here. The current round, the Vertical Horizontal one, is here

© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service