Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Jerkiness is random, and is not actually an oscillation.  It is usually caused by too much vibration.  Replace or straighten bent shafts, balance and track your props, and if that is not enough and the tuning doesn't fly right, try increasing (doubling) GCS -> Configuration -> Stabilization -> Expert -> Gyro Noise Filtering.

Invisible oscillation (sometimes D term oscillation) generally cannot be seen or heard.  One way you know you have it is that all throttle stick positions can act as if they were closer to the middle.  Another way you know is if you have two FMS positions that use different PID banks (and manual thrust), and one set of PIDs has significantly lower D term and you are hovering and switch from the high D to the low D, you may notice that you need to add power to maintain altitude.  Increased thrust from the high D term is caused by the ESCs being commanded up and down and being quicker when increasing RPM than when decreasing it.  You may find that motors tend to run hotter and batteries don't last as long as they should.  Powerful copters (those that require less than 50% power to hover) will take off with much less throttle than expected.  Weak copters (those that require more than 50% power to hover) will need more power than expected to take off, or will not take off even at full power.  Try reducing your D terms (Stabilization -> Advanced), or increasing (doubling) GyroTau (GCS -> Configuration -> Stabilization -> Expert -> Gyro Noise Filtering), but realize that increasing GyroTau will make AutoTune create very slow smooth PIDs.

...

Flight Mode Switch setup:
Note that when AutoTune is complete, it writes the calculated PIDs into the destination stabilization (PID) bank which by default is configured to be bank 2.  The standard procedure has you flying the AutoTune mode on bank 1 and writing the new PIDs to bank 3 (default destination PID bank was changed from 2 .

The recommended setup for running AutoTune uses a 3 position Flight Mode Switch.  With this, you can take off and fly Attitude mode with default PIDs, run AutoTune with default 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 2 (that is the default)
Pos#3 - Attitude mode using bank 2 (bank 2 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.
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 (Flight Mode Switch) 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.

 An alternate FMS setup for a 2 position FMS removes the ability to fly with default PIDs once you have run AutoTuneto 3).

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.

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 2 (bank 2 is where the tuned PIDs are written by default)1
Pos#2 - AutoTune using bank 1 with SystemIdentSettings.DestinationPidBank set to 2 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 2 start out with the same PIDs as bank 1, but the PIDs will be changed by AutoTune.

It is possible to arm in Pos#1, then switch to Pos#2 and immediately take off before the AutoTune shaking starts, if your tuned PIDs don't work and you want to retune.

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 even moderately affect the total weight of the copter should be mounted to get a 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.  Fly it smoothly.  Don't let the copter touch anything (such as the ground) while tuning is running.  60 seconds after that, 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.

Switch to Pos#3 (Pos#1 for the 2 position FMS) which now holds the tuned PIDs.  Cautiously take off, and be ready to immediately cut power to zero if there is any problem.  You are now flying tuned PIDs.  If for some reason you want to run AutoTune again, just switch to Pos#2 as before.

That covers the basics of AutoTune.  If you don't want to use additional AutoTune features, you can remove AutoTune from your FMS at this point.  Enhanced functionality, further tweaks, and safety issues are discussed below.

Further Information follows:
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.

An alternate FMS setup for a 2 position FMS removes the ability to fly with default PIDs once you have run AutoTune:
Pos#1 - Attitude mode using bank 3 (bank 3 is where the tuned PIDs are written by default)
Pos#2 - AutoTune using bank 1 with SystemIdentSettings.DestinationPidBank set to 3 (that is the 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.

PID bank 3 starts out with the same PIDs as bank 1, but the PIDs will be changed by AutoTune.

It is possible to arm in Pos#1, then switch to Pos#2 and immediately take off before the AutoTune shaking starts (two seconds), if your tuned PIDs don't work and you want to retune.

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 even moderately affect the total weight of the copter should be mounted to get a 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.)

Switch to Pos#3 (Pos#1 for the 2 position FMS) which now holds the tuned PIDs.  Cautiously take off, and be ready to immediately cut power to zero if there is any problem.  You are now flying tuned PIDs.  If for some reason you want to run AutoTune again, just switch to Pos#2 as before.

That covers the basics of AutoTune.  If you don't want to use additional AutoTune features, you can remove AutoTune from your FMS at this point.  Enhanced functionality, further tweaks, and safety issues are discussed below.

Further Information follows:

For expert pilots, in the above instructions, you might consider setting all bank 3 outer loop PIDs to zero.  If you do this, beware that you will not have roll or pitch control when using bank 3 until you have successfully completed AutoTune, so be ready to land immediately after takeoff when using bank 3.  The reason you would do this is for immediate confirmation that
AutoTune was successful and wrote new PIDs to bank 3.  After tuning, take off using an FMS position that uses bank 3, quickly test to see if you have roll or pitch control, and immediately land if you don't have control.  This is safer than starting a hover with bank 1 and and switching to bank 3 when you haven't tested the new PIDs in bank 3 yet.

Any time after tuning is complete, you can switch to Pos#3 (Pos#1 for the 2 position FMS setup) which is Attitude mode using the tuned PIDs to test them.  Use caution!  It's recommended that when tuning completes you land and disarm, but if you were to switch to Pos#3, even without landing, you would be flying the new PIDs.  If you have time and access to a GCS at this point and understand what reasonable PID values look like, you could examine the new PIDs before you fly them.

To test fly your new PIDs, switch to Pos#3 (Attitude with tuned PIDs), arm, and cautiously take off.  Beginners beware: a slow increase in motor power for takeoff is not recommended as it causes PID windup.  It is best to start with motors off and immediately jump up the smallest amount you can to barely get off the ground and stay off.  You can learn the correct amount of throttle by starting with small blips and giving bigger and bigger blips until you learn how much throttle it takes to take off.  Before you take off, mentally prepare yourself to immediately apply zero throttle if something doesn't feel right.  A fall from 3 feet / 1 meter generally causes little or no damagedamage so it is best to keep it below that.

You can simply retune by running AutoTune again if you want to.  The use of Attitude mode when testing the new PIDs is recommended (but not required), even for experts.  AutoTune mode itself is a modified form of Attitude mode and it doesn't matter what other modes you have as far as the tune is concerned.

...

Using SmoothQuick semi-permanently:
It isn't necessary to manually enable the AutoTune module because it will be enabled each time the FC boots with AutoTune in the FMS.

If you do enable the AutoTune module manually then it will always be running, even if there is no AutoTune flight mode in your FMS.  In that case your SmoothQuick Accessory knob (or FMS 3x toggle) is always active to change the PIDs in the destination PID bank (default 23) and you can adjust PIDs from smooth to quick any time you need itwant to.

AutoTune data:
The settings used by SmoothQuick are all stored permanently in SystemIdentSettings.  They are Tau, GyroReadTimeAverage, the 3 Beta values, and SmoothQuickSettingSmoothQuickValue.  'Complete' must also be True.  SmoothQuickSetting SmoothQuick
Value is only important if you use the 3x FMS toggle method to select how smooth or quick you want your PIDs.  It stores the current value of the toggle as a number from -1 to +1.

If you erase settings or build a copy of your tuned modelanother of the same model of multicopter, you can copy the settings by hand if you know what they are.  They are stored as text in an exported uav file, or you can make a screen capture when they are visible on your computer screen.

AutoTune tries to produce results that make the tuning flight correctly tuned.  That does not take into account the non-linearity of thrust response.  To remove high thrust oscillations (or increase stability during descent), use TPS to decrease PIDs at high thrust (and if necessary, increase PIDs at low thrust).  Typically you want the TPS curve/line to cross the horizontal axis at the point (thrust value) where the copter hovers.  Examine SystemIdentState -> HoverThrottle after tuning and before you power off (SystemIdentState is not saved) to see what your hover thrust is.  Beware of throttle "bloom" that happens when slow responding ESC's make a copter climb just because of the fast RPY controls.

SystemIdent stabilization mode:
AutoTune is a flight mode that can directly go on the FMS.  SystemIdent is a stabilization mode that can be put in a Stabilized1-6 flight mode.  There is no reason to use SystemIdent stabilization mode.  What you will get is a mode that acts a lot like the shaking part of AutoTune, but the shakes may be bigger or smaller.  SystemIdent stabilization mode has been hidden in from use when using the GCS FMS setup GUI.  It can only be enabled with settings on the System tab.

Field descriptions:
System.SystemIdentSettings are stored permanently but do not show up in logs.  DataObjects.SystemIdentState shows up in logs but is not stored permanently.  Read the source if you need to know more of the technical aspects of their fields. the xml files or source if you need to know more of the technical aspects of their fields.
  The descriptions in the xml files should be displayed on the System page if you enable "Show Descriptions" (click the eyeball to find this setting) (not working as of this writing).

System.SystemIdentSettings:
- Is stored permanently
- Is not logged
- Is reset to default values if you stay in AutoTune mode until the shaking starts (about 2.5 seconds).  As with other data changes, this is not stored permanently until you disarm.  If you power off without disarming, the reset values are not stored permanently.
- Tau, GyroReadTimeAverage, Beta (3 values), and Complete are the fields filled in by AutoTune.  Other fields are used by SmoothQuick to convert these values into PIDs and check and limit the PIDs.
- DampMin, DampRate, DampMax affect the control damping.  Decrease damping to make your aircraft response more rapidly.
- NoiseMin, NoiseRate, NoiseMax affect control sensitivity.  Increasing noise (sensitivity) will make your aircraft respond more rapidly, but will cause twitches due to noise
- These Damp and Noise values together form the dual virtual slider SmoothQuick
- The smooth end of SmoothQuick uses DampMax and NoiseMin
- The quick end of SmoothQuick uses DampMin and NoiseMax
- The center of the SmoothQuick slider uses DampRate and NoiseRate
- CalculateYaw can be False,TrueLimitToRatio,TrueIgnoreLimit default is TrueLimitToRatio
- YawToRollPitchPIDRatioMin is enabled with CalculateYaw default is 1.0
- YawToRollPitchPIDRatioMax is enabled with CalculateYaw default is 2.5
- DestinationPidBank default is 23
- TuningDuration is 60 seconds
- SmoothQuickSource default is 25 (FMS toggle method with 5 positions)
- SmoothQuickSetting SmoothQuickValue default is 0
- DisableSanityChecks disables certain checks that stop the PIDs from being written default is false
- Complete is set true after a successful AutoTune run.  It must be true for PIDs to be written to
DestinationPidBank 

DataObjects.SystemIdentState
- Is not stored permanently (Goes away when power is removed)
- Is logged
- HoverThrottle is the average throttle used during tuning.  It is a reasonable value to use in Settings.AltitudeHoldSettings.ThrustLimits.Neutral although it is usually a little smaller than it should be due to throttle bloom during shaking.
- The 3 values in Noise tell you how much vibration you have on the 3 axes.  Normal values range from about 100 to about 1000.  For high values, or jittery response to the PIDs created, you may want to increase Settings.StabilizationSettings.GyroTau (found in the GCS GUI at Configuration -> Stabilization -> Expert -> GyroNoiseFiltering) and retune.  Now you know how much vibration you actually have.
- Contains fields that may be useful if debugging problems with AutoTune
- Contains copies (for logging purposes) of some fields from System.SystemIdentSettings

PID bank 1 should have default PIDs or something that is at least known to fly without oscillations.