Add options 'deadzone' for endpoints and 'max_calib_koef' for motor #761
+71
−5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The option 'deadzone' consists of three new attributes of ODrive.Endpoint: deadzone_min, deadzone_max, deadzone_value.
It is useful when PWM/ADC signal is used for e.g. set velocity, and can't be set precisely to get motor stopped (usually exactly middle of full range). In this case, one can add attribute values for corresponding endpoint as deadzone_min=0.4, deadzone_max=0.6, deadzone_value=0.0, so when input signal (fraction) is between 0.4 and 0.6, then output to endpoint will be exactly zero.
The option 'max_dc_calib_koef' make configurable (now hardcoded) value 0.1f -- a threshold for current measurements to be accounted as correct. It can be useful in rare cases of bad quality and/or compatibility of hardware parts, in which cases slight extending of threshold can be helpful. Or, maybe one might want to decrease threshold to have more failure-awared configuration.