Placeholders
I don't know if you are familiar with the concept of placeholders? PrusSlicer is a derivative of Slic3r which uses this concept to insert placeholders (sort of constants, with the possibility to do arithmetic) into your G-code (e.g. start or end codes) which are evaluated just before the slicer generates the final G-code upon slicing.
Unfortunately, although there is a constant for the filament type (filament_type
), you cannot use a conditional expression as this does not work on string comparison (which should work with regular expressions...), but with some imagination you can fabricate a way to get past this problem.
E.g.
{if printer_notes=~/.*PRINTER_VENDOR_PRUSA3D.*/};Printer is Prusa{endif}
M117 [filament_type]
evaluates fine, but
{if filament_type=~/.*PLA.*/};Filament type is PLA{endif}
does not evaluate fine...
Solving this using placeholders, the printing temperatures for PLA and PETG are different, so in a conditional statement of the first_layer_temperature
you could add an additional offset to the code at the end of the start G-code.
Start G-code
A place to do this is the filament dependent start G-code section:
You can always edit this start G-code to include a manually set offset by moving the printer to a certainly height:
G1 Z0.15
and then redefining the zero level
G92 Z0
Printer Z-offset
Note that a z_offset
constant exists, so it is configurable in the graphical interface, if so, than I assume this fixes your problem instantly as the offset is directly applied in the final G-code. The z-offset
option is part of the "printer settings" interface. This extra offset is added to the initial layer height movement.