Commit 8f0e0a2a authored by DonLakeFlyer's avatar DonLakeFlyer

Generic PID tuning support

parent 65ebabe4
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
<file alias="QGroundControl/Controls/PageView.qml">src/QmlControls/PageView.qml</file> <file alias="QGroundControl/Controls/PageView.qml">src/QmlControls/PageView.qml</file>
<file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file> <file alias="QGroundControl/Controls/ParameterEditor.qml">src/QmlControls/ParameterEditor.qml</file>
<file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file> <file alias="QGroundControl/Controls/ParameterEditorDialog.qml">src/QmlControls/ParameterEditorDialog.qml</file>
<file alias="QGroundControl/Controls/PIDTuning.qml">src/QmlControls/PIDTuning.qml</file>
<file alias="QGroundControl/Controls/PlanToolBar.qml">src/PlanView/PlanToolBar.qml</file> <file alias="QGroundControl/Controls/PlanToolBar.qml">src/PlanView/PlanToolBar.qml</file>
<file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file> <file alias="QGroundControl/Controls/QGCButton.qml">src/QmlControls/QGCButton.qml</file>
<file alias="QGroundControl/Controls/QGCCheckListItem.qml">src/QmlControls/QGCCheckListItem.qml</file> <file alias="QGroundControl/Controls/QGCCheckListItem.qml">src/QmlControls/QGCCheckListItem.qml</file>
......
...@@ -7,11 +7,16 @@ ...@@ -7,11 +7,16 @@
* *
****************************************************************************/ ****************************************************************************/
import QtQuick 2.3
import QtQuick.Controls 1.2
import QtCharts 2.2
import QtQuick.Layouts 1.2
import QtQuick 2.3 import QGroundControl 1.0
import QtQuick.Controls 1.2 import QGroundControl.Controls 1.0
import QGroundControl.FactSystem 1.0
import QGroundControl.Controls 1.0 import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0
SetupPage { SetupPage {
id: tuningPage id: tuningPage
...@@ -20,47 +25,64 @@ SetupPage { ...@@ -20,47 +25,64 @@ SetupPage {
Component { Component {
id: pageComponent id: pageComponent
FactSliderPanel { Column {
width: availableWidth width: availableWidth
qgcViewPanel: tuningPage.viewPanel
sliderModel: ListModel { Component.onCompleted: {
ListElement { showAdvanced = !ScreenTools.isMobile
title: qsTr("Roll sensitivity") }
description: qsTr("Slide to the left to make roll control faster and more accurate. Slide to the right if roll oscillates or is too twitchy.")
param: "FW_R_TC"
min: 0.2
max: 0.8
step: 0.01
}
ListElement { FactPanelController {
title: qsTr("Pitch sensitivity") id: controller
description: qsTr("Slide to the left to make pitch control faster and more accurate. Slide to the right if pitch oscillates or is too twitchy.") factPanel: tuningPage.viewPanel
param: "FW_P_TC" }
min: 0.2
max: 0.8
step: 0.01
}
ListElement { // Standard tuning page
title: qsTr("Cruise throttle") FactSliderPanel {
description: qsTr("This is the throttle setting required to achieve the desired cruise speed. Most planes need 50-60%.") width: availableWidth
param: "FW_THR_CRUISE" qgcViewPanel: tuningPage.viewPanel
min: 20 visible: !advanced
max: 80
step: 1
}
ListElement { sliderModel: ListModel {
title: qsTr("Mission mode sensitivity") ListElement {
description: qsTr("Slide to the left to make position control more accurate and more aggressive. Slide to the right to make flight in mission mode smoother and less twitchy.") title: qsTr("Cruise throttle")
param: "FW_L1_PERIOD" description: qsTr("This is the throttle setting required to achieve the desired cruise speed. Most planes need 50-60%.")
min: 12 param: "FW_THR_CRUISE"
max: 50 min: 20
step: 0.5 max: 80
step: 1
}
} }
} }
}
}
} Loader {
anchors.left: parent.left
anchors.right: parent.right
sourceComponent: advanced ? advancePageComponent : undefined
}
Component {
id: advancePageComponent
PIDTuning {
anchors.left: parent.left
anchors.right: parent.right
tuneList: [ qsTr("Roll"), qsTr("Pitch"), qsTr("Yaw") ]
params: [
[ controller.getParameterFact(-1, "FW_RR_P"),
controller.getParameterFact(-1, "FW_RR_I"),
controller.getParameterFact(-1, "FW_RR_FF"),
controller.getParameterFact(-1, "FW_R_TC"),],
[ controller.getParameterFact(-1, "FW_PR_P"),
controller.getParameterFact(-1, "FW_PR_I"),
controller.getParameterFact(-1, "FW_PR_FF"),
controller.getParameterFact(-1, "FW_P_TC") ],
[ controller.getParameterFact(-1, "FW_YR_P"),
controller.getParameterFact(-1, "FW_YR_I"),
controller.getParameterFact(-1, "FW_YR_FF") ] ]
}
} // Component - Advanced Page
} // Column
} // Component - pageComponent
} // SetupPage
This diff is collapsed.
...@@ -32,6 +32,7 @@ OfflineMapButton 1.0 OfflineMapButton.qml ...@@ -32,6 +32,7 @@ OfflineMapButton 1.0 OfflineMapButton.qml
PageView 1.0 PageView.qml PageView 1.0 PageView.qml
ParameterEditor 1.0 ParameterEditor.qml ParameterEditor 1.0 ParameterEditor.qml
ParameterEditorDialog 1.0 ParameterEditorDialog.qml ParameterEditorDialog 1.0 ParameterEditorDialog.qml
PIDTuning 1.0 PIDTuning.qml
PlanToolBar 1.0 PlanToolBar.qml PlanToolBar 1.0 PlanToolBar.qml
QGCButton 1.0 QGCButton.qml QGCButton 1.0 QGCButton.qml
QGCCheckListItem 1.0 QGCCheckListItem.qml QGCCheckListItem 1.0 QGCCheckListItem.qml
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment