fix(dshot): make 3D deadband inclusive on both ends
EKF Update Change Indicator / unit_tests (push) Has been cancelled

Change the 3D deadband check from [L, H) to [L, H] so that setting
DSHOT_3D_DEAD_L equal to DSHOT_3D_DEAD_H (both default to 1000) produces
a single-point deadband at that value, matching the natural reading of
"between L and H" in the param description.

Clarify the DSHOT_3D_DEAD_L/H param descriptions to state the range is
inclusive and note the L=H default behavior.
This commit is contained in:
Jacob Dahl
2026-04-19 19:27:02 -08:00
parent 3580632288
commit 05cedf1093
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -741,7 +741,7 @@ uint16_t DShot::convert_output_to_3d_scaling(uint16_t output)
// This is in terms of DShot values, code below is in terms of actuator_output
// Direction 1) 48 is the slowest, 1047 is the fastest.
// Direction 2) 1049 is the slowest, 2047 is the fastest.
if (output >= _3d_dead_l && output < _3d_dead_h) {
if (output >= _3d_dead_l && output <= _3d_dead_h) {
return DSHOT_DISARM_VALUE;
}
+4 -2
View File
@@ -56,7 +56,8 @@ parameters:
description:
short: DSHOT 3D deadband high
long: |
When the actuator_output is between DSHOT_3D_DEAD_L and DSHOT_3D_DEAD_H, motor will not spin.
When the actuator_output is in the inclusive range [DSHOT_3D_DEAD_L, DSHOT_3D_DEAD_H], the motor will not spin.
Setting DSHOT_3D_DEAD_L equal to DSHOT_3D_DEAD_H (e.g. the default 1000) produces a single-point deadband at that value.
This value is with respect to the mixer_module range (0-1999), not the DSHOT values.
type: int32
min: 1000
@@ -66,7 +67,8 @@ parameters:
description:
short: DSHOT 3D deadband low
long: |
When the actuator_output is between DSHOT_3D_DEAD_L and DSHOT_3D_DEAD_H, motor will not spin.
When the actuator_output is in the inclusive range [DSHOT_3D_DEAD_L, DSHOT_3D_DEAD_H], the motor will not spin.
Setting DSHOT_3D_DEAD_L equal to DSHOT_3D_DEAD_H (e.g. the default 1000) produces a single-point deadband at that value.
This value is with respect to the mixer_module range (0-1999), not the DSHOT values.
type: int32
min: 0