I'm delighted to announce the release of ArduPlane 2.72 for your flying pleasure.

The big news in this release is the addition of the new L1 navigation controller. The work on the L1 controller library was started by Brandon Jones, and his initial github pull request is a great please to look to understand the new code. As is so often the case with ArduPlane, the documentation still hasn't caught up with the code (though I hope it soon will!).

After Brandon’s initial work Paul Riseborough did a lot of work to add more robustness to the algorithm. The base L1 algorithm suffered from from instability in "path capture", which is how it handles navigation when you are a long way off course (for example, when you enter auto after having flown manually). Paul made some fantastic improvements which have been extensively flight tested by Brandon, Paul, Jon and myself.

I did a final test flight of it this morning in a Bixler2, and it flew very nicely. I found a setting of NAVL1_PERIOD=20 suited the Bixler2 very well. It produced great path tracking, and very nice circles in loiter, despite high wind.

Paul is not finished yet though! He's been working on re-working the APM_Control library started by Jon Challinger, and is getting fantastic results with roll and pitch control, greatly reducing the altitude loss in turns. That isn't in the 2.72 release though as I want to do a bit more testing and tweaking of the code, but I expect to get Paul’s new controllers in the next release.

Before I go into detail on how to tune the new L1 controller, I better list some of the other changes in this release:

  • avoid doing auto radio trim if the resulting trim leaves less than 20% of travel between the trim value and the MAX and MIN for the aileron, elevator or rudder. This prevents auto-trim leaving you with very bad trim if you do it while your transmitter is off
  • removed HIL_MODE_ATTITUDE, we always now use SENSORS HIL, which is much more accurate, and is needed for correct operation of the L1 controller
  • added new LEVEL_ROLL_LIMIT parameter. This replaces both the TKOFF_HEAD_HOLD and RUDDER_STEER options, and instead allows you to specify a roll limit in degrees for auto land and takeoff. The default is 5 degrees, which should be small enough to prevent wings scraping on the runway in most planes.
  • Removed the AHRS_BARO_USE option, as it caused trouble for too many users
  • allow the WP_LOITER_RAD loiter radius to be set negative to mean that a counter clockwise loiter should be performed by default
  • fixed the handling of the LOITER_TURNS and LOITER_TIME commands
  • added new dataflash logging system, with self-describing logging format. See notes below for more info.
  • on auto-takeoff, if we have an airspeed sensor then keep throttle suppressed until we have both 5m/s ground speed and 5m/s airspeed
  • added support for 12 output PWM channels on PX4
  • enable relay in camera library for all APM boards (thanks to SSzilard)
  • cleanup use of const in libraries (thanks to Tobias)
  • lowered default AHRS roll-pitch correction gains from 0.4 to 0.3
  • changed AHRS to lower roll-pitch gains by another 50% when a high X acceleration is detected for a catapult launch, to prevent nose down on fast launch due to GPS velocity lag
  • fixed RC throttle failsafe handling on PX4
  • fixed a bug in returning airspeed estimate from DCM if an airspeed sensor is available (thanks to Jon Challinger for finding this important bug)

As you can see, the dev team has been busy!

A few special notes about the DataFlash logging changes. This is the first release to support 'dataflash' logging on the PX4, and it implements it by writing binary log files to the SD card in an APM/logs sub-directory. Those log files are self-describing, which means the format of the logs is contained in the headers of the log. This makes it possible to add new log messages without having to change MissionPlanner. It also means you can now get logs into MissionPlanner by pulling the SD card out of the PX4 and plugging them into your PC, which is much faster than using the CLI. The new log format is also used for APM1 and APM2, which will mean we no longer have to align the version of MissionPlanner with the ArduPlane log version when analyzing dataflash logs.

Now on to the main thing in this release - the new L1 navigation controller.

The new controller makes a huge difference to navigation in ArduPlane in the following ways:

  • tuning is now much simpler - the only navigation parameter you really have to change is NAVL1_PERIOD
  • much better path tracking, even in high wind
  • loiter now produces a very nice circle even in high wind
  • much less servo flapping! If you tried to tune the old controller for very good path tracking it would end up changing servo position very rapidly, wearing out the servos and drawing more current than it should. The new controller has much smoother servo movement.

The default NAVL1_PERIOD is 25, which should give quite gentle navigation on most airframes. A smaller number means more aggressive navigation (tighter turns). Adjust it by around 5 at a time until you are happy with the performance. Most small RC planes will need a value of between 15 and 20. I need a value of 15 on my Phoenix Tiger60 low wing nitro sports plane, and 20 for my Bixler2. The default is 25 to ensure that we get gentle navigation by default - if the value is too small the plane can snake rapidly, and roll too rapidly, possibly leading to a stall if the aircraft is heavily loaded.

I hope you all enjoy flying this release as much as I do. Happy flying!

Cheers, Tridge

(PDF tuning guide)

Views: 16416

Reply to This

Replies to This Discussion

Now this sounds exciting, what a pity I am 100km from my airframe at the moment! Will have a play with htis as soon as I get home. It sounds like the PX 4 will really enjoy this code might be time to get one.

One more thing I forgot to mention about the L1 navigation controller - it replaces a lot of other parameters. The new NAVL1_PERIOD parameter replaces all of these parameters:

  • HDNG2RLL_D
  • HDNG2RLL_I
  • HDNG2RLL_IMAX
  • HDNG2RLL_P
  • XTRK_ANGLE_CD
  • XTRK_GAIN_SC
  • XTRK_MIN_DIST
  • XTRK_USE_WIND

That is one of the reasons I'm so delighted with the new code. All too often in ArduPlane we improve performance by adding more and more tuning parameters, which users then need to tweak for their airframe to get the best performance. With this controller we've removed a whole bunch of difficult to tune parameters, but also achieved much better performance. I'm looking forward to more changes like this.

Cheers, Tridge

Hi Tridge,

Just uploaded the new code and went for a short flight.
Overall performance was just great! much better loiter and much better path following than before.
this update feels like a big leap forward.
After uploading I didn't need to change any parameter, I just set the NAVL1_PERIOD to 20, just like you did.  (I fly the  Bixler 2 too!)


The way it handles crosstrack is just fantastic!

made an onboard vid, see for yourself.
http://www.youtube.com/watch?v=hKpsXRDS1qY

Hi

I update my firmware from 2.63 to 2.69 and found out that the navigation become bad. I spend a few days to tune the xtrack and it become better but sometime still unable to trace the grid line especially in high wind condition.

Looks like 2.72 is the answer ? 

Tridge, this works very well in x5, a flight very smooth and accurate compared to 2.71, congratulations for this great work.

crosswind had of10-15 km / h

Question: do i only need to launch the mission planner with the apm powered on and connected via modem to update? Or do i need to connect via usb?

I suggest you try it out.
For my bixler it worked wonders.
When there was only a little bit of wind, it would wander all over the track. Increasing Xtrack gain would only make it less accurate.

Now it follows its path exceptionally well.

Thanks Paul!

Hi Matt,

upgrading the firmware can only be done over USB.

Cheers, Tridge

thanks Paul, excellent work!

AWESOME!  great work!

Hi Andrew.

This looks great, Someone needs to make this a sticky!!

How does this impact on the total tuning process for a new plane?

Is this correct:-

load 2.72 from mission planner

Calibrate Tx radio for inputs

Level aircraft

Adjust PID gains to stabilize aircraft, in FBW A , and manual control

then adjust NAVL1_PERIOD until Auto is smooth and follows waypoints

Thats it? or have I missed something. !!

many thanks for a great system.

Reply to Discussion

RSS

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service