Fix for "Can not change rate while motor is running (direction differs)" error when guiding #369
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.
Resolves #358
(I've made this PR using my @beaglebot github account, rather than the @bengal123 account I used in the issue earlier)
A number of EQMOD users reported that the PHD2 star cross test was failing, and the PHD Guiding Assistant would incorrectly report large DE backlash values (mine was 22000ms). The following message was present in the EQMOD log when these errors occured:
The error was triggered when a guide north command was quickly followed by a guide south command (within 1 second). This is unlikely to happen in a normal guiding situation, but does happen during the cross test and backlash estimation.
There's a test harness which duplicates the bug here.
The cause of the error appears to be that the motor status is not updated after the call to StopMotor() between the two guiding commands, so DERunning still indicates the mount is still running in the second call to SetDERate().
NOTE: I've confirmed that this fix corrects the error in the test harness, however I haven't had a chance to do a star cross test yet, so can't be 100% sure the underlying issue is fixed. Feel free to hold off on merging this until then.