Turn off print fan before color change
 
Notifications
Clear all

Turn off print fan before color change  

  RSS
nsand
(@nsand)
Active Member
Turn off print fan before color change

I want to turn off the print fan before the color change and then turn it back on after the M600 routine is complete. I thought I could do this with a little scripting in Prusa Slicer (currently using ver. 2.3.3) but I'm not having any luck - maybe it's something I'm just missing or a detail that I've overlooked. Here's the code that I'm trying to use in the 'Color Change G-Code' box of the Custom G-code section:

{if layer_z > disable_fan_first_layers}M107{endif}
M600
{if layer_z > disable_fan_first_layers}M106 S{max_fan_speed * 2.55}{endif}

The problem I'm running into, is that none of my statements are being evaluated - the entire thing is being inserted into the generate gcode file as a string, like so:

;AFTER_LAYER_CHANGE
;6.4
;COLOR_CHANGE,T1
{if layer_z > disable_fan_first_layers}M107{endif}
M600
{if layer_z > disable_fan_first_layers}M106 S{max_fan_speed * 2.55}{endif}

I also tried without the 'disable_fan_first_layers' variable and just used a hard-coded 3 but the same thing was happening. Any help would be appreciated. 

Posted : 11/08/2021 1:27 pm
Ringarn67
(@ringarn67)
Reputable Member

@nsand

There may be a bug, check this thread

https://forum.prusa3d.com/forum/prusaslicer/prusaslicer-placeholder-variable-evaluation/

Prusa i3 MK3S+ FW 3.11.0 (kit dec -20), PrusaSlicer 2.5.0+win64, Fusion 360, Windows 10

Posted : 11/08/2021 1:46 pm
nsand
(@nsand)
Active Member
Topic starter answered:
thanks

Thanks very much. Looks like the same issue.

Posted : 11/08/2021 2:19 pm
Neophyl
(@neophyl)
Illustrious Member

You could possibly just insert a block that doesnt need any evaluation until they get it fixed

M107
M600
M106 S255

 

 

Posted : 11/08/2021 7:14 pm
nsand liked
nsand
(@nsand)
Active Member
Topic starter answered:

 

Posted by: @neophyl

You could possibly just insert a block that doesnt need any evaluation until they get it fixed

M107
M600
M106 S255

 

 

yep - and that works fine - it's how I've been doing it, but since I've no way to know what the fan speed was set to before the color/material change (a feature that would be really helpful), I was hoping to use the interpreted code to set it to the max fan speed set up in the filament profile. 100% fan speed is too much for some materials/prints. 

Posted : 11/08/2021 8:28 pm
Share: