Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset SG when writing to GCONF or COOLCONF #300

Merged
merged 2 commits into from
Mar 29, 2021

Conversation

wavexx
Copy link
Collaborator

@wavexx wavexx commented Mar 28, 2021

Description

At least on the real TMC2130, SG seems to clear when parameters related
to SG are updated (GCONF or COOLCONF).

It is unclear if that's truly the case by the spec, but this seems to
match the behavior expected by the MK3 FW.

Behaviour/ Breaking changes

Resets SG DIAG output when writing to GCONF or COOLCONF.
This works as expected on the MK3/S, however I'm not sure if klipper actually expects the existing status to be kept (and not just reset). This would be interesting to test.

Have you tested the changes?

Against the MK3 FW.

wavexx added 2 commits March 29, 2021 01:36
At least on the real TMC2130, SG seems to clear when parameters related
to SG are updated (GCONF or COOLCONF).

It is unclear if that's truly the case by the spec, but this seems to
match the behavior expected by the MK3 FW.
Instead of checking that the DIAG output gets inverted, check that when
rewriting the same configuration DIAG is cleared.
@vintagepc vintagepc merged commit bc56fba into vintagepc:master Mar 29, 2021
wavexx added a commit to wavexx/MK404 that referenced this pull request Apr 4, 2021
vintagepc pushed a commit that referenced this pull request Apr 5, 2021
* Revert "Reset SG when writing to GCONF or COOLCONF (#300)"

This reverts commit bc56fba.

* Test for "FINISHED" in TMC2130

This ensures no extra output goes untested

* TMC2130: handle DIAG correctly when entering STST

TMC2130 clears DIAG when the overload condition is resolved, not when
moving off an endstop. This means that when the motor is not moving DIAG
should be cleared.

Transition to standstill implies this, so handle this situation by
adding a couple of helper functions to set/clear DIAG consistently
and use them when StandStill is detected.

Add tests to check this condition.

Also cancel the StandStill timer when the object is destroyed to avoid
callbacks on uninitialized instances, causing crashes during quit.

* TMC2130: add some extra commentary to the test sequence

* TMC2130: clear DIAG also when changing state

As a followup from 997ba3d, disabling
motors should have the same end result by clearing the DIAG flag.

We do this by triggering standstill internally, which is not 100%
accurate if we take into account freewheeling and/or passive braking,
but good enough to allow full debugging of PowerPanic on the Prusa FW.
@wavexx wavexx deleted the reset_diag_on_gconf branch April 5, 2021 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants