From ee636a0e3d7552061fc4d7e68a1c3757d59fe1e7 Mon Sep 17 00:00:00 2001 From: Balduin Date: Thu, 19 Feb 2026 08:44:57 +0100 Subject: [PATCH] refactor(control_allocator): Remove slew rate from ice shedding Will be unified with main output slew rate in commit just after --- .../control_allocator/ControlAllocator.cpp | 18 ++++-------------- .../control_allocator/ControlAllocator.hpp | 4 ---- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/modules/control_allocator/ControlAllocator.cpp b/src/modules/control_allocator/ControlAllocator.cpp index ee4f27519e..4d962a835e 100644 --- a/src/modules/control_allocator/ControlAllocator.cpp +++ b/src/modules/control_allocator/ControlAllocator.cpp @@ -76,8 +76,6 @@ ControlAllocator::ControlAllocator() : } parameters_updated(); - - _slew_limited_ice_shedding_output.setSlewRate(ICE_SHEDDING_MAX_SLEWRATE); } ControlAllocator::~ControlAllocator() @@ -665,23 +663,15 @@ ControlAllocator::get_ice_shedding_output(hrt_abstime now, bool any_stopped_moto const bool apply_shedding = _is_vtol && in_forward_flight && !any_stopped_motor_failed; if (feature_disabled_by_param || !apply_shedding) { - // Bypass slew limit and immediately set zero, to not - // interfere with backtransition in any way - _slew_limited_ice_shedding_output.setForcedValue(0.0f); + return 0.0f; } else { - // Raw square wave output + // Square wave output const float elapsed_in_period = fmodf(static_cast(now) / 1_s, period_sec); - const float raw_ice_shedding_output = elapsed_in_period < ICE_SHEDDING_ON_SEC ? ICE_SHEDDING_OUTPUT : 0.0f; + const float ice_shedding_output = elapsed_in_period < ICE_SHEDDING_ON_SEC ? ICE_SHEDDING_OUTPUT : 0.0f; - // Apply slew rate limit - const float dt = static_cast(now - _last_ice_shedding_update) / 1_s; - _slew_limited_ice_shedding_output.update(raw_ice_shedding_output, dt); + return ice_shedding_output; } - - _last_ice_shedding_update = now; - - return _slew_limited_ice_shedding_output.getState(); } void diff --git a/src/modules/control_allocator/ControlAllocator.hpp b/src/modules/control_allocator/ControlAllocator.hpp index bd9c8b726d..f31a888021 100644 --- a/src/modules/control_allocator/ControlAllocator.hpp +++ b/src/modules/control_allocator/ControlAllocator.hpp @@ -91,7 +91,6 @@ public: static constexpr int MAX_NUM_MOTORS = actuator_motors_s::NUM_CONTROLS; static constexpr int MAX_NUM_SERVOS = actuator_servos_s::NUM_CONTROLS; - static constexpr float ICE_SHEDDING_MAX_SLEWRATE = 0.1f; static constexpr float ICE_SHEDDING_ON_SEC = 2.0f; static constexpr float ICE_SHEDDING_OUTPUT = 0.01f; @@ -225,9 +224,6 @@ private: bool _has_slew_rate{false}; - SlewRate _slew_limited_ice_shedding_output; - hrt_abstime _last_ice_shedding_update{}; - DEFINE_PARAMETERS( (ParamInt) _param_ca_airframe, (ParamInt) _param_ca_method,