Filament Monitor Disbaled for First layer only
-
maybe something like this in daemon.g
if job.layer = 0 M591 D0 P0 else M591 D0 P1 C"e0stop"
or whatever your filament monitor is
-
@jay_s_uk said in Filament Monitor Disbaled for First layer only:
if job.layer = 0 M591 D0 P0else M591 D0 P1 C"e0stop"
Thanks.
I tried adding the below lines in daemon.g
if job.layer = 0
M591 D0 P0
M591 D1 P0
else
M591 D0 P3 C"121.io1.in" E5 S1 R10:190 ; Filament Runout Sensor for tool 0
M591 D1 P3 C"122.io1.in" E5 S1 R10:190 ; Filament Runout Sensor for tool 1Disabled these lines from config.g
Before starting the print, it shows No Filament present.
As soon as I hit the print button, the filament monitors are enabled.
'M591 D1
Duet3D rotating magnet filament monitor v4 on pin 122.io1.in, enabled' -
@selva_tvi sorry, i meant job.layer = 1 not 0.
They will be activated the rest of the time.
We could always expand it a bit to only run when the printer is processing.if job.layer = 0 & state.status = "processing" M591 D0 P0 M591 D1 P0 else M591 D0 P3 C"121.io1.in" E5 S1 R10:190 ; Filament Runout Sensor for tool 0 M591 D1 P3 C"122.io1.in" E5 S1 R10:190 ; Filament Runout Sensor for tool 1
Don't forget they need to be indented accordingly
-
@selva_tvi I suggest you disable the filament monitor in either the slicer start GCode or in your start.g file. Then enable it either in the slicer layer change script or in daemon.g when the layer number reaches 1 or 2.
-
@dc42 @jay_s_uk Thanks for the support.
I tried giving M591 D0 P0 at the start and after Layer 2 enabling as M591 D0 P3.
But that didn't work.
Then I enabled FRS in config.g as usual, then rewrote daemon.g as below:
if job.layer = 1 & state.status = "processing"
M591 D0 S0
M591 D1 S0
else
M591 D0 S1
M591 D1 S1For the first layer, both were disabled and then after 2nd layer it was enabled.
-
-
-
@selva_tvi said in Filament Monitor Disbaled for First layer only:
I tried giving M591 D0 P0 at the start and after Layer 2 enabling as M591 D0 P3.
That's not what I meant. Configure the filament monitor in config.g as usual. Then use M591 D0 S0 at the start of the job or in start.g to disable it, and M591 D0 S1 at layer 2 to enable it.
-
@dc42 Yes, I have configured the FRS as usual in config.g.
M591 D0 P3 C"121.io1.in" E5 S1 R10:190 ; Filament Runout Sensor for tool 0
M591 D1 P3 C"122.io1.in" E5 S1 R10:190 ; Filament Runout Sensor for tool 1Then in the daemon.g as below:
if job.layer = 1 & state.status = "processing"
M591 D0 S0
M591 D1 S0
else
M591 D0 S1
M591 D1 S1When the print starts, it shows both the FRS is disabled at layer 1.
Then from Layer 2, it shows as enabled.
By the way, may I know the difference in keeping the above commands in daemon.g vs start.g?
Thanks
-
@selva_tvi said in Filament Monitor Disbaled for First layer only:
By the way, may I know the difference in keeping the above commands in daemon.g vs start.g?
start.g will be run once before the print starts so it makes sense to disable your filament sensors there.
daemon.g will run by default every 10 seconds, so it's probably using resources needlessly in this case, but it's not going to hurt anything albeit that there's a possible 10 second delay between your layer starting and the sensors beinf enabled.
You could use that to enable your sensors or you could just us your slicer's before layer change section.
In superslicer or pruser slicer you could use this to only enable the sensors at the start of layer 2{if layer_num == 2} ;enabled filament sensors on layer 2 M591 D0 S1 M591 D1 S1 {endif}
Output in Gcode
-
@OwenD said in Filament Monitor Disbaled for First layer only:
start.g will be run once before the print starts so it makes sense to disable your filament sensors there.
I disabled daemon.g and kept the below contents in start.g
if job.layer = 1 & state.status = "processing"
M591 D0 S0
M591 D1 S0
else
M591 D0 S1
M591 D1 S1But it didnt work. Even at layer 1, it was enabled only.
Any change to be made?
-
@selva_tvi said in Filament Monitor Disbaled for First layer only:
@OwenD said in Filament Monitor Disbaled for First layer only:
start.g will be run once before the print starts so it makes sense to disable your filament sensors there.
I disabled daemon.g and kept the below contents in start.g
if job.layer = 1 & state.status = "processing"
M591 D0 S0
M591 D1 S0
else
M591 D0 S1
M591 D1 S1But it didnt work. Even at layer 1, it was enabled only.
Any change to be made?
start.g is run before printing starts, so the layer number will be zero
Therefore your code would enable the sensor as the layer does not equal one.
In start.g just disable the sensors without any if conditions.
If you use the slicer layer change code I gave then it puts the enabling commands in the print gcode.
Otherwise use daemon.g to do the enabling if you can't use the slicer layer change section