Prime gcode

Discussion in 'Getting Started' started by Andy Cohen, Dec 12, 2019.

  1. Andy Cohen

    Andy Cohen Well-Known Member

    Joined:
    Aug 23, 2019
    Messages:
    217
    Likes Received:
    57
    Oy...
    Why oh why is my extruder reversing at the end of the Prime???
    When I test the following by selecting the tool manually on the webUI or panel the prime works exactly as I want it to.
    When I print though instead of giving me a second extrusion at the lower feed rate for 5mm it reverses and goes for a 20mm retraction which ruins everything.

    ;Prime
    G92 E0; set position
    G1 E20 F200; Extrude 20mm
    G1 F50 ; Set feedrate to 50
    G1 E5 F50; Extrude 5mm
    G1 E-0.05 F200; retract .05mm
    G92 E0; set position
    G4 S2; Dwell 2Sec

    Anybody?
     
  2. Andy Cohen

    Andy Cohen Well-Known Member

    Joined:
    Aug 23, 2019
    Messages:
    217
    Likes Received:
    57
    FWIW...
    I added another set position and it stopped the unwanted retraction:
    ;Prime
    G92 E0; set position
    G1 E20 F200; Extrude 20mm
    G92 E0; set position
    G1 E5 F50; Extrude 5mm
    G1 E-0.05 F200; retract .05mm
    G92 E0; set position
    G4 S2; Dwell 2Sec
     
  3. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    459
    Likes Received:
    206
    Looks like you forgot to put M83 to select relative extrusion at the start of your macro.
     
  4. Andy Cohen

    Andy Cohen Well-Known Member

    Joined:
    Aug 23, 2019
    Messages:
    217
    Likes Received:
    57
    Keeping it in absolute mode seems prudent given each tool uses this macro and each tool has it's parked location. Resetting the position fixed it.
     
  5. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    459
    Likes Received:
    206
    No, you should always switch to relative mode in any macro that does extrusion. That way you don't mess up the virtual extruder position when the slicer isn't expecting it. When the macro completes, the original absolute/relative setting will be restored.

    BTW I strongly recommend that you slice models in relative extrusion mode. Handling absolute extrusion mode invokes a lot of extra complexity in the firmware.
     
    #5 dc42, Dec 30, 2019
    Last edited: Jan 4, 2020
  6. Aluminati

    Aluminati Member

    Joined:
    Dec 27, 2019
    Messages:
    7
    Likes Received:
    3
    Correct me if I am wrong, but I believe you meant to say "No, you should always switch to relative mode in any macro that does extrusion."
     
  7. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    459
    Likes Received:
    206
    You are quite right. I have corrected that post. [BTW is there a strikeout format option in this forum software?]
     
  8. Jai Stanley

    Jai Stanley Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    115
    Likes Received:
    60
    This is something I've been struggling with too; thank you for the lead! I'll look at my prime scripts today after I get some prints through. I haven't yet done any toolchanging prints because I've had such little faith in the prime (that and I've been prototyping direct drive extruders). I tried resetting the extrusion length at various points in the macro; but still get gaps even in the brim prime on first layers. That wouldn't be good if toolchanging with no prime tower...
     

Share This Page