1

I am working on a filament unload script. My current problem is that the script always does an auto bed leveling.

I have two scripts to test this issue:

LevelBed.gcode:

G28             ; Auto home
G29             ; Level bed
M500            ; Save to EEPROM

Move.gcode:

M501            ; Restore from EEPROM (try to eliminate bed leveling)
G21             ; Metric values
G90             ; Absolute positioning
G28             ; Auto home
M420 S1         ; Enable bed leveling
G1 X100 Y100 Z100 F1000 ; Move
M400            ; Finish moves

Move.gcode does bed leveling (LevelBed.gcode was executed before).

How is it possible to do a movement from G-code without doing automatic bed leveling?


My intention with Move.gcode:

  • Do an auto home
  • Do a move to (100, 100, 100)

The problem:

  • Bed leveling happens between the Auto Home and the Move. (It probes the bed at 9 points)

I think G28 Auto Home is not required for filament load/unload scripts. My donor scripts for this purpose just contained them. I made an example script to just rotate the feeder gear and it seems to be working.

ColdExtrude.gcode

G21           ; Metric values
M83           ; Extruder relative mode
M302 S5       ; Allow extrusion above 5C
G1 E-10 F200  ; Pull back filament a bit
M400

So I cannot eliminate doing an Auto Bed Leveling sequence after G28, but maybe I even won't need to do it :)


This question remains relevant. I'll need a good print startup code for the Cura slicer. It should do something like:

  • Heat the bed
  • Auto Home
  • Auto Bed Level
  • Auto Home again
  • Lift up the hot-end a bit and heat it up
  • Draw a prime line

I am afraid if this problem is not solved, an other Auto Bed Level sequence will be executed between the 2nd Auto Home and the hot-end lift up.


I have recently noticed that the my load/unload scripts based on ColdExtrude.gcode are not always working. Sometimes the printer starts Auto Bed Leveling without knowing the origin position and badly hits the X/Y movement limits. So I have to do G28 in my filament load/unload scripts, which involves an implicit Auto Bed Leveling sequence, which is time wasting.

So my question is still active:

How to do extrusion from .gcode without implicit execution of an Auto Bed Leveling sequence?

Endre
  • 133
  • 6
  • 1
    Could you please explain what you want to happen in what order? Probing the bed to determine the level is always done by the `G29`, so when you call it it will probe the bed, note that a `G28` after `G29` disables bed leveling. "Follow with `M420 S` to turn leveling on, or use `RESTORE_LEVELING_AFTER_G28` to automatically keep leveling on after `G28`" ([reference](https://marlinfw.org/docs/gcode/G028.html)). – 0scar Feb 09 '21 at 19:30
  • What I would like to do is an Auto Home, than a Move. The problem is that a bed leveling is happening in between (the bed is probed at 9 points), I don't want this bed leveling and I don't know how to turn it off. I guess `RESTORE_LEVELING_AFTER_G28` is a `C` macro, I'd like to avoid FW recompilation and re-flashing. – Endre Feb 09 '21 at 19:39
  • If so, that can only be caused by M420 then. But, I've looked into the sources of Marlin 2, but don't see that a level probing is instructed. Have you tried `M420 S` without the `1`? – 0scar Feb 10 '21 at 13:05
  • Hi @Oscar, thanks for your help. It also doesn't work as I expect with `M420 S`. But as I see I even don't have to solve this problem now to move forward. – Endre Feb 10 '21 at 16:37
  • Please delete the question if it is not relevant anymore. – 0scar Feb 10 '21 at 17:03
  • @0scar, I think it is actually good question. It's the leftover, if you check [the previous one](/q/15576). I plan to try making similar setup the next weekend, and possibly reproduce this. @Endre would you mind [attaching your configuration files](https://meta.stackexchange.com/questions/47689/how-can-i-attach-a-file-to-a-post)? Btw. will it do ABL when you execute `G28 X Y`? Or if you execute `G28 Z` separately after then? – octopus8 Feb 10 '21 at 22:50
  • Why a second auto home, while a `G0 X0 Y0 Z10` would suffice. Homing is an action that should be performed once. – 0scar Feb 11 '21 at 05:55
  • Right. `G0` or `G1` move is sufficient instead of `G28`. What I have experienced that my `load/unload` scripts without `G28` are not functioning well sometimes. Sometimes they just start an auto-bed-level, without knowing where the origin is :(. As I see it is too risky to even do just a feeder gear rotation without `G28`, which involves a bed-level sequence which is sometimes time wasting. – Endre Feb 11 '21 at 08:15
  • Maybe the board doesn't store the changes, that was pretty common for SKR boards and older Marlin firmware versions, that has been fixed now that the changes can be stored on the SD card of the board. What printer and which firmware is being used? – 0scar Mar 14 '22 at 17:02

1 Answers1

0

A second G28 should not be necessary as it can be replaced by a G0 or G1 command, but in the end it should work when RESTORE_LEVELING_AFTER_G28 has been set in firmware weren't it for a bug present in the Marlin 2.0.7.2 and 2.0.x bug-fix release.

0scar
  • 32,029
  • 10
  • 59
  • 135