Adding a +Z offset at a specific layer ?



  • My coding skills are ZERO. I can navigate the duet g-code just about, but only through stubbornness do I get stuff to eventually work.

    Im wondering if it is possible for a Duet to add a positive Z offset to be implemented at a specific layer in the g-code, I currently do this manually by editing my slicer g-code in notepad++

    The Background of this is that I mainly print with PETG and after reels and reels of printing with the stuff I have found that around layer 5 I like to lift the nozzle by 0.2mm as this stops the dreaded PETG "boogers" from forming.

    Another option for preventing boogers is that I have just bought half a dozen of these new Nozzle "X"'s from E3D, we will see how they perform.

    But it would be really nice to not have to edit my slicer g-code every print.



  • @CaLviNx Sorry I can't help - I'd guess some sort of conditional gcode/macro would do the job but I'll let someone more knowledgeable that I answer that. But your technique of lifting the nozzle slightly fascinates me and I must give it a try. I guess you have no problem with layer adhesion otherwise you wouldn't do it. Is it something that you do only once on layer 5 or do your repeat it every "n" layers?



  • @deckingman

    I only have it lift once as I kind of "squish" (as much as you can with PETG anyway) for the the first 5 layers then lift the nozzle, and its only 0.2mm, been doing it for years I thought everyone overcome the PETG boogers this way.

    Only other thing I spent lots of time on was the getting my ooze control settings in S3D (extra restart & coast distance) to my liking as before I optimised them I was sometimes getting small blobs at the start and end of direction changes.

    I should add that I know you can add an extra process in S3D and have a global offset at a certain layer/height, but having more than one printer has led to me inadvertently deleting the additional process when i go to slice something else in an other material and getting puzzled/grumpy at my print stopping at layer 5......



  • @CaLviNx Ah OK. I don't have a need for the initial "squish" with my setup so may not see any benefit from that Z lift. TBH I hadn't come across that technique before (but I lead a sheltered life and maybe need to get out more). ☺

    I don't really get the "boogers" but I've never been able to completely eliminate stringing with PET-G - almost eliminated with tuning firmware retraction, pressure advance, fast travel speeds etc, but not completely eliminated. Might try the odd 0.1mm Z lift here and there to see if it helps....

    Edit =- sorry for digressing - hope you get an answer to your OP.



  • @CaLviNx said in Adding a +Z offset at a specific layer ?:

    My coding skills are ZERO. I can navigate the duet g-code just about, but only through stubbornness do I get stuff to eventually work.

    Im wondering if it is possible for a Duet to add a positive Z offset to be implemented at a specific layer in the g-code, I currently do this manually by editing my slicer g-code in notepad++

    The Background of this is that I mainly print with PETG and after reels and reels of printing with the stuff I have found that around layer 5 I like to lift the nozzle by 0.2mm as this stops the dreaded PETG "boogers" from forming.

    Another option for preventing boogers is that I have just bought half a dozen of these new Nozzle "X"'s from E3D, we will see how they perform.

    But it would be really nice to not have to edit my slicer g-code every print.

    There are "divisions of responsibility" between firmware and slicers, and doing a specific thing at a layer is very clearly the slicer.

    Just saw in your reply it is S3D. Let me take a look for a super-easy way to automate this.



  • @CaLviNx said in Adding a +Z offset at a specific layer ?:

    I currently do this manually by editing my slicer g-code in notepad++

    What do you modify? Just a line or two or the Z levels for the rest of the file? If only a few lines, that may be done using a conditional gcode in the slicer's settings.



  • I do understand why you don't want to use multiple processes in S3D; it requires you to specify them every time, and therefore it is easy to miss.

    What I'm going to suggest in the first screenshot below becomes a permanent part of an S3D profile, and therefore can't be forgotten or missed. G10 L20 P0 offsets the "current" coordinate system. Z0.2 is your desired offset. You MAY need Z-0.2, you'll have to try it and decide.

    Note: It is important to REMOVE this offset before the NEXT print job. See the second screenshot for how to automate this, assuming the current job ends. If something goes wrong, reset the printer before the next print job.

    Those two lines should make it "automagic".

    1697c4a3-fe4e-4ea3-ae2f-d5f4ee9f77ef-image.png

    44c483bd-b791-4f73-94e0-be03b970e6a0-image.png



  • @zapta

    I do nothing fancy, through trial and error I worked out I could successfully inject M290 S0.2 at the start of layer 6 of the generated g-code file, it effectively tells the duet to "baby-step" up by 0.2mm automatically, from layer 6 on.!

    Baby Stepping



  • You could put that M290 in where I was showing the G10.



  • @Danal

    Thanks, I will test and report.

    I already have M290 R0 S0
    To clear any baby stepping in my start & end scripts.

    I was thinking about the layer change tab but needed to work out what the actual code for that should be, as i didnt know it was possible to define a layer with the M290 command



  • WAIT!!

    I just realized my solution has a huge hole in it (one of your comments triggered the thought).

    The way I suggested, the commands in that box would get applied at EVERY layer. That won't work.

    Let me check for an easy way to do them once, at a few mm / layers up.



  • This is what you want. In the box circled in the diagram below, place:

    
    {REPLACE "; layer 6"  "M290 S0.2\n; layer 6"}
    
    

    9485e759-4b9e-487c-a2ac-4deb09a36b1b-image.png



  • Just tested that, and it worked perfectly. These lines are about 1300 down into the G-Code file:

    G1 X81.267 Y106.723 E1.9034
    G92 E0.0000
    G1 E-1.0000 F1800
    M290 S0.2
    ; layer 6, Z = 1.200
    ; feature inner perimeter
    G1 Z1.200 F1000
    G1 X79.550 Y104.482 F4800
    


  • @Danal, Very elegant.

    Will the +0.2 offset accumulate over successive prints?



  • @zapta said in Adding a +Z offset at a specific layer ?:

    @Danal, Very elegant.

    Will the +0.2 offset accumulate over successive prints?

    It would, but he already has the code in his end G-code to reset it.

    And... if the job does not run to completion, a full printer reset is always a good idea. Who knows what all was set in a given job?



  • Thanks for the update.

    Time for me to go and try to learn about conditional g-code it would appear...



  • @CaLviNx said in Adding a +Z offset at a specific layer ?:

    Thanks for the update.

    Time for me to go and try to learn about conditional g-code it would appear...

    The conditional here is in the slicer, not the gcode.

    • REPLACE is a Simplify3D command, first string is what to look for, second is the replacement.

    • The { } cause Simp to regard the whole thing as a script,

    • The box it is in causes it to run when all the Gcode is done, but before the file is saved.



  • @Danal

    I managed to get time to test that small script you wrote, it works perfect.

    Thanks for the assistance.


Log in to reply