Merged in f5soh/librepilot/LP-514_Dshot_Wizard (pull request #490)
LP-514 Dshot Wizard support and other Esc types Approved-by: Lalanne Laurent <f5soh@free.fr> Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
@ -179,7 +179,9 @@ void ConnectionDiagram::setupGraphicsScene()
|
||||
case VehicleConfigurationSource::CONTROLLER_CC:
|
||||
case VehicleConfigurationSource::CONTROLLER_CC3D:
|
||||
prefix = "cc-";
|
||||
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT ||
|
||||
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT125 ||
|
||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT42 ||
|
||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_MULTISHOT ||
|
||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_SYNCHED) {
|
||||
suffix = "-oneshot";
|
||||
}
|
||||
|
@ -93,8 +93,10 @@ void EscCalibrationPage::resetAllSecurityCheckboxes()
|
||||
|
||||
int EscCalibrationPage::getHighOutputRate()
|
||||
{
|
||||
if (getWizard()->getEscType() == SetupWizard::ESC_ONESHOT) {
|
||||
return HIGH_ONESHOT125_OUTPUT_PULSE_LENGTH_MICROSECONDS;
|
||||
if (getWizard()->getEscType() == SetupWizard::ESC_ONESHOT125 ||
|
||||
getWizard()->getEscType() == SetupWizard::ESC_ONESHOT42 ||
|
||||
getWizard()->getEscType() == SetupWizard::ESC_MULTISHOT) {
|
||||
return HIGH_ONESHOT_MULTISHOT_OUTPUT_PULSE_LENGTH_MICROSECONDS;
|
||||
} else {
|
||||
return HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS;
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ private:
|
||||
// Min value should match min value defined in vehicleconfigurationsource.h
|
||||
static const int LOW_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1000;
|
||||
static const int HIGH_PWM_OUTPUT_PULSE_LENGTH_MICROSECONDS = 1900;
|
||||
static const int HIGH_ONESHOT125_OUTPUT_PULSE_LENGTH_MICROSECONDS = 2000;
|
||||
static const int HIGH_ONESHOT_MULTISHOT_OUTPUT_PULSE_LENGTH_MICROSECONDS = 2000;
|
||||
Ui::EscCalibrationPage *ui;
|
||||
bool m_isCalibrating;
|
||||
OutputCalibrationUtil m_outputUtil;
|
||||
|
@ -47,17 +47,41 @@ void EscPage::initializePage()
|
||||
{
|
||||
bool enabled = isSynchOrOneShotAvailable();
|
||||
|
||||
ui->oneshotESCButton->setEnabled(enabled);
|
||||
if (ui->oneshotESCButton->isChecked() && !enabled) {
|
||||
ui->oneshotESCButton->setChecked(false);
|
||||
ui->oneshot125ESCButton->setEnabled(enabled);
|
||||
ui->oneshot42ESCButton->setEnabled(enabled);
|
||||
ui->multishotESCButton->setEnabled(enabled);
|
||||
|
||||
if ((ui->oneshot125ESCButton->isChecked() ||
|
||||
ui->oneshot42ESCButton->isChecked() ||
|
||||
ui->multishotESCButton->isChecked()) && !enabled) {
|
||||
ui->oneshot125ESCButton->setChecked(false);
|
||||
ui->oneshot42ESCButton->setChecked(false);
|
||||
ui->multishotESCButton->setChecked(false);
|
||||
ui->rapidESCButton->setChecked(true);
|
||||
}
|
||||
|
||||
enabled = isFastDShotAvailable();
|
||||
ui->dshot1200ESCButton->setEnabled(enabled);
|
||||
if (ui->dshot1200ESCButton->isChecked() && !enabled) {
|
||||
ui->dshot1200ESCButton->setChecked(false);
|
||||
ui->dshot600ESCButton->setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
bool EscPage::validatePage()
|
||||
{
|
||||
if (ui->oneshotESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_ONESHOT);
|
||||
if (ui->dshot1200ESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_DSHOT1200);
|
||||
} else if (ui->dshot600ESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_DSHOT600);
|
||||
} else if (ui->dshot150ESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_DSHOT150);
|
||||
} else if (ui->multishotESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_MULTISHOT);
|
||||
} else if (ui->oneshot42ESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_ONESHOT42);
|
||||
} else if (ui->oneshot125ESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_ONESHOT125);
|
||||
} else if (ui->rapidESCButton->isChecked()) {
|
||||
if (isSynchOrOneShotAvailable()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_SYNCHED);
|
||||
@ -65,7 +89,7 @@ bool EscPage::validatePage()
|
||||
getWizard()->setEscType(SetupWizard::ESC_RAPID);
|
||||
}
|
||||
} else if (ui->defaultESCButton->isChecked()) {
|
||||
getWizard()->setEscType(SetupWizard::ESC_STANDARD);
|
||||
getWizard()->setEscType(SetupWizard::ESC_STANDARD300);
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -107,3 +131,22 @@ bool EscPage::isSynchOrOneShotAvailable()
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
bool EscPage::isFastDShotAvailable()
|
||||
{
|
||||
bool available = true;
|
||||
|
||||
switch (getWizard()->getControllerType()) {
|
||||
case SetupWizard::CONTROLLER_CC3D:
|
||||
case SetupWizard::CONTROLLER_SPRACINGF3:
|
||||
case SetupWizard::CONTROLLER_SPRACINGF3EVO:
|
||||
case SetupWizard::CONTROLLER_PIKOBLX:
|
||||
case SetupWizard::CONTROLLER_TINYFISH:
|
||||
available = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return available;
|
||||
}
|
||||
|
@ -46,6 +46,7 @@ public:
|
||||
private:
|
||||
Ui::EscPage *ui;
|
||||
bool isSynchOrOneShotAvailable();
|
||||
bool isFastDShotAvailable();
|
||||
};
|
||||
|
||||
#endif // ESCPAGE_H
|
||||
|
@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>641</width>
|
||||
<height>400</height>
|
||||
<width>699</width>
|
||||
<height>549</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@ -59,7 +59,7 @@ p, li { white-space: pre-wrap; }
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Standard ESC: Slow refresh rate (50Hz), not recommended for Multirotors.</string>
|
||||
<string>Standard ESC: Minimal refresh rate (300Hz), for Multirotors.</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
@ -69,8 +69,8 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-ESC-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-ESC-down.png</normalon>:/setupwizard/resources/bttn-ESC-up.png</iconset>
|
||||
<normaloff>:/setupwizard/resources/bttn-esc300-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-esc300-dwn.png</normalon>:/setupwizard/resources/bttn-esc300-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
@ -139,10 +139,17 @@ p, li { white-space: pre-wrap; }
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="oneshotESCButton">
|
||||
<widget class="QToolButton" name="oneshot125ESCButton">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
@ -150,18 +157,260 @@ p, li { white-space: pre-wrap; }
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>OneShot ESC: BLHeli, Kiss...</string>
|
||||
<string>OneShot125 ESC: BLHeli, Kiss...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OneShot ESC</string>
|
||||
<string>OneShot125 ESC</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-oneshot-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-oneshot-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot-up.png</iconset>
|
||||
<normaloff>:/setupwizard/resources/bttn-oneshot125-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-oneshot125-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot125-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="oneshot42ESCButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>OneShot42 ESC: BLHeli, Kiss...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OneShot42 ESC</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-oneshot42-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-oneshot42-dwn.png</normalon>:/setupwizard/resources/bttn-oneshot42-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="multishotESCButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>MultiShot ESC: BLHeli, Kiss...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>MultiShot ESC</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-multishot-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-multishot-dwn.png</normalon>:/setupwizard/resources/bttn-multishot-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QToolButton" name="dshot150ESCButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>DShot150 ESC: BLHeli_S...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DShot150 ESC</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-dshot150-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-dshot150-dwn.png</normalon>:/setupwizard/resources/bttn-dshot150-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="dshot600ESCButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>DShot600 ESC: BLHeli_S...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DShot600 ESC</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-dshot600-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-dshot600-dwn.png</normalon>:/setupwizard/resources/bttn-dshot600-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>200</width>
|
||||
<height>100</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="autoExclusive">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
</property>
|
||||
<property name="autoRaise">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="dshot1200ESCButton">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>10</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>DShot1200 ESC: BLHeli_S...</string>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">QToolButton { border: none }</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>DShot1200 ESC</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../wizardResources.qrc">
|
||||
<normaloff>:/setupwizard/resources/bttn-dshot1200-up.png</normaloff>
|
||||
<normalon>:/setupwizard/resources/bttn-dshot1200-dwn.png</normalon>:/setupwizard/resources/bttn-dshot1200-up.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
|
@ -82,8 +82,8 @@ void OutputCalibrationPage::setupActuatorMinMaxAndNeutral(int motorChannelStart,
|
||||
for (int servoid = 0; servoid < 12; servoid++) {
|
||||
if (servoid >= motorChannelStart && servoid <= motorChannelEnd) {
|
||||
// Set to motor safe values
|
||||
m_actuatorSettings[servoid].channelMin = LOW_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelNeutral = LOW_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelMin = getLowOutputRate();
|
||||
m_actuatorSettings[servoid].channelNeutral = getLowOutputRate();
|
||||
m_actuatorSettings[servoid].channelMax = getHighOutputRate();
|
||||
m_actuatorSettings[servoid].isReversableMotor = false;
|
||||
// Car, Tank, Boat and Boat differential should use reversable Esc/motors
|
||||
@ -91,25 +91,25 @@ void OutputCalibrationPage::setupActuatorMinMaxAndNeutral(int motorChannelStart,
|
||||
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_DIFFERENTIAL)
|
||||
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_BOAT)
|
||||
|| (getWizard()->getVehicleSubType() == SetupWizard::GROUNDVEHICLE_DIFFERENTIAL_BOAT)) {
|
||||
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MS;
|
||||
m_actuatorSettings[servoid].isReversableMotor = true;
|
||||
// Set initial output value
|
||||
m_calibrationUtil->startChannelOutput(servoid, NEUTRAL_OUTPUT_RATE_MILLISECONDS);
|
||||
m_calibrationUtil->stopChannelOutput();
|
||||
}
|
||||
// Set initial output value
|
||||
m_calibrationUtil->startChannelOutput(servoid, m_actuatorSettings[servoid].channelNeutral);
|
||||
m_calibrationUtil->stopChannelOutput();
|
||||
} else if (servoid < totalUsedChannels) {
|
||||
// Set to servo safe values
|
||||
m_actuatorSettings[servoid].channelMin = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelMax = NEUTRAL_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelMin = NEUTRAL_OUTPUT_RATE_MS;
|
||||
m_actuatorSettings[servoid].channelNeutral = NEUTRAL_OUTPUT_RATE_MS;
|
||||
m_actuatorSettings[servoid].channelMax = NEUTRAL_OUTPUT_RATE_MS;
|
||||
// Set initial servo output value
|
||||
m_calibrationUtil->startChannelOutput(servoid, NEUTRAL_OUTPUT_RATE_MILLISECONDS);
|
||||
m_calibrationUtil->startChannelOutput(servoid, NEUTRAL_OUTPUT_RATE_MS);
|
||||
m_calibrationUtil->stopChannelOutput();
|
||||
} else {
|
||||
// "Disable" these channels
|
||||
m_actuatorSettings[servoid].channelMin = LOW_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelNeutral = LOW_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelMax = LOW_OUTPUT_RATE_MILLISECONDS;
|
||||
m_actuatorSettings[servoid].channelMin = LOW_OUTPUT_RATE_MS;
|
||||
m_actuatorSettings[servoid].channelNeutral = LOW_OUTPUT_RATE_MS;
|
||||
m_actuatorSettings[servoid].channelMax = LOW_OUTPUT_RATE_MS;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -466,11 +466,18 @@ void OutputCalibrationPage::setWizardPage()
|
||||
qDebug() << "Current channel: " << currentChannel + 1;
|
||||
if (currentChannel >= 0) {
|
||||
if (currentPageIndex == 1) {
|
||||
// Set Min, Neutral and Max for slider in all cases, needed for DShot.
|
||||
ui->motorNeutralSlider->setMinimum(m_actuatorSettings[currentChannel].channelMin);
|
||||
ui->motorNeutralSlider->setValue(m_actuatorSettings[currentChannel].channelNeutral);
|
||||
ui->motorPWMValue->setText(QString(tr("Output value : <b>%1</b> µs")).arg(m_actuatorSettings[currentChannel].channelNeutral));
|
||||
ui->motorNeutralSlider->setMaximum(m_actuatorSettings[currentChannel].channelMin + NEUTRAL_OUTPUT_RATE_RANGE);
|
||||
if (ui->motorNeutralSlider->minimum() == LOW_OUTPUT_RATE_DSHOT) {
|
||||
// DShot output
|
||||
ui->motorPWMValue->setText(tr("Digital output value : <b>%1</b>").arg(m_actuatorSettings[currentChannel].channelNeutral));
|
||||
} else {
|
||||
ui->motorPWMValue->setText(tr("Output value : <b>%1</b> µs").arg(m_actuatorSettings[currentChannel].channelNeutral));
|
||||
}
|
||||
// Reversable motor found
|
||||
if (m_actuatorSettings[currentChannel].isReversableMotor) {
|
||||
ui->motorNeutralSlider->setMinimum(m_actuatorSettings[currentChannel].channelMin);
|
||||
ui->motorNeutralSlider->setMaximum(m_actuatorSettings[currentChannel].channelMax);
|
||||
ui->motorInfo->setText(tr("<html><head/><body><p><span style=\" font-size:10pt;\">To find </span><span style=\" font-size:10pt; font-weight:600;\">the neutral rate for this reversable motor</span><span style=\" font-size:10pt;\">, press the Start button below and slide the slider to the right or left until you find the value where the motor doesn't start. <br/><br/>When done press button again to stop.</span></p></body></html>"));
|
||||
}
|
||||
@ -781,10 +788,10 @@ bool OutputCalibrationPage::checkAlarms()
|
||||
|
||||
if (data.Alarm[SystemAlarms::ALARM_ACTUATOR] != SystemAlarms::ALARM_OK) {
|
||||
QMessageBox mbox(this);
|
||||
mbox.setText(QString(tr("The actuator module is in an error state.\n\n"
|
||||
"Please make sure the correct firmware version is used then "
|
||||
"restart the wizard and try again. If the problem persists please "
|
||||
"consult the librepilot.org support forum.")));
|
||||
mbox.setText(tr("The actuator module is in an error state.\n\n"
|
||||
"Please make sure the correct firmware version is used then "
|
||||
"restart the wizard and try again. If the problem persists please "
|
||||
"consult the librepilot.org support forum."));
|
||||
mbox.setStandardButtons(QMessageBox::Ok);
|
||||
mbox.setIcon(QMessageBox::Critical);
|
||||
|
||||
@ -816,20 +823,40 @@ void OutputCalibrationPage::debugLogChannelValues(bool showFirst)
|
||||
qDebug() << "ChannelMax : " << m_actuatorSettings[currentChannel].channelMax;
|
||||
}
|
||||
|
||||
int OutputCalibrationPage::getLowOutputRate()
|
||||
{
|
||||
if (getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT150 ||
|
||||
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT600 ||
|
||||
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT1200) {
|
||||
return LOW_OUTPUT_RATE_DSHOT;
|
||||
}
|
||||
return LOW_OUTPUT_RATE_PWM_MS;
|
||||
}
|
||||
|
||||
int OutputCalibrationPage::getHighOutputRate()
|
||||
{
|
||||
if (getWizard()->getEscType() == SetupWizard::ESC_ONESHOT) {
|
||||
return HIGH_OUTPUT_RATE_MILLISECONDS_ONESHOT125;
|
||||
} else {
|
||||
return HIGH_OUTPUT_RATE_MILLISECONDS_PWM;
|
||||
if (getWizard()->getEscType() == VehicleConfigurationSource::ESC_ONESHOT125 ||
|
||||
getWizard()->getEscType() == VehicleConfigurationSource::ESC_ONESHOT42 ||
|
||||
getWizard()->getEscType() == VehicleConfigurationSource::ESC_MULTISHOT) {
|
||||
return HIGH_OUTPUT_RATE_ONESHOT_MULTISHOT_MS;
|
||||
} else if (getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT150 ||
|
||||
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT600 ||
|
||||
getWizard()->getEscType() == VehicleConfigurationSource::ESC_DSHOT1200) {
|
||||
return HIGH_OUTPUT_RATE_DSHOT;
|
||||
}
|
||||
return HIGH_OUTPUT_RATE_PWM_MS;
|
||||
}
|
||||
|
||||
void OutputCalibrationPage::on_motorNeutralSlider_valueChanged(int value)
|
||||
{
|
||||
Q_UNUSED(value);
|
||||
ui->motorPWMValue->setText(tr("Output value : <b>%1</b> µs").arg(value));
|
||||
|
||||
if (ui->motorNeutralSlider->minimum() == LOW_OUTPUT_RATE_DSHOT) {
|
||||
// DShot output
|
||||
ui->motorPWMValue->setText(tr("Digital output value : <b>%1</b>").arg(value));
|
||||
} else {
|
||||
ui->motorPWMValue->setText(tr("Output value : <b>%1</b> µs").arg(value));
|
||||
}
|
||||
if (ui->motorNeutralButton->isChecked()) {
|
||||
quint16 value = ui->motorNeutralSlider->value();
|
||||
m_calibrationUtil->setChannelOutputValue(value);
|
||||
|
@ -87,10 +87,14 @@ private slots:
|
||||
|
||||
private:
|
||||
enum ElementType { FULL, FRAME, MOTOR, SERVO };
|
||||
static const int LOW_OUTPUT_RATE_MILLISECONDS = 1000;
|
||||
static const int NEUTRAL_OUTPUT_RATE_MILLISECONDS = 1500;
|
||||
static const int HIGH_OUTPUT_RATE_MILLISECONDS_PWM = 1900;
|
||||
static const int HIGH_OUTPUT_RATE_MILLISECONDS_ONESHOT125 = 2000;
|
||||
static const int LOW_OUTPUT_RATE_DSHOT = 0;
|
||||
static const int HIGH_OUTPUT_RATE_DSHOT = 2000;
|
||||
static const int LOW_OUTPUT_RATE_MS = 1000;
|
||||
static const int LOW_OUTPUT_RATE_PWM_MS = 1000;
|
||||
static const int HIGH_OUTPUT_RATE_PWM_MS = 1900;
|
||||
static const int NEUTRAL_OUTPUT_RATE_RANGE = 500;
|
||||
static const int NEUTRAL_OUTPUT_RATE_MS = 1500;
|
||||
static const int HIGH_OUTPUT_RATE_ONESHOT_MULTISHOT_MS = 2000;
|
||||
|
||||
void setupVehicle();
|
||||
void startWizard();
|
||||
@ -112,6 +116,7 @@ private:
|
||||
|
||||
void getCurrentChannels(QList<quint16> &channels);
|
||||
void enableAllMotorsCheckBox(bool enable);
|
||||
int getLowOutputRate();
|
||||
int getHighOutputRate();
|
||||
quint16 getCurrentChannel();
|
||||
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 4.9 KiB |
After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 5.6 KiB After Width: | Height: | Size: 5.6 KiB |
BIN
ground/gcs/src/plugins/setupwizard/resources/bttn-esc300-dwn.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
ground/gcs/src/plugins/setupwizard/resources/bttn-esc300-up.png
Normal file
After Width: | Height: | Size: 5.6 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 6.0 KiB After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 5.6 KiB |
@ -181,7 +181,10 @@ int SetupWizard::nextId() const
|
||||
}
|
||||
|
||||
case PAGE_BIAS_CALIBRATION:
|
||||
if (getVehicleType() == VEHICLE_MULTI) {
|
||||
if ((getVehicleType() == VEHICLE_MULTI) &&
|
||||
(getEscType() != ESC_DSHOT150) &&
|
||||
(getEscType() != ESC_DSHOT600) &&
|
||||
(getEscType() != ESC_DSHOT1200)) {
|
||||
return PAGE_ESC_CALIBRATION;
|
||||
} else {
|
||||
return PAGE_OUTPUT_CALIBRATION;
|
||||
@ -414,14 +417,32 @@ QString SetupWizard::getSummaryText()
|
||||
case ESC_STANDARD:
|
||||
summary.append(tr("Standard ESC (%1 Hz)").arg(VehicleConfigurationHelper::LEGACY_ESC_FREQUENCY));
|
||||
break;
|
||||
case ESC_STANDARD300:
|
||||
summary.append(tr("Standard ESC (%1 Hz)").arg(VehicleConfigurationHelper::LEGACY_MULTI_ESC_FREQUENCY));
|
||||
break;
|
||||
case ESC_RAPID:
|
||||
summary.append(tr("Rapid ESC (%1 Hz)").arg(VehicleConfigurationHelper::RAPID_ESC_FREQUENCY));
|
||||
break;
|
||||
case ESC_SYNCHED:
|
||||
summary.append(tr("Synched ESC"));
|
||||
break;
|
||||
case ESC_ONESHOT:
|
||||
summary.append(tr("Oneshot ESC"));
|
||||
case ESC_ONESHOT125:
|
||||
summary.append(tr("Oneshot125 ESC"));
|
||||
break;
|
||||
case ESC_ONESHOT42:
|
||||
summary.append(tr("Oneshot42 ESC"));
|
||||
break;
|
||||
case ESC_MULTISHOT:
|
||||
summary.append(tr("Multishot ESC"));
|
||||
break;
|
||||
case ESC_DSHOT150:
|
||||
summary.append(tr("Dshot150 ESC"));
|
||||
break;
|
||||
case ESC_DSHOT600:
|
||||
summary.append(tr("Dshot600 ESC"));
|
||||
break;
|
||||
case ESC_DSHOT1200:
|
||||
summary.append(tr("Dshot1200 ESC"));
|
||||
break;
|
||||
default:
|
||||
summary.append(tr("Unknown"));
|
||||
|
@ -157,7 +157,9 @@ void VehicleConfigurationHelper::applyHardwareConfiguration()
|
||||
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PWMNOONESHOT;
|
||||
break;
|
||||
case VehicleConfigurationSource::INPUT_PPM:
|
||||
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT ||
|
||||
if (m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT125 ||
|
||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_ONESHOT42 ||
|
||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_MULTISHOT ||
|
||||
m_configSource->getEscType() == VehicleConfigurationSource::ESC_SYNCHED) {
|
||||
data.CC_RcvrPort = HwSettings::CC_RCVRPORT_PPM_PIN8ONESHOT;
|
||||
} else {
|
||||
@ -515,6 +517,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
ActuatorSettings *actSettings = ActuatorSettings::GetInstance(m_uavoManager);
|
||||
|
||||
qint16 escFrequence = LEGACY_ESC_FREQUENCY;
|
||||
qint16 escDShotMode = LEGACY_DSHOT_MODE;
|
||||
ActuatorSettings::BankModeOptions bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||
|
||||
switch (m_configSource->getEscType()) {
|
||||
@ -522,6 +525,10 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
escFrequence = LEGACY_ESC_FREQUENCY;
|
||||
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_STANDARD300:
|
||||
escFrequence = LEGACY_MULTI_ESC_FREQUENCY;
|
||||
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_RAPID:
|
||||
bankMode = ActuatorSettings::BANKMODE_PWM;
|
||||
escFrequence = RAPID_ESC_FREQUENCY;
|
||||
@ -530,9 +537,32 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
bankMode = ActuatorSettings::BANKMODE_PWMSYNC;
|
||||
escFrequence = PWMSYNC_ESC_FREQUENCY;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_ONESHOT:
|
||||
case VehicleConfigurationSource::ESC_ONESHOT125:
|
||||
bankMode = ActuatorSettings::BANKMODE_ONESHOT125;
|
||||
escFrequence = ONESHOT_ESC_FREQUENCY;
|
||||
escFrequence = ESC_FREQUENCY_ZERO;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_ONESHOT42:
|
||||
bankMode = ActuatorSettings::BANKMODE_ONESHOT42;
|
||||
escFrequence = ESC_FREQUENCY_ZERO;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_MULTISHOT:
|
||||
bankMode = ActuatorSettings::BANKMODE_MULTISHOT;
|
||||
escFrequence = ESC_FREQUENCY_ZERO;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_DSHOT150:
|
||||
bankMode = ActuatorSettings::BANKMODE_DSHOT;
|
||||
escFrequence = ESC_FREQUENCY_ZERO;
|
||||
escDShotMode = DSHOT_MODE_150;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_DSHOT600:
|
||||
bankMode = ActuatorSettings::BANKMODE_DSHOT;
|
||||
escFrequence = ESC_FREQUENCY_ZERO;
|
||||
// escDShotFrequence = LEGACY_DSHOT_ESC_FREQUENCY;
|
||||
break;
|
||||
case VehicleConfigurationSource::ESC_DSHOT1200:
|
||||
bankMode = ActuatorSettings::BANKMODE_DSHOT;
|
||||
escFrequence = ESC_FREQUENCY_ZERO;
|
||||
escDShotMode = DSHOT_MODE_1200;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -574,6 +604,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
switch (m_configSource->getVehicleSubType()) {
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_TRI_Y:
|
||||
// Servo always on channel 4
|
||||
data.DShotMode = escDShotMode;
|
||||
data.BankUpdateFreq[0] = escFrequence;
|
||||
data.BankMode[0] = bankMode;
|
||||
if (m_configSource->getControllerType() == VehicleConfigurationSource::CONTROLLER_REVO
|
||||
@ -591,6 +622,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
break;
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_X:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_QUAD_PLUS:
|
||||
data.DShotMode = escDShotMode;
|
||||
data.BankUpdateFreq[0] = escFrequence;
|
||||
data.BankMode[0] = bankMode;
|
||||
data.BankUpdateFreq[1] = escFrequence;
|
||||
@ -617,6 +649,7 @@ void VehicleConfigurationHelper::applyActuatorConfiguration()
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_X:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_COAX_PLUS:
|
||||
case VehicleConfigurationSource::MULTI_ROTOR_OCTO_V:
|
||||
data.DShotMode = escDShotMode;
|
||||
data.BankUpdateFreq[0] = escFrequence;
|
||||
data.BankMode[0] = bankMode;
|
||||
data.BankUpdateFreq[1] = escFrequence;
|
||||
|
@ -61,15 +61,19 @@ public:
|
||||
VehicleConfigurationHelper(VehicleConfigurationSource *configSource);
|
||||
bool setupVehicle(bool save = true);
|
||||
bool setupHardwareSettings(bool save = true);
|
||||
static const qint16 LEGACY_ESC_FREQUENCY = 50;
|
||||
static const qint16 RAPID_ESC_FREQUENCY = 490;
|
||||
static const qint16 PWMSYNC_ESC_FREQUENCY = 0;
|
||||
static const qint16 ONESHOT_ESC_FREQUENCY = 0;
|
||||
static const qint16 ANALOG_SERVO_FREQUENCY = 50;
|
||||
static const qint16 DIGITAL_SERVO_FREQUENCY = 333;
|
||||
static const qint16 LEGACY_ESC_FREQUENCY = 50;
|
||||
static const qint16 LEGACY_MULTI_ESC_FREQUENCY = 300;
|
||||
static const qint16 RAPID_ESC_FREQUENCY = 490;
|
||||
static const qint16 PWMSYNC_ESC_FREQUENCY = 0;
|
||||
static const qint16 ESC_FREQUENCY_ZERO = 0;
|
||||
static const qint16 DSHOT_MODE_150 = 150;
|
||||
static const qint16 LEGACY_DSHOT_MODE = 600;
|
||||
static const qint16 DSHOT_MODE_1200 = 1200;
|
||||
static const qint16 ANALOG_SERVO_FREQUENCY = 50;
|
||||
static const qint16 DIGITAL_SERVO_FREQUENCY = 333;
|
||||
static const int MIXER_TYPE_NONE = 0;
|
||||
static const int MIXER_TYPE_MOTOR = 1;
|
||||
static const int MIXER_TYPE_REVERSABLEMOTOR = 2;
|
||||
static const int MIXER_TYPE_REVERSABLEMOTOR = 2;
|
||||
static const int MIXER_TYPE_SERVO = 3;
|
||||
|
||||
|
||||
|
@ -65,7 +65,7 @@ public:
|
||||
MULTI_ROTOR_OCTO_X, MULTI_ROTOR_OCTO_V, MULTI_ROTOR_OCTO_COAX_X, MULTI_ROTOR_OCTO_COAX_PLUS,
|
||||
FIXED_WING_DUAL_AILERON, FIXED_WING_AILERON, FIXED_WING_ELEVON, FIXED_WING_VTAIL, HELI_CCPM,
|
||||
GROUNDVEHICLE_MOTORCYCLE, GROUNDVEHICLE_CAR, GROUNDVEHICLE_DIFFERENTIAL, GROUNDVEHICLE_BOAT, GROUNDVEHICLE_DIFFERENTIAL_BOAT };
|
||||
enum ESC_TYPE { ESC_ONESHOT, ESC_SYNCHED, ESC_RAPID, ESC_STANDARD, ESC_UNKNOWN };
|
||||
enum ESC_TYPE { ESC_DSHOT1200, ESC_DSHOT600, ESC_DSHOT150, ESC_MULTISHOT, ESC_ONESHOT42, ESC_ONESHOT125, ESC_SYNCHED, ESC_RAPID, ESC_STANDARD300, ESC_STANDARD, ESC_UNKNOWN };
|
||||
enum SERVO_TYPE { SERVO_ANALOG, SERVO_DIGITAL, SERVO_UNKNOWN };
|
||||
enum INPUT_TYPE { INPUT_PWM, INPUT_PPM, INPUT_SBUS, INPUT_DSM, INPUT_SRXL, INPUT_HOTT_SUMD, INPUT_EXBUS, INPUT_IBUS, INPUT_UNKNOWN };
|
||||
enum AIRSPEED_TYPE { AIRSPEED_ESTIMATE, AIRSPEED_EAGLETREE, AIRSPEED_MS4525, AIRSPEED_DISABLED };
|
||||
|
@ -12,8 +12,8 @@
|
||||
<file>resources/bttn-plane-down.png</file>
|
||||
<file>resources/bttn-plane-over.png</file>
|
||||
<file>resources/bttn-plane-up.png</file>
|
||||
<file>resources/bttn-ESC-down.png</file>
|
||||
<file>resources/bttn-ESC-up.png</file>
|
||||
<file>resources/bttn-esc-down.png</file>
|
||||
<file>resources/bttn-esc-up.png</file>
|
||||
<file>resources/bttn-ppm-down.png</file>
|
||||
<file>resources/bttn-ppm-up.png</file>
|
||||
<file>resources/bttn-pwm-down.png</file>
|
||||
@ -52,8 +52,22 @@
|
||||
<file>resources/bttn-upgrade-up.png</file>
|
||||
<file>resources/not-connected.png</file>
|
||||
<file>resources/connected.png</file>
|
||||
<file>resources/bttn-esc300-dwn.png</file>
|
||||
<file>resources/bttn-esc300-up.png</file>
|
||||
<file>resources/bttn-oneshot-dwn.png</file>
|
||||
<file>resources/bttn-oneshot-up.png</file>
|
||||
<file>resources/bttn-oneshot125-dwn.png</file>
|
||||
<file>resources/bttn-oneshot125-up.png</file>
|
||||
<file>resources/bttn-oneshot42-dwn.png</file>
|
||||
<file>resources/bttn-oneshot42-up.png</file>
|
||||
<file>resources/bttn-multishot-dwn.png</file>
|
||||
<file>resources/bttn-multishot-up.png</file>
|
||||
<file>resources/bttn-dshot150-dwn.png</file>
|
||||
<file>resources/bttn-dshot150-up.png</file>
|
||||
<file>resources/bttn-dshot600-dwn.png</file>
|
||||
<file>resources/bttn-dshot600-up.png</file>
|
||||
<file>resources/bttn-dshot1200-dwn.png</file>
|
||||
<file>resources/bttn-dshot1200-up.png</file>
|
||||
<file>resources/bttn-srxl-down.png</file>
|
||||
<file>resources/bttn-srxl-up.png</file>
|
||||
<file>resources/bttn-hott-down.png</file>
|
||||
|