Jump to content

Testing with 'Firmware Retraction'.


Go to solution Solved by GregValiant,

Recommended Posts

Posted (edited) · Testing with 'Firmware Retraction'.

Hello. I have set 'Gcode Flavor' to Marlin (1st image). And Marlin supports Z Hop (2nd image). When I test with 'Firmware Retraction' on, and 'Z hop Height' set to 0.6mm, Cura inserts 2 extra Z movements (3rd image). These extra Z movements lead to more oozing. Which is exactly what you want to prevent with 'Retraction'.
When I set the 'Z hop Height' set to 0.0mm (4th image) there is no extra movement. But then I have to set this myself on the 3D printer, after starting to print.

Is this something that will be fixed?

There are also no settings from Cura that are transferred to Gcode. That's fine. I have included this in 'Extruder Start G-code'.

 

Edit: The third and fourth image fit perfectly, unfortunately. But one can see the line numbers 3638, 3623 from Notepad++.

1-Machine Settings.jpg

2-Marlin M207.jpg

3-Gcode.jpg

4-Gcode.jpg

4-Gcode.jpg

Edited by toreae
  • Link to post
    Share on other sites

    Posted (edited) · Testing with 'Firmware Retraction'.

    I apologize because I have to guess here.  If you could post a project file ("File | Save Project") it would be helpful.

     

    If your "firmware retraction" of your printer is handling the Z-hops then you should probably turn off "Z-hops" in Cura.  You don't want to double-dip on the Z-hops.

    Cura does not typically insert M207 or M208 in gcodes.  Whatever retraction distance (and z-hop height) is in the printer as defaults are what is used whenever the printer sees a G10 or G11.

     

    An option would be to add M207 (and M208) lines to your StartUp Gcode so you could tune them to the print.  Cura can now do some math and logic in the StartUp and Ending Gcodes.

    I'm not giving any guarantees here, but something like this in your StartUp MIGHT allow you to use Cura inserted Z-Hops.
    M207 S{retraction_amount} F{retraction_retract_speed * 60} Z0

    M208 F{retraction_prime_speed * 60}

     

    You can allow the Firmware Retraction to handle the Z-hops, or let Cura handle the Z-hops, but enabling both is not a good idea.

     

    Edited by GregValiant
    • Like 1
    Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    I have these lines in 'Extruder Start Gcode'.


    M207 F{retraction_speed} S{retraction_amount} Z{retraction_hop}
    M208 F{retraction_prime_speed} S{retraction_extra_prime_amount}


    The problem is that Cura leaves 'retraction_speed', 'retraction_amount', 'retraction_prime_speed', and 'retraction_extra_prime_amount' to the printer's firmware so I can tune these while printing.

     

    Cura does not do the same with 'retraction_hop'. This is not logical.

     

    Marlin Firmware can tune retraction_hop while printing.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    You still haven't mentioned what printer you are talking about.  I see "Klipper" on one of your images so I "guess" it isn't an Ultimaker which would likely configure the M207/M208 internally dependent on the material.

    UltiMaker does the heavy lifting on writing Cura so (I'm guessing again) there is no M207/M208 required from their point of view.

    How are you "tuning on the fly"?  Are you using a print server?  Some sort of Klipper Console?

     

    To start - You have to multiply the speeds by 60 to convert to the gcode "mm/minute".

    M207 F{retraction_retract_speed * 60}

    That might be one of the problems you are having as "G1 F35 Exxx" is a lot different than "G1 F2100 Exxxx"

    You have a dual extruder printer.  The Z-hops can be different for each extruder.  You would need to explain that in your M207 lines.

    M207 S{retraction_amount,0} for extruder 1 and M207 S{retraction_amount,1} for extruder 2.

     

    If you turn on Z-hops in Cura then (as you have noted) the "G1 Fsss Zxx.xx" will be hard coded in the gcode.  You can't "tune" that on the fly because every time there is a retraction there will be a Z-hop line and the height is fixed.

    What you can do is enable Z-hops in Cura, set the hop height for each extruder, and then turn off "Z-hops" in Cura.  The numbers would be available in the Extruder Start gcodes.  Every time there is a tool change the Hop Height will return to what that line says.  Your "tuning" would then revert to the value in the M207 line.

     

    If there are multiple tool changes in a file, every time there is a tool change the Z-hop amount will be set back to whatever {retraction_hop} for the current tool.

     

    If you want to tune the retraction hop height during a print you need to turn off "Z-Hop" in Cura.  The G10 and G11 lines will still be in the Gcode and they will be configured the way you told it with the M207 lines.

     

     

     

     

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    I use Klipper. And Klipper use mm/s:


    "#retract_speed: 20
    # The speed of retraction, in mm/s. The default is 20 mm/s."


    Cura cannot be set to Klipper, so Marlin should be the right choice.

     

    Again:
    The problem is that Cura leaves 'retraction_speed', 'retraction_amount', 'retraction_prime_speed', and 'retraction_extra_prime_amount' to the printer's firmware so I can tune these while printing. (Which is correct.)
    But Cura does not do the same with 'retraction_hop'. This is not logical.


    Why only include 4 out of 5 features in 'Firmware Retraction'? 

    Why omit 'retraction_hop'?

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    Retraction Hop is a separate setting.  Retraction can be turned on without Z-hops being enabled.  The Hop Height can still be used by your M207 line.  I don't understand why you think that it isn't tuneable.  In the case of M207, the Z height is still controlled by the firmware.

     

    If you were to move the M207 lines from the Extruder StartUp gcode into the regular StartUp Gcode then if it was M207 F35 Z0.5 and you were to add "M207 Z0" at layer 25 then you would have 0.5 z-hops until the end of layer 24 and from there up to the end of the print there would be no z-hops because the height has been set to 0.

    I just don't see a problem here.  If you want to use firmware retraction, and you want Z-hops, then set the Z parameter of M207 to the hop height you want and turn Z-hops off in Cura.

     

    You have customized your printer from whatever it started out as.  There will necessarily be workarounds.  I have read that UM may consider adding Klipper as a gcode flavor.  I have no idea where they are on that.  

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    I don't have any idea if it would help, but there is a "Klipper Settings" plugin available in the marketplace:

    image.thumb.png.d4997b8af6d7fc0079f50572c12b9028.png

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.
    23 minutes ago, GregValiant said:

    I don't understand why you think that it isn't tuneable.

    I don't know why you are writing this.

     

    24 minutes ago, GregValiant said:

    Retraction Hop is a separate setting.

    Yes, Cura treats this completely differently. But Marlin has it included in the G10, G11, M207 and M208.
     

    37 minutes ago, GregValiant said:

    If you want to use firmware retraction, and you want Z-hops, then set the Z parameter of M207 to the hop height you want and turn Z-hops off in Cura.

    Yes, if I want Z-Hop p 0.6mm as a starting point, then set it to 0mm in Cura. And then I have to manually edit the g-code afterwards. So as I already wrote, why only include 4 out of 5 features that 'Firmware Retraction' is?

     

    41 minutes ago, GregValiant said:

    You have customized your printer from whatever it started out as.  There will necessarily be workarounds.  I have read that UM may consider adding Klipper as a gcode flavor.  I have no idea where they are on that.  

    If I rebuilt the printer back to what it was, this would still be a problem. If I bought a new printer, it would be a problem.
    If I want to use 'Firmware retraction' including Z-Hop, I have to set Z-Hop to 0.0mm in Cura, and edit the gcode afterwards. Circumstantial.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    @toreae, please try to keep the tone of things friendly. We're just volunteers trying to help.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.
    16 minutes ago, Slashee_the_Cow said:

    I don't have any idea if it would help, but there is a "Klipper Settings" plugin available in the marketplace:

    image.thumb.png.d4997b8af6d7fc0079f50572c12b9028.png

    I have tried that plugin before. And it didn't help. Klipper does not have 'Firmware Retraction' with 'Z-hop'. So you have to arrange that yourself, with a macro.

    I'm trying to get nice Z-seams with PETG, TPU. Not easy. But I like the challenge.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.
    4 minutes ago, Slashee_the_Cow said:

    @toreae, please try to keep the tone of things friendly. We're just volunteers trying to help.

     

    I'm sorry. I have to use google translate. If my choice of words sounds unfriendly, I can assure you that they are not meant to be.
    It's more a frustration with the problem, and my lack of ability to explain things correctly.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.
    30 minutes ago, toreae said:

    I'm sorry. I have to use google translate. If my choice of words sounds unfriendly, I can assure you that they are not meant to be.
    It's more a frustration with the problem, and my lack of ability to explain things correctly.

    There are forums for Dutch, German, Spanish, French, Italian, Japanese and other languages you can use if you're having trouble expressing yourself in English.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    Let's start from the beginning...

    What printer are we talking about?  That would seem to be a basic thing to know.  I had to figure the Klipper thing out from an image because it was never stated.

     

    I understand that you are trying to alter the z-hops to get better seams, Exactly how are you attempting to accomplish that?  Are you trying to not Z-hop at one particular place on each layer?  Not Z-hop for a range of layers?  What is it that you really want?

     

     

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.
    1 hour ago, GregValiant said:

    What printer are we talking about?

    A highly modified Ender 5. Among other things, it has 2 extruders on the same X-carriage. And it runs on Klipper firmware.

     

    1 hour ago, GregValiant said:

    I understand that you are trying to alter the z-hops to get better seams, Exactly how are you attempting to accomplish that?

    By, among other things, tuning 'Firmware Retraction'. Especially 'Z-hop', 'Retract length' and 'Additional recover length'. And 'pressure_advance' with 'pressure_advance_smooth_time'.

     

    1 hour ago, GregValiant said:

    Are you trying to not Z-hop at one particular place on each layer? 

    No.

     

    1 hour ago, GregValiant said:

    Not Z-hop for a range of layers?

    No.

     

    1 hour ago, GregValiant said:

    What is it that you really want?

     

    I would like Cura to also include the 5th feature in 'Firmware Retraction', 'Z-hop' (Z lift on retraction).

     

    (When I look, Marlin also has 'Retract swap length', which I think Cura has included. And 'Additional recover swap length' which I think Cura has not included. But these functions are not important (for this time).)


    But if you check 'Firmware Retraction', Cura still creates gcode with 'Z-hop':
    "3668 G10"
    "3669 G1 F900 Z6.2"
    Line 3669 should not have been here. As the G10 in Marlin already has 'Z-hop'.

    So what I want is for Cura to use 'Firmware Retraction' with 'Z-hop', in the way Marlin ment it should be used.

     

    Again, I apologize if the wording is unfriendly.

  • Link to post
    Share on other sites

    Posted (edited) · Testing with 'Firmware Retraction'.

    Alright.  I think I have it.  Maybe.

     

    If "Firmware Retraction" is enabled, and "Z-hop on Retraction" is enabled you want an option to handle the Z-hops with G10 or with the regular Cura Z-hop code.

    So the setting you want doesn't exist and would require a feature request.  I think the best way to do that (for now) would be to put a feature request in for the Klipper Plugin and maybe the author can add the function.  It already does the retractions and appears to take multiple extruders into account.  It is probably faster than waiting for the Cura team to add it.

     

    The Klipper plugin uses this line to set up the G10 parameters:

    SET_RETRACTION RETRACT_LENGTH=6.5 RETRACT_SPEED=35 UNRETRACT_SPEED=25 ;KlipperSettingsPlugin

    It would need at least one additional setting box (Enable Z-Hop for G10) and one more parameter in that SET_RETRACTION line.

     

    Right now you have to do it manually.

    Enable "Z-hop on retraction"

    Set the Z-hop heights for each extruder.

    Disable "Z-Hop on retraction.

     

    If your Z-hop height, Retraction Speed, Retraction Amount are the same for each extruder you can put this into your Startup Gcode:

    M207 F{retraction_retract_speed*60} S{retraction_amount} Z0.6

    M208 F{retraction_prime_speed}

    If you want to disable Z-hops for a print you would need to go into the StartUp and change the Z parameter to "0".  If you want to change the Z-hop height then enter the new number.

     

    If your Z-hop height, Retraction Speed, or Retract Amount is different for each extruder (Ex: E1 has 0.6 Z-hop height and E2 has 1.0 Z-hop height) then you need to put the M207 and M208 lines into the Extruder 1 and 2 StartUp:

    M207 F{retraction_retract_speed*60,0} S{retraction_amount,0} Z0.6

    M208 F{retraction_prime_speed*60,0}

    This goes into Extruder 2 StartUp:

    M207 F{retraction_retract_speed*60,1} S{retraction_amount,1} Z0.6

    M208 F{retraction_prime_speed*60,1}

    If you want to disable Z-hops for a print or change the hop heights you would need to go into the StartUp for both extruders and change the Z parameter.  The " ,0" or " ,1" are required so Cura can add the right number for the extruder.

     

    The Klipper plugin enters the retraction settings using what looks like a Klipper macro line "SET_RETRACTION" so having the speeds in mm/sec is fine .  You are unable to do the same thing with the Z-hop and M207 is a regular Gcode command.  I think you will find that you need the "*60" in there.  All the other F parameters in the file are in mm/min.

     

     

    Edited by GregValiant
  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    This is the gcode I get from the above.

    G10
    G92 E0
    T0
    G92 E0
    M207 F600 S3 Z0.6
    M208 F600

    M105
    M109 S220
    M104 T1 S210
    M205 X10 Y10
    G0 F9000 X227.315 Y214.697 Z8.4
    G0 X230.419 Y216.924
    G0 X229.228 Y216.425
    M104 S230
    G11

    I set this up with different values for each extruder.  At the next change the numbers are different.

    G10
    G92 E0
    T1
    G92 E0
    M207 F1500 S6.5 Z1.0
    M208 F1500

    ....
    G11

     

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.
    8 hours ago, GregValiant said:

    Alright.  I think I have it.  Maybe.

    I also think you have understood this.

     

    8 hours ago, GregValiant said:

    If your Z-hop height, Retraction Speed, or Retract Amount is different for each extruder (Ex: E1 has 0.6 Z-hop height and E2 has 1.0 Z-hop height) then you need to put the M207 and M208 lines into the Extruder 1 and 2 StartUp:

    This is how I have it set up in Cura now. I think this is the best solution.
    It is very rare that I use both extruders. When I use both, usually one is for support.
    If I use both, it creates another problem. Any tuning disappears when you change the extruder.

     

    To the question of whether it should be in the Klipper plugin:
    Yes that would be nice. But Klipper does not have 'Z-hop'. I have made a dirty macro that adds 'Z-hop'. I was hoping maybe there was a hidden menu or something...

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    "If I use both, it creates another problem. Any tuning disappears when you change the extruder."

    Yes, that will happen.

    The upside to putting the M207 into the regular "StartUp Gcode" is that it would not happen.  BUT doing that insures that each extruder would have the same Z-hop height.  That may not be important.

    Once you get your tuning dialed in then you could put the lines back into the Extruder StartUp gcodes.

     

    Because what you really want to do is missing a setting in Cura, you would need to jump through some hoops to make this work exactly right.

    Ex:  Enable z-hops, change the hop height, disable z-hops

    If you use Extruder StartUp then tuning would still be an issue because of the M207 lines at each tool change.

     

    I would probably go with this in the regular StartUp Gcode because this allows any tuning to continue through the print:

    M207 F{retraction_retract_speed*60,initial_extruder_nr} S{retraction_amount,initial_extruder_nr} Z{retraction_hop,initial_extruder_nr}

    M208 F{retraction_prime_speed*60,0}

     

    Essentially what that does is turn the "Z-Hop Height" setting into the on-off switch.  When Z-hop height is "0" then the Z parameter is "0" and there would be no hops.

    "Z-hop on Retraction" and "Z-hop after extruder switch" would ALWAYS need to be disabled in Cura so all that extra code doesn't show up.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    Well, you gave me a challenge. First:

    5 hours ago, GregValiant said:

    Ex:  Enable z-hops, change the hop height, disable z-hops

    This looks like it will remove the need to edit the gcode, afterwards. It is good. Then it's just a matter of remembering it, and hoping that the opportunity doesn't disappear with new editions of Cura.

     

    5 hours ago, GregValiant said:

    M207 F{retraction_retract_speed*60,initial_extruder_nr} S{retraction_amount,initial_extruder_nr} Z{retraction_hop,initial_extruder_nr}

    M208 F{retraction_prime_speed*60,0}

    M208 F{retraction_prime_speed*60,initial_extruder_nr} Surely it should be like this?

     

    Being able to use both extruders is not yet important. What I'm trying to do is get PETG right. And then I hope that I won't have to use G10 - G11 (for tuning).

  • Link to post
    Share on other sites

    • Solution
    Posted (edited) · Testing with 'Firmware Retraction'.

    Ok.  Watch closely.  I have nothing up my sleeves.

    In the StartUp gcode...


    M207 F{retraction_retract_speed*60} S{retraction_amount} Z{retraction_hop if machine_endstop_positive_direction_z else 0.0}
    M208 F{retraction_prime_speed*60}

     

    If you haven't done so, go to the MarketPlace and load the "Printer Settings" plugin.  A couple of the settings don't do anything - except for now.

    The above line will allow you to use "Z Endstop in Positive Direction" to turn G10 Z-hops on and off.  It's located 4th from the bottom in the Printer Settings.  When it is checked the "z-hop height" will be in the line and if it unchecked then the z hop height will be 0.0.

     

     

     

     

     

     

    Edited by GregValiant
  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    Well, that gave me something to wonder about! I have now rewritten my macros, so that my printer now supports full control over G10-G11 for each extruder. (I think.) So that all tuning is saved between changing extruders. And with your help I added the following lines to the StartUp gcode:


    T0
    M207 F{retraction_speed,0} S{retraction_amount,0} Z{retraction_hop if machine_endstop_positive_direction_z else 0.0,0}
    M208 F{retraction_prime_speed,0} S{retraction_extra_prime_amount,0}
    T1
    M207 F{retraction_speed,1} S{retraction_amount,1} Z{retraction_hop if machine_endstop_positive_direction_z else 0.0,1} P40
    M208 F{retraction_prime_speed,1} S{retraction_extra_prime_amount,1}
    T{initial_extruder_nr}

     

    The P40 in one of the M207 lines is because I am experimenting with a short break before G10, for PETG. I get underextrusion at the end of the line. I think this is because the nozzle drags filament with it when it goes to the next place.

    Where do you find all these codes? (Z{retraction_hop if machine_endstop_positive_direction_z else 0.0})
    Is there a place where all these codes are described?

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.
    56 minutes ago, toreae said:

    Where do you find all these codes? (Z{retraction_hop if machine_endstop_positive_direction_z else 0.0})
    Is there a place where all these codes are described?

    @ahoeben keeps a handy list of them here (thanks). In the curly braces {} in @GregValiant's example here is actually a Python conditional statement (evaluating basic Python statements in start/end gcode is a fairly recent addition to Cura but pretty handy) but for most of the settings you just put the replacement value in curly braces, don't need to worry about code.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    Thanks.
    I knew a little, like Z{retraction_hop}. But nothing about Z{retraction_hop,0}, or {retraction_hop if machine_endstop_positive_direction_z else 0.0}.
    All of this has to be tested, which is boring, so it won't happen straight away.
    Thanks to both of you. There will probably be a continuation.

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    It's an interesting topic.  That silly workaround (using another setting to enable your z-hops) will suffice for testing.  

    Because plugins and post-processors always run after the Gcode is built up, trying to alter the M207 lines on a tool-by-tool basis is tough.  It will require you to learn some coding and (horror of horrors) some RegEx replacement patterns to use with Search and Replace.

     

    You can start with this override for your printer definition file.  Once it's custom you will need to put it into your Configuration Folder.  Be careful because you can make a mess.


            "machine_endstop_positive_direction_z": {
                "default_value": false,
                "label": "Configure Firmware Z-Hop",
                "description": "This requires a very specific M207 line in the StartUp Gcode" },

     

    Good Luck.

     

  • Link to post
    Share on other sites

    Posted · Testing with 'Firmware Retraction'.

    The code is written. And tested through terminal. I am currently printing with only 1 extruder. PETG. So I haven't tested with the extruder switch while I'm printing.

     

    And now it's overextrusion!


    So then I have to change the code in the menu, too. I had forgotten that. I still use the display that came with the Ender 5.

  • Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • UltiMaker Cura 5.9 stable released!
        Here comes Cura 5.9 and in this stable release we have lots of material and printer profiles for UltiMaker printers, including the newly released Sketch Sprint. Additionally, scarf seams have been introduced alongside even more print settings and improvements.  Check out the rest of this article to find out the details on all of that and more
          • Like
        • 5 replies
      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Heart
          • Thanks
          • Like
        • 4 replies
    ×
    ×
    • Create New...