Mysterious GCODE before CUSTOM on export
I'm trying to create a custom start gcode for my klipper machine. I've got a problem with probing Z axis when bed is cold / hot; the drift that the temperature creates.
So I want to first heat up the bed to first_layer_bed_temperature - 10°C, wait for it to reach the temperature and then turn on the extruder heater and probe the bed. The "issue" with klipper is that when you call for it to wait for temperature, it doesn't start the next line until the temperature is reached, unlike in Marlin when it starts as soon as it's over the target temperature; so if you have your bed at 80°C and tell it to heat up to 70°C and wait it will actually wait for it to drop to 70°C instead of just going ahead with 80°C.
This is my start GCODE config:
SET_PIN PIN=leds VALUE=1 SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={first_layer_bed_temperature[0] - 10} G90 ; use absolute coordinates SET_PRINT_STATS_INFO TOTAL_LAYER=[total_layer_count] TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={first_layer_bed_temperature[0] - 10} MAXIMUM=120 SET_HEATER_TEMPERATURE HEATER=extruder TARGET={first_layer_temperature[initial_extruder]} SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET={first_layer_bed_temperature[0]} G28 ; home all BED_MESH_PROFILE LOAD=default TEMPERATURE_WAIT SENSOR=extruder MINIMUM={first_layer_temperature[initial_extruder]} MAXIMUM={first_layer_temperature[initial_extruder] + 50} TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM={first_layer_bed_temperature[0]} MAXIMUM=120
But when exporting GCODE and inspecting it there are 3 lines of code that don't appear anywhere in my config (exported the whole config and searched for the strings). They appear before the "CUSTOM GCODE" block and after it.
M190 S72 ; set bed temperature and wait for it to be reached M104 S240 ; set temperature ;TYPE:Custom M109 S240 ; set temperature and wait for it to be reached
How to get rid of these 3 lines?
This is sample export of GCODE.
; thumbnail end ; ; ; external perimeters extrusion width = 0.45mm ; perimeters extrusion width = 0.45mm ; infill extrusion width = 0.45mm ; solid infill extrusion width = 0.45mm ; top infill extrusion width = 0.40mm M73 P0 R41 ; printing object Body1.stl id:0 copy 0 ; stop printing object Body1.stl id:0 copy 0 M190 S72 ; set bed temperature and wait for it to be reached M104 S240 ; set temperature ;TYPE:Custom SET_PIN PIN=leds VALUE=1 SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=62 G90 ; use absolute coordinates SET_PRINT_STATS_INFO TOTAL_LAYER=200 TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM=62 MAXIMUM=120 SET_HEATER_TEMPERATURE HEATER=extruder TARGET=240 SET_HEATER_TEMPERATURE HEATER=heater_bed TARGET=72 G28 ; home all BED_MESH_PROFILE LOAD=default TEMPERATURE_WAIT SENSOR=extruder MINIMUM=240 MAXIMUM=290 TEMPERATURE_WAIT SENSOR=heater_bed MINIMUM=72 MAXIMUM=120 G92 E0 M109 S240 ; set temperature and wait for it to be reached G21 ; set units to millimeters G90 ; use absolute coordinates M83 ; use relative distances for extrusion ; Filament gcode BED_MESH_PROFILE LOAD=70 M107 ;LAYER_CHANGE
RE: Mysterious GCODE before CUSTOM on export
If PS doesnt see the normal commands for heating things up it will automatically add them. In the past this caused issues with klipper setup and the work around was to add them in at the start with temps set to zero. Then place your custom sequence after those.
However with later versions of PS there a tick box called Emit Temperature commands automatically. Its a expert level setting in Printers>Custom Gcode. You can untick that and it supresses those additions. Was basically added for Klipper users. Located just Below the start gcode field.