Repository navigation
conf_general: Fail flux linkage detection when the result is zero or negative - #987
Merged
Merged
Conversation
…negative The unconditional res = true after the undriven check overwrote both the open-loop result and the zero-or-less check, so -10 was never returned on single-motor hardware (and for motor 1 on dual hardware). Check the selected flux linkage after choosing between the driven and undriven values, in both the single-motor path and the dual-motor task. Refs vedderb#986
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes the overwrite in #986.
What changes
res = true;inconf_general_detect_apply_all_foc, which overwrote both the open-loop result and the zero-or-less check.<= 0check out of the> 60undriven-samples block, so it applies to whichever flux linkage value is selected. Same change inmeasure_flux_linkage_taskfor motor 2 on dual hardware.Effect
Tested
Off the board only: with the detection functions compiled against stand-ins and a simple motor model, removing the line made both failure cases return -10 and store nothing. Moving the check is the same comparison and was read, not run. Not tested on a real motor or in a firmware build. The same bug is on
release_7_00.