Filament Sensor
-
Sensor is the stock Ender 6 filament sensor
-
See https://duet3d.dozuki.com/Wiki/Gcode#Section_M591_RepRapFirmware_Num_3
I don't know anything about the Ender 6 filament sensor, but if it behaves like a real switch (i.e., return either low when filament present and high when absent, or vice versa) then you want something like this in config.g:
M591 D0 P2 C"io0.in" S1
That says extruder zero (D0), a sensor that is low when filament present (P2) on pin io0 (C"io0.in") and enabled (S1).
You don't need to also declare a trigger.
-
@achrn
Thanks for the response.Yes, this is a switch that pressed = filament, unpressed = no filament.
When I physically press and release the lever, the LED light shows up on the switch, but in Duet Web using M591 D0, I get the same status when the switch is in either state.
Here's my gcode: M591 D0 P1 C"io0.in" S1
I've also tried M591 D0 P2 C"io0.in" S1So P1 or P2 gives me a response in console, but the state doesn't change when the switch does.
Here's a video showing the switch in both states and the LED on the switch lighting.
IMG_0107 (trimmed)-1.mp4Here's the console response with the switch in both states.
console.txt -
On the io_0 connector, try jumpering io0.in to ground and run M591 D0
Then, jumper it to +5 Volts and run M591 D0 again.Post the results.
If you see proper responses from M591 D0, they your sensor or wiring is not functioning.
If you do not see the proper results, then your configuration or your Duet board is not functioning.
-
Do you have a multimeter to put on the signal wire and see what the voltage is being presented to the duet as the switch switches?
I found a schematic on the web (of doubtful provenance) thats suggested the switch would be high when filament present.
-
I'm in the middle of a long print.
I will test when it is finished. -
-
@davidewen using X.in is correct.
-
@davidewen said in Filament Sensor:
5v which I suspected.
And does it drop to 0V when the filament is absent?
-
Jump:
G to io0.inResult:
M591 D0
Simple filament sensor on pin io0.in, disabled, output high when no filament, filament present: yesJump:
5v to io0.inResult:
M591 D0
Simple filament sensor on pin io0.in, disabled, output high when no filament, filament present: noSo, based on your post, my wiring is incorrect.
-
OK, that's good news, it shows that your board and configuration are working properly.
Now connect the sensor and measure the voltage between io0.in and ground on the Duet.
Press the switch, what is the voltage?
Release the switch, what is the voltage?If the voltage does not change, you can measure the voltage between S and G on the PCB of your switch.
If it changes on the PCB but not at the Duet, you've got a bad connector or wire.
If it does not change on the PCB, follow the traces on either the NO or NC terminals on the switch back to the Power and Ground connections on the connector and see if there's a break somewhere.
-
Thanks for your help Alan.
The wiring was incorrect. Now that I have it correct, it's working.