Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: simple use case at the top for those that don't want to know details

Both next and 16.09 (RC's) have AutoTune.  AutoTune is not currently built into CC3D firmware, but in the future there may be a special version of CC3D firmware just for AutoTune use.  Here is the simplest version of how to use AutoTune for those that don't want details.  If you don't read the details and ask questions that are answered farther down in the details, be prepared for a bit of derision.  (smile)

Simplest use of AutoTune:
- use stock PIDs (or known, slow, smooth PIDs that do not have "invisible oscillation") in bank #1
- set up FMS (Flight Mode Switch) for
--- FMS#1 Attitude mode manual throttle (Stabilized 1) on bank 1
--- FMS#2 AutoTune mode (like Attitude mode but with shaking) on bank 1
--- FMS#3 Attitude mode manual throttle (Stabilized 1) on bank 3
- take off with FMS #1
- switch to FMS #2 and after 2 seconds, it will shake around for 60 seconds
- land after shaking stops
- disarm
- switch to FMS #3
- arm
- carefully take off to test the new PIDs (be ready to instantly drop by using zero throttle if anything strange happens)

If everything works, set up FMS as you like, with all modes pointing to bank 3

For the slightly less impatient, skip down to the section titled "Cloning Instructions" or "Flight Mode Switch setup" (not recommended)..

Background and Details"
LibrePilot has ported Tau Labs / dRonin "Autotune" into a coming version of the LibrePilot firmware'next' and the coming 16.09 release (including RC#'s).

First some precautions.  Tuning carries a risk of oscillation and for LibrePilot firmware, oscillation tends to effectively move the throttle toward 50%.  If your copter requires more than 50% power to hover, then oscillation will make it descend.  If your copter needs less than 50% to hover, then obviously 50% will have it climbing.  In extreme cases any throttle above 0% will effectively be 50%.  Remember that zero throttle stick will stop the motors.  Don't make any changes to this important "motor off" safety feature.  Tuning is known to fail in some cases.  Testing has shown that these same cases fail dRonin Autotune as well.  Be prepared.

...

AutoTune is not currently supported on CC3D, although it is hoped that a CC3D firmware can be made that removes other features to add AutoTune.  This would be flashed temporarily just to run AutoTune and then normal firmware would be reflashed.  Also, there will be a GCS GUI for all this at some time, but it was designed to make it possible to set it up at home and run it at the flying field without requiring use of the GCS at the flying field.
Currently you must be able to compile LibrePilot software / firmware yourself to be able to use this.  The pre-release source code can be found at: https://bitbucket.org/librepilot/librepilot/branch/nextuse of the GCS at the flying field.

AutoTune is merged into both 'next' and 'rel-16.09' branches and is available in 16.09 RC#'s.

Before you uninstall or overwrite your old software / firmware you should run the old GCS, plug the FC (flight controller) into USB, and do a "File → Export UAV Settings" to save your old settings in case you want to know how it was set up.  You should also do screen captures (print screen) on all the setup pages you have used (and thus have non-default values).  These could be valuable later on.

...

Updating an old clone:
The old branch has recently been rebased onto next (now and rel-16.09) and uploaded with push -f.  That means you will have problems if you originally started from the version before the rebase.  AutoTune has been merged into nextrel-16.09, so the best way now is to delete the old directory and clone "next" rel-16.09.
With GCS running and firmware built, go to the Firmware page, press Halt.  Wait about 15 seconds for the Flash button to appear.  Also, it should automatically select firmware that matches your flight controller.  Press Flash.  You will also have to erase settings and run the setup wizard again.  With that complete, you need to do your calibrations before anything else.

...

Note that you must start with PIDs that will fly without oscillation.  These PIDs need to be in bank 1 in the following instructions.  Usually the default PIDs are OK, but occasionally they will need to be changed to make them flyable, or to remove oscillations.  If you have or suspect invisible / D term oscillation, set all D terms to zero and multiply all other PID P terms by 0.75 and all other PID I terms by 0.6 before flying the AutoTune flight.

Note that you must reboot the FC after adding AutoTune to the FMS because the AutoTune module is only initialized if it sees it is needed at boot time.

The recommended setup for running AutoTune uses a 3 position FMS (Flight Mode Switch).  With this, you can take off and fly Attitude mode with known working PIDs, run AutoTune with known working PIDs and fly Attitude mode with new PIDs, all without using the GCS:
Pos#1 - Attitude mode using bank 1
Pos#2 - AutoTune using bank 1 with SystemIdentSettings.DestinationPidBank set to 3 (that is the default)
Pos#3 - Attitude mode using bank 3 (bank 3 is where the tuned PIDs are written by default)
PID bank 1 should have default PIDs or something that is at least known to fly without oscillations.
PID bank 3 should have default PIDs or something that is at least known to fly without oscillations in case you use it before successfully completing a tune.
This setup can all be done at home, and everything else can be done at the flying field, without using the GCS.
With this FMS setup, you always have Pos#1 to fall back on.  Use Pos#1 to recover from any bad situation or to start over and run AutoTune again.

...

Remove anything that is expensive or fragile (e.g. cameras and antennas, but understand that transmitters must remain unpowered any time they don't have an antenna attached) from the multicopter if this is your first experience with AutoTune on this multicopter.  Be aware though, that you eventually need to tune in "flight trim".  Things like cameras and FPV gear that noticeably affect the total weight of the copter should be mounted to get the best tune good tune.

Arm and take off in Pos#1 which is Attitude mode with default (or other known-good) PIDs.  These PIDs must not oscillate for the tuning to work.  Switch to Pos#2 which is AutoTune mode which is also configured to use default (or other known-good) PIDs.  After a few seconds the copter begins to shake (and may tend to climb).  Fly it smoothly.  Don't let the copter touch anything (such as the ground) while tuning is running.  60 seconds after switching into AutoTune, the shaking stops and the tuning is complete.  The PIDs have already been written to the destination PID bank, but are only stored in RAM memory at this point.  The standard procedure is to land and disarm which writes the PIDs to permanent storage.  (The PIDs will be written to permanent settings if you disarm before powering off.  The PIDs will be discarded if the copter is powered off without disarming it.)  Note that you can disarm while in AutoTune mode, but you cannot arm while in AutoTune mode.

...