mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-12-01 09:24:10 +01:00
Merged in alessiomorale/librepilot/amorale/LP-124_rename_txpid_easytune_options (pull request #65)
Amorale/lp 124_rename_txpid_easytune_options
This commit is contained in:
commit
e068c0026a
@ -256,17 +256,17 @@ static void updatePIDs(UAVObjEvent *ev)
|
||||
case TXPIDSETTINGS_PIDS_ROLLRATEKP:
|
||||
needsUpdateBank |= update(&bank.RollRatePID.Kp, value);
|
||||
break;
|
||||
case TXPIDSETTINGS_PIDS_ROLLRATEPID:
|
||||
case TXPIDSETTINGS_PIDS_EASYTUNERATEROLL:
|
||||
easyTuneEnabled = true;
|
||||
needsUpdateBank |= update(&bank.RollRatePID.Kp, value);
|
||||
needsUpdateBank |= update(&bank.RollRatePID.Ki, value * inst.PitchRollRateFactors.I);
|
||||
needsUpdateBank |= update(&bank.RollRatePID.Kd, value * inst.PitchRollRateFactors.D);
|
||||
needsUpdateBank |= update(&bank.RollRatePID.Ki, value * inst.EasyTunePitchRollRateFactors.I);
|
||||
needsUpdateBank |= update(&bank.RollRatePID.Kd, value * inst.EasyTunePitchRollRateFactors.D);
|
||||
break;
|
||||
case TXPIDSETTINGS_PIDS_PITCHRATEPID:
|
||||
case TXPIDSETTINGS_PIDS_EASYTUNERATEPITCH:
|
||||
easyTuneEnabled = true;
|
||||
needsUpdateBank |= update(&bank.PitchRatePID.Kp, value);
|
||||
needsUpdateBank |= update(&bank.PitchRatePID.Ki, value * inst.PitchRollRateFactors.I);
|
||||
needsUpdateBank |= update(&bank.PitchRatePID.Kd, value * inst.PitchRollRateFactors.D);
|
||||
needsUpdateBank |= update(&bank.PitchRatePID.Ki, value * inst.EasyTunePitchRollRateFactors.I);
|
||||
needsUpdateBank |= update(&bank.PitchRatePID.Kd, value * inst.EasyTunePitchRollRateFactors.D);
|
||||
break;
|
||||
case TXPIDSETTINGS_PIDS_ROLLRATEKI:
|
||||
needsUpdateBank |= update(&bank.RollRatePID.Ki, value);
|
||||
@ -451,11 +451,11 @@ static void updatePIDs(UAVObjEvent *ev)
|
||||
AltitudeHoldSettingsSet(&altitude);
|
||||
}
|
||||
#endif
|
||||
if (easyTuneEnabled && (inst.RatePIDRecalculateYaw != TXPIDSETTINGS_RATEPIDRECALCULATEYAW_FALSE)) {
|
||||
float newKp = (bank.RollRatePID.Kp + bank.PitchRatePID.Kp) * .5f * inst.YawRateFactors.P;
|
||||
if (easyTuneEnabled && (inst.EasyTuneRatePIDRecalculateYaw != TXPIDSETTINGS_EASYTUNERATEPIDRECALCULATEYAW_FALSE)) {
|
||||
float newKp = (bank.RollRatePID.Kp + bank.PitchRatePID.Kp) * .5f * inst.EasyTuneYawRateFactors.P;
|
||||
needsUpdateBank |= update(&bank.YawRatePID.Kp, newKp);
|
||||
needsUpdateBank |= update(&bank.YawRatePID.Ki, newKp * inst.YawRateFactors.I);
|
||||
needsUpdateBank |= update(&bank.YawRatePID.Kd, newKp * inst.YawRateFactors.D);
|
||||
needsUpdateBank |= update(&bank.YawRatePID.Ki, newKp * inst.EasyTuneYawRateFactors.I);
|
||||
needsUpdateBank |= update(&bank.YawRatePID.Kd, newKp * inst.EasyTuneYawRateFactors.D);
|
||||
}
|
||||
if (needsUpdateBank) {
|
||||
switch (inst.BankNumber) {
|
||||
|
@ -167,8 +167,8 @@ static bool isExpoOption(int pidOption)
|
||||
static bool isFullPIDOption(int pidOption)
|
||||
{
|
||||
switch (pidOption) {
|
||||
case TxPIDSettings::PIDS_ROLLRATEPID:
|
||||
case TxPIDSettings::PIDS_PITCHRATEPID:
|
||||
case TxPIDSettings::PIDS_EASYTUNERATEPITCH:
|
||||
case TxPIDSettings::PIDS_EASYTUNERATEROLL:
|
||||
return true;
|
||||
|
||||
default:
|
||||
@ -197,11 +197,11 @@ static float defaultValueForPidOption(const StabilizationSettingsBankX *bank, in
|
||||
return 0.0f;
|
||||
|
||||
case TxPIDSettings::PIDS_ROLLRATEKP:
|
||||
case TxPIDSettings::PIDS_ROLLRATEPID:
|
||||
case TxPIDSettings::PIDS_EASYTUNERATEROLL:
|
||||
return bank->getRollRatePID_Kp();
|
||||
|
||||
case TxPIDSettings::PIDS_PITCHRATEKP:
|
||||
case TxPIDSettings::PIDS_PITCHRATEPID:
|
||||
case TxPIDSettings::PIDS_EASYTUNERATEPITCH:
|
||||
return bank->getPitchRatePID_Kp();
|
||||
|
||||
case TxPIDSettings::PIDS_ROLLPITCHRATEKP:
|
||||
|
@ -883,7 +883,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:PitchRollRateFactors</string>
|
||||
<string>fieldname:EasyTunePitchRollRateFactors</string>
|
||||
<string>scale:0.1</string>
|
||||
<string>element:I</string>
|
||||
<string>buttongroup:10</string>
|
||||
@ -948,7 +948,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:PitchRollRateFactors</string>
|
||||
<string>fieldname:EasyTunePitchRollRateFactors</string>
|
||||
<string>scale:1</string>
|
||||
<string>element:D</string>
|
||||
<string>buttongroup:10</string>
|
||||
@ -973,7 +973,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:RatePIDRecalculateYaw</string>
|
||||
<string>fieldname:EasyTuneRatePIDRecalculateYaw</string>
|
||||
<string>buttongroup:11</string>
|
||||
</stringlist>
|
||||
</property>
|
||||
@ -1039,7 +1039,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:YawRateFactors</string>
|
||||
<string>fieldname:EasyTuneYawRateFactors</string>
|
||||
<string>scale:0.1</string>
|
||||
<string>element:P</string>
|
||||
<string>buttongroup:11</string>
|
||||
@ -1101,7 +1101,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:YawRateFactors</string>
|
||||
<string>fieldname:EasyTuneYawRateFactors</string>
|
||||
<string>scale:1</string>
|
||||
<string>element:I</string>
|
||||
<string>buttongroup:11</string>
|
||||
@ -1166,7 +1166,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:YawRateFactors</string>
|
||||
<string>fieldname:EasyTuneYawRateFactors</string>
|
||||
<string>scale:1</string>
|
||||
<string>element:D</string>
|
||||
<string>buttongroup:11</string>
|
||||
@ -1284,7 +1284,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:YawRateFactors</string>
|
||||
<string>fieldname:EasyTuneYawRateFactors</string>
|
||||
<string>scale:1</string>
|
||||
<string>element:P</string>
|
||||
<string>buttongroup:11</string>
|
||||
@ -1324,7 +1324,7 @@ font:bold;</string>
|
||||
<property name="objrelation" stdset="0">
|
||||
<stringlist>
|
||||
<string>objname:TxPIDSettings</string>
|
||||
<string>fieldname:PitchRollRateFactors</string>
|
||||
<string>fieldname:EasyTunePitchRollRateFactors</string>
|
||||
<string>scale:1</string>
|
||||
<string>element:I</string>
|
||||
<string>buttongroup:10</string>
|
||||
|
@ -11,7 +11,7 @@
|
||||
<field name="PIDs" units="option" type="enum"
|
||||
elementnames="Instance1,Instance2,Instance3"
|
||||
options="Disabled,
|
||||
PitchRatePID,RollRatePID,
|
||||
EasyTuneRatePitch,EasyTuneRateRoll,
|
||||
Roll Rate.Kp, Roll Rate.Ki, Roll Rate.Kd, Roll Rate.ILimit, Roll Rate.Resp,
|
||||
Pitch Rate.Kp, Pitch Rate.Ki, Pitch Rate.Kd, Pitch Rate.ILimit, Pitch Rate.Resp,
|
||||
Roll+Pitch Rate.Kp, Roll+Pitch Rate.Ki, Roll+Pitch Rate.Kd, Roll+Pitch Rate.ILimit, Roll+Pitch Rate.Resp,
|
||||
@ -28,9 +28,9 @@
|
||||
<field name="MinPID" units="" type="float" elementnames="Instance1,Instance2,Instance3" defaultvalue="0"/>
|
||||
<field name="MaxPID" units="" type="float" elementnames="Instance1,Instance2,Instance3" defaultvalue="0"/>
|
||||
|
||||
<field name="PitchRollRateFactors" units="" type="float" elementnames="I,D" defaultvalue="3,0.0135"/>
|
||||
<field name="YawRateFactors" units="" type="float" elementnames="P,I,D" defaultvalue="1.5,1.9,0.0085"/>
|
||||
<field name="RatePIDRecalculateYaw" units="" type="enum" elements="1" options="FALSE,TRUE" defaultvalue="TRUE"/>
|
||||
<field name="EasyTunePitchRollRateFactors" units="" type="float" elementnames="I,D" defaultvalue="3,0.0135"/>
|
||||
<field name="EasyTuneYawRateFactors" units="" type="float" elementnames="P,I,D" defaultvalue="1.5,1.9,0.0085"/>
|
||||
<field name="EasyTuneRatePIDRecalculateYaw" units="" type="enum" elements="1" options="FALSE,TRUE" defaultvalue="TRUE"/>
|
||||
|
||||
<access gcs="readwrite" flight="readwrite"/>
|
||||
<telemetrygcs acked="true" updatemode="onchange" period="0"/>
|
||||
|
Loading…
Reference in New Issue
Block a user