Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: how MaximumRate affects tuning, etc

...

Cloning Instructions (tested on Linux):
It is assumed that you have a working development environment:
git  clone  https://bitbucket.org/librepilot/librepilot.git
cd  librepilot
git  checkout  nextrel-16.09
make  build_sdk_install   (I avoid this by sym linking my global downloads and tools directories into this directory, so whatever you need to do for downloads and tools)
nice  -n15  make  -j4  gcs  revolution  revonano    sparky2   (the 4 is however many real CPU cores you have to keep all of them busy, it still works even if it is wrong)  (gcs might take 30 minutes to build)  (or remove 'nice -n15' which says to run it at low priority in case you want to do something else with the computer while it is making the software)
./build/librepilot-gcs_release/bin/librepilot-gcs   (runs the GCS that you just built) (in Linux that is ./b <tab> l (lower case L) <tab> b <tab> <tab>)

...

Updating an old clone:
The old branch has recently been rebased onto next (now 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 next, so the best way now is to delete the old directory and clone "next".
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.

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 23.  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 to 3).

...

If you intend to fly this copter both with and without a significant payload attached (like a camera) or with different batteries (weight, cell count) then ideally you would tune each case separately and store them in different PID banks.  Probably the easiest way to handle the simple case of with/without a camera is to tune with the camera, copy bank2 to bank3, retune without the camera and leave that in bank 2.  Then remove AutoTune from your FMS and add flight modes that include both bank 2 (without camera) and bank 3 (with camera).  Note that the lighter total weight has smaller PIDs.  Smaller PIDs will work when carrying an extra load that wasn't there when tuning (it is a bit mushy), but if you use the larger PIDs that come from tuning with a camera mounted when the camera is not mounted, you may get some minor oscillations.

It won't arm:
 It won't arm if you
- try to arm it in AutoTune mode
-
have put SystemIdent stabilization on Thrust on any FMS switch position
- use GPS Assist with AutoTune
- enable it on a vehicle that is not a multicopter

SmoothQuick:
There is a virtual slider called SmoothQuick, and the PIDs you get by default are in the middle of the slider.  At one end of the virtual slider are smooth PIDs which may be preferred for photography.  At the other end are quick PIDs which may be preferred for racing.  Once you have run the tuning, the FC will always remember the tuning and allow you to change PIDs along this sliding scale at any time in the future.  Starting the AutoTune process by staying in AutoTune mode for over 2 seconds while armed will erase the old settings and start a new tuning.  If you accidentally start an unwanted new tuning you can just power it off without disarming and it will forget the new tuning rather than making it permanent.  To use the SmoothQuick virtual slider, you need to attach a real slider (or knob or FMS 3x toggle) to it.  SmoothQuick works in real time, even while you are flying the tuned/destination PID bank if you want.

SystemIdentSettings -> SmoothQuickSource is where you attach a real slider.  SmoothQuickSource = 0 disables SmoothQuick entirely.  The default of 25 says to access the next of a set of 5 equally spaced points on the slider by toggling the Flight Mode Switch (starting outside of AutoTune) into AutoTune and back out, 3 times, in less than 2 seconds, but only if armed.  If you think of the SmoothQuick slider as a scale from -100 to +100, with smoothest being -100 and quickest being +100, then you start out in the middle at 0.  The first time you do the fast FMS 3x double toggle it will move you to +50 on the slider, then +100, then -100, then -50, then back to 0, etc.  If you do the fast FMS 3x toggle while disarmed, it will always set it to 0.  You can do that to set it to a known value if you forget.  SmoothQuickSource = 23, 25, and 27 give you 3, 5, and 7 equally spaced stops on the SmoothQuick slider.  25 is the default and gives you positions at -100, -50, 0, 50, and 100.

You can also set SmoothQuickSource to be a number from 10 to 13 which corresponds to using Accessory0 to Accessory3 to directly adjust the slider.  This requires that you have an available knob or slider on your transmitter, that you already have your transmitter configured to send it out as a separate channel, that the FC has been configured to attach that RC channel to one of the four FC Accessory channels, and that that FC Accessory is not being used by another FC function.

AutoTune / SmoothQuick 'data' is stored permanently.  Once you have run AutoTune once, you can use SmoothQuick with this stored data to produce smoother or quicker PIDs any time in the future.  You don't have to run AutoTune again, but you may want to if you change something, like props or weight or motors or cell count.

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 is always active to change the PIDs in the destination PID bank (default 3) and you can adjust PIDs from smooth to quick any time you want to.

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

AutoTune data:
The settings used by SmoothQuick are all stored permanently in SystemIdentSettings.  They are Tau, GyroReadTimeAverage, the 3 Beta values, and SmoothQuickValue.  'Complete' must also be True.  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 another 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 from use when using the GCS FMS setup GUI.  It can only be enabled with settings on the System tab.

Enabling the AutoTune module manually:
The AutoTune module is automatically enabled at boot time if the FC detects that AutoTune has been added to the FMS.  The AutoTune module can also be enabled manually so it is always enabled.  After either of these changes, you must reboot the FC for AutoTune to actually run.  There are two reasons you might want to manually enable the AutoTune module:
- You no longer have AutoTune on the FMS, but you want to be able to continue to use SmoothQuick.
- You know you are going to experiment with FMS changes that include adding and removing AutoTune from the FMS (e.g. over the course of many days).  Without manually enabling the AutoTune module, you will need to reboot after adding AutoTune to the FMS if it was not enabled in the FMS at power up.

There is currently what might be described as a conflict between Outer Loop / Attitude Mode and the StabilizationSettingsBank#.MaximumRate's.  The outer loop PIDs are calculated assuming that there is no artificial limit to inner loop rates.  These .MaximumRate's are just such a limit.  Some high power / quick multicopters will experience oscillation in Attitude mode using the PIDs calculated by AutoTune.  You can either manually change (reduce) the outer loop PIDs or manually change (drastically increase) .MaximumRate (e.g. increase StabilizationSettingsBank3.MaximumRate.Roll and .Pitch to perhaps as high as 1500).  There is a code change that has already been coded and tested for this, but it is not yet part of rel-16.09 (or next).  The new code will automatically scale back the outer loop PIDs based on the .MaximumRate's in the destination bank.  The result of this is that (for this new code) you should set the .MaximumRate's before running AutoTune.  If you change the .MaximumRate's after flying the AutoTune flight, and later you change the .MaximumRate's, it isn't necessary to fly the AutoTune flight again, just rewrite the PIDs with SmoothQuick after the change.

It won't arm:
 It won't arm if you
- try to arm it in AutoTune mode
-
have put SystemIdent stabilization on Thrust on any FMS switch position
- use GPS Assist with AutoTune
- enable it on a vehicle that is not a multicopter

SmoothQuick:
There is a virtual slider called SmoothQuick, and the PIDs you get by default are in the middle of the slider.  At one end of the virtual slider are smooth PIDs which may be preferred for photography.  At the other end are quick PIDs which may be preferred for racing.  Once you have run the tuning, the FC will always remember the tuning and allow you to change PIDs along this sliding scale at any time in the future.  Starting the AutoTune process by staying in AutoTune mode for over 2 seconds while armed will erase the old settings and start a new tuning.  If you accidentally start an unwanted new tuning you can just power it off without disarming and it will forget the new tuning rather than making it permanent.  To use the SmoothQuick virtual slider, you need to attach a real slider (or knob or FMS 3x toggle) to it.  SmoothQuick works in real time, even while you are flying the tuned/destination PID bank if you want.

SystemIdentSettings -> SmoothQuickSource is where you attach a real slider.  SmoothQuickSource = 0 disables SmoothQuick entirely.  The default of 25 says to access the next of a set of 5 equally spaced points on the slider by toggling the Flight Mode Switch (starting outside of AutoTune) into AutoTune and back out, 3 times, in less than 2 seconds, but only if armed.  If you think of the SmoothQuick slider as a scale from -100 to +100, with smoothest being -100 and quickest being +100, then you start out in the middle at 0.  The first time you do the fast FMS 3x double toggle it will move you to +50 on the slider, then +100, then -100, then -50, then back to 0, etc.  If you do the fast FMS 3x toggle while disarmed, it will always set it to 0.  You can do that to set it to a known value if you forget.  SmoothQuickSource = 23, 25, and 27 give you 3, 5, and 7 equally spaced stops on the SmoothQuick slider.  25 is the default and gives you positions at -100, -50, 0, 50, and 100.

You can also set SmoothQuickSource to be a number from 10 to 13 which corresponds to using Accessory0 to Accessory3 to directly adjust the slider.  This requires that you have an available knob or slider on your transmitter, that you already have your transmitter configured to send it out as a separate channel, that the FC has been configured to attach that RC channel to one of the four FC Accessory channels, and that that FC Accessory is not being used by another FC function.

AutoTune / SmoothQuick 'data' is stored permanently.  Once you have run AutoTune once, you can use SmoothQuick with this stored data to produce smoother or quicker PIDs any time in the future.  You don't have to run AutoTune again, but you may want to if you change something, like props or weight or motors or cell count.

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 is always active to change the PIDs in the destination PID bank (default 3) and you can adjust PIDs from smooth to quick any time you want to.

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

AutoTune data:
The settings used by SmoothQuick are all stored permanently in SystemIdentSettings.  They are Tau, GyroReadTimeAverage, the 3 Beta values, and SmoothQuickValue.  'Complete' must also be True.  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 another 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 from use when using the GCS FMS setup GUI.  It can only be enabled with settings on the System tab.

Enabling the AutoTune module manually:
The AutoTune module is automatically enabled at boot time if the FC detects that AutoTune has been added to the FMS.  The AutoTune module can also be enabled manually so it is always enabled.  After either of these changes, you must reboot the FC for AutoTune to actually run.  There are two reasons you might want to manually enable the AutoTune module:
- You no longer have AutoTune on the FMS, but you want to be able to continue to use SmoothQuick.
- You know you are going to experiment with FMS changes that include adding and removing AutoTune from the FMS (e.g. over the course of many days).  Without manually enabling the AutoTune module, you will need to reboot after adding AutoTune to the FMS if it was not enabled in the FMS at power up.

You can copy these settings from an old run of AutoTune instead of flying the AutoTune flight:
If you want to, you can copy these AutoTune settings from an old run of AutoTune.  You might do this if you are upgrading firmware or building a duplicate of a model.  They are all fields in SystemIdentSettings. 
All other SystemIdentSettings fields can be modified and the new values will affect the PIDs written the next time SmoothQuick is used to rewrite the tuned PIDs:
- Tau
- Beta.Roll

- Beta.Pitch

- Beta.Yaw

-
GyroReadTimeAverage
- Complete


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 xml files or source if you need to know more of the technical aspects of their fields.  The field descriptions should be displayed on the System page if you hover over a field or enable "Show Descriptions" (click the eyeball at the top of the GCS System page to find this setting).

...

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 AutoTune data changes (not sent by you from the GCS), 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 the AutoTune flight.  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 3
- TuningDuration is 60 seconds
- DerivativeFactor default is 1.0 and can be set between 0.0 and 1.0 to reduce the normal PID D term (helps reduce D term oscillation if that is a problem)
- OuterLoopKpSoftClamp is value of outer loop kp where outer loop limiting starts default is 6.5
- SmoothQuickSource default is 25 (FMS toggle method with 5 positions)
- 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, balance your props and if that doesn't help, you may want to increase Settings.StabilizationSettings.GyroTau (found in the GCS GUI at Configuration -> Stabilization -> Expert -> GyroNoiseFiltering) and retune (you must actually fly the tuning flight again).  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


GyroReadTimeAverage