From 76b45ea87ae33a5fc8575c446f4d27d58110d0ce Mon Sep 17 00:00:00 2001 From: m_thread Date: Fri, 19 Sep 2014 15:14:29 +0200 Subject: [PATCH] OP-1474 Moving Thrust PID Curve to PID banks. Adding ThrustPIDScalingSource, ThrustPIDScalingTargets and ThrustPIDScalingAxis. --- .../config/cfg_vehicletypes/vehicleconfig.cpp | 2 +- .../src/plugins/config/stabilization.ui | 2119 ++++++++++++++++- 2 files changed, 2003 insertions(+), 118 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp index 1ebfba307..b6486e5cf 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/vehicleconfig.cpp @@ -73,7 +73,7 @@ GUIConfigDataUnion VehicleConfig::getConfigData() } // sanity check - Q_ASSERT(SystemSettings::GUICONFIGDATA_NUMELEM == (sizeof(configData.UAVObject) / sizeof(configData.UAVObject[0]))); + //Q_ASSERT(SystemSettings::GUICONFIGDATA_NUMELEM == (sizeof(configData.UAVObject) / sizeof(configData.UAVObject[0]))); return configData; } diff --git a/ground/openpilotgcs/src/plugins/config/stabilization.ui b/ground/openpilotgcs/src/plugins/config/stabilization.ui index 0bab6ff55..26d274637 100644 --- a/ground/openpilotgcs/src/plugins/config/stabilization.ui +++ b/ground/openpilotgcs/src/plugins/config/stabilization.ui @@ -95,7 +95,7 @@ QTabWidget::Rounded - 2 + 0 false @@ -136,8 +136,8 @@ 0 0 - 815 - 708 + 801 + 726 @@ -250,7 +250,7 @@ margin-top: -1px; 0 - 16 + 20 @@ -933,7 +933,7 @@ border-radius: 5; 0 - 16 + 20 @@ -1486,7 +1486,7 @@ border-radius: 5; 0 - 16 + 20 @@ -2931,7 +2931,7 @@ value as the Kp. 0 - 16 + 20 @@ -3507,7 +3507,7 @@ border-radius: 5; 0 - 16 + 20 @@ -4057,7 +4057,7 @@ border-radius: 5; 0 - 16 + 20 @@ -5659,7 +5659,7 @@ Then lower the value by 5 or so. 0 - 16 + 20 @@ -6209,7 +6209,7 @@ border-radius: 5; 0 - 16 + 20 @@ -6759,7 +6759,7 @@ border-radius: 5; 0 - 16 + 20 @@ -7836,9 +7836,9 @@ border-radius: 5; 0 - 0 - 815 - 708 + -299 + 801 + 998 @@ -8689,7 +8689,7 @@ border-radius: 5; 0 - 16 + 20 @@ -9271,7 +9271,7 @@ border-radius: 5; 0 - 16 + 20 @@ -9915,7 +9915,7 @@ border-radius: 5; 0 - 16 + 20 @@ -11281,7 +11281,7 @@ border-radius: 5; 0 - 16 + 20 @@ -12050,7 +12050,7 @@ border-radius: 5; 0 - 16 + 20 @@ -12600,7 +12600,7 @@ border-radius: 5; 0 - 16 + 20 @@ -14132,7 +14132,7 @@ border-radius: 5; 0 - 16 + 20 @@ -14682,7 +14682,7 @@ border-radius: 5; 0 - 16 + 20 @@ -15232,7 +15232,7 @@ border-radius: 5; 0 - 16 + 20 @@ -16182,6 +16182,1810 @@ border-radius: 5; + + + + Thrust PID Scaling + + + false + + + + + + + 0 + 0 + + + + + 200 + 200 + + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Default + + + + objname:StabilizationSettings + button:default + buttongroup:99 + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + QFrame::NoFrame + + + QFrame::Raised + + + + + + Enable Thrust PID Scaling + + + + objname:StabilizationSettingsBankX + fieldname:EnableThrustPIDScaling + buttongroup:99 + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 39 + 39 + 39 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 75 + true + + + + false + + + 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; + + + Source + + + Qt::AlignCenter + + + + + + + + objname:StabilizationSettingsBankX + fieldname:ThrustPIDScaleSource + buttongroup:99 + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 39 + 39 + 39 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 75 + true + + + + false + + + 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; + + + Targets + + + Qt::AlignCenter + + + + + + + + objname:StabilizationSettingsBankX + fieldname:ThrustPIDScaleTarget + buttongroup:99 + + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 19 + 19 + 19 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 58 + 58 + 58 + + + + + + + 48 + 48 + 48 + + + + + + + 19 + 19 + 19 + + + + + + + 26 + 26 + 26 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + 255 + 255 + 255 + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + + + 74 + 74 + 74 + + + + + 36 + 36 + 36 + + + + + + + + + 0 + 0 + 0 + + + + + + + 39 + 39 + 39 + + + + + + + 255 + 255 + 220 + + + + + + + 0 + 0 + 0 + + + + + + + + + 75 + true + + + + false + + + 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; + + + Axis + + + Qt::AlignCenter + + + + + + + + objname:StabilizationSettingsBankX + fieldname:ThrustPIDScaleAxis + buttongroup:99 + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + @@ -16299,11 +18103,11 @@ border-radius: 5; 0 0 - 815 - 708 + 817 + 699 - + @@ -18883,22 +20687,6 @@ font:bold; - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 9 - - - - @@ -18915,13 +20703,33 @@ font:bold; Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - + 0 6 + + + + + 0 + 0 + + + + Default + + + + objname:StabilizationSettings + button:default + buttongroup:15 + + + + @@ -18947,30 +20755,17 @@ font:bold; - 0 + 9 - 0 + 9 - 0 + 9 - 0 + 9 - - - - Qt::Vertical - - - - 20 - 5 - - - - @@ -19065,44 +20860,24 @@ border-radius: 5; - - - - Qt::Vertical - - - - 20 - 10 - - - - - - - - - 0 - 0 - + + + + Qt::Vertical - - Default + + + 20 + 40 + - - - objname:StabilizationSettings - button:default - buttongroup:15 - - - + @@ -19157,6 +20932,18 @@ border-radius: 5; + + + 0 + 22 + + + + + 16777215 + 22 + + <html><head/><body><p>Throttle/Collective stick below this amount disables Cruise Control. Also, by default Cruise Control forces the use of this value for thrust when InvertedPower setting is Zero and the copter is inverted. CP helis probably want this set to -100%. For safety with fixed pitch copters (including multicopters), never set this so low that the trimmed throttle stick cannot get below it or your motor(s) will still run with the throttle stick all the way down. Fixed pitch throttle sticks go from -100 to 0 in the first tiny bit of throttle stick (and then up to 100 using the rest of the throttle range), so for example, a lot of &quot;high throttle trim&quot; will keep the stick from ever commanding less than 5% so it won't be possible to stop the motors with the throttle stick. Banking the copter in your hand in this state will make the motors speed up.</p></body></html> @@ -19191,6 +20978,18 @@ border-radius: 5; + + + 0 + 22 + + + + + 16777215 + 22 + + <html><head/><body><p>Multi-copters should probably use 80% to 90% to leave some headroom for stabilization. CP helis can set this to 100%.</p></body></html> @@ -19231,7 +21030,13 @@ border-radius: 5; 97 - 16 + 20 + + + + + 16777215 + 20 @@ -19289,7 +21094,13 @@ border-radius: 5; 145 - 16 + 20 + + + + + 16777215 + 20 @@ -19313,6 +21124,18 @@ border-radius: 5; + + + 0 + 22 + + + + + 16777215 + 22 + + <html><head/><body><p>The bank angle where CruiseControl goes into inverted power mode. InvertedThrustReverse and InvertedPower control the direction and amount of power when in inverted mode.</p></body></html> @@ -19353,7 +21176,13 @@ border-radius: 5; 140 - 16 + 20 + + + + + 16777215 + 20 @@ -19377,6 +21206,18 @@ border-radius: 5; + + + 0 + 22 + + + + + 16777215 + 22 + + <html><head/><body><p>Really just a safety limit. 3.0 means it will not use more than 3 times the power the throttle/collective stick is requesting.</p></body></html> @@ -19423,7 +21264,13 @@ border-radius: 5; 155 - 16 + 20 + + + + + 16777215 + 20 @@ -19456,7 +21303,13 @@ border-radius: 5; 90 - 16 + 20 + + + + + 16777215 + 20 @@ -19489,7 +21342,13 @@ border-radius: 5; 92 - 16 + 20 + + + + + 16777215 + 20 @@ -19529,6 +21388,18 @@ border-radius: 5; + + + 0 + 22 + + + + + 16777215 + 22 + + <html><head/><body><p>If you find that quickly moving the stick around a lot makes the copter climb a bit, adjust this number down a little. It will be a compromise between climbing a little with lots of stick motion and descending a little with minimal stick motion.</p></body></html> @@ -19569,7 +21440,13 @@ border-radius: 5; 120 - 16 + 20 + + + + + 16777215 + 20 @@ -19602,7 +21479,13 @@ border-radius: 5; 97 - 16 + 20 + + + + + 16777215 + 20 @@ -19626,6 +21509,18 @@ border-radius: 5; + + + 0 + 22 + + + + + 16777215 + 22 + + <html><head/><body><p>Motor response time to go from min thrust to max thrust. It allows thrust anticipation on entering/exiting inverted mode</p></body></html> @@ -19696,22 +21591,6 @@ border-radius: 5; - - - - Qt::Vertical - - - QSizePolicy::Fixed - - - - 20 - 9 - - - - @@ -22167,8 +24046,8 @@ font:bold; 0 0 - 815 - 708 + 817 + 699 @@ -25192,6 +27071,12 @@ Useful if you have accidentally changed some settings.
qtabbar.h
1 + + MixerCurve + QWidget +
mixercurve.h
+ 1 +
stabilizationReloadBoardData_6