Browse Source

pid tuning: add MPC_POS_MODE, MC_AIRMODE and THR_MDL_FAC params

QGC4.4
Beat Küng 4 years ago committed by Lorenz Meier
parent
commit
128f22dd2c
  1. 34
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml
  2. 20
      src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml

34
src/AutoPilotPlugins/PX4/PX4TuningComponentCopterRate.qml

@ -18,7 +18,38 @@ import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
PIDTuning { Column {
width: availableWidth
property Fact _airmode: controller.getParameterFact(-1, "MC_AIRMODE", false)
property Fact _thrustModelFactor: controller.getParameterFact(-1, "THR_MDL_FAC", false)
GridLayout {
columns: 2
QGCLabel {
textFormat: Text.RichText
text: qsTr("Airmode (disable during tuning) <b><a href=\"https://docs.px4.io/master/en/config_mc/pid_tuning_guide_multicopter.html#airmode-mixer-saturation\">?</a></b>:")
onLinkActivated: Qt.openUrlExternally(link)
visible: _airmode
}
FactComboBox {
fact: _airmode
indexModel: false
visible: _airmode
}
QGCLabel {
textFormat: Text.RichText
text: qsTr("Thrust curve <b><a href=\"https://docs.px4.io/master/en/config_mc/pid_tuning_guide_multicopter.html#thrust-curve\">?</a></b>:")
onLinkActivated: Qt.openUrlExternally(link)
visible: _thrustModelFactor
}
FactTextField {
fact: _thrustModelFactor
visible: _thrustModelFactor
}
}
PIDTuning {
width: availableWidth width: availableWidth
property var roll: QtObject { property var roll: QtObject {
@ -119,5 +150,6 @@ PIDTuning {
unit: "deg/s" unit: "deg/s"
axis: [ roll, pitch, yaw ] axis: [ roll, pitch, yaw ]
chartDisplaySec: 3 chartDisplaySec: 3
}
} }

20
src/AutoPilotPlugins/PX4/PX4TuningComponentCopterVelocity.qml

@ -18,9 +18,26 @@ import QGroundControl.FactControls 1.0
import QGroundControl.ScreenTools 1.0 import QGroundControl.ScreenTools 1.0
import QGroundControl.Vehicle 1.0 import QGroundControl.Vehicle 1.0
PIDTuning { Column {
width: availableWidth width: availableWidth
property Fact _mcPosMode: controller.getParameterFact(-1, "MPC_POS_MODE", false)
GridLayout {
columns: 2
QGCLabel {
text: qsTr("Position control mode (set this to 'simple' during tuning):")
visible: _mcPosMode
}
FactComboBox {
fact: _mcPosMode
indexModel: false
visible: _mcPosMode
}
}
PIDTuning {
width: availableWidth
property var horizontal: QtObject { property var horizontal: QtObject {
property string name: qsTr("Horizontal") property string name: qsTr("Horizontal")
property string plotTitle: qsTr("Horizontal (Y direction, sidewards)") property string plotTitle: qsTr("Horizontal (Y direction, sidewards)")
@ -94,6 +111,7 @@ PIDTuning {
tuningMode: Vehicle.ModeVelocityAndPosition tuningMode: Vehicle.ModeVelocityAndPosition
unit: "m/s" unit: "m/s"
axis: [ horizontal, vertical ] axis: [ horizontal, vertical ]
}
} }

Loading…
Cancel
Save