Skip to content

Commit

Permalink
remove auto throttle
Browse files Browse the repository at this point in the history
  • Loading branch information
bkleiner committed Dec 9, 2023
1 parent 3553d68 commit 5ef1e42
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 26 deletions.
3 changes: 0 additions & 3 deletions src/config/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,6 @@
// *************retune it back up to where it feels good. I'm finding about 60 to 65% of my previous D value seems to work.
// #define TORQUE_BOOST 1.0

// *************throttle angle compensation in level mode
// #define AUTO_THROTTLE

// *************BRUSHED TARGET MIXER SETTINGS
// *************MIX_THROTTLE_REDUCTION_PERCENT reduces thrust imbalances by reducing throttle proportionally to the adjustable reduction percent to the limit set by MIX_THROTTLE_REDUCTION_MAX
// *************MIX_THROTTLE_INCREASE_MAX increases the authority of the pid controller at lowest throttle values like airmode when combined with idle up
Expand Down
23 changes: 0 additions & 23 deletions src/flight/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,25 +100,6 @@ CBOR_END_STRUCT_ENCODER()
#undef ARRAY_MEMBER
#undef STR_ARRAY_MEMBER

// throttle angle compensation
static void auto_throttle() {
#ifdef AUTO_THROTTLE
// float autothrottle = fastcos(state.attitude.axis[0] * DEGTORAD) * fastcos(state.attitude.axis[1] * DEGTORAD);
float autothrottle = state.GEstG.axis[2];
float old_throttle = state.throttle;
if (autothrottle <= 0.5f)
autothrottle = 0.5f;
state.throttle = state.throttle / autothrottle;
// limit to 90%
if (old_throttle < 0.9f)
if (state.throttle > 0.9f)
state.throttle = 0.9f;

if (state.throttle > 1.0f)
state.throttle = 1.0f;
#endif
}

static void control_flight_mode() {
// flight control
const vec3_t rates = input_rates_calc();
Expand Down Expand Up @@ -430,10 +411,6 @@ void control() {
state.throttle += (float)(profile.motor.throttle_boost) * throttlehpf(state.throttle);
state.throttle = constrain(state.throttle, 0.0f, 1.0f);
}

if (rx_aux_on(AUX_LEVELMODE)) {
auto_throttle();
}
}

motor_mixer_calc(state.motor_mix.axis);
Expand Down

0 comments on commit 5ef1e42

Please sign in to comment.