mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-12 03:33:34 +08:00
PWM: cleaner clamping and docs typo
This commit is contained in:
@@ -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.
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user