Arducopter 2.1.1 alpha

This is a work in progress. I've tried to address some fine tuning and performance issues.

Denny R. had made a comment about the inertia of bigger props causing issues. I've added a low pass filter to smooth the positive acceleration of the props to see if we can get at this issue. It may require tuning up Rate_P for a few folks, but I saw little issue in multiple flights.

Crosstrack had a small math error that decreased the resolution of it. I've fixed that and upped the default gains to get better tracking. 

Made WP hit radius 1 by default. even 3m is too much for quads. (If you pass a WP you will move on to the next)

The Loiter method is tuned a little better by default, and now uses GPS offsets when flying less than 1.5m/s. Code experimentation will continue on this front. Thanks to Emile and afernan for their help!

A fix in the Z Accel startup was added to get an averaged result.

Added the ability to enter Loiter with Optflow enabled. - still a work in progress, not for everyday use just yet.

This alpha is on GIT now and is for user's who want to test code. As always, you need to use the "relaxpatch" version of Arduino you can find in the downloads section

Update: We've found and patched some small type bugs in the latest and updated some GPS drivers in the Library. Be sure to pull the latest code and check for the status of each build run against the SIL sim server.

Update r3:

I pushed a version on to GIT that addresses a number of issues.

- the low speed GPS XY calculations were incorrect and have been fixed

- Nav_Rate I term has been removed in loiter control - it's too easy to get two iterms working out of phase

- A second derivative has been added to Roll and Pitch. I found it removed wobbles nicely - Can be adjusted in the planner as STAB_D with a default of .25 (just enough)

- Smoothing has been applied to the motor commands in a way that really quiets down the alt hold pulsing without much effect on latency

- Yaw now has a dynamic constraint and I've upped the yaw gain.

- The motors output now have an LP filter on them so that the accelerate just a tad slower than the deceleration. This is a test to see if it helps big Octo's and Hexa's

- The Rate_I term is now zero'd for first five seconds after takeoff to keep balance.

- Loiter gains are lightened up a bit

- Nav_Rate_P is lower to remove back and forth sped related hunting in loiter

- Compass is enabled by default

- New I2C Library now included which should solve I2C related lockouts

- optflow is still a work in progress.

Update R4:

This update is based on flights today in a very windy environment.

It occurred to me that we're handling the WP nav I terms incorrectly and I reworked the WP navigation to share the same I terms from the Loiter. Even though they use different error input, etc, they turn out to both deal with wind in the same way. I have not Flown WPs with this new code, but heavily tested it in the sim and It's really rocking in hard wind. Transitions from Loiter flight and Nav flight are very smooth. Please let me know if you have luck.

Update R5:

This is a quick patch based on a bad crash Marco had. My theory was an I term that built up during wind that needed to be reset, but wasn't. It's a corner case but It bit Marco pretty bad. Please re-pull if you have R4 running to go to R5. And please, please be careful. This is alpha code not for general testing, but for development. Don't fly it on anything you would feel bad about crashing. 


Update R6:

Includes fix for Acro mode reset bug.
I went through all of the global variables and gave them lengthy descriptions. It's worth a read if you want to learn more how the internals work. I'll be doing some more organization like this as we move forward with an architectural redesign for 3.0 \
This version is mostly clean-up, but does include 1 interesting performance enhancement. It's disabled by default because It's fairly untested. The idea is that the wind compensation created by the Iterms for lat and lon in Loiter and Navigation are carried over into Stabilize. This unifies all of the modes so that when you switch modes, you don't get a small, but fast change in pitch or roll. This is only noticeable in high wind environment. 
To get this to work, I look for near zero velocity and start moving the pitch and roll into the wind control items. This takes a  transformation from copter frame to world frame, but the result is the copter will hold the position against the wind with the sticks in the center of the controller. If you fly around the wind compensation will bleed off slowly - about 30 seconds.
Again, this is off by default and needs significant testing, preferably in the HIL sim first.JNL has already started and flown this version for real.
The feature may be off by default for another version or two, but just letting you know it's there.
I think it will go a long way to making the mode changes feel seamless.

Update R7:

Added an auto-land timer for RTL. If you don't change modes for 20s after the copter arrives at home, it will begin to auto-land. If you have failsafe and no GPS, you will immediately begin auto-landing.
Failsafe RTL now goes 10M up as it RTLs to avoid obstructions.
Added SIL test for failsafe. 

Update R8:

Minor tweaks and cleanup

Update R9:

Made climb rate controller for landing universal for all altitude changes

Update R10:

Updated Loiter controller - Works great in the sim, thanks Afernan.



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

Join diydrones

Email me when people reply –


  • Jason:

    Do we have a tentative date that a new release 2.1.XX will be available in APM Planner with fixes for the following functions:





    Knowing if it is days, weeks or months down the road will help very much in making some design decisions.

    Regards and Happy New Year.


  • Developer

    Here a video of an autonomous test flight of the Quad Rotor Observer (QRO) piloted with the ArduCopter firmware v2.1.1 (latest version from today) set in GPS Position Hold (LOITER) done on dec 27, 2011.

    Regards, Jean-Louis

  • Hi Jason and Co, I don't know if it's a problem but I got this when compiling with the latest 2.1.1 from git:

    Compiling 'ArduCopter' for 'Arduino Mega 2560'
    ArduCopter.cpp.o : In function `test_imu'
    ArduCopter.cpp : out of range error
    ArduCopter.cpp : out of range error
    ArduCopter.cpp : out of range error
    ArduCopter.cpp : out of range error
    ArduCopter.cpp.o : In function `setup_accel'
    ArduCopter.cpp : out of range error
    ArduCopter.cpp : out of range error
    ArduCopter.cpp.o : In function `erase_logs'
    ArduCopter.cpp : out of range error
    ArduCopter.cpp : out of range error
    FastSerial.cpp.o : out of range error
    FastSerial.cpp.o : out of range error
    AP_GPS_Auto.cpp.o : init()'
    AP_GPS_Auto.cpp : out of range error
    AP_GPS_Auto.cpp : out of range error
    AP_OpticalFlow_ADNS3080.cpp.o : out of range error
    AP_OpticalFlow_ADNS3080.cpp.o : out of range error
    AP_OpticalFlow_ADNS3080.cpp.o : out of range error
    AP_OpticalFlow_ADNS3080.cpp.o : out of range error
    AP_OpticalFlow_ADNS3080.cpp.o : out of range error
    Binary sketch size: 140832 bytes (of a 258048 byte maximum) (26.4539023 secs)
    Uploading to I/O board using 'COM3'
    Done uploading

    Will Try anyway.

    See what happens.

  • This is a Y6

    in the log are the motor out.

    motor 8 is working much less than motor 4 

    how come?3692324176?profile=original

  • HIL testing on 2.1.1 (last GIT code up to now)

    Is anybody testing using HIL?.

    I´m using it (on AeroSIM-RC) and works great. You can reproduce the same behaviour (and code problems) that in real flight. In particular, I´m testin LOITER with wind (you can tune the wind intensity, gust, directions, etc). Very usefull!

    I guess the model dynamics is well reproduced against the APM code. Is it true?

    A nice thing is that you can see what the code does in the sticks for controlling (it´s an input for the SIMULATOR so is represented in the sticks graphic movement).

    I have already some comments for the new code but I want first to HIL test extensively before post them.

  • Could anyone post a zip with all the fixes for the new apm2.0?

  • This my new log...... ALT Hold and Loiter 

    2554-12-27 06-15 4.log

    2554-12-27 06-15 4.kmz

  • Developer

    Hi all... i need a little help from someone here, just for a test.
    I think in the code of 2.1.1 somewhere there is something wrong that bothers my OilPAN, because when the attack lipo or USB-powered the red/green led are always off, doesn't boot.
    The APM answers from the CLI (LOL), but it never goes in a "ready-to-flight".
    .. is like is always inside CLI, but when i check IMU inside "test" i've no reply.
    found issues only in version 2.1.1, to 2.1.0 I never had this problem.
    I ask
    someone if they can install my version, put some of my setting like turn on compass/ sonar / battery volt (option # 3), then remove and apply main power anche check if the led red/green work fine.
    This version is the original GIT with some mods (tolerated, however, always) like camera roll control on ch7 and led pattern management on ch 8.
    .. i've installed the latest ArduPPM "AC mode" for using ch 8.
    I repeat
    , everything has worked up to 2.1.0,
    my intention is to try to find out if he is employed by the code or my hardware (APM1).
    I'm waiting, thanks in advance.

  • Flew with 2.1.1 on my APM2 today. I liked alt hold the best, much better than APM1 on the same frame.

    One question:

    In position mode the quad wants to move somewhere else pretty badly. I got it to hold position by trimming the remote 100% back and a bit to the right. What is the procedure to calibrate position hold better? Is my leveling bad? The gps seems to have a propper lock.

    One issue (also observed on 2.1):

    When i switch from acro to stabilized mode, my quad jerks 90 degrees in the yaw axis. After that initial jerk it is pretty controllable. Since i now know that this will happen its less of a surprise and I can recover quickly.
  • Back to V2.1.0

    Much better

    the only thing is, after yaw there is a side effect of pitch i think few milisec after.

    when the yaw P is lower its less but i think its still exist.

    2011-12-27 12-28 1.log

This reply was deleted.


Laurie J. Troy liked Jasper Kueppers's profile
Apr 1
Timothy Miller liked Joseph Udofia's profile
Mar 18
Joseph Udofia liked Joseph Udofia's profile
Mar 3