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

Add Klipper Support #1

Closed
garethky opened this issue Nov 13, 2023 · 3 comments
Closed

Add Klipper Support #1

garethky opened this issue Nov 13, 2023 · 3 comments

Comments

@garethky
Copy link
Owner

garethky commented Nov 13, 2023

Klipper is largely Marlin compatible and I already have code to emit the PRESSURE_ADVANCE gcode. But its not working with the function that updates the last M109 call's temperature.

Klipper machines are usually configured with a custom PRINT_START macro. Its common to pass this macro the bed and nozzle temps for the print. e.g. this is my print start gcode from my Voron 2.4:

M104 S0 ; Stops PS/SS from sending temp waits separately
M140 S0

PRINT_WARMUP EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature]
PRINT_START EXTRUDER_TEMP=[first_layer_temperature] BED_TEMP=[first_layer_bed_temperature] PRINT_START_X=[first_layer_print_min_0] PRINT_START_Y=[first_layer_print_min_1] PRINT_END_X=[first_layer_print_max_0] PRINT_END_Y=[first_layer_print_max_1]

This raw code is in the config that Prusa Slicer emits. I think I could parse that and substitute in the required variables. It doesn't have any of the lanugage features like conditionals, loops, expressions etc. This is simple s/[first_layer_temperature]/240/ stuff that should be quick to prototype.

Also, the checking for/modifying of M109 needs to not result in an exception if its not found for klipper machines.

@garethky
Copy link
Owner Author

garethky commented Nov 24, 2023

Made some progress:

  • Updated the M109 alteration code to not run at all if the first layer temp is the same as the filament temp
  • If the M109 update code cant find an M106 call it now adds one to match the required temp. This will cause your printer to stop while it heats up. This isn't exactly desirable but it works.
  • Added SET_VELOCITY_LIMIT SQUARE_CORNER_VELOCITY=1 gcode required for PA testing. Right now its at the end of the start gcode.

Implementing a parser for Prusa's start Gcode language is not something I think I have time for right now.

garethky added a commit that referenced this issue Nov 25, 2023
* re-evaluation of the start_gcode to solve for injecting the filament temperature and print area. #1, #4
* addition of object commands for klipper used by adaptive bed mesh. #4
* Support for altering M555 in Prusa gcode #4

Also changed when the start and end gcode get built so exceptions will trigger the error box in the UI.
@garethky
Copy link
Owner Author

This needs to be verified with testing but klipper should be supported now.

I implemented a minimal variable templating engine for the prusa gcode templates so the start_gcode can be re-evaluated. A very minimal set of values is provided, just temperatures and print location and size. If you used anything else more exotic its going to fail with an exception.

Object markers have also been added if the emitted gcode had an object marker present. This dive the plugin version of adaptive bed meshing.

@garethky
Copy link
Owner Author

I'm closing this for now. If klipper users have issues with their start gcode being processed we can open a new issue about the specifics.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant