Not sure if have this figured out yet but I do something similar except for different extrusion widths when I was running Marlin. Just changed over to Klipper now and figuring out how I can do the same so still looking into an elegant solution but for the moment I use post-processing in Cura to set my K values
Basically in my start gcode in Cura I have:
M140 S{material_bed_temperature_layer_0} ; Start heating the bed to initial layer temp
G4 S30 ; wait 30 secs
M104 S{material_print_temperature_layer_0} ; start heating the hot end to initial layer temp
M190 S{material_bed_temperature_layer_0} ; wait for bed
M109 S{material_print_temperature_layer_0} ; wait for hotend
In Search and Replace with the checkbox for expressions ticked I do the following
Search: M190 S85.1\t; wait for bed\nM109 S225\t; wait for hotend
Replace: ;POST-PROCESSED DETAIL PETG 0.2_0.42\nM190 S85.1\t; wait for bed\nM109 S225\t; wait for hotend\nM92 E414.63\t; set new extruder setting for PETG\nM301 P14.19 I0.81 D62.17\t; set PID hotend 230C/50% fan\nM304 P114.31 I19.93 D437.00\t; set PID bed 85C\nM900 T0 K1.635 L1.72\t; Linear advance for DETAIL PETG 0.2_0.42
And then in my specific Cura profiles, I just make sure to set the initial bed temperature to 85.1 (or whatever else triggers you use) so that it will trigger the search and replace code that I want. I also use this to set my extruder E steps, as well as PID settings. Because I have my PID values, and E-steps tuned for whatever setting that I'm using (PLA or PETG etc).
So in the end I have about 15 different Search and Replace code to handle the various settings that I have. All hinging on this initial bed temp value.
I even use this Search and Replace method to set different K (and L) values when I'm doing a different initial layer height for example. Bear in mind this was all for Marlin, so you'll have to modify the code to your needs.
-
1
Recommended Posts
ahoeben 1,981
Use the Linear Advance Setting plugin (from the Marketplace) to set your linear advance factor in profiles. Then - since you seem to be using Klipper), add this gcode macro to your printer.cfg:
[gcode_macro m900] default_parameter_K: 0 gcode: SET_PRESSURE_ADVANCE ADVANCE={K}
Link to post
Share on other sites