Filament sensor triggers for the wrong extruder
-
I'm trying to setup some simple switch filament sensors on my IDEX machine, so I have 2 sensors. One is connected to the main 6HC (which controls the left tool) and the other to the 3HC expansion (which controls the right tool).
Sensor setup is as follows:
M591 D0 P1 C"0.io4.in" S0 ;left tool M591 D1 P1 C"1.io5.in" S0 ;right tool
They start disabled but are enabled in
start.g
However, as soon as a job starts it triggers a pause and says:Error: Filament error on extruder 0: noFilament
Except, I tested first turning on only the left sensor (which has filament) and it works fine.
But if I then enable the right sensor (withM591 D1 S1
) which doesn't have any filament loaded it will immediately pause the print with the no filament error above.I feel this partly means I need to have it only enable the sensor when that particular tool is selected, which I will do - however the main problem I'm seeing here is that it's reporting the error for extruder 0, not extruder 1.
Any thoughts as to what would cause that?
Here's my full
config.g
; Configuration file for Duet 3 (firmware version 3.3) ; executed by the firmware on start-up ; ; generated by RepRapFirmware Configuration Tool v3.3.10 on Mon Feb 14 2022 00:04:10 GMT-0500 (Eastern Standard Time) ; Load global vars M98 P"globals.g" ; General preferences G90 ; send absolute coordinates... M83 ; ...but relative extruder moves M550 P"Rancor" ; set printer name ; Audio Player Serial Config M575 P2 B57600 S2 ; Setup UART on IO_1 to 57600 baud ; Setup Lights M950 P0 C"0.out9" Q4000 ; Setup Servos M950 S1 C"0.io7.out" M280 P1 S100 ; Wait a moment for the CAN expansion boards to start G4 S2 ; speak greeting M800 F"greeting" ; Drives M569 P0.0 S0 ; Left Y M569 P0.1 S1 ; Left X M569 P0.2 S0 ; Left Extruder M569 P0.3 S1 ; Left Z M569 P0.4 S1 ; Right Rear Z M569 P0.5 S1 ; Right Front Z M569 P1.0 S1 ; Right Y M569 P1.1 S1 ; Right X M569 P1.2 S0 ; Right Extruder M584 X0.1 U1.1 Y0.0:1.0 Z0.3:0.4:0.5 E0.2:1.2 ; set drive mapping M350 X16 U16 Y16 Z16 E16:16 I1 ; configure microstepping with interpolation M92 X160 U160 Y160 Z1600 E397:397 ; set steps per mm M566 X400 U400 Y400 Z100 E1500:1500 ; set maximum instantaneous speed changes (mm/min) M203 X10800 U10800 Y10800 Z900 E3600:3600 ; set maximum speeds (mm/min) M201 X500 U500 Y500 Z100 E1500 ; set accelerations (mm/s^2) M906 X1400 U1400 Y1400 Z1200 E1100:1100 I75 ; set motor currents (mA) and motor idle factor in per cent ;M84 S30 ; Set idle timeout ;Leadscrew locations M671 X-13.7:343.8:343.8 Y160:287.5:32.5 S7.5 ; Axis Limits ; TODO - these are wild guesses at this point for X ; will need to change mins to negatives M208 S1 X-85 U0 Y0 Z-2 ; set axis minima M208 S0 X405 U450 Y345 Z600 ; set axis maxima ; Endstops M574 X1 S1 P"0.io2.in" ; X homes low end M574 U2 S1 P"1.io2.in" ; U homes high end M574 Y1 S1 P"0.io3.in+1.io3.in" ; Y has dual motors and endstops ; TODO - setup homing files https://duet3d.dozuki.com/Wiki/ConfiguringMultipleIndependentXcarriagesCartesian#Section_Homing_files ; Z-Probe M558 P5 C"^0.io5.in" H2.5 F250 T6000 ; set Z probe type to switch and the dive height + speeds G31 P500 X0 Y0 Z1.2 ; set Z probe trigger value, offset and trigger height M557 X15:315 Y20:300 S75:70 ; define mesh grid ; Heaters ; Bed M308 S0 P"0.temp0" Y"thermistor" T100000 B4240 ; configure sensor 0 as thermistor on pin temp0 M950 H0 C"0.out0" T0 ; create bed heater output on out0 and map it to sensor 0 M307 H0 B0 R0.611 C647.0 D2.25 S1.00 ; enable bang-bang mode for the bed heater and set PWM limit M140 H0 ; map heated bed to heater 0 M143 H0 S120 ; set temperature limit for heater 0 to 120C ; Left M308 S1 P"0.temp1" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 1 as thermistor on pin temp1 M950 H1 C"0.out1" T1 ; create nozzle heater output on out1 and map it to sensor 1 ; M307 H1 R2.616 K0.237:0.348 D5.69 E1.35 S1.00 B0 V23.9 ; disable bang-bang mode for heater and set PWM limit ; M143 H1 S285 ; set temperature limit for heater 1 to 280C ; Right M308 S2 P"1.temp0" Y"thermistor" T100000 B4725 C7.06e-8 ; configure sensor 2 as thermistor on pin 1.temp0 M950 H2 C"1.out0" T2 ; create nozzle heater output on 1.out0 and map it to sensor 2 ; M307 H1 R2.616 K0.237:0.348 D5.69 E1.35 S1.00 B0 V23.9 ; disable bang-bang mode for heater and set PWM limit ; M143 H2 S285 ; set temperature limit for heater 2 to 280C ; Fans ; left HEF M950 F0 C"0.out7" ; create fan 0 on pin out7 and set its frequency M106 P0 S1 H1 T45 ; set fan 0 value. Thermostatic control is turned on ; Left PCF M950 F1 C"0.out8" ; create fan 1 on pin out8 and set its frequency M106 P1 S0 H-1 ; set fan 1 value. Thermostatic control is turned off ; Right HEF M950 F2 C"1.out7" ; create fan 2 on pin 1.out7 and set its frequency M106 P2 S1 H2 T45 ; set fan 2 value. Thermostatic control is turned on ; Right PCF M950 F3 C"1.out8" ; create fan 3 on pin 1.out8 and set its frequency M106 P3 S0 H-1 ; set fan 3 value. Thermostatic control is turned on ; Tools ; Left M563 P0 S"Left" D0 X0 H1 F1 ; define tool 0 ; G10 P0 X-71.5 Y-20.6 Z0 ; set tool 0 axis offsets G10 P0 X0 Y0 Z0 G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C M591 D0 P1 C"0.io4.in" S0 ; setup T0 filament sensor ; Right M563 P1 S"Right" D1 X3 H2 F3 ; define tool 1 ; G10 P1 U-0.3 Y-20.6 Z0.35 ; set tool 1 axis offsets G10 P1 U0 Y0 Z0 G10 P1 R0 S0 ; set initial tool 1 active and standby temperatures to 0C M591 D1 P1 C"1.io5.in" S0 ; setup T1 filament sensor ; extra sensors M308 S10 Y"mcu-temp" A"MCU" ; defines sensor 10 as MCU temperature sensor ; set base tool names M98 P"tools/t0.g" M98 P"tools/t1.g" ; load variable tool configs M98 P"tools/setup.g" ; Ensure T0 loaded M98 P"soft_load_tool.g" S0
-
Try using your tool change files to enable and disable the monitor so that only the active tool has it enabled.
-
@phaedrux said in Filament sensor triggers for the wrong extruder:
Try using your tool change files to enable and disable the monitor so that only the active tool has it enabled.
Ok - I've since done that... However:
- This enables the monitoring if a tool is selected even if I'm not currently printing. Which means if you are unloading filament it will trigger an error message. I guess I need more conditional logic so it only enables it when the tool is selected AND it's currently printing.
- There's still the issue that it specifies the wrong tool when the error is thrown for my right (T1) tool. And it calls
filament-error0.g
instead offilament-error1.g
. I realize I can also just usefilament-error.g
which I will do - just trying to point out that it's noting the incorrect tool when throwing the filament error. Is that something that needs to be fixed in firmware or am I just doing something wrong?
-
Something like if state=processing might be enough. See if that leads you in teh right direction.
-
@phaedrux said in Filament sensor triggers for the wrong extruder:
Something like if state=processing might be enough. See if that leads you in teh right direction.
Ah, cool - there wasn't a "printing" state so I wasn't sure.
What I had come up with so far was:
if job.build != null
Any thought though as to why it's triggering for the wrong tool? That's my real concern here.
-
@adammhaile said in Filament sensor triggers for the wrong extruder:
Any thought though as to why it's triggering for the wrong tool? That's my real concern here.
What exactly do you mean by wrong tool? What have you put in which tool change file?
-
@phaedrux said in Filament sensor triggers for the wrong extruder:
What exactly do you mean by wrong tool? What have you put in which tool change file?
When the filament sensor configured for T1 triggers, I get the following error:
Error: Filament error on extruder 0: noFilament
Which is the same error I get when the sensor for T0 triggers. I would expect the error for T1 to be:
Error: Filament error on extruder 1: noFilament
The T1 filament error also triggers
filament-error0.g
instead offilament-error1.g
tpost0.g
containsM591 D0 S1
tpost1.g
containsM591 D1 S1
I call
M591 D<tool_id> S0
in thetfree
files. -
Can you please post your full set of files, including these macros
; set base tool names M98 P"tools/t0.g" M98 P"tools/t1.g" ; load variable tool configs M98 P"tools/setup.g" ; Ensure T0 loaded M98 P"soft_load_tool.g" S0
-
@phaedrux said in Filament sensor triggers for the wrong extruder:
Can you please post your full set of files, including these macros
Sure thing, everything can be viewed here: https://github.com/adammhaile/Rancor/tree/f48014f7924d1a6958722ad6c128a8c379bcafbb/sd/sys
The
tools/
stuff is a little convoluted, but I'll try to explain best I can:My machine is IDEX but has cold-swappable tool heads. I have 5 total tool heads that can be placed on either of the 2 tool carriages. So everything under
tools/
is my attempt to create a management system for quickly swapping configs.tools/t0.g
andtools/t1.g
simply just set a global variable with the name of the tool that is in that position. That name is then used to load configs from the correct directory undertools/
. For the most part those configs set more global vars.tools/setup.g
takes all the currently set global vars and sets things like tool offsets.soft_load_tool.g
is basically just an extension of callingT<num> P0
because when a tool change happens I need it to also push a tool name intoglobal.cur_tool
which normally would happen in thetpost
scripts.global.cur_tool
is mostly used for filament handling because I have it setup so that I can have different filament configs based on the tool that is loaded. -
Best I can figure there is an error in your tool files, but I can't spot it.
-
@adammhaile I confirm there is a bug. When the filament-error event is constructed, the CAN address and device number parameters are swapped.
I have fixed this in the source code. The fix will be in RRF 3.5.0beta1 and also in 3.4.1 if we do that release.
-
@dc42 said in Filament sensor triggers for the wrong extruder:
@adammhaile I confirm there is a bug. When the filament-error event is constructed, the CAN address and device number parameters are swapped.
I have fixed this in the source code. The fix will be in RRF 3.5.0beta1 and also in 3.4.1 if we do that release.Awesome. Thanks for the update!