Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not auto-generate G-code when using Klipper #232

Closed
c10l opened this issue May 10, 2020 · 8 comments
Closed

Do not auto-generate G-code when using Klipper #232

c10l opened this issue May 10, 2020 · 8 comments
Labels
enhancement fix is live in the last release Please download /build the last release and try to reproduce.

Comments

@c10l
Copy link

c10l commented May 10, 2020

Version

2.2.49

Operating system type + version

macOS Catalina (probably unrelated)

3D printer brand / version + firmware version (if known)

Klipper firmware v0.8.0-520-g787ed452 (although this is unrelatad since this is a feature request for generated G-Code)

Behavior

I use Klipper firmware and have a START_PRINT macro that does the entire start procedure, including heating up bed and nozzle in a specific pattern.

If my Start G-code in the Printer Settings -> Custom G-code doesn't explicitly set the bed temperature, Slic3r++ prepends my macro with:

M107
M190 S<bed_temp>
M104 S<extruder_temp>

That bit of G-code interferes with my startup sequence.

  • Expected Results
    First lines of G-code:
START_PRINT EXTRUDER=230 BED=70
  • Actual Results
    First lines of G-code:
M107
M190 S70 ; set bed temperature and wait for it to be reached
M104 S230 ; set temperature
START_PRINT EXTRUDER=230 BED=70

Is this a new feature request?
Yes, I'd like the option to suppress this automatic G-code generation. It could be a configuration flag that gets enabled when I select Klipper as the G-code flavour.

Project File (.3MF) where problem occurs

project.3mf.gz

@supermerill
Copy link
Owner

supermerill commented May 10, 2020

Will do, when i'll change the scripting engine, hooks & gui.

Personally, i don't see the advantage to write the macro in klipper instead of writing it in the slicer. It's harder to edit.

@c10l
Copy link
Author

c10l commented May 10, 2020

Thanks! I love macros because I can keep things in Klipper and don't need to reslice if I change them.
I have a relatievly fiddly hotend+probe and I'm trying a few different song and dances to get it to set the first layer right the first try, and once I've got it I'd rather keep it in one place.
It's personal preference I guess. :)

Anyway, thanks for considering this. Your fork is awesome!

@DeviousPenguin
Copy link

DeviousPenguin commented May 10, 2020

I may have a solution for this as I'm doing something similar with Klipper, here;s my gcode in slic3r++:

M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
START_PRINT ; Klipper Start GCode Macro

And here's where my macro gets the temps in my klipper macro:

[gcode_macro START_PRINT]
gcode:
    CLEAR_PAUSE                     ; Clears the Pause state
    SET_IDLE_TIMEOUT TIMEOUT=600    ; set the idle timeout (in seconds)
    # Wait for bed to reach temperature
    M190 S{printer.heater_bed.target}
    # Set and wait for nozzle to reach temperature
    M109 S{printer.extruder.target}
    # Temps are good
    # rest of the macro...

Note you need to be running an up to date install of Klipper for this to work. This allows me to do things like set LED's while the hotend heats up for example.

@c10l
Copy link
Author

c10l commented May 11, 2020

I fail to see how this is a solution. The point of this issue is to have the whole startup procedure in the macro. In your solution you have M104 and M140 in the slicer, running before the macro. That defeats the whole purpose.

@DeviousPenguin
Copy link

DeviousPenguin commented May 11, 2020

Ok maybe what I posted isn't really a solution, more of a workaround so I can do things in klipper while heating up the printer. I see you are trying to avoid the need to re-slice, this may be more tricky unless you create Klipper macros for the M104 and M140 commands.

@supermerill
Copy link
Owner

builds without these gcode are available here.
https://github.com/supermerill/Slic3r/actions

@supermerill supermerill added the fixed for the next version That means that you should be able to test it in the latest nightly build label May 11, 2020
@c10l
Copy link
Author

c10l commented May 11, 2020

That's awesome, very quick turnaround! :)

I've just tested it, looks great!

@ChasonDeshotel
Copy link

ChasonDeshotel commented Apr 22, 2022

Personally, i don't see the advantage to write the macro in klipper instead of writing it in the slicer.

Config files are always better. In this case:

  • keeps the printer slicer-agnostic
  • network share config file between printers
  • don't have to keep laptop and desktop slicers in sync (I tweak from presets)
  • track changes with git
  • use a real text editor

It's harder to edit.

Any text that I can't edit with Vim is harder to edit ;)

ssh pi then kc (alias for vim ~/klipper_config/klipper.conf). Then when the file is open I can/ search for macros and edit all of them without ever leaving the keyboard

I can comment blocks of code at once, have an undo buffer, get syntax highlighting, etc, etc...

Anyway I found the checkbox 😊 Thank you for implementing that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement fix is live in the last release Please download /build the last release and try to reproduce.
Projects
None yet
Development

No branches or pull requests

4 participants