PETG-CF blob prevention G-code

Hey guys, as I have noticed multiple users are facing the same issue of blob creation on the nozzle when printing carbon fiber reinforced filaments…

I was annoyed to babysit the printer and pause the print every 30 minutes to clean the blob, so I have created custom machine g-code that does that automatically. Modified code makes the printer go back where the rubber nozzle cleaner is located make a 3 sweeps to clean the blob and continue printing. Maybe this may come handy to someone else as well :slight_smile:
**
PLEASE NOTE THIS IS FOR P2S ONLY!!!** and supposed to be used with bambu CF filaments to prevent oozing and blob creation.

Insert following code into the printer machine g-code section, into window called “Layer change G-code“. There is some existing default code already, do not touch it, just add and copy extra code after. Then save a new printer preset with suffix “nozzle-clean“ and use as necessary. For smaller models consider increasing cleaning after more layers (10 or more)

Enjoy!

; --- Auto nozzle wipe every 5 layers (back cleaning area) ---
{if ((layer_num + 1) % 5 == 0)}
  M117 Nozzle wipe layer {layer_num+1}
  M400

  ; lift to avoid collision
  G91
  G1 Z5.0 F600        ; Z_LIFT - increase if needed
  G90

  ; move to back cleaning station (adjust if your cleaner is elsewhere)
  G1 X70 Y269.5 F20000

  ; ensure relative extrusion mode and small retract
  M83
  G92 E0
  G1 E-1.0 F300
  G4 P150

  ; slow wipe passes across rubber cleaner (tune offsets and passes)
  G1 X70 Y269.5 F5000
  G1 X100 Y269.5 F5000
  G1 X70 Y269.5 F5000
  G1 X100 Y269.5 F5000
  G1 X70 Y269.5 F5000
  G1 X100 Y269.5 F5000

  ; return to previous Z
  G91
  G1 Z-5.0 F600
  G90

  M400
{endif}

Disclaimer: you are making modifications on your own responsibility, I am not responsible for any damage or issues caused by this code. Test before use on simple 5x5mm cube which is 20mm high to test the code functionality. Do not use on any other printer than P2S!

3 Likes

@Wilikskiller Hello, new here with my p2s and g codes, where exactly in the g code i have to change from every 5 layers to 10 o more? hope you can help, thank you!

Hey, just change the number in very first command:

”{if ((layer_num + 1) % 10 == 0)}”

@Wilikskiller Thank you for your reply, and thanks for the code!