Variables in Printer start code
 
Notifications
Clear all

Variables in Printer start code  

  RSS
Uwe
 Uwe
(@uwe-2)
New Member
Variables in Printer start code

Hi all,

i am an owner of a Creality K1 printer. I cannot use the Creality own Slicing software because it's is not working properly on Linux (even if they have a version).

The printer requires a start code which includes variables to set hotend and print bed temperatures.
Whenever i put the start code in the appropriate field in Prusa Slicer, i get an error message. 
Using fixed values are working, but depending on my printing temperature, it might go wrong until the hotend reached the temperature provided in the GCODE of the files i am trying to print.

The start code for this particular printer looks like this where the variables are in:

M140 S0
M104 S0
START_PRINT EXTRUDER_TEMP=[material_print_temperature_layer_0] BED_TEMP=[material_bed_temperature_layer_0]

How can i achieve the same on Prusa Slicer?

Posted : 26/08/2023 3:40 pm
JoanTabb
(@joantabb)
Veteran Member Moderator
RE: Variables in Printer start code

Try these commands

M104 S[first_layer_temperature] ; set extruder temp
M140 S[first_layer_bed_temperature] ; set bed temp
M190 S[first_layer_bed_temperature] ; wait for bed temp
M109 S[first_layer_temperature] ; wait for extruder temp

Instead of 

M140 S0
M104 S0
START_PRINT EXTRUDER_TEMP=[material_print_temperature_layer_0] BED_TEMP=[material_bed_temperature_layer_0]

regards Joan

I try to make safe suggestions,You should understand the context and ensure you are happy that they are safe before attempting to apply my suggestions, what you do, is YOUR responsibility. Location Halifax UK

Posted : 26/08/2023 5:10 pm
Uwe liked
Uwe
 Uwe
(@uwe-2)
New Member
Topic starter answered:
RE: Variables in Printer start code

Thanks Joan,

i will give it a try on my next attempt and keep the forum updated.

Posted : 26/08/2023 5:23 pm
Neophyl
(@neophyl)
Illustrious Member
RE: Variables in Printer start code

I believe the K1 uses a form of Klipper.  As such the "START_PRINT EXTRUDER_TEMP=" & "BED_TEMP=" are the commands Klipper is looking for.  Your issue is that the parts inside the brackets [material_print_temperature_layer_0] & [material_bed_temperature_layer_0] are the Cura placeholders.  Those aren't part of Prusa Slicer and mean absolutely nothing to PS.  Hence the error.

You need to replace those placeholders with the PS equivalents.  Which handily Joan has already listed.  The gcode Joan listed are standard Marlin commands  which Klipper will probably recognise so might work but if the Klipper Macro's needs those values elsewhere it might still cause you problems.  The Klipper version you will need is I believe - 

M140 S0
M104 S0
START_PRINT EXTRUDER_TEMP=first_layer_temperature[0]  BED_TEMP=first_layer_bed_temperature[0]

You might have to play around with brackets {} possibly but the idea is to substitute the Cura placeholders for PS ones.  Btw you can find the PS placeholders by looking for a tooltip when you hover over a setting.  Theres also a list on the PS knowledge base.  

Posted : 26/08/2023 9:38 pm
Uwe
 Uwe
(@uwe-2)
New Member
Topic starter answered:
RE:

Your issue is that the parts inside the brackets [material_print_temperature_layer_0] & [material_bed_temperature_layer_0] are the Cura placeholders.  Those aren't part of Prusa Slicer and mean absolutely nothing to PS.

Yes, that might be exactly the issue. As both Creality Print and Cura are using the same root they both understand that, but PS does not.

Using your alternatvie throws this error about a missing legacy variable:

start_gcode
Parsing error at line 3. Expecting a legacy variable expansion format
START_PRINT EXTRUDER_TEMP=first_layer_temperature[0] BED_TEMP=first_layer_bed_temperature[0]

 

This post was modified 9 months ago by Uwe
Posted : 27/08/2023 4:54 am
Uwe
 Uwe
(@uwe-2)
New Member
Topic starter answered:
RE:

Update: After putting some brackets (as you suggested), the error is gone and the objects are sliced without any further. It works now with that code:

 

M140 S0
M104 S0
START_PRINT 
EXTRUDER_TEMP={first_layer_temperature[0]}  
BED_TEMP={first_layer_bed_temperature[0]}
Posted : 27/08/2023 5:08 am
Share: