From ed3e0769cff67a26bccff95d4364a99b61a68264 Mon Sep 17 00:00:00 2001 From: Dominic Clifton Date: Sat, 21 Jun 2014 22:39:42 +0100 Subject: [PATCH] Renamed alt_hold_throttle_neutral to alt_hold_deadband for consistency. --- docs/Configuration.md | 4 ++++ src/main/config/config.c | 2 +- src/main/config/config_profile.h | 6 +++--- src/main/io/serial_cli.c | 2 +- src/main/mw.c | 6 +++--- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/docs/Configuration.md b/docs/Configuration.md index b12a26033..c2b0c2ece 100644 --- a/docs/Configuration.md +++ b/docs/Configuration.md @@ -230,3 +230,7 @@ reason: renamed to `3d_deadband_throttle` for consistency ### neutral3d reason: renamed to `3d_neutral` for consistency +### alt_hold_throttle_neutral +reason: renamed to 'alt_hold_deadband' + + diff --git a/src/main/config/config.c b/src/main/config/config.c index 710a38ade..e0e4883be 100755 --- a/src/main/config/config.c +++ b/src/main/config/config.c @@ -291,7 +291,7 @@ static void resetConf(void) parseRcChannels("AETR1234", &masterConfig.rxConfig); currentProfile.deadband = 0; currentProfile.yaw_deadband = 0; - currentProfile.alt_hold_throttle_neutral = 40; + currentProfile.alt_hold_deadband = 40; currentProfile.alt_hold_fast_change = 1; 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 diff --git a/src/main/config/config_profile.h b/src/main/config/config_profile.h index 74149c028..e2d70fc6a 100644 --- a/src/main/config/config_profile.h +++ b/src/main/config/config_profile.h @@ -45,9 +45,9 @@ typedef struct profile_s { // 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 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_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 yaw_deadband; // introduce a deadband around the stick center for yaw axis. Must be greater than zero. + 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_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 uint8_t throttle_correction_value; // the correction that will be applied at throttle_correction_angle. diff --git a/src/main/io/serial_cli.c b/src/main/io/serial_cli.c index 67543dc5f..3bced3fbc 100644 --- a/src/main/io/serial_cli.c +++ b/src/main/io/serial_cli.c @@ -232,7 +232,7 @@ const clivalue_t valueTable[] = { { "gyro_cmpf_factor", VAR_UINT16, &masterConfig.gyro_cmpf_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 }, { "throttle_correction_value", VAR_UINT8, ¤tProfile.throttle_correction_value, 0, 150 }, diff --git a/src/main/mw.c b/src/main/mw.c index 103be7bbd..76f0564d1 100755 --- a/src/main/mw.c +++ b/src/main/mw.c @@ -575,10 +575,10 @@ void loop(void) // multirotor alt hold if (currentProfile.alt_hold_fast_change) { // rapid alt changes - if (abs(rcCommand[THROTTLE] - initialThrottleHold) > currentProfile.alt_hold_throttle_neutral) { + if (abs(rcCommand[THROTTLE] - initialThrottleHold) > currentProfile.alt_hold_deadband) { errorAltitudeI = 0; 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 { if (isAltHoldChanged) { AltHold = EstAlt; @@ -588,7 +588,7 @@ void loop(void) } } else { // 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) AltHoldCorr += rcCommand[THROTTLE] - initialThrottleHold; AltHold += AltHoldCorr / 2000;