want to set the timeout period for a simple filament sensor.
-
I am currently using a simple switch type filament sensor for my tool change 3D printer.
Printing is temporarily stopped due to a momentary false detection by the filament sensor, so I found a previous post while searching for a timeout period.
Re: Simple switch Run-Out Sensor too sensitive. Add timeout?
I would like to write a function similar to this in daemo.g, but I don't really know how to write it.
(https://forum.duet3d.com/post/187835)Can you provide me with a sample daemon.g code like the one written here?
I find this mechanism a little difficult to code.RRF for Duet 3 Mini 5+ version 3.4.5 (SBC mode)
PS. I am developing a tool change 3D printer in Japan.(https://twitter.com/Senju_3Dprinter)
-
@Nagoya-Kougei
I don't think you really need to use daemon.g
When the sensor triggers it will run filament-error.g if it exists
If it's not, then the print just pauses.
You put whatever you want in that file.You may be getting switch "bounce" issues
I use this to overcome thatG4 P10 ; delay 10ms to debounce if sensors.filamentMonitors[0].status="ok" echo "switch bounce detected - error cancelled" M99 ; break out if sensor value is zero again (bouncing) ; if we got this far the switch is still showing no filament M25 ;pause
You could easily increase the G4 delay time to whatever you want.
You'll need to put M25 after your checks in order to pause the print if the switch is still activated -
@OwenD
thank you!
I immediately inserted the code and tried it out, and it worked as expected!There is just one problem, because my 3d printer is a tool change , the [] part of "sensors.filamentMonitors[0]" changes depending on the head used from 0 to 2.
How can I make it compatible? Thank you for your wonderful support.
-
@Nagoya-Kougei
Have a read of
https://docs.duet3d.com/User_manual/RepRapFirmware/EventsI think it will be something like the following, but you'll need to test
G4 P10 ; delay 10ms to debounce if sensors.filamentMonitors[{param.B}].status="ok" echo "switch bounce detected - error cancelled" M99 ; break out if sensor value is zero again (bouncing) ; if we got this far the switch is still showing no filament M25 ;pause
-
@OwenD
When I changed it to param.D, it worked! !
{param.B} => {param.D}G4 P10 ; delay 10ms to debounce if sensors.filamentMonitors[{param.D}].status="ok" echo "switch bounce detected - error cancelled" M99 ; break out if sensor value is zero again (bouncing) ; if we got this far the switch is still showing no filament M25 ;pause
Now let's continue with the printing test!
-
@Nagoya-Kougei I'm glad you got it working. You don't need the { } around param.D.
-
@dc42 Thank you for the additional information! , I trt it !
Thanks to your support, we have successfully configured the firmware and will soon be able to release our tool change 3D printer!