1
$\begingroup$

I want to make a G-code script for Cura to clean the nozzle every Xth layer or every one minute?

With Cura there is only start and end G-code, so there is no "layer change" G-code like another slicer (e.g. Ideamaker).

Where should I write the code?

How can I define the Layer number?

$\endgroup$
3
  • $\begingroup$ just as a side note. Is this something that you would want your printer to do automatically without needing to resort to g-code modifications? I'm asking.. er... for a "friend". $\endgroup$
    – user77232
    Nov 15 '20 at 17:32
  • $\begingroup$ yes the Printer should do this automatically, you have to write the G-code in the Slicer (Cura) and every time you slice the written G-code will be automatic there! sometimes you have to be careful, if you change the Template the Orginal G-code will be used! just look if you still have the same G-code! $\endgroup$ Dec 14 '20 at 15:07
  • $\begingroup$ Not an answer, but if your nozzle is getting dirty during your print, it means there is a significant amount of material that came out of the extruder that did not bond where it was supposed to. This means the part was not printed right, and does not have the structural properties it should. You should probably try to figure out why that's happening and fix it, and if you do, you'll probably find that you no longer need to clean the nozzle. $\endgroup$ Aug 15 at 16:55
0
$\begingroup$

There are extensions for Cura that can do almost what you want to do for you (with respect to the layer or height).

You need to add post-processing scripts to the Cura slicer. You do that from the top menu options Extensions -> Post Processing -> Modify G-Code and then add the option of choice.

E.g. for an event at every layer change you should use script "Insert at layer change" and fill out the G-code you want to perform.

There are options to write your own extension, but that would require some software development skills.

Optionally, you could use the "ChangeAtZ" script to add absurd temperature changes of the extruder to post process that later by a simple e.g. Python script (outside Cura) to replace those actions with the cleaning actions you want to perform. But, when you can do that, you could write a script outside Cura to detect the layers (e.g. from the comments or from the layer change command G1 Zxx) and insert that right away.

For inserting this on the basis of time would be very difficult, it is difficult to estimate the time printing actions take to then inject such a script.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.