refactor(control_allocator): Remove slew rate from ice shedding

Will be unified with main output slew rate in commit just after
This commit is contained in:
Balduin
2026-02-19 08:44:57 +01:00
committed by Balduin
parent a631716265
commit ee636a0e3d
2 changed files with 4 additions and 18 deletions
@@ -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<float>(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<float>(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
@@ -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<float> _slew_limited_ice_shedding_output;
hrt_abstime _last_ice_shedding_update{};
DEFINE_PARAMETERS(
(ParamInt<px4::params::CA_AIRFRAME>) _param_ca_airframe,
(ParamInt<px4::params::CA_METHOD>) _param_ca_method,