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

Filament ramming and z improvements #1760

Closed

Conversation

wavexx
Copy link
Collaborator

@wavexx wavexx commented Apr 23, 2019

This PR combines a fix for #1095 and #1748 due to space requirements (FIY this PR will also make room for PR #1759 and #1758). Please let me know if you whish to split this further.

First, we replace the filament unloading procedure with the mmu_filament_ramming() code to fix #1095.
If ramming is good enough for the mmu2, well, it must be good enough for plain unloading ;).
I didn't touch the custom filament unload procedure which is triggered by the filament runout, because that sequence could be triggered also by a clogged extruder and ramming the clog might not be a good idea. Ramming will thus be done for the Menu -> unload filament, for M702 and M600. I tested all cases with PLA and PETG.

I introduce a new function, raise_z_above to move Z carefully when the current position is potentially unknown, using stallguard. The following conditions will now use raise_z_above:

  • during filament loading/unloading, for blob clearance. This was already done during loading, but now it's also done while unloading, since the ramming will extrude a little bit.

  • extruder spacing when preheating. This is done to avoid buildplate marks on the PEI sheet, which is something I have, as I often preheat from the menu and sometimes come back late.

  • before homing to avoid scratching the build plate. Again, this was already done, but badly (see Z raised above maximum when issuing "G28" (autohome) or filament autoload from maximum height #1748).

In the original sequence, G28 will raise, home XY, then raise again unconditionally. If the printer was already at max height, then reset, then a G28 is issued, the carriage is essentially crashed twice against the Z tops.

We now use raise_z_above before homing XY, and during home Z. raise_z_above is a no-op if the position is already above the target, which means that no move is ever issued if current position is already beyond the target. This results in G28 in a single raising move, which is faster to booth. If Z was already raised by a preheat or filament loading sequence, then there won't be any Z movement.

As a plus, stallguard is used when the position is unknown, making raise_z_above useful in all cases when Z is unknown (basically, all the above). raise_z_above will move the axis carefully and set the current position to max_height if the endpoint is hit. This will effectively prevent/fix #1748.

Note that #1748 will happen during regular printing too: if a tall print is completed and leaves the extruder at maximum height, a G28 issued by a subsequent print will currently crash the axis. A simple check is not enough: if the printer is reset while the extruder is at maximum height, then both homing and filament unloading will crash the axis.

- Introduce raise_z_above to move Z carefully when the current position
  is potentially unknown, using stallguard
- Use raise_z_above for:
  * filament loading/unloading clearance
  * extruder spacing when preheating (to avoid buildplate marks on PEI)
  * before homing to avoid damaging the build plate and to avoid
    repeated Z moves as well

Since raise_z_above is conditional, it will only raise when needed.

Calling raise_z_above when the extruder position is unknown and already
at maximum travel is safe and will prevent further vertical moves.
@wavexx
Copy link
Collaborator Author

wavexx commented Apr 23, 2019

No idea why the MK3 variant fails on travis, I tried to rebuild on my end without issues (I'm also currently checking the code on a MK3).

@wavexx wavexx force-pushed the filament_ramming_and_z_improvements branch from bf82ee6 to 0ca5748 Compare April 24, 2019 10:43
In raise_z_above, power Z steppers in normal mode to overcome initial
load. This avoids triggering the endstop right at the start if the
Z axis was started directly in low-power mode.
@wavexx wavexx force-pushed the filament_ramming_and_z_improvements branch from 0ca5748 to d723e1b Compare April 24, 2019 10:44
@wavexx
Copy link
Collaborator Author

wavexx commented Apr 25, 2019

Closing in favor of #1768 which isolates only the Z movement improvements

@wavexx wavexx closed this Apr 25, 2019
@wavexx wavexx deleted the filament_ramming_and_z_improvements branch April 25, 2019 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant