PWM: cleaner clamping and docs typo

This commit is contained in:
ttechnick
2025-11-12 09:12:39 +01:00
parent cf09318b09
commit d69a215190
2 changed files with 2 additions and 8 deletions
+1 -1
View File
@@ -593,7 +593,7 @@ To set this up:
1. Set `Minimum`, `Maximum`, `Trim` and `Disarm` value so that the surface will stay at neutral position approximately.
This is usually around `1500` for PWM servos (near the centre of the servo range).
2. Gradualy increate the `Maximum` for each servo, while checking the deflection with the sliders or manual input with [`COM_PREARM_MODE`](../advanced_config/parameter_reference.md#COM_PREARM_MODE) parameter to `Always` until the desired deflection is reached.
2. Gradualy increase the `Maximum` for each servo, while checking the deflection with the sliders or manual input with [`COM_PREARM_MODE`](../advanced_config/parameter_reference.md#COM_PREARM_MODE) parameter to `Always` until the desired deflection is reached.
3. Gradualy decrease the `Minimum` for each servo, until the desired deflection is reached.
4. Set `PWM_MAIN_TRIMx` / `PWM_AUX_TRIMx` to the neutral point of each servo.
+1 -7
View File
@@ -190,13 +190,7 @@ void MixingOutput::updateParams()
}
// Trim needs to be clamped to min/max
if (_trim_value[i] < _min_value[i]) {
_trim_value[i] = _min_value[i];
}
if (_trim_value[i] > _max_value[i]) {
_trim_value[i] = _max_value[i];
}
_trim_value[i] = math::constrain(_trim_value[i], _min_value[i], _max_value[i]);
if (_param_handles[i].failsafe != PARAM_INVALID && param_get(_param_handles[i].failsafe, &val) == 0) {
_failsafe_value[i] = val;