Marlin icon indicating copy to clipboard operation
Marlin copied to clipboard

Fix Z increase issue on a toolchange

Open svpcom opened this issue 4 years ago • 4 comments

Description

With enabled mesh bed leveling during tool change (if there are print head moves during it) Z will temporary increased (up to next Z motion) to some small value (0.27mm in my case and it seems that it depends from bed mesh values). I've debug it and found that problem is in leveling disabling and restore in toolchange code. IMHO this action is not needed and simple fix is not touch leveling state during toolchange.

svpcom avatar Oct 12 '21 09:10 svpcom

Originally this was only disabled for UBL. This is done as UBL has an issue with crossing the mesh boundary not consistently reapplying correction on return. I would suggest instead returning it to the old functionality of UBL only rather than removing it.

InsanityAutomation avatar Oct 13 '21 14:10 InsanityAutomation

I have made the change as @InsanityAutomation suggested. But more investigation is warranted to understand why leveling is disabled temporarily during various kinds of tool-change, and why position could be lost by temporary disabling of leveling. In general, since the current logical Z position can always be affected by enabling leveling after a move in XY, it sounds like it's a good idea to always follow up re-enable of bed leveling with a real Z move to the desired current Z position, thus ensuring that the Z is at the right height to proceed with adjusted layers. So, maybe that extra Z move is all that is really missing. That would be good to know.

thinkyhead avatar Oct 15 '21 01:10 thinkyhead

Another case that comes to mind is IDEX where it goes off the mesh one way, and returns from the opposing side. May need to test what happens in that scenario.

InsanityAutomation avatar Oct 15 '21 02:10 InsanityAutomation

I still think it's a good idea to disable leveling before tool change and then restore leveling afterward, especially for the matrix-based leveling systems where XY also needs adjustment. I would actually expect ABL to handle this better since there has been some close attention paid to that. So I don't want to merge this without looking more closely at the changes that are being applied to Z upon enable / disable of leveling.

Let's do the usual testing to see if we can figure out the root of the problem and the appropriate solution:

  • Fetch the latest copy of bugfix-2.0.x so we're testing the latest code.
  • Enable DEBUG_LEVELING_FEATURE and M114_DETAIL and re-flash the firmware.
  • Connect to your printer from host software such as Cura, Printrun or Repetier Host.
  • Send M502 and M500 to ensure your Configurations are applied.
  • Issue the command M111 S247 to enable maximum logging.
  • Perform a G28 to do your standard homing procedure.
  • Do a G29 to probe the bed. This will also enable bed leveling.
  • Do some moves and some tool-changing, observing Z. Take notes.

Repeat this procedure, if needed, to demonstrate inconsistencies. From these logs we should hopefully get a better idea of what's going on.

thinkyhead avatar Apr 23 '22 10:04 thinkyhead