MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.3k stars 19.25k forks source link

[FR] periodic nozzle auto clean #13401

Open Andrei-Pozolotin opened 5 years ago

Andrei-Pozolotin commented 5 years ago

Description

Marlin already implements G12 nozzle clean command http://marlinfw.org/docs/gcode/G012.html

Some high end 3d printers do periodic nozzle auto clean by automatically executing an equivalent of G12 every few layers.

Is it feasible to introduce similar feature in Marlin? Where in Marlin code one would start to implement this?

reloxx13 commented 5 years ago

could be doable with postprocessing script which inserts g12 every x layers. but i dunno if u can execute g12 mid printing in the gcode file.

if u want to try it, u can use this as start and replace the temp logic with the nozzle clean. should not be too hard to modify https://github.com/fchorney/CuraPlugins/blob/master/post_processing_scripts/VaryTempWithHeight.py

Andrei-Pozolotin commented 5 years ago

thank you for the cura plugin link, I am still interested in firmware-level solution

boelle commented 5 years ago

insert it in start or stop Gcode of the slicer, how would firmware know when to do it?

personal i take a single sheet of toilet paper and fold it to form a small pad then every 2nd print i carefully wipe the nozzle while its still semi hot (~150C) and it takes off all the molten filament without scratching the nozzle

boelle commented 5 years ago

Some high end 3d printers do periodic nozzle auto clean by automatically executing an equivalent of G12 every few layers.

what you dont know is how they did it, my bet is that they have it setup in slicer

with slic3r you can insert this in layer change code

{if layer_z ==5.00}M104 S200; change temp to 200C at layer height of 5.00mm{endif}

does not take much rocket science to change that to wipe the nozzle every 5 or 10 mm

Andrei-Pozolotin commented 5 years ago

thank you for the input. do you by chance know a "safe place" in marlin source to inject auto-clean hook code w/o messing up the rest of the system (planner, motion advance, etc)?

boelle commented 5 years ago

you dont have to put in in the firmware

just trigger the clean from slicer like i suggested?

dcwalmsley commented 4 years ago

So I'm a bit of a NOOB when it comes to writing scripts but I am in agreement that I would like to implement G12 every so many layers (operator's choice) or after so many minutes throughout the print. In other words repeat cleaning process periodically while print is running to ensure clean nozzle and no residual or build up on nozzle tip that can blemish the print. This does not replace dialing in the temperature, feed rate, retraction distance and speed, but to help mitigate print failures.

I'd appreciate either an option to include this into firmware or some way to develop this into GCODE for slicing.

Thanks, Doug W

vajonam commented 3 years ago

If you are running Prusa Slicer or Super Slicer you can add this

{if (layer_num != 0)}{if (layer_num % 40) == 0}G12 P1 S2{endif}{endif} simple mod function to do a G12 Wipe every 40 layers. skipping the first or 0th layer.

quick explanation.

layer_num - Slicer's variables that is available for custom GCode 40 - clean ever 40th layer. G12 - Nozzle Clean - https://marlinfw.org/docs/gcode/G012.html P1 - Triangles S2 - Two Strokes

You can change that however often you like. This is assuming you have G12 in the start g-code, which does a more thorough wipe, this particular is just a quick wipe of S2 two strokes

Here is Pursa/Super Slicer example, but others will have similar places where you can enter it in. image

EDIT: Make sure the print you are doing isn't knocked over the X-Gantry this depends on brush position.