fixup! Balance App: introduce new speed based variable tiltback

This commit is contained in:
Davorin Mista 2021-06-30 12:46:52 -07:00
parent 813d5b15fa
commit 9f086cfe6f
1 changed files with 2 additions and 7 deletions

View File

@ -198,14 +198,9 @@ void app_balance_configure(balance_config *conf, imu_config *conf2) {
torquetilt_current_biquad.b2 = (1 - K / Q + K * K) * norm;
}
// Variable nose angle adjustment / tiltback
// Variable nose angle adjustment / tiltback (setting is per 1000erpm, convert to per erpm)
tiltback_variable = balance_conf.tiltback_variable / 1000;
// Signs of both settings must match, if not we disable this feature
if (SIGN(tiltback_variable) == SIGN(balance_conf.tiltback_variable_max)) {
tiltback_variable_max_erpm = balance_conf.tiltback_variable_max / tiltback_variable;
} else {
tiltback_variable_max_erpm = 0;
}
tiltback_variable_max_erpm = fabsf(balance_conf.tiltback_variable_max / tiltback_variable);
// Reset loop time variables
last_time = 0;