2

I have upgraded my ER-20 with a Bondtech dual gear feeder. It is not or hardly possible to load/unload filament manually with this feeder, so some .gcode is needed to do it. I wanted to implement something similar to the atomic cleaning method for unloading: https://ultimakernasupport.zendesk.com/hc/en-us/articles/115004187066-Atomic-Cleaning-Method

Here is my current .gcode:

G21 ; Metric values
G90 ; Absolute positioning
M82 ; Extruder absolute mode
G28 ; Auto home
M420 S1
G1 X100 Y100 Z100 F1000
; M92 E415 ; 415 steps/mm
M302 S105 ; Allow extrusion above 105C
M109 S218 ; Heat hotend to 218C
M400
G92 E0 ; Reset extruder positioning
M104 S160 ; Start the cool down
M117 Extrude prime blob
G1 E10 F100 ; Extrude a short before unload to avoid blob forming
M109 S160 ; Wait for 160C
M104 S110
G92 E0
G1 E0.2 F100 ; Pressurize the hotend
M117 Pressurize hotend
M109 S110 ; Heat hotend to 110C
G92 E0 ; Reset extruder positioning
M117 Pull out slow
G1 E-3 F200 ; Pull back a bit, slow
M117 Pull out fast
G1 E-430 F2000 ; Pull back 43cm with 2000mm/min
G92 E0 ; Reset extruder positioning
M400 ; Wait for command finish
M117 Remove the filament now
; M400 ; Wait for command finish
M302 S170 ; Allow extrusion above 170C
M104 S0

It doesn't work:

  • the auto bed leveling is always done, I don't know how to turn it off
  • when I see that the "Extrude a short before unload to avoid blob forming" event is happening, I also see the "Pull out fast" message on the display and the "print" process ends

Could anyone take a look at this code please? Or is there any .gcode validator for Marlin somewhere?

What I intend to do with this code:

  • heat up the hotend to 218 °C
  • extrude some material while a cool down to 160 °C is already started
  • when temp 160 °C is reached, start a cool-down process to 110 °C and push a little material to the feeder (pressurize)
  • when 110 °C is reached pull out some material from the hotend slow (maybe the feeder won't be enough strong to do it, but I have never reached this point to check)
  • then pull out the filament from the Bowden and feeder fast
agarza
  • 1,334
  • 2
  • 10
  • 30
Endre
  • 133
  • 6

1 Answers1

3

There are three things to fix and one suggestion:

  • Change follwing lines of M109, using parameter R instead of S, because the latter is not waiting to cool down:

    M109 R160 ; Wait for 160C
    ...
    M109 R110 ; Heat hotend to 110C
    
  • The behavior of M420 will depend on type of bed leveling, saved mesh, etc. It is off topic to troubleshoot this. The printer operates 10 cm above the surface for this operation. G28 disables bed leveling. Why do you need to re-enable it? Just remove this line:

    ; M420 S1 - remove (or comment out)
    
  • Redefine maximum extrusion length in Configuration.h to allow for scripted long pull (G1 E-430), for example:

    #define EXTRUDE_MAXLENGTH 450
    
  • Suggestion: Use relative mode for extrusion (M83) instead of absolute positioning (M82). It will simplify your code a lot. You just want to express the distance in E parameter. Then you will not have to reset position with G92 E0 every now and then (do it just once on the start). (I use this Extrusion mode also for slicing becuase it makes easier to re-start a print in case of failure).

octopus8
  • 916
  • 2
  • 17
  • [Note: 160 might be below the temperature that allows to move the extruder.](https://3dprinting.stackexchange.com/questions/15495/how-to-print-at-low-temperatures-filament-melting-at-about-70-c). Luckily OP included `M302 S105` before the cooldown. – Trish Feb 08 '21 at 08:23
  • Yes, the script looks quite mature and consistent. Btw. I have added `#define USER_DESC_7 "Allow cold extrusion"` `#define USER_GCODE_7 "M302 P1"` to my custom commands in *Configuration_adv.h* and used it quite often since then. – octopus8 Feb 08 '21 at 08:36
  • Thanks @octopus8. I use the factory firmware for my EryOne ER-20. As I see the Marlin FW development is Windows centrist. The flashing tool was even not working for me on Linux, I had to borrow a Windows machine to flash the printer with the new factory FW release. – Endre Feb 08 '21 at 17:25
  • Maybe I'll try to set up some kind of serial debug logging (if it is possible), and I hope I'll get some meaningful error messages (like M302 is not supported by this config). – Endre Feb 08 '21 at 17:27
  • But to change lines in G-code - as described in an answer - and possibly make you script work, you don't need to re-flash Marlin. Or do you, for any reason which I do not recognize? But for tunning custom menu, yes indeed. – octopus8 Feb 08 '21 at 17:47
  • Thanks for the "using parameter R instead of S" tip. Now I see the cool-down sequence. But no extrusion (pull) happens. Maybe it is just not enabled in the FW. Other annoying thing, that the bed leveling always happens. Is there any way to turn that off? As I remember when I worked on startup g-code for the Cura slicer, I had to figure out how to bed-level from the code. Now I have to figure out how to not bed-level :) – Endre Feb 08 '21 at 17:51
  • `M302 S105` followed by `G1 E-1` works for me at 145 °C, I just checked it with PuTTY. *(Maybe you would like to try executing your script line by line, manually from terminal? Marlin is giving some valuable textual feedback, more debug details with `M111 S247`.)* As for the auto bed leveling I do not have a response at hand, I was too lazy so far to inspect all these settings in practice... but: maybe you didn't ever save the mesh to EEPROM after performing leveling, and thus it wants to re-do this process? – octopus8 Feb 08 '21 at 18:28
  • 1
    Hi, I guess I got it. I have checked the source of the Factory FW and I have seen that the maximum extrusion length is set to 200. So I divided my long one piece extrusion into 3 smaller and now the pull back is working. – Endre Feb 08 '21 at 18:37