1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Merged in f5soh/librepilot/LP-399_GUI_for_Autotune (pull request #451)

LP-399 GUI for Autotune

Approved-by: Lalanne Laurent <f5soh@free.fr>
Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
Approved-by: Vladimir Zidar <mr_w@mindnever.org>
Approved-by: Jan NIJS <dr.oblivium@gmail.com>
Approved-by: Alessio Morale <alessiomorale@gmail.com>
This commit is contained in:
Lalanne Laurent 2017-09-11 19:42:29 +00:00 committed by Philippe Renon
commit 9d11a2219e
9 changed files with 2202 additions and 791 deletions

View File

@ -9,7 +9,7 @@
* @{
*
* @file AutoTune/autotune.c
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016-2017.
* dRonin, http://dRonin.org/, Copyright (C) 2015-2016
* Tau Labs, http://taulabs.org, Copyright (C) 2013-2014
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
@ -69,43 +69,39 @@
#undef STACK_SIZE_BYTES
// Pull Request version tested on Sparky2. 292 bytes of stack left when configured with 1340
// Beware that Nano needs 156 bytes more stack than Sparky2
#define STACK_SIZE_BYTES 1340
#define TASK_PRIORITY (tskIDLE_PRIORITY + 1)
#define STACK_SIZE_BYTES 1340
#define TASK_PRIORITY (tskIDLE_PRIORITY + 1)
#define AF_NUMX 13
#define AF_NUMP 43
#define AF_NUMX 13
#define AF_NUMP 43
#if !defined(AT_QUEUE_NUMELEM)
#define AT_QUEUE_NUMELEM 18
#define AT_QUEUE_NUMELEM 18
#endif
#define TASK_STARTUP_DELAY_MS 250 /* delay task startup this much, waiting on accessory valid */
#define NOT_AT_MODE_DELAY_MS 50 /* delay this many ms if not in autotune mode */
#define NOT_AT_MODE_RATE (1000.0f / NOT_AT_MODE_DELAY_MS) /* this many loops per second if not in autotune mode */
#define SMOOTH_QUICK_FLUSH_DELAY 0.5f /* wait this long after last change to flush to permanent storage */
#define SMOOTH_QUICK_FLUSH_TICKS (SMOOTH_QUICK_FLUSH_DELAY * NOT_AT_MODE_RATE) /* this many ticks after last change to flush to permanent storage */
#define TASK_STARTUP_DELAY_MS 250 /* delay task startup this much, waiting on accessory valid */
#define NOT_AT_MODE_DELAY_MS 50 /* delay this many ms if not in autotune mode */
#define NOT_AT_MODE_RATE (1000.0f / NOT_AT_MODE_DELAY_MS) /* this many loops per second if not in autotune mode */
#define SMOOTH_QUICK_FLUSH_DELAY 0.5f /* wait this long after last change to flush to permanent storage */
#define SMOOTH_QUICK_FLUSH_TICKS (SMOOTH_QUICK_FLUSH_DELAY * NOT_AT_MODE_RATE) /* this many ticks after last change to flush to permanent storage */
#define MAX_PTS_PER_CYCLE 4 /* max gyro updates to process per loop see YIELD_MS and consider gyro rate */
#define INIT_TIME_DELAY_MS 100 /* delay to allow stab bank, etc. to be populated after flight mode switch change detection */
#define SYSTEMIDENT_TIME_DELAY_MS 2000 /* delay before starting systemident (shaking) flight mode */
#define INIT_TIME_DELAY2_MS 2500 /* delay before starting to capture data */
#define YIELD_MS 2 /* delay this long between processing sessions see MAX_PTS_PER_CYCLE and consider gyro rate */
#define MAX_PTS_PER_CYCLE 4 /* max gyro updates to process per loop see YIELD_MS and consider gyro rate */
#define INIT_TIME_DELAY_MS 100 /* delay to allow stab bank, etc. to be populated after flight mode switch change detection */
#define SYSTEMIDENT_TIME_DELAY_MS 2000 /* delay before starting systemident (shaking) flight mode */
#define INIT_TIME_DELAY2_MS 2500 /* delay before starting to capture data */
#define YIELD_MS 2 /* delay this long between processing sessions see MAX_PTS_PER_CYCLE and consider gyro rate */
// CheckSettings() returned error bits
#define TAU_NAN 1
#define BETA_NAN 2
#define ROLL_BETA_LOW 4
#define PITCH_BETA_LOW 8
#define YAW_BETA_LOW 16
#define TAU_TOO_LONG 32
#define TAU_TOO_SHORT 64
#define CPU_TOO_SLOW 128
// smooth-quick modes
#define SMOOTH_QUICK_DISABLED 0
#define SMOOTH_QUICK_ACCESSORY_BASE 10
#define SMOOTH_QUICK_TOGGLE_BASE 20
#define TAU_NAN 1
#define BETA_NAN 2
#define ROLL_BETA_LOW 4
#define PITCH_BETA_LOW 8
#define YAW_BETA_LOW 16
#define TAU_TOO_LONG 32
#define TAU_TOO_SHORT 64
#define CPU_TOO_SLOW 128
#define FMS_TOGGLE_STEP_DISABLED 0.0f
// Private types
enum AUTOTUNE_STATE { AT_INIT, AT_INIT_DELAY, AT_INIT_DELAY2, AT_START, AT_RUN, AT_FINISHED, AT_WAITING };
@ -136,11 +132,11 @@ static float gyroReadTimeAverageAlpha;
static float gyroReadTimeAverageAlphaAlpha;
static float alpha;
static float smoothQuickValue;
static float flightModeSwitchToggleStepValue;
static volatile uint32_t atPointsSpilled;
static uint32_t throttleAccumulator;
static uint8_t rollMax, pitchMax;
static int8_t accessoryToUse;
static int8_t flightModeSwitchTogglePosition;
static bool moduleEnabled;
@ -288,13 +284,13 @@ static void AutoTuneTask(__attribute__((unused)) void *parameters)
savePidNeeded = false;
// Save PIDs to permanent settings
switch (systemIdentSettings.DestinationPidBank) {
case 1:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK1:
UAVObjSave(StabilizationSettingsBank1Handle(), 0);
break;
case 2:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK2:
UAVObjSave(StabilizationSettingsBank2Handle(), 0);
break;
case 3:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK3:
UAVObjSave(StabilizationSettingsBank3Handle(), 0);
break;
}
@ -306,13 +302,13 @@ static void AutoTuneTask(__attribute__((unused)) void *parameters)
// and the autotune data gathering is complete
// and the autotune data gathered is good
// note: CheckFlightModeSwitchForPidRequest(mode) only returns true if current mode is not autotune
if (flightModeSwitchTogglePosition != -1 && CheckFlightModeSwitchForPidRequest(flightStatus.FlightMode)
if (flightModeSwitchToggleStepValue > FMS_TOGGLE_STEP_DISABLED && CheckFlightModeSwitchForPidRequest(flightStatus.FlightMode)
&& systemIdentSettings.Complete && !CheckSettings()) {
if (flightStatus.Armed == FLIGHTSTATUS_ARMED_ARMED) {
// if user toggled while armed set PID's to next in sequence
// if you assume that smoothest is -1 and quickest is +1
// this corresponds to 0,+.50,+1.00,-1.00,-.50 (for 5 position toggle)
smoothQuickValue += 1.0f / (float)flightModeSwitchTogglePosition;
smoothQuickValue += flightModeSwitchToggleStepValue;
if (smoothQuickValue > 1.001f) {
smoothQuickValue = -1.0f;
}
@ -746,39 +742,45 @@ static void InitSystemIdent(bool loadDefaults)
// Update SmoothQuickSource to be used
static void UpdateSmoothQuickSource(uint8_t smoothQuickSource, bool loadDefaults)
{
// disable PID changing with accessory0-3 and flight mode switch toggle
accessoryToUse = -1;
flightModeSwitchToggleStepValue = FMS_TOGGLE_STEP_DISABLED;
switch (smoothQuickSource) {
case SMOOTH_QUICK_ACCESSORY_BASE + 0: // use accessory0
case SMOOTH_QUICK_ACCESSORY_BASE + 1: // use accessory1
case SMOOTH_QUICK_ACCESSORY_BASE + 2: // use accessory2
case SMOOTH_QUICK_ACCESSORY_BASE + 3: // use accessory3
// leave smoothQuickValue alone since it is always controlled by knob
// disable PID changing with flight mode switch
flightModeSwitchTogglePosition = -1;
// enable PID changing with accessory0-3
accessoryToUse = smoothQuickSource - SMOOTH_QUICK_ACCESSORY_BASE;
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_ACCESSORY0:
accessoryToUse = 0;
break;
case SMOOTH_QUICK_TOGGLE_BASE + 3: // use flight mode switch toggle with 3 points
case SMOOTH_QUICK_TOGGLE_BASE + 5: // use flight mode switch toggle with 5 points
case SMOOTH_QUICK_TOGGLE_BASE + 7: // use flight mode switch toggle with 7 points
// don't allow init of current toggle position in the middle of 3x fms toggle
if (loadDefaults) {
// set toggle to middle of range
smoothQuickValue = 0.0f;
}
// enable PID changing with flight mode switch
flightModeSwitchTogglePosition = (smoothQuickSource - 1 - SMOOTH_QUICK_TOGGLE_BASE) / 2;
// disable PID changing with accessory0-3
accessoryToUse = -1;
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_ACCESSORY1:
accessoryToUse = 1;
break;
case SMOOTH_QUICK_DISABLED:
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_ACCESSORY2:
accessoryToUse = 2;
break;
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_ACCESSORY3:
accessoryToUse = 3;
break;
// enable PID changing with flight mode switch
// -1 to +1 give a range = 2, define step value for desired positions: 3, 5, 7
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_FMSTOGGLE3POS:
flightModeSwitchToggleStepValue = 1.0f;
break;
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_FMSTOGGLE5POS:
flightModeSwitchToggleStepValue = 0.5f;
break;
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_FMSTOGGLE7POS:
flightModeSwitchToggleStepValue = 0.33f;
break;
case SYSTEMIDENTSETTINGS_SMOOTHQUICKSOURCE_DISABLED:
default:
// leave smoothQuickValue alone so user can set it to a different value and have it stay that value
// disable PID changing with flight mode switch
flightModeSwitchTogglePosition = -1;
// disable PID changing with accessory0-3
accessoryToUse = -1;
flightModeSwitchToggleStepValue = FMS_TOGGLE_STEP_DISABLED;
break;
}
// don't allow init of current toggle position in the middle of 3x fms toggle
if (loadDefaults && (flightModeSwitchToggleStepValue > FMS_TOGGLE_STEP_DISABLED)) {
// set toggle to middle of range
smoothQuickValue = 0.0f;
}
}
@ -928,13 +930,13 @@ static void ComputeStabilizationAndSetPidsFromDampAndNoise(float dampRate, float
_Static_assert(sizeof(StabilizationSettingsBank1Data) == sizeof(StabilizationBankData), "sizeof(StabilizationSettingsBank1Data) != sizeof(StabilizationBankData)");
StabilizationBankData volatile stabSettingsBank;
switch (systemIdentSettings.DestinationPidBank) {
case 1:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK1:
StabilizationSettingsBank1Get((void *)&stabSettingsBank);
break;
case 2:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK2:
StabilizationSettingsBank2Get((void *)&stabSettingsBank);
break;
case 3:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK3:
StabilizationSettingsBank3Get((void *)&stabSettingsBank);
break;
}
@ -1161,13 +1163,13 @@ static void ComputeStabilizationAndSetPidsFromDampAndNoise(float dampRate, float
// Save PIDs to UAVO RAM (not permanently yet)
switch (systemIdentSettings.DestinationPidBank) {
case 1:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK1:
StabilizationSettingsBank1Set((void *)&stabSettingsBank);
break;
case 2:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK2:
StabilizationSettingsBank2Set((void *)&stabSettingsBank);
break;
case 3:
case SYSTEMIDENTSETTINGS_DESTINATIONPIDBANK_BANK3:
StabilizationSettingsBank3Set((void *)&stabSettingsBank);
break;
}

View File

@ -1,140 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AutotuneWidget</class>
<widget class="QWidget" name="AutotuneWidget">
<class>AutoTuneWidget</class>
<widget class="QWidget" name="AutoTuneWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>739</width>
<height>688</height>
<width>979</width>
<height>794</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>6</number>
</property>
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QTabWidget" name="Autotune_tabs">
<property name="currentIndex">
<number>0</number>
<widget class="QTabWidget" name="tabWidget">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<widget class="QWidget" name="Preautotune_tab">
<widget class="QWidget" name="tabWidgetPage1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>Pre-Autotune</string>
<string>AutoTune Configuration</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_5">
<property name="leftMargin">
<number>12</number>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item row="3" column="0" colspan="3">
<widget class="QTextEdit" name="textEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:20pt; font-weight:600; color:#ff0000;&quot;&gt;WARNING:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt;This is an experimental plugin for the GCS that is going to make your aircraft shake, etc, so test with lots of space and be &lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt; font-weight:600;&quot;&gt;very very wary&lt;/span&gt;&lt;span style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot;&gt; for it creating bad tuning values.  Basically there is no reason to think this will work at all.&lt;br /&gt;&lt;br /&gt;To use autotuning, here are the steps:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul style=&quot;margin-top: 0px; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; -qt-list-indent: 1;&quot;&gt;&lt;li style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;On the &lt;span style=&quot; font-style:italic;&quot;&gt;Input configuration&lt;/span&gt; tab, &lt;span style=&quot; font-style:italic;&quot;&gt;Flight Mode Switch Settings&lt;/span&gt;, set one of your flight modes to &amp;quot;Autotune&amp;quot;.&lt;br /&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Take off, change flight mode to autotune, keep it in the air while it's shaking.&lt;br /&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Land and disarm.  (note - you &lt;span style=&quot; font-weight:600;&quot;&gt;MUST&lt;/span&gt; stay in autotune mode through this point, leaving autotune before disarming aborts the process)&lt;br /&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;We'd recommend checking your stabilization settings before trying them out (ie: compare to what you currently use, if they are VASTLY different, probably a good indication bad things will happen).&lt;br /&gt;&lt;/li&gt;
&lt;li style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot; style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Test fly the new settings.&lt;/li&gt;
&lt;li style=&quot; font-family:'Lucida Grande'; font-size:13pt;&quot; style=&quot; margin-top:0px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;If you're ready to proceed, click the &lt;span style=&quot; font-style:italic;&quot;&gt;Enable Autotune Module&lt;/span&gt; checkbox above this text, click &lt;span style=&quot; font-style:italic;&quot;&gt;save&lt;/span&gt; and go to the next tab.&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<widget class="QGroupBox" name="groupBox_5">
<property name="title">
<string>Module Control</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="enableAutoTune">
<property name="text">
<string>Enable Autotune Module</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>After enabling the module, you must power cycle before using and configuring.</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="autotune_tab">
<attribute name="title">
<string>Autotune Setup</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
@ -149,76 +47,12 @@ p, li { white-space: pre-wrap; }
</property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="palette">
<palette>
<active>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="Base">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
<colorrole role="Window">
<brush brushstyle="SolidPattern">
<color alpha="0">
<red>232</red>
<green>232</green>
<blue>232</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
@ -227,367 +61,1834 @@ p, li { white-space: pre-wrap; }
<rect>
<x>0</x>
<y>0</y>
<width>526</width>
<height>510</height>
<width>957</width>
<height>706</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="autoFillBackground">
<bool>true</bool>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>12</number>
</property>
<property name="leftMargin">
<number>12</number>
</property>
<property name="topMargin">
<number>12</number>
</property>
<property name="rightMargin">
<number>12</number>
</property>
<property name="bottomMargin">
<number>12</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Tuning Aggressiveness</string>
<layout class="QGridLayout" name="gridLayout">
<item row="11" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Rate Tuning:</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Attitude Tuning:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSlider" name="rateTuning">
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:RelayTuningSettings</string>
<string>fieldname:RateGain</string>
<string>scale:0.01</string>
<string>haslimits:no</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSlider" name="attitudeTuning">
<property name="maximum">
<number>100</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:RelayTuningSettings</string>
<string>fieldname:AttitudeGain</string>
<string>scale:0.01</string>
<string>haslimits:no</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Measured Properties</string>
<item row="9" column="0">
<widget class="QGroupBox" name="statusGroupBox">
<property name="minimumSize">
<size>
<width>430</width>
<height>0</height>
</size>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Roll:</string>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 4px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="title">
<string>Status</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_4" rowstretch="0,0,0,0,0">
<item row="3" column="7">
<widget class="QDoubleSpinBox" name="stateBiasRoll">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="measuredRollPeriod">
<property name="text">
<string>0</string>
<property name="toolTip">
<string>Measured amount and direction of control stick that stabilization automatically adds for motionless hover.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:RelayTuning</string>
<string>fieldname:Period</string>
<string>objname:SystemIdentState</string>
<string>fieldname:Bias</string>
<string>element:Roll</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="measuredRollGain">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:RelayTuning</string>
<string>fieldname:Gain</string>
<string>element:Roll</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Period (ms)</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Gain (deg/s) / output</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Pitch</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="measuredPitchPeriod">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:RelayTuning</string>
<string>fieldname:Period</string>
<string>element:Pitch</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="measuredPitchGain">
<property name="text">
<string>0</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:RelayTuning</string>
<string>fieldname:Gain</string>
<string>element:Pitch</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Computed Values</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="2">
<widget class="QLabel" name="label_9">
<property name="text">
<string>RateKi</string>
</property>
</widget>
</item>
<item row="0" column="3">
<widget class="QLabel" name="label_10">
<property name="text">
<string>AttitudeKp</string>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QLabel" name="pitchRateKi">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Pitch</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>RateKp</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="rollRateKp">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="label_11">
<property name="text">
<string>AttitudeKi</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Roll</string>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="rollAttitudeKp">
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="pitchAttitudeKi">
<widget class="QDoubleSpinBox" name="stateTau">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured delay between inner loop and detected gyro response ln(sec).</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-100.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Tau</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="11">
<widget class="QDoubleSpinBox" name="stateSpilledPts">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Number of Gyro samples that were dropped (should be zero).</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:NumSpilledPts</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="9">
<widget class="QDoubleSpinBox" name="stateNumAfPredicts">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Number of Gyro samples that were counted.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="decimals">
<number>0</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>99999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:NumAfPredicts</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="7">
<widget class="QDoubleSpinBox" name="stateGyroReadTimeAverage">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured delay from Gyro read to inner loop in milliseconds.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:GyroReadTimeAverage</string>
<string>scale:0.001</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="8">
<widget class="QLabel" name="label_9">
<property name="text">
<string>0</string>
<string>Bias Pitch</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="8">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Beta Pitch</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="9">
<widget class="QDoubleSpinBox" name="stateBetaPitch">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>(Natural log of) Measured control gain.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Beta</string>
<string>element:Pitch</string>
</stringlist>
</property>
</widget>
</item>
<item row="4" column="7">
<widget class="QDoubleSpinBox" name="stateNoiseRoll">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured vibration: Usually 10's to 1000's.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Noise</string>
<string>element:Roll</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="10">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Bias Yaw</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="11">
<widget class="QDoubleSpinBox" name="stateBetaYaw">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>(Natural log of) Measured control gain.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Beta</string>
<string>element:Yaw</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="11">
<widget class="QDoubleSpinBox" name="stateBiasYaw">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured amount and direction of control stick that stabilization automatically adds for motionless hover.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Bias</string>
<string>element:Yaw</string>
</stringlist>
</property>
</widget>
</item>
<item row="4" column="8">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Noise Pitch</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QDoubleSpinBox" name="stateHoverThrottle">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Throttle level needed to hover, in percent. How the multirotor is under/over powered.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:HoverThrottle</string>
</stringlist>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QDoubleSpinBox" name="statePeriod">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Period (ms)</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Period</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="10">
<widget class="QLabel" name="label_16">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Dropped</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="9">
<widget class="QDoubleSpinBox" name="stateBiasPitch">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured amount and direction of control stick that stabilization automatically adds for motionless hover.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Bias</string>
<string>element:Pitch</string>
</stringlist>
</property>
</widget>
</item>
<item row="4" column="9">
<widget class="QDoubleSpinBox" name="stateNoisePitch">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured vibration: Usually 10's to 1000's.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Noise</string>
<string>element:Pitch</string>
</stringlist>
</property>
</widget>
</item>
<item row="4" column="10">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Noise Yaw</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="8">
<widget class="QLabel" name="label_15">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Samples</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="6">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Noise Roll</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="6">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Beta Roll</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="11">
<widget class="QDoubleSpinBox" name="stateNoiseYaw">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured vibration: Usually 10's to 1000's.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Noise</string>
<string>element:Yaw</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="6">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Bias Roll</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="10">
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Beta Yaw</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QDoubleSpinBox" name="stateBetaRoll">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>(Natural log of) Measured control gain.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentState</string>
<string>fieldname:Beta</string>
<string>element:Roll</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="6">
<widget class="QLabel" name="label_18">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Gyro Avg</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_14">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Period</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="pitchAttitudeKp">
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0</string>
<string>Tau</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLabel" name="pitchRateKp">
<item row="3" column="3">
<widget class="QLabel" name="label_17">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>0</string>
<string>HoverThrottle</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QLabel" name="rollRateKi">
<item row="0" column="4">
<widget class="QCheckBox" name="stateComplete">
<property name="toolTip">
<string>Automatically checked for a good complete tune or unchecked for incomplete or bad tune.</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string>0</string>
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentState</string>
<string>fieldname:Complete</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="rollAttitudeKi">
<item row="0" column="3">
<widget class="QLabel" name="label_2">
<property name="text">
<string>0</string>
<string>Complete</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="title">
<string/>
<item row="7" column="0">
<widget class="QGroupBox" name="configurationGroupBox">
<property name="enabled">
<bool>true</bool>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="1" colspan="2">
<widget class="QPushButton" name="useComputedValues">
<property name="styleSheet">
<string notr="true"/>
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="title">
<string>Configuration</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="7">
<widget class="QPushButton" name="systemIdentSettings_Reset">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Reset AutoTune settings to default values.</string>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Default</string>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>button:default</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="CalculateYawLabel">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>Calculate Yaw</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="4" column="1" colspan="7">
<layout class="QGridLayout" name="gridLayout_3">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<item row="3" column="5">
<widget class="QDoubleSpinBox" name="SmoothQuickValue">
<property name="minimumSize">
<size>
<width>60</width>
<height>28</height>
</size>
</property>
<property name="text">
<string>Apply Computed Values</string>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Smooth - Normal - Quick PID response desired for PID calc based on AutoTune measurements.</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>1.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="value">
<double>0.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentSettings</string>
<string>fieldname:SmoothQuickValue</string>
<string>scale:1</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="label_21">
<item row="0" column="0">
<widget class="QLabel" name="smooth_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>29</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Smooth PID response, preferred for photography.</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Step Size</string>
<string>Smooth</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QSlider" name="stepSizeSlider">
<item row="0" column="4">
<widget class="QLabel" name="quick_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>29</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Quick PID response, preferred for racing.</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Quick</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="3" column="0" colspan="5">
<widget class="QSlider" name="SmoothQuickValueSlider">
<property name="minimumSize">
<size>
<width>0</width>
<height>28</height>
</size>
</property>
<property name="toolTip">
<string>Smooth - Normal - Quick PID response desired for PID calc based on AutoTune measurements.</string>
</property>
<property name="minimum">
<number>-10</number>
</property>
<property name="maximum">
<number>10</number>
</property>
<property name="singleStep">
<number>1</number>
</property>
<property name="pageStep">
<number>5</number>
</property>
<property name="value">
<number>0</number>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="tickPosition">
<enum>QSlider::TicksBelow</enum>
</property>
<property name="tickInterval">
<number>5</number>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:RelayTuningSettings</string>
<string>fieldname:Amplitude</string>
<string>scale:0.01</string>
<string>haslimits:no</string>
<string>objname:SystemIdentSettings</string>
<string>fieldname:SmoothQuickValue</string>
<string>scale:0.1</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer">
<item row="0" column="2">
<widget class="QLabel" name="normal_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>120</width>
<height>29</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>120</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Normal PID response.</string>
</property>
<property name="styleSheet">
<string notr="true">background-color: qlineargradient(spread:reflect, x1:0.507, y1:0, x2:0.507, y2:0.772, stop:0.208955 rgba(74, 74, 74, 255), stop:0.78607 rgba(36, 36, 36, 255));
color: rgb(255, 255, 255);
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Normal</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<item row="0" column="3">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="8" column="1">
<widget class="QComboBox" name="CalculateYaw">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Whether to calculate yaw and whether to use Yaw to Roll/Pitch PID Ratios limits bellow.</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="modelColumn">
<number>0</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:CalculateYaw</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QComboBox" name="SmoothQuickSource">
<property name="toolTip">
<string>How the SmoothQuick slider is controlled, using Accessory or FMS 3x toggle method with 3, 5, 7 positions. Allow testing smooth/quick PID sets after a AutoTune flight.</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:SmoothQuickSource</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="SmoothQuickSource_label">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>SmoothQuick Source</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="pidBankDestination_label">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>PID Bank Destination</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="DestinationPidBank">
<property name="toolTip">
<string>Which bank the calculated PIDs will be stored in after tuning.</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:DestinationPidBank</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="ThrustControl_label">
<property name="text">
<string>Thrust Control</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QComboBox" name="ThrustControl">
<property name="toolTip">
<string>Manual is direct control, AltitudeVario helps to maintain altitude.</string>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:ThrustControl</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item row="10" column="5">
<widget class="QLabel" name="outerloopKpLimit_label">
<property name="text">
<string>OuterLoop Kp Limit</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="4" colspan="2">
<widget class="QLabel" name="calculateYaw_label">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="text">
<string>Yaw to Roll/Pitch PID Ratio Limits</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="8" column="3">
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="8" column="6" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDoubleSpinBox" name="YawToRollPitchPIDRatioMin">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Minimum Yaw to Pitch/Roll ratio limit.</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:YawToRollPitchPIDRatioMin</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
<item>
<widget class="QDoubleSpinBox" name="YawToRollPitchPIDRatioMax">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Maximum Yaw to Pitch/Roll ratio limit.</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:YawToRollPitchPIDRatioMax</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</item>
<item row="10" column="6" colspan="2">
<widget class="QDoubleSpinBox" name="OuterLoopKpSoftClamp">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Set a limiting upper value for the OuterLoop Kp.</string>
</property>
<property name="decimals">
<number>1</number>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:OuterLoopKpSoftClamp</string>
<string>buttongroup:20</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="8" column="0">
<widget class="QGroupBox" name="statusGroupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>430</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<weight>50</weight>
<bold>false</bold>
</font>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="styleSheet">
<string notr="true">QLineEdit {
border: none;
border-radius: 1px;
padding: 0 4px;
background: rgba(0, 0, 0, 16);
/* background: transparent; */
/* selection-background-color: darkgray;*/
}</string>
</property>
<property name="title">
<string>Tuning Results Stored</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<layout class="QGridLayout" name="gridLayout_5" rowstretch="0,0,0">
<item row="2" column="6">
<widget class="QDoubleSpinBox" name="settingsBetaRoll">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>(Natural log of) Stored control gain.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentSettings</string>
<string>fieldname:Beta</string>
<string>element:Roll</string>
<string>buttongroup:30</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QDoubleSpinBox" name="settingsTau">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Stored delay between inner loop and detected gyro response ln(sec).</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-100.000000000000000</double>
</property>
<property name="maximum">
<double>100.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentSettings</string>
<string>fieldname:Tau</string>
<string>scale:1</string>
<string>buttongroup:30</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="3">
<widget class="QLabel" name="label_20">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>110</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Tau</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="5">
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Beta Roll</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="11">
<widget class="QDoubleSpinBox" name="settingsBetaYaw">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>(Natural log of) Stored control gain.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentSettings</string>
<string>fieldname:Beta</string>
<string>element:Yaw</string>
<string>buttongroup:30</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="7">
<widget class="QLabel" name="label_26">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Beta Pitch</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="8">
<widget class="QDoubleSpinBox" name="settingsBetaPitch">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>(Natural log of) Stored control gain.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="minimum">
<double>-999.000000000000000</double>
</property>
<property name="maximum">
<double>999.000000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentSettings</string>
<string>fieldname:Beta</string>
<string>element:Pitch</string>
<string>buttongroup:30</string>
</stringlist>
</property>
</widget>
</item>
<item row="2" column="9">
<widget class="QLabel" name="label_28">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Beta Yaw</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="6">
<widget class="QDoubleSpinBox" name="settingsGyroReadTimeAverage">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>Measured delay from Gyro read to inner loop in milliseconds.</string>
</property>
<property name="frame">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="readOnly">
<bool>false</bool>
</property>
<property name="buttonSymbols">
<enum>QAbstractSpinBox::NoButtons</enum>
</property>
<property name="decimals">
<number>2</number>
</property>
<property name="minimum">
<double>0.000000000000000</double>
</property>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="singleStep">
<double>0.010000000000000</double>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>objname:SystemIdentSettings</string>
<string>fieldname:GyroReadTimeAverage</string>
<string>scale:0.001</string>
<string>buttongroup:30</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="5">
<widget class="QLabel" name="label_21">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Gyro Avg</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="7" colspan="5">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
@ -596,11 +1897,199 @@ p, li { white-space: pre-wrap; }
</property>
</spacer>
</item>
<item row="2" column="0" colspan="4">
<widget class="QLabel" name="label_22">
<item>
<widget class="QPushButton" name="systemIdentSettingsTuningReset">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Clear results of previous AutoTune flight.</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="autoFillBackground">
<bool>false</bool>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>The Apply and Save buttons below save the autotuning settings which
will alter settings for the next autotuning flight</string>
<string>Default</string>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>button:default</string>
<string>buttongroup:30</string>
</stringlist>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="4">
<widget class="QCheckBox" name="settingsComplete">
<property name="toolTip">
<string>Automatically checked for a good complete tune or unchecked for incomplete or bad tune.</string>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="text">
<string/>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="objrelation" stdset="0">
<stringlist>
<string>objname:SystemIdentSettings</string>
<string>fieldname:Complete</string>
</stringlist>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label">
<property name="text">
<string>Complete</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>6</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Module Control</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="topMargin">
<number>9</number>
</property>
<item>
<widget class="QCheckBox" name="AutotuneEnable">
<property name="maximumSize">
<size>
<width>900</width>
<height>16777215</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>Allow AutoTune module to be started all time, without any AutoTune set in one FlightMode.</string>
</property>
<property name="text">
<string>Enable AutoTune module</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>After enabling the module, you must power cycle before using and configuring.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Module Status</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="topMargin">
<number>9</number>
</property>
<item>
<widget class="QLabel" name="autotuneModuleStatus">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>200</height>
</size>
</property>
<property name="toolTip">
<string/>
</property>
<property name="styleSheet">
<string notr="true">border: 1px solid grey;
border-radius: 5;
margin:1px;
font:bold;</string>
</property>
<property name="text">
<string>Stopped</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
@ -608,22 +2097,9 @@ will alter settings for the next autotuning flight</string>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>77</height>
</size>
</property>
</spacer>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
@ -634,22 +2110,19 @@ will alter settings for the next autotuning flight</string>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<layout class="QHBoxLayout" name="submitButtons">
<property name="spacing">
<number>4</number>
</property>
<item>
<spacer name="horizontalSpacer_3">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>13</width>
<height>25</height>
<width>40</width>
<height>5</height>
</size>
</property>
</spacer>
@ -664,8 +2137,8 @@ will alter settings for the next autotuning flight</string>
</property>
<property name="minimumSize">
<size>
<width>25</width>
<height>25</height>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
@ -674,6 +2147,9 @@ will alter settings for the next autotuning flight</string>
<height>25</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string/>
</property>
@ -687,82 +2163,42 @@ will alter settings for the next autotuning flight</string>
<height>25</height>
</size>
</property>
<property name="objrelation" stdset="0">
<string notr="true">button:help</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="reloadButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Reloads the saved settings into GCS.
Useful if you have accidentally changed some settings.</string>
</property>
<property name="styleSheet">
<string notr="true"/>
</property>
<property name="text">
<string>Reload Board Data</string>
<property name="flat">
<bool>true</bool>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>button:reload</string>
<string>buttongroup:10</string>
<string>button:help</string>
</stringlist>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="applyButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Send settings to the board but do not save to the non-volatile memory</string>
</property>
<property name="styleSheet">
<string notr="true"/>
<string>Send settings to the board but do not save to the non-volatile memory.</string>
</property>
<property name="text">
<string>Apply</string>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>button:apply</string>
</stringlist>
<string notr="true">button:apply</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="saveButton">
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
<property name="toolTip">
<string>Send settings to the board and save to the non-volatile memory</string>
</property>
<property name="styleSheet">
<string notr="true"/>
<string>Send settings to the board and save to the non-volatile memory.</string>
</property>
<property name="text">
<string>Save</string>
</property>
<property name="checked">
<bool>false</bool>
</property>
<property name="objrelation" stdset="0">
<stringlist notr="true">
<string>button:save</string>
</stringlist>
<string notr="true">button:save</string>
</property>
</widget>
</item>
@ -770,6 +2206,10 @@ Useful if you have accidentally changed some settings.</string>
</item>
</layout>
</widget>
<tabstops>
<tabstop>applyButton</tabstop>
<tabstop>saveButton</tabstop>
</tabstops>
<resources>
<include location="../coreplugin/core.qrc"/>
</resources>

View File

@ -64,6 +64,7 @@ HEADERS += \
calibration/levelcalibrationmodel.h \
calibration/gyrobiascalibrationmodel.h \
calibration/calibrationuiutils.h \
configautotunewidget.h \
configoplinkwidget.h \
configrevonanohwwidget.h \
configsparky2hwwidget.h \
@ -106,6 +107,7 @@ SOURCES += \
calibration/sixpointcalibrationmodel.cpp \
calibration/levelcalibrationmodel.cpp \
calibration/gyrobiascalibrationmodel.cpp \
configautotunewidget.cpp \
configoplinkwidget.cpp \
configrevonanohwwidget.cpp \
configsparky2hwwidget.cpp \
@ -133,6 +135,7 @@ FORMS += \
mixercurve.ui \
configrevohwwidget.ui \
configspracingf3hwwidget.ui \
autotune.ui \
oplink.ui \
configrevonanohwwidget.ui \
configsparky2hwwidget.ui \

View File

@ -1,173 +1,133 @@
/**
****************************************************************************************
*
* @file configautotunewidget.cpp
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2017.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
* @{
* @brief The Configuration Gadget used to configure autotune module
***************************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "configautotunewidget.h"
#include "ui_autotune.h"
#include "relaytuningsettings.h"
#include "relaytuning.h"
#include "stabilizationsettings.h"
#include <uavobjectutilmanager.h>
#include <systemidentsettings.h>
#include <systemidentstate.h>
#include "hwsettings.h"
#include "taskinfo.h"
#include <QMessageBox>
#include <QDebug>
#include <QStringList>
#include <QWidget>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QPushButton>
#include <QDesktopServices>
#include <QUrl>
#include <QList>
ConfigAutotuneWidget::ConfigAutotuneWidget(QWidget *parent) :
ConfigTaskWidget(parent)
ConfigAutoTuneWidget::ConfigAutoTuneWidget(QWidget *parent) : ConfigTaskWidget(parent)
{
m_autotune = new Ui_AutotuneWidget();
m_autotune = new Ui_AutoTuneWidget();
m_autotune->setupUi(this);
// must be done before auto binding !
// setWikiURL("");
setWikiURL("AutoTune+Configuration");
// Add HwSettings before auto binding to give priority while saving
addUAVObject("HwSettings");
addAutoBindings();
disableMouseWheelEvents();
// Whenever any value changes compute new potential stabilization settings
connect(m_autotune->rateTuning, SIGNAL(valueChanged(int)), this, SLOT(recomputeStabilization()));
connect(m_autotune->attitudeTuning, SIGNAL(valueChanged(int)), this, SLOT(recomputeStabilization()));
systemIdentStateObj = dynamic_cast<SystemIdentState *>(getObject("SystemIdentState"));
Q_ASSERT(systemIdentStateObj);
addUAVObject("HwSettings");
addWidget(m_autotune->enableAutoTune);
systemIdentSettingsObj = dynamic_cast<SystemIdentSettings *>(getObject("SystemIdentSettings"));
Q_ASSERT(systemIdentSettingsObj);
RelayTuning *relayTuning = RelayTuning::GetInstance(getObjectManager());
Q_ASSERT(relayTuning);
if (relayTuning) {
connect(relayTuning, SIGNAL(objectUpdated(UAVObject *)), this, SLOT(recomputeStabilization()));
}
// Connect the apply button for the stabilization settings
connect(m_autotune->useComputedValues, SIGNAL(pressed()), this, SLOT(saveStabilization()));
addWidget(m_autotune->AutotuneEnable);
}
/**
* Apply the stabilization settings computed
*/
void ConfigAutotuneWidget::saveStabilization()
ConfigAutoTuneWidget::~ConfigAutoTuneWidget()
{
StabilizationSettings *stabilizationSettings = StabilizationSettings::GetInstance(getObjectManager());
Q_ASSERT(stabilizationSettings);
if (!stabilizationSettings) {
return;
}
// Make sure to recompute in case the other stab settings changed since
// the last time
recomputeStabilization();
// Apply this data to the board
stabilizationSettings->setData(stabSettings);
stabilizationSettings->updated();
// Do nothing
}
/**
* Called whenever the gain ratios or measured values
* are changed
/*
* This overridden function refreshes widgets which have no direct relation
* to any of UAVObjects. It saves their dirty state first because update comes
* from UAVObjects, and then restores it.
*/
void ConfigAutotuneWidget::recomputeStabilization()
{
RelayTuningSettings *relayTuningSettings = RelayTuningSettings::GetInstance(getObjectManager());
Q_ASSERT(relayTuningSettings);
if (!relayTuningSettings) {
return;
}
RelayTuning *relayTuning = RelayTuning::GetInstance(getObjectManager());
Q_ASSERT(relayTuning);
if (!relayTuning) {
return;
}
StabilizationSettings *stabilizationSettings = StabilizationSettings::GetInstance(getObjectManager());
Q_ASSERT(stabilizationSettings);
if (!stabilizationSettings) {
return;
}
RelayTuning::DataFields relayTuningData = relayTuning->getData();
RelayTuningSettings::DataFields tuningSettingsData = relayTuningSettings->getData();
stabSettings = stabilizationSettings->getData();
// Need to divide these by 100 because that is what the .ui file does
// to get the UAVO
const double gain_ratio_r = m_autotune->rateTuning->value() / 100.0;
const double zero_ratio_r = m_autotune->rateTuning->value() / 100.0;
const double gain_ratio_p = m_autotune->attitudeTuning->value() / 100.0;
const double zero_ratio_p = m_autotune->attitudeTuning->value() / 100.0;
// For now just run over roll and pitch
for (int i = 0; i < 2; i++) {
if (relayTuningData.Period[i] == 0 || relayTuningData.Gain[i] == 0) {
continue;
}
double wu = 1000.0 * 2 * M_PI / relayTuningData.Period[i]; // ultimate freq = output osc freq (rad/s)
double wc = wu * gain_ratio_r; // target openloop crossover frequency (rad/s)
double zc = wc * zero_ratio_r; // controller zero location (rad/s)
double kpu = 4.0f / M_PI / relayTuningData.Gain[i]; // ultimate gain, i.e. the proportional gain for instablity
double kp = kpu * gain_ratio_r; // proportional gain
double ki = zc * kp; // integral gain
// Now calculate gains for the next loop out knowing it is the integral of
// the inner loop -- the plant is position/velocity = scale*1/s
double wc2 = wc * gain_ratio_p; // crossover of the attitude loop
double kp2 = wc2; // kp of attitude
double ki2 = wc2 * zero_ratio_p * kp2; // ki of attitude
switch (i) {
case 0: // Roll
stabSettings.RollRatePID[StabilizationSettings::ROLLRATEPID_KP] = kp;
stabSettings.RollRatePID[StabilizationSettings::ROLLRATEPID_KI] = ki;
stabSettings.RollPI[StabilizationSettings::ROLLPI_KP] = kp2;
stabSettings.RollPI[StabilizationSettings::ROLLPI_KI] = ki2;
break;
case 1: // Pitch
stabSettings.PitchRatePID[StabilizationSettings::PITCHRATEPID_KP] = kp;
stabSettings.PitchRatePID[StabilizationSettings::PITCHRATEPID_KI] = ki;
stabSettings.PitchPI[StabilizationSettings::PITCHPI_KP] = kp2;
stabSettings.PitchPI[StabilizationSettings::PITCHPI_KI] = ki2;
break;
}
}
// Display these computed settings
m_autotune->rollRateKp->setText(QString().number(stabSettings.RollRatePID[StabilizationSettings::ROLLRATEPID_KP]));
m_autotune->rollRateKi->setText(QString().number(stabSettings.RollRatePID[StabilizationSettings::ROLLRATEPID_KI]));
m_autotune->rollAttitudeKp->setText(QString().number(stabSettings.RollPI[StabilizationSettings::ROLLPI_KP]));
m_autotune->rollAttitudeKi->setText(QString().number(stabSettings.RollPI[StabilizationSettings::ROLLPI_KI]));
m_autotune->pitchRateKp->setText(QString().number(stabSettings.PitchRatePID[StabilizationSettings::PITCHRATEPID_KP]));
m_autotune->pitchRateKi->setText(QString().number(stabSettings.PitchRatePID[StabilizationSettings::PITCHRATEPID_KI]));
m_autotune->pitchAttitudeKp->setText(QString().number(stabSettings.PitchPI[StabilizationSettings::PITCHPI_KP]));
m_autotune->pitchAttitudeKi->setText(QString().number(stabSettings.PitchPI[StabilizationSettings::PITCHPI_KI]));
}
void ConfigAutotuneWidget::refreshWidgetsValuesImpl(UAVObject *obj)
void ConfigAutoTuneWidget::refreshWidgetsValuesImpl(UAVObject *obj)
{
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
if (obj == hwSettings) {
bool enabled = (hwSettings->getOptionalModules(HwSettings::OPTIONALMODULES_AUTOTUNE) == HwSettings::OPTIONALMODULES_ENABLED);
m_autotune->enableAutoTune->setChecked(enabled);
TaskInfo *taskInfo = TaskInfo::GetInstance(getObjectManager());
bool moduleEnabled = (hwSettings->getOptionalModules(HwSettings::OPTIONALMODULES_AUTOTUNE) == HwSettings::OPTIONALMODULES_ENABLED);
bool moduleRunning = (taskInfo->runningAutoTune() == TaskInfo_Running::True);
if (obj == systemIdentStateObj) {
QString message;
QString tooltip_message;
QString color;
if (moduleRunning && moduleEnabled) {
message = tr("Running");
tooltip_message = tr("Module is running because it is enabled to be started at all times");
color = "green";
} else if (moduleRunning && !moduleEnabled) {
message = tr("Running");
tooltip_message = tr("Module is running, due to a Flightmode setup with Autotune on it.");
color = "green";
} else if (!moduleRunning && moduleEnabled) {
message = tr("Please Reboot");
tooltip_message = tr("Module is enabled but not running yet, needs a reboot.");
color = "orange";
} else {
message = tr("Stopped");
tooltip_message = tr("Module is stopped. It can be enabled by adding an AutoTune flightmode or force the module to be started at all times.");
color = "gray";
}
QString style = QString("QLabel { background-color: %1; color: rgb(255, 255, 255); \
border: 1px solid grey; border-radius: 5; margin:1px; font:bold;}").arg(color);
m_autotune->autotuneModuleStatus->setStyleSheet(style);
m_autotune->autotuneModuleStatus->setText(message);
m_autotune->autotuneModuleStatus->setToolTip(tooltip_message);
} else {
m_autotune->AutotuneEnable->setChecked(moduleEnabled);
// Request TaskInfo update at start
taskInfo->requestUpdate();
}
}
void ConfigAutotuneWidget::updateObjectsFromWidgetsImpl()
/*
* This overridden function updates UAVObjects which have no direct relation
* to any of widgets.
*/
void ConfigAutoTuneWidget::updateObjectsFromWidgetsImpl()
{
// Save state of the module enable checkbox first.
// Do not use setData() member on whole object, if possible, since it triggers unnecessary UAVObect update.
quint8 enableModule = m_autotune->AutotuneEnable->isChecked() ?
HwSettings::OPTIONALMODULES_ENABLED : HwSettings::OPTIONALMODULES_DISABLED;
HwSettings *hwSettings = HwSettings::GetInstance(getObjectManager());
quint8 enableModule = (m_autotune->enableAutoTune->isChecked()) ? HwSettings::OPTIONALMODULES_ENABLED : HwSettings::OPTIONALMODULES_DISABLED;
hwSettings->setOptionalModules(HwSettings::OPTIONALMODULES_AUTOTUNE, enableModule);
;
}

View File

@ -2,12 +2,13 @@
******************************************************************************
*
* @file configautotunewidget.h
* @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2017.
* The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012.
* @addtogroup GCSPlugins GCS Plugins
* @{
* @addtogroup ConfigPlugin Config Plugin
* @{
* @brief The Configuration Gadget used to adjust or recalculate autotuning
* @brief The Configuration Gadget used to configure autotune module
*****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify
@ -27,36 +28,29 @@
#ifndef CONFIGAUTOTUNE_H
#define CONFIGAUTOTUNE_H
#include "../uavobjectwidgetutils/configtaskwidget.h"
#include "extensionsystem/pluginmanager.h"
#include "uavobjectmanager.h"
#include "uavobject.h"
#include "configtaskwidget.h"
#include "stabilizationsettings.h"
#include "relaytuningsettings.h"
#include "relaytuning.h"
class SystemIdentState;
class SystemIdentSettings;
#include <QWidget>
#include <QTimer>
class Ui_AutoTuneWidget;
class Ui_AutotuneWidget;
class ConfigAutotuneWidget : public ConfigTaskWidget {
class ConfigAutoTuneWidget : public ConfigTaskWidget {
Q_OBJECT
public:
explicit ConfigAutotuneWidget(QWidget *parent = 0);
private:
Ui_AutotuneWidget *m_autotune;
StabilizationSettings::DataFields stabSettings;
public:
ConfigAutoTuneWidget(QWidget *parent = 0);
~ConfigAutoTuneWidget();
protected:
virtual void refreshWidgetsValuesImpl(UAVObject *obj);
virtual void updateObjectsFromWidgetsImpl();
private slots:
void recomputeStabilization();
void saveStabilization();
private:
Ui_AutoTuneWidget *m_autotune;
SystemIdentState *systemIdentStateObj;
SystemIdentSettings *systemIdentSettingsObj;
};
#endif // CONFIGAUTOTUNE_H

View File

@ -2,7 +2,7 @@
******************************************************************************
*
* @file configgadgetwidget.cpp
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015.
* @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2015-2017.
* E. Lafargue & The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
* @addtogroup GCSPlugins GCS Plugins
* @{
@ -37,6 +37,7 @@
#include "configtxpidwidget.h"
#include "configrevohwwidget.h"
#include "config_cc_hw_widget.h"
#include "configautotunewidget.h"
#include "configoplinkwidget.h"
#include "configrevowidget.h"
#include "configrevonanohwwidget.h"
@ -130,6 +131,12 @@ ConfigGadgetWidget::ConfigGadgetWidget(QWidget *parent) : QWidget(parent)
static_cast<ConfigTaskWidget *>(widget)->bind();
stackWidget->insertTab(ConfigGadgetWidget::TxPid, widget, *icon, QString("TxPID"));
icon = new QIcon();
icon->addFile(":/configgadget/images/autotune_normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/autotune_selected.png", QSize(), QIcon::Selected, QIcon::Off);
widget = new DefaultConfigWidget(this, tr("AutoTune Configuration"));
stackWidget->insertTab(ConfigGadgetWidget::AutoTune, widget, *icon, QString("AutoTune"));
icon = new QIcon();
icon->addFile(":/configgadget/images/pipx-normal.png", QSize(), QIcon::Normal, QIcon::Off);
icon->addFile(":/configgadget/images/pipx-selected.png", QSize(), QIcon::Selected, QIcon::Off);
@ -223,6 +230,9 @@ void ConfigGadgetWidget::onAutopilotConnect()
widget = new ConfigRevoWidget(this);
widget->bind();
stackWidget->replaceTab(ConfigGadgetWidget::Sensors, widget);
widget = new ConfigAutoTuneWidget(this);
widget->bind();
stackWidget->replaceTab(ConfigGadgetWidget::AutoTune, widget);
if (board == 0x0903 || board == 0x0904) {
widget = new ConfigRevoHWWidget(this);
} else if (board == 0x0905) {
@ -236,6 +246,9 @@ void ConfigGadgetWidget::onAutopilotConnect()
widget = new ConfigRevoWidget(this);
widget->bind();
stackWidget->replaceTab(ConfigGadgetWidget::Sensors, widget);
widget = new ConfigAutoTuneWidget(this);
widget->bind();
stackWidget->replaceTab(ConfigGadgetWidget::AutoTune, widget);
widget = new ConfigSparky2HWWidget(this);
widget->bind();
stackWidget->replaceTab(ConfigGadgetWidget::Hardware, widget);
@ -278,6 +291,9 @@ void ConfigGadgetWidget::onAutopilotDisconnect()
widget = new DefaultConfigWidget(this, tr("Hardware"));
stackWidget->replaceTab(ConfigGadgetWidget::Hardware, widget);
widget = new DefaultConfigWidget(this, tr("AutoTune"));
stackWidget->replaceTab(ConfigGadgetWidget::AutoTune, widget);
}
void ConfigGadgetWidget::onOPLinkConnect()

View File

@ -38,7 +38,7 @@ class ConfigGadgetWidget : public QWidget {
Q_OBJECT
public:
enum WidgetTabs { Hardware = 0, Aircraft, Input, Output, Sensors, Stabilization, CameraStabilization, TxPid, OPLink };
enum WidgetTabs { Hardware = 0, Aircraft, Input, Output, Sensors, Stabilization, AutoTune, CameraStabilization, TxPid, OPLink };
ConfigGadgetWidget(QWidget *parent = 0);
~ConfigGadgetWidget();

View File

@ -56,23 +56,19 @@
<field name="YawToRollPitchPIDRatioMax" units="" type="float" elements="1" defaultvalue="2.5" description="Setting: Yaw PID will be at most this times Pitch PID (if enabled)"/>
<field name="DerivativeFactor" units="" type="float" elements="1" defaultvalue="1.0" limits="%BE:0:1" description="Setting: Multiplicative factor. If you have D term oscillations, reduce it toward zero and it will reduce PID D terms."/>
<field name="OuterLoopKpSoftClamp" units="" type="float" elements="1" defaultvalue="6.5" limits="%BE:0:100" description="Setting: Change this to change the outer loop Kp and Ki limiting"/>
<field name="DestinationPidBank" units="bank#" type="uint8" elements="1" defaultvalue="3" limits="%BE:1:3" description="Setting: Which bank the calculated PIDs will be stored in after tuning"/>
<field name="DestinationPidBank" units="bank#" type="enum" elements="1" options="Bank1,Bank2,Bank3" defaultvalue="Bank3" description="Setting: Which bank the calculated PIDs will be stored in after tuning"/>
<field name="TuningDuration" units="s" type="uint8" elements="1" defaultvalue="60" limits="%BI:0" description="Setting: Duration of the tuning motions (expert)"/>
<field name="ThrustControl" units="" type="enum" elements="1" options="Manual,AltitudeVario" defaultvalue="Manual" description="Setting: Manual is direct control, AltitudeVario helps to maintain altitude"/>
<!-- SmoothQuickSource: the smooth vs. quick PID selector -->
<!-- 0 = disabled -->
<!-- 10 thru 13 correspond to accessory0 -> accessory3 transmitter knobs -->
<!-- an accessory knob works as expected, with full left being smoothest and full right being quickest -->
<!-- 23, 25, and 27 are discrete 3, 5, and 7 position rount robin selectors -->
<!-- accessory0 -> accessory3 transmitter knobs works as expected, with full left being smoothest (-1) and full right being quickest (+1) -->
<!-- FMSToggle 3, 5, and 7 positions rount robin selectors -->
<!-- incremented by quickly double toggling the fms 3 times (starting outside autotune mode -->
<!-- with each double toggle going into and back out of autotune) to go to the next position -->
<!-- think of the positions on a scale from 0 to 100, with smoothest being 0 and quickest being 100, and you start out at 50 -->
<!-- 23 (3 stops) means stops at 50, then 100, then 0 then back to 50 -->
<!-- 25 (5 stops) means stops at 50, 75, 100, 0, 25 (repeat as you toggle) -->
<!-- 27 (7 stops) means stops at 50, 67, 83, 100, 0, 17, 33 (repeat as you toggle) -->
<!-- 25 is special in that the 3 middle values (25, 50, 75) are exactly those that are recommended for smooth, normal, and quick responses -->
<field name="SmoothQuickSource" units="" type="uint8" elements="1" defaultvalue="25" description="Setting: 10-13 to use one of accessory0-3, 23 25 27 for FMS 3x toggle method with 3 5 7 positions"/>
<field name="SmoothQuickValue" units="" type="float" elements="1" defaultvalue="0.0" description="Remembers the value of the FMS 3x toggle"/>
<!-- 3 stops means stops at 0, then +1, then -1 then back to 0 -->
<!-- 5 stops means stops at 0, +0.5, +1, -1, -0.5 the 3 middle values (-0.5, 0, +0.5) are exactly those that are recommended for smooth, normal, and quick responses-->
<!-- 7 stops means stops at 0, +0.33, +0.66, +1, -1, -0.66, -0.33 -->
<field name="SmoothQuickSource" units="" type="enum" elements="1" options="Disabled,Accessory0,Accessory1,Accessory2,Accessory3,FMSToggle3pos,FMSToggle5pos,FMSToggle7pos" defaultvalue="FMSToggle5pos" description="Setting: Choose Accessory or FMS 3x toggle method with 3, 5, 7 positions"/>
<field name="SmoothQuickValue" units="" type="float" elements="1" defaultvalue="0.0" description="Remembers the value of the FMS 3x toggle (-1 to +1 range)"/>
<field name="DisableSanityChecks" units="bool" type="enum" elements="1" options="False,True" defaultvalue="False" description="Setting: Debugging tool (expert)"/>
<field name="GyroReadTimeAverage" units="s" type="float" elements="1" defaultvalue="0.001" description="Measured delay from gyro read to inner loop"/>
<field name="Complete" units="bool" type="enum" elements="1" options="False,True" defaultvalue="False" description="Automatically set True for a good complete tune or False for incomplete or bad"/>

View File

@ -12,7 +12,7 @@
<field name="HoverThrottle" units="%/100" type="float" elements="1" defaultvalue="0" description="Measured throttle stick position"/>
<field name="GyroReadTimeAverage" units="s" type="float" elements="1" defaultvalue="0.001" description="Measured delay from gyro read to inner loop"/>
<field name="Complete" units="bool" type="enum" elements="1" options="False,True" defaultvalue="False" description="Automatically set True for a good complete tune or False for incomplete or bad"/>
<access gcs="readwrite" flight="readwrite"/>
<access gcs="readonly" flight="readwrite"/>
<telemetrygcs acked="false" updatemode="manual" period="0"/>
<telemetryflight acked="false" updatemode="periodic" period="1000"/>
<logging updatemode="manual" period="0"/>