From 97673b0b5225531fcfb1686cfa4dd89929f0fda1 Mon Sep 17 00:00:00 2001 From: Bill Geyer Date: Sun, 1 Dec 2024 18:08:36 -0500 Subject: [PATCH] AC_AutoTune: another try --- libraries/AC_AutoTune/AC_AutoTune_Heli.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/AC_AutoTune/AC_AutoTune_Heli.cpp b/libraries/AC_AutoTune/AC_AutoTune_Heli.cpp index 05fda86c174dab..17cc288ec48dd4 100644 --- a/libraries/AC_AutoTune/AC_AutoTune_Heli.cpp +++ b/libraries/AC_AutoTune/AC_AutoTune_Heli.cpp @@ -815,7 +815,8 @@ void AC_AutoTune_Heli::dwell_test_run(sweep_info &test_data) if (is_positive(dwell_freq)) { float ang_limit_rate = radians(rate_max) / dwell_freq; float ang_limit_accel = radians(accel_max) / sq(dwell_freq); - tgt_att_limited = MIN(tgt_attitude, ang_limit_rate, ang_limit_accel); + float tgt_att_temp = MIN(ang_limit_rate, tgt_attitude); + tgt_att_limited = MIN(ang_limit_rate, tgt_att_trmp); } target_angle_cd = -chirp_input.update((now - dwell_start_time_ms) * 0.001, degrees(tgt_att_limited) * 100.0f); dwell_freq = chirp_input.get_frequency_rads();