diff --git a/docs/assets/setup/Motors.png b/docs/assets/setup/Motors.png index bb523741b13..68e0b321727 100644 Binary files a/docs/assets/setup/Motors.png and b/docs/assets/setup/Motors.png differ diff --git a/docs/en/qgc-user-guide/setup_view/motors.md b/docs/en/qgc-user-guide/setup_view/motors.md index f04acd81dfd..01b69188c85 100644 --- a/docs/en/qgc-user-guide/setup_view/motors.md +++ b/docs/en/qgc-user-guide/setup_view/motors.md @@ -19,14 +19,21 @@ To test the motors: You must remove props before activating the motors! ::: -1. (_PX4-only_) Enable safety switch - if used. -1. Slide the switch to enable motor sliders (labeled: _Propellers are removed - Enable motor sliders_). -1. Adjust the individual sliders to spin the motors and confirm they spin in the correct direction. +2. (_PX4-only_) Enable safety switch - if used. + +3. Slide the switch to enable motor slider and buttons (labeled: _Propellers are removed - Enable slider and motors_). + +4. Adjust the slider to select the power for the motors. + +5. Press the button corresponding to the motor and confirm it spin in the correct direction. ::: info - The motors only spin after you release the slider and will automatically stop spinning after 3 seconds. + The motors will automatically stop spinning after 3 seconds. + You can also stop the motor by pressing the 'Stop' button. + If no motors turn, raise the “Throttle %” and try again. ::: ## Additional Information - [Basic Configuration > Motor Setup](http://docs.px4.io/master/en/config/motors.html) (_PX4 User Guide_) - This contains additional PX4-specific information. +- [ESCS and Motors](https://ardupilot.org/copter/docs/connect-escs-and-motors.html#motor-order-diagrams) - This is the Motor order diagrams for all frames diff --git a/src/AutoPilotPlugins/APM/APMMotorComponent.qml b/src/AutoPilotPlugins/APM/APMMotorComponent.qml index d9325bccbaf..507672921bb 100644 --- a/src/AutoPilotPlugins/APM/APMMotorComponent.qml +++ b/src/AutoPilotPlugins/APM/APMMotorComponent.qml @@ -22,7 +22,7 @@ SetupPage { readonly property int _barHeight: 10 readonly property int _barWidth: 5 - readonly property int _sliderHeight: 10 + readonly property int _sliderWidth: 15 readonly property int _motorTimeoutSecs: 3 FactPanelController { @@ -42,86 +42,69 @@ SetupPage { } Row { - id: motorSliders + id: motorSlider enabled: safetySwitch.checked spacing: ScreenTools.defaultFontPixelWidth * 4 + + ValueSlider { + id: sliderThrottle + width: motorButtons.width + label: qsTr("Throttle") + from: 0 + to: 100 + majorTickStepSize: 5 + decimalPlaces: 0 + unitsString: qsTr("%") + } + } // Row - Repeater { - id: sliderRepeater - model: controller.vehicle.motorCount == -1 ? 8 : controller.vehicle.motorCount - - Column { - property alias motorSlider: slider + QGCLabel { + anchors.left: parent.left + anchors.right: parent.right + wrapMode: Text.WordWrap + text: qsTr("Make sure you remove all props.") + } - QGCLabel { - anchors.horizontalCenter: parent.horizontalCenter - text: vehicleComponent.motorIndexToLetter(index) - } + Row { + id: motorButtons + enabled: safetySwitch.checked + spacing: ScreenTools.defaultFontPixelWidth * 4 - QGCSlider { - id: slider - height: ScreenTools.defaultFontPixelHeight * _sliderHeight - orientation: Qt.Vertical - from: 0 - to: 100 - stepSize: 1 - value: 0 - live: false - - onValueChanged: { - controller.vehicle.motorTest(index + 1, value, value == 0 ? 0 : _motorTimeoutSecs, true) - if (value != 0) { - motorTimer.restart() - } - } - - Timer { - id: motorTimer - interval: _motorTimeoutSecs * 1000 - repeat: false - running: false - - onTriggered: { - allSlider.value = 0 - slider.value = 0 - } - } + Repeater { + id: buttonRepeater + model: controller.vehicle.motorCount === -1 ? 8 : controller.vehicle.motorCount + + QGCButton { + id: button + anchors.verticalCenter: parent.verticalCenter + text: vehicleComponent.motorIndexToLetter(index) + onClicked: { + controller.vehicle.motorTest(index + 1, sliderThrottle.value, sliderThrottle.value === 0 ? 0 : _motorTimeoutSecs, true) } - } // Column + } } // Repeater - Column { - QGCLabel { - anchors.horizontalCenter: parent.horizontalCenter - text: qsTr("All") + QGCButton { + id: allButton + text: qsTr("All") + onClicked: { + for (var motorIndex=0; motorIndex