Filament out sensor G code M591 query
-
Hi, in the last year I have built my own Core XY printer using a Duet wifi controller with a Panel duo display and it has been working OK for some time. I am now doing larger prints and am trying to fit a filament out sensor using a simple micro switch. I have been unable to make this work.
I have been using M581 T2 E0 S0 C1 to configure the switch to trigger a sys/trigger2.g macro to pause the machine.
I used the M582 T2 to poll the switch.
When I look at the machine state on my computer interface the switch show E0 on /off when the swich is operated.I looked through previous posts and see from the administrator in Jan2019 that M581/582 should no longer be used and M591 should be used instead. Is that the case? if so perhaps some comment in the Gcode dictionary would be useful.
In my case using M591 the gcode for setup is
M591 D0 P2 C3
when I send
M591 D0 the status of my switch is correctly displayed on my computer interface.
I understood the concept of polling an interrupt in real time as I assumed the M582 command should have done but would someone explain where I should put the M582 D0 command so that it will poll the printer in real time and when the sensor changes state it how it will issue a Pause command.
I would appreciate some assistance with this as I have now spent some hours trying to figure out how to make it work without any success. -
@willo47 the pause is automatic when printing from SD card, you just need to enable the sensor by adding parameter S1 to the M591 command.
-
Hello dc42, thanks for the reply.
How simple was that. In carefully reading the M591 code explanation I now see right at the beginning that a pause is activated on filament sense. I put in the S1 and it worked.
Could someone remove the M581 code references please to prevent others from wasting time trying to make it work.
Thanks again for the help. -
@willo47 which M581 code references are you referring to?