Updated ArduCopter and ArduPlane code: APM2 users please upgrade!

The Dev Team has now pushed a maintenance update to both ArduCopter (2.5.5) and ArduPlane (2.34) that all APM 2 users should upgrade to (it also includes some nice improvements for APM 1).  It fixes both the APM 2 reset issue (you sometimes need to press the reset button to start the board under battery power) and an issue with some APM2s that have a slightly different version of the MPU-6000 sensor with a different accelerometer scaling factor (this is now auto-detected by the code).

Both of these are now in the Mission Planner so everyone can easily upgrade.

Tridge describes some of the changes to ArduPlane in this post:

This release includes one very important update for APM2 users, and a few other minor updates.

The main reason for the release is to fix a bug in the scaling of the MPU6000 accelerometers. We discovered that the MPU6000 on the most recently shipped APM2 boards had different accelerometer scaling than earlier boards. This resulted in bad attitude calculations which would get worse during flight (as the DCM code interpreted the conflicting information between the gyroscope and accelerometers as gyro drift). We now query the product ID of the MPU6000 on startup, and fix the scaling according to whether it is a RevC or RevD version of the chip.

If you use an APM2 with ArduPlane then it is strongly recommended that you update to the 2.34 release.

Other less critical changes in this release include:

  • fixes for building ArduPlane with the MAVLink 1.0 protocol (we currently use the 0.9 protocol). In a future release this will be the default once all other components are ready
  • expose a new parameter AHRS_YAW_P to control how fast the compass controls the heading. The default is 0.2, which should be good for most users (this was mostly added for ArduCopter users)
  • fixed the reporting of the raw servo output value in the MAVLink logs. Previously if you uses a mission element to set a servo value (for example, for a bottle drop) the log would not reflect the servo change. The logged value is now obtained directly from the servo library so will always be accurate
  • changed the default I terms for navigation roll and pitch to 0.1. It is very common to need a small I value for navigation, so a 0.1 default is better than 0
  • make it possible to use UART2 for Telemetry. The APM2 has a otherwise unused UART2 port, which you can connect to the telemetry connector via a solder bridge. This adds a TELEMETRY_UART2 build option to configure the code to use this port. This is mostly useful if you have an onboard computer connecting to the APM2 via USB at the same time as you connect a radio to the telemetry port, and you want both telemetry streams active

For ArduCopter, here's the short form of the some of the changes, thanks to Randy and Marco:

  1. MPU6000 accelerometer scaling fix (affected APM2s shipped from early May)
  2. "Retro Loiter" by Adam Rivera (uses ground speed directly from GPS instead of calculating from lon/lat position). Improves Loiter performance
  3. "AutoApproach" function by Marco Robustini, developed by Adam Rivera
  4. APM2 support for Optical Flow
  5. bug fix for needing to push reset before motors will arm
  6. compass reversal problem (actually same root cause as #5)
  7. Fix for Tri tail servo reverse issue as reported during testing.

  All frame types were updated in the planner including the TradHeli and Y6.  We figured for the Y6, even though the TB_Ratio (top/bottom motor speed ratio) has temporarily gone missing (but will be back in 2.6), it's more important to get this scaling issue fix out there.


Now the ArduCopter dev team will return to their focus on 2.6, which is all about performance (fine-tuning Loiter and Navigation accuracy)

Views: 4173

Comment by Andre K. on May 14, 2012 at 10:28am

Thank you.

I flashed Copter 2.5.5 - even reset to factory settings, then calibrated compass (by moving in 30sec) - still - my compass is reversed.

Gyros is now fine.

Comment by Vernon Barry on May 14, 2012 at 11:35am

Thanks so much for releasing this in Mission Planner! I did not fly this weekend with my new APM 2.0 because I knew it had the new 6000 scaling and was waiting for official code release rather than a crash.

While I've coached others into programming using Arduino with the Relax Patch, I was unable to compile the source from the 2.5.5 zip. Again, funny I can try to tell others how to follow directions and then I couldn't get it to work. Rather than post questions, I knew it was just a matter of something not being correct in my libraries and just waited for the "official" release.

Thanks again for the quick turnaround. You guys were all on top of this problem once it was identified.


Developer
Comment by Andrew Tridgell on May 14, 2012 at 6:48pm

@Andke,

I would very much appreciate a tlog showing this "compass reversed" problem. I have heard from others that the problem exists, but nobody has sent me a tlog showing the issue. Please capture the tlog as follows:

  • install 2.5.5
  • install latest planner
  • put the APM2 on a bench away from all magnetic sources (eg. be careful the table doesn't have metal supports)
  • point the APM2 at magnetic north
  • connect with the planner
  • after the connection is established, rotate the APM2 once through all compass bearings (ie. 360 degrees)
  • disconnect the planner

attach the tlog from the above in a reply on this thread

Cheers, Tridge

Comment by Vernon Barry on May 14, 2012 at 7:21pm

Just wanted to come and show a success story. My 3DR quad with 880kv motors, APM 2.0 with the new version of the 6000 flew great on it's maiden voyage. Box stock PIDs were dead stable. 2.5.5 works great for me!!!

Thanks again to all the developers who quickly fixed the gyro problem.


3D Robotics
Comment by Chris Anderson on May 14, 2012 at 7:23pm

Thanks, Vernon!

Comment by Tom in NOVA on May 14, 2012 at 7:31pm

As always, appreciate all the hard work that went into this and previous versions so we all can benefit, enjoy, and learn.


Distributor
Comment by Dany Thivierge on May 14, 2012 at 8:05pm

Just like most users I can report that 2.5.5 is really the version to load.  I had a bunch of "bad" APM2 around the shop (all boot related issues that I knew was going to get address soon) and they all came back to life.  

No more reset button to start on LIPO, no more strange boot loader crash, no more "no heart beat"... 

Thanks team for this much needed fix. 

All new boards sold around here come tested with 2.5.5 on my personal Quad. 

Enjoy! 

Dany

www.canadadrones.com

Comment by Tom in NOVA on May 14, 2012 at 8:54pm

Not wanting to be greedy, but wonder how difficult would it be to add voice recognition to Mission Planner that would command changing flight modes, set speed, and command towards preloaded waypoints.

Comment by Andre K. on May 14, 2012 at 11:33pm

Andrew Tridgell: I attempted to follow your request, by discovered that when booting when APM2 is aligned with magnetic north, it works correctly.  A quick test proved that if booted when pointing to south - its bad.

(the most convenient direction for me is to south, so that may explain a lot.)

I am very surprised - does this mean I did not RTFM and this is standard procedure ? - or still a bug.  It would be strange if APM2 required that it pointed to North on boot..

So - i short, it works correctly when aligned to magnetic North on boot, it is wrong if booted in another direction. - would you like logs for when booted towards South ?

BTW: Mission Planner's "restart on connect" is enabled.


Developer
Comment by Randy on May 15, 2012 at 5:28pm

Andke,

     It sounds much more like your compass is not working at all.  By default the APM assumes that it's facing north when it's booted up but it updates to the correct heading when the first compass messages arrives.  What you're describing sounds like it's never receiving that first message from the compass.

     If you attach a dataflash log, I suspect we will see zeros in the MagHeading message (in the CTUN message I think).

     You've definitely also run the CLI compass test and had it reporting good headings?

Comment

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

Join DIY Drones

© 2017   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service