Renamed alt_hold_throttle_neutral to alt_hold_deadband for consistency.
This commit is contained in:
parent
d2ff7550ac
commit
ed3e0769cf
|
@ -230,3 +230,7 @@ reason: renamed to `3d_deadband_throttle` for consistency
|
||||||
### neutral3d
|
### neutral3d
|
||||||
reason: renamed to `3d_neutral` for consistency
|
reason: renamed to `3d_neutral` for consistency
|
||||||
|
|
||||||
|
### alt_hold_throttle_neutral
|
||||||
|
reason: renamed to 'alt_hold_deadband'
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -291,7 +291,7 @@ static void resetConf(void)
|
||||||
parseRcChannels("AETR1234", &masterConfig.rxConfig);
|
parseRcChannels("AETR1234", &masterConfig.rxConfig);
|
||||||
currentProfile.deadband = 0;
|
currentProfile.deadband = 0;
|
||||||
currentProfile.yaw_deadband = 0;
|
currentProfile.yaw_deadband = 0;
|
||||||
currentProfile.alt_hold_throttle_neutral = 40;
|
currentProfile.alt_hold_deadband = 40;
|
||||||
currentProfile.alt_hold_fast_change = 1;
|
currentProfile.alt_hold_fast_change = 1;
|
||||||
currentProfile.throttle_correction_value = 0; // could 10 with althold or 40 for fpv
|
currentProfile.throttle_correction_value = 0; // could 10 with althold or 40 for fpv
|
||||||
currentProfile.throttle_correction_angle = 800; // could be 80.0 deg with atlhold or 45.0 for fpv
|
currentProfile.throttle_correction_angle = 800; // could be 80.0 deg with atlhold or 45.0 for fpv
|
||||||
|
|
|
@ -46,8 +46,8 @@ typedef struct profile_s {
|
||||||
// Radio/ESC-related configuration
|
// Radio/ESC-related configuration
|
||||||
uint8_t deadband; // introduce a deadband around the stick center for pitch and roll axis. Must be greater than zero.
|
uint8_t deadband; // introduce a deadband around the stick center for pitch and roll axis. Must be greater than zero.
|
||||||
uint8_t yaw_deadband; // introduce a deadband around the stick center for yaw axis. Must be greater than zero.
|
uint8_t yaw_deadband; // introduce a deadband around the stick center for yaw axis. Must be greater than zero.
|
||||||
uint8_t alt_hold_throttle_neutral; // defines the neutral zone of throttle stick during altitude hold, default setting is +/-40
|
uint8_t alt_hold_deadband; // defines the neutral zone of throttle stick during altitude hold, default setting is +/-40
|
||||||
uint8_t alt_hold_fast_change; // when disabled, turn off the althold when throttle stick is out of deadband defined with alt_hold_throttle_neutral; when enabled, altitude changes slowly proportional to stick movement
|
uint8_t alt_hold_fast_change; // when disabled, turn off the althold when throttle stick is out of deadband defined with alt_hold_deadband; when enabled, altitude changes slowly proportional to stick movement
|
||||||
|
|
||||||
uint16_t throttle_correction_angle; // the angle when the throttle correction is maximal. in 0.1 degres, ex 225 = 22.5 ,30.0, 450 = 45.0 deg
|
uint16_t throttle_correction_angle; // the angle when the throttle correction is maximal. in 0.1 degres, ex 225 = 22.5 ,30.0, 450 = 45.0 deg
|
||||||
uint8_t throttle_correction_value; // the correction that will be applied at throttle_correction_angle.
|
uint8_t throttle_correction_value; // the correction that will be applied at throttle_correction_angle.
|
||||||
|
|
|
@ -232,7 +232,7 @@ const clivalue_t valueTable[] = {
|
||||||
{ "gyro_cmpf_factor", VAR_UINT16, &masterConfig.gyro_cmpf_factor, 100, 1000 },
|
{ "gyro_cmpf_factor", VAR_UINT16, &masterConfig.gyro_cmpf_factor, 100, 1000 },
|
||||||
{ "gyro_cmpfm_factor", VAR_UINT16, &masterConfig.gyro_cmpfm_factor, 100, 1000 },
|
{ "gyro_cmpfm_factor", VAR_UINT16, &masterConfig.gyro_cmpfm_factor, 100, 1000 },
|
||||||
|
|
||||||
{ "alt_hold_throttle_neutral", VAR_UINT8, ¤tProfile.alt_hold_throttle_neutral, 1, 250 },
|
{ "alt_hold_deadband", VAR_UINT8, ¤tProfile.alt_hold_deadband, 1, 250 },
|
||||||
{ "alt_hold_fast_change", VAR_UINT8, ¤tProfile.alt_hold_fast_change, 0, 1 },
|
{ "alt_hold_fast_change", VAR_UINT8, ¤tProfile.alt_hold_fast_change, 0, 1 },
|
||||||
|
|
||||||
{ "throttle_correction_value", VAR_UINT8, ¤tProfile.throttle_correction_value, 0, 150 },
|
{ "throttle_correction_value", VAR_UINT8, ¤tProfile.throttle_correction_value, 0, 150 },
|
||||||
|
|
|
@ -575,10 +575,10 @@ void loop(void)
|
||||||
// multirotor alt hold
|
// multirotor alt hold
|
||||||
if (currentProfile.alt_hold_fast_change) {
|
if (currentProfile.alt_hold_fast_change) {
|
||||||
// rapid alt changes
|
// rapid alt changes
|
||||||
if (abs(rcCommand[THROTTLE] - initialThrottleHold) > currentProfile.alt_hold_throttle_neutral) {
|
if (abs(rcCommand[THROTTLE] - initialThrottleHold) > currentProfile.alt_hold_deadband) {
|
||||||
errorAltitudeI = 0;
|
errorAltitudeI = 0;
|
||||||
isAltHoldChanged = 1;
|
isAltHoldChanged = 1;
|
||||||
rcCommand[THROTTLE] += (rcCommand[THROTTLE] > initialThrottleHold) ? -currentProfile.alt_hold_throttle_neutral : currentProfile.alt_hold_throttle_neutral;
|
rcCommand[THROTTLE] += (rcCommand[THROTTLE] > initialThrottleHold) ? -currentProfile.alt_hold_deadband : currentProfile.alt_hold_deadband;
|
||||||
} else {
|
} else {
|
||||||
if (isAltHoldChanged) {
|
if (isAltHoldChanged) {
|
||||||
AltHold = EstAlt;
|
AltHold = EstAlt;
|
||||||
|
@ -588,7 +588,7 @@ void loop(void)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// slow alt changes for apfags
|
// slow alt changes for apfags
|
||||||
if (abs(rcCommand[THROTTLE] - initialThrottleHold) > currentProfile.alt_hold_throttle_neutral) {
|
if (abs(rcCommand[THROTTLE] - initialThrottleHold) > currentProfile.alt_hold_deadband) {
|
||||||
// Slowly increase/decrease AltHold proportional to stick movement ( +100 throttle gives ~ +50 cm in 1 second with cycle time about 3-4ms)
|
// Slowly increase/decrease AltHold proportional to stick movement ( +100 throttle gives ~ +50 cm in 1 second with cycle time about 3-4ms)
|
||||||
AltHoldCorr += rcCommand[THROTTLE] - initialThrottleHold;
|
AltHoldCorr += rcCommand[THROTTLE] - initialThrottleHold;
|
||||||
AltHold += AltHoldCorr / 2000;
|
AltHold += AltHoldCorr / 2000;
|
||||||
|
|
Loading…
Reference in New Issue