Unsolved Problems with filament-error.g
-
I have a delta with attached Pi. It has a simple microswitch filament out sensor, which triggers filament-error.g, but that stops part-way through running, even though it completes fine if I run it manually.
Board: Duet 3 MB6HC (MB6HC)
DSF Version: 3.3.0
Firmware: RepRapFirmware for Duet 3 MB6HC 3.3 (2021-06-15)Filament sensor (microswitch, wired with three wires) is defined in config.g as:
M591 D0 P2 C"io8.in" S1
That works as expected if I don't have a filament-error.g - if the filament runs out the machine pauses (as per pause.g) .
However, I wanted it to move the head out of the way, eject the remaining filament in the bowden, switch off the nozzle heater, display a message and wait until I notice. Then, when I notice, I can load the next spool, acknowledge the message, and it should heat the nozzle, feed the filament back down the bowden and resume printing.
So I have a filament-error.g like this:
; filament-error.g ; called when filament out sensor is triggered ; ; first move the print head away from print G60 ; save extruder position to slot 0 M83 ; relative extruder moves G1 E-10 F3000 ; retract 10mm of filament G91 ; relative positioning G1 Z5 F360 ; lift Z by 5mm G90 ; absolute positioning echo "filament out - reload initialised" if move.axes[2].userPosition < 100 G1 X0 Y-150 Z100 F6000 ; move to front of bed and 100mm up else G1 X0 Y-150 F6000 ; move to front limit of bed ; ; eject remaining filament (note already done a 10mm retract above) G1 E-630 F3000 ; 630mm at 3000mm/min var nozt = heat.heaters[1].active ; memorise nozzle temperature echo "nozzle temperature:", var.nozt M400 ; wait for all moves to complete G10 S0 ; turn off the nozzle heater ; ; message user and wait M291 P"Remove remaining filament, load new spool and click to proceed." R"Filament out" S2 echo "after message" ; ; heat to same temperature as previously and reload G10 S{var.nozt} ; Set current tool temperature to whatever it was echo "after temperature set" echo "heat.heaters[1].active:", heat.heaters[1].active M116 ; Wait for the temperatures to be reached echo "temperatures reached" echo "heat.heaters[1].active:", heat.heaters[1].active G1 E10 F300 ; feed first 10mm slowly G1 E600 F3000 ; Feed 600mm of filament at 3000mm/min G1 E40 F300 ; Feed 40mm of filament at 300mm/min echo "filament load done" G4 P2000 ; Wait two seconds G1 E-10 F3000 ; retract 10mm of filament echo "ready to resume" ; ; return to saved position and resume G1 R0 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move G1 R0 X0 Y0 Z0 F360 ; slowly down to the saved position G1 E10 F3600 ; extrude 10mm of filament echo "filament-error.g done"
It has a load of extra 'echo's where I've been trying to figure out why it doesn't work.
It pops up an initial pause dialog ("Printing paused Extruder 0 reported 'noFilament'"), and then filament-error.g starts running and works fine up to the point where it has set nozzle temperature to zero and displayed the dialog box message to the user. The echo at line 26 doesn't happen though. At least, it doesn't come up on the console:
The machine then just sits in state 'pausing' as long as I've had patience to let it (about 38 minutes is the longest I've left it). While it's like this clicking the resume print button or the cancel print button displays a whirling circle, but doesn't seem to do anything else - the status remains as 'Pausing'. The emergency stop button on the page works though.
If I explicitly run the filament-error.g manually when the printer isn't in the midst of a print job (i.e. M98 P"filament-error.g"), it all goes as expected, with nozzle heater switching off until I acknowledging the dialog, then immediately resetting to the previous temperature and reloading when it reaches that:
Here is my config.g and M122 result. Config.g runs without any errors or warnings.
; Configuration file for Duet 3 (firmware version 3) ; initially generated by RepRapFirmware Configuration Tool v3.1.4 on Thu Sep 17 2020 20:49:45 ; but subsequently significantly modified variously ; General preferences G90 ; send absolute coordinates M83 ; relative extruder moves M550 P"Delta" ; set printer name ; M665 = diagonal rod length, delta radius, printable radius, homed height, tower pos corrections ; M666 = endstop adjustments M665 L360.250:360.250:360.250 R184.870 H536.741 B150.0 X-0.081 Y0.064 Z0.000 M666 X-0.074 Y0.076 Z-0.002 A0.00 B0.00 ; Drives M569 P0.0 S0 ; physical drive 0.0 goes backwards M569 P0.1 S0 ; physical drive 0.1 goes backwards M569 P0.2 S0 ; physical drive 0.2 goes backwards M569 P0.5 S1 ; physical drive 0.5 goes forwards M584 X0.0 Y0.1 Z0.2 E0.5 ; set drive to axis mapping M350 X16 Y16 Z16 E16 I1 ; configure microstepping with interpolation M92 X160.00 Y160.00 Z160.00 E830.00 ; set steps per mm M592 D0 A0.0007 B0.0010 ; configure non-linear extrusion, though negligible correction ; Speeds ; jerk at configtool defaults (20 mm/s) but extruder less M566 X1200.00 Y1200.00 Z1200.00 E400.00 ; set maximum instantaneous speed changes (mm/min) M203 X15000 Y15000 Z15000 E6000 ; set maximum speeds (mm/min) ; acceleration (configtool default is 1000 mm/s2) and set extruder a bit less M201 X1200 Y1200 Z1200 E500 ; set accelerations (mm/s^2) ; rated current E3D high-torque motor = 1.68A, x 75% = 1260 mA ; rated current Ooozenest extruder motor = 1.33A, x 75% = 1000 mA M906 X1260 Y1260 Z1260 E1000 I30 ; set motor currents (mA) and motor idle percentage M84 S30 ; Stop idle hold after 30 seconds timeout ; Axis Limits M208 Z0 S1 ; set minimum Z ; Endstops M574 X2 S1 P"io0.in" ; configure active-high endstop for high end on X via pin io0.in M574 Y2 S1 P"io1.in" ; configure active-high endstop for high end on Y via pin io1.in M574 Z2 S1 P"io2.in" ; configure active-high endstop for high end on Z via pin io2.in ; Z-Probe M558 P8 R0.4 C"io3.in+io3.out" H3 F1200 T6000 ; set Z probe type to effector and the dive height + speeds G31 P500 X0 Y0 Z-0.04 ; set Z probe trigger value, offset and trigger height M557 R125 S30 ; define mesh grid ; filament monitoring M591 D0 P2 C"io8.in" S1 ; enable filament monitoring, low = filament present, on io8 ; Heaters ; bed M308 S0 P"spi.cs1" Y"rtd-max31865" ; configure sensor 0 as PT100 via CS pin spi.cs1 M950 H0 C"out1" Q3 T0 ; create bed heater output on out1 and map it to sensor 0 ; v3.1 tuning: M307 H0 A530 C1330 D21 S1 V0 B0 M307 H0 R0.243 C1212.7 D46.41 S1.0 V0 B0 ; configure bed heater average three runs M303 H0 S75 M140 H0 ; map heated bed to heater 0 M143 H0 S150 ; set temperature limit for heater 0 to 150C ; hotend M308 S1 P"spi.cs0" Y"rtd-max31865" ; configure sensor 1 as PT100 via CS pin spi.cs0 M950 H1 C"out2" Q25 T1 ; create nozzle heater output on out2 and map it to sensor 1 ; v3.1 tuning: M307 H1 A550 C330 D3 S1 V24 B0 M307 H1 R1.543 C300:200 D4.17 S1.0 V24 B0 ; v3.2 average of three runs M303 H1 S220 M143 H1 S350 ; heater 1 (ie hot end) limit 350 (generate heater fault) M143 H1 S310 P1 A2 ; heater 1 limit 310 (temporary turn off) - sock limit is 300 ; additional sensors M308 S8 P"temp0" Y"thermistor" T4701 B4266 C1.048787e-7 A"board" ; define sensor 8 to be thermistor for main board M308 S9 P"mcu-temp" Y"mcu-temp" A"mcu" ; define sensor 9 to be mcu temperature ; Fans ; print fan is connected via a PWM to variable DC daughter board ; cutoff f = 1.59 Hz and rise time 0% to 99% = 0.46 seconds, so any sensible Q will be ok M950 F0 C"!out7" Q500 ; create fan 0 on pin !out7 and set its frequency M106 P0 S0 L0.25 B0.5 H-1 ; fan initially off, min pwm 0.25, 0.5 second blip, not thermostatic ; hot end fan ; hot end fan is always either on or off so PWM frequency doesnt much matter M950 F1 C"out8" Q100 ; create fan 1 on pin out8 and set its frequency M106 P1 S1 H1 T50 ; set fan 1 thermostatic control on heater 1 at 50C ; mainboard cooling fans ; fan 2 is blowing air into electronics compartment M950 F2 C"!out4" Q25000 ; fan 2 is 4-wire noctua on out4 (note inverse for 4-wire to work correctly) tacho not used M106 P2 S1 L0.25 B0.5 H8 T35:40 C"mainb" ; cooling electronics space thermostatic on sensor 8 35 to 40C ; fan 3 is small centrifugal fan blowing under main board M950 F3 C"out9" Q100 ; fan 3 on pin out9 and set its frequency M106 P3 S1 L0.40 B0.5 H9 T50:60 C"underb" ; fan 3 for cooling mainboard underside thermostatic sensor 9 (mcu temperature) 50 to 60C ; Servo ; servo 1 on io7.out (note, needs to be 4, 5 or 7 as these are only PWM capable outputs) M950 S1 C"io7.out" ; create servo 1 M280 P1 S90 ; set to 90degree position ; Tools M563 P0 S"Nozzle" D0 H1 F0 ; define tool 0 G10 P0 X0 Y0 Z0 ; set tool 0 axis offsets G10 P0 R0 S0 ; set initial tool 0 active and standby temperatures to 0C ; Miscellaneous T0 ; select first tool M81 S1 ; switch off power (it's not on, but this tells DWC I want power control buttons)
M122 === Diagnostics === RepRapFirmware for Duet 3 MB6HC version 3.3 (2021-06-15 21:45:47) running on Duet 3 MB6HC v0.6 or 1.0 (SBC mode) Board ID: 08DJM-956L2-G43S8-6J1DG-3S86J-KB32F Used output buffers: 1 of 40 (11 max) === RTOS === Static ram: 150904 Dynamic ram: 60708 of which 0 recycled Never used RAM 139724, free system stack 152 words Tasks: SBC(ready,4.9%,338) HEAT(notifyWait,0.0%,325) Move(notifyWait,0.0%,263) CanReceiv(notifyWait,0.0%,944) CanSender(notifyWait,0.0%,362) CanClock(delaying,0.0%,333) TMC(notifyWait,7.7%,59) MAIN(running,87.3%,1272) IDLE(ready,0.0%,29), total 100.0% Owned mutexes: HTTP(MAIN) === Platform === Last reset 00:16:09 ago, cause: software Last software reset at 2021-08-07 15:50, reason: User, none spinning, available RAM 142828, slot 2 Software reset code 0x0012 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0044a000 BFAR 0x00000000 SP 0x00000000 Task SBC Freestk 0 n/a Error status: 0x00 Step timer max interval 716 MCU temperature: min 46.9, current 47.7, max 48.2 Supply voltage: min 2.1, current 24.1, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes 12V rail voltage: min 0.2, current 12.2, max 12.2, under voltage events: 1 Heap OK, handles allocated/used 99/0, heap memory allocated/used/recyclable 2048/738/738, gc cycles 0 Driver 0: position 52320, standstill, reads 54588, writes 47 timeouts 0, SG min/max 0/507 Driver 1: position 54016, standstill, reads 54588, writes 47 timeouts 0, SG min/max 0/161 Driver 2: position 56024, standstill, reads 54588, writes 47 timeouts 0, SG min/max 0/171 Driver 3: position 0, standstill, reads 54613, writes 22 timeouts 0, SG min/max 0/0 Driver 4: position 0, standstill, reads 54614, writes 22 timeouts 0, SG min/max 0/0 Driver 5: position 0, standstill, reads 54597, writes 39 timeouts 0, SG min/max 0/125 Date/time: 2021-08-07 16:06:55 Slowest loop: 92.31ms; fastest: 0.04ms === Storage === Free file entries: 10 SD card 0 not detected, interface speed: 37.5MBytes/sec SD card longest read time 0.0ms, write time 0.0ms, max retries 0 === Move === DMs created 125, maxWait 152123ms, bed compensation in use: none, comp offset 0.000 === MainDDARing === Scheduled moves 39, completed moves 39, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 4], CDDA state -1 === AuxDDARing === Scheduled moves 0, completed moves 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters = 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1, chamberHeaters = -1 -1 -1 -1 Heater 1 is on, I-accum = 0.4 === GCodes === Segments left: 0 Movement lock held by null HTTP* is doing "M122" in state(s) 0 Telnet is idle in state(s) 0 File is idle in state(s) 0 USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger* is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 SBC is idle in state(s) 0 Daemon is idle in state(s) 0 Aux2 is idle in state(s) 0 Autopause is idle in state(s) 0 Code queue is empty. === Filament sensors === Extruder 0 sensor: ok === CAN === Messages queued 8715, received 0, lost 0, longest wait 0ms for reply type 0, peak Tx sync delay 0, free buffers 49 (min 49), ts 4847/0/0 Tx timeouts 0,1,4846,0,0,3865 last cancelled message type 30 dest 127 === SBC interface === State: 4, failed transfers: 0, checksum errors: 0 Last transfer: 1ms ago RX/TX seq numbers: 34126/34126 SPI underruns 0, overruns 0 Disconnects: 0, timeouts: 0, IAP RAM available 0x2c83c Buffer RX/TX: 0/0-0 === Duet Control Server === Duet Control Server v3.3.0 Code buffer space: 4096 Configured SPI speed: 8000000Hz Full transfers per second: 35.25, max wait times: 4.8ms/0.0ms Codes per second: 0.15 Maximum length of RX/TX data transfers: 3028/664
-
Sounds similar to this one: https://forum.duet3d.com/topic/24524/m600-still-problem/6
Taking a look.
-
@phaedrux said in Problems with filament-error.g:
Sounds similar to this one: https://forum.duet3d.com/topic/24524/m600-still-problem/6
OK, thanks.
Noting that in that thread you ask about removing the M291, I've tried removing that from my script (just commented out). If I replace the M291 with a 10 second pause, the macro runs as expected (but subject to some serious caveats below). That is, this works (I've also tweaked the echo statements compared to above):
; filament-error.g ; called when filament out sensor is triggered ; echo "filament-error.g running" ; first move the print head away from print G60 ; save extruder position to slot 0 M83 ; relative extruder moves G1 E-10 F3000 ; retract 10mm of filament G91 ; relative positioning G1 Z5 F360 ; lift Z by 5mm echo "head lifted" G90 ; absolute positioning if move.axes[2].userPosition < 100 G1 X0 Y-150 Z100 F6000 ; move to front of bed and 100mm up else G1 X0 Y-150 F6000 ; move to front limit of bed echo "head front" ; ; eject remaining filament (note already done a 10mm retract above) G1 E-630 F3000 ; 630mm at 3000mm/min var nozt = heat.heaters[1].active ; memorise nozzle temperature echo "nozzle temperature:", var.nozt M400 ; wait for all moves to complete G10 S0 ; turn off the nozzle heater ; ; message user and wait ;M291 P"Remove remaining filament, load new spool and click to proceed." R"Filament out" S2 G4 S10 echo "after message" ; ; heat to same temperature as previously and reload G10 S{var.nozt} ; Set current tool temperature to whatever it was echo "after temperature set" echo "heat.heaters[1].active .current:", heat.heaters[1].active, heat.heaters[1].current M116 ; Wait for the temperatures to be reached echo "temperatures reached" echo "heat.heaters[1].active .current:", heat.heaters[1].active, heat.heaters[1].current G1 E10 F300 ; feed first 10mm slowly G1 E600 F3000 ; Feed 600mm of filament at 3000mm/min G1 E40 F300 ; Feed 40mm of filament at 300mm/min echo "filament load done" G4 P2000 ; Wait two seconds G1 E-10 F3000 ; retract 10mm of filament echo "ready to resume" ; ; return to saved position and resume G1 R0 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move G1 R0 X0 Y0 Z0 F360 ; slowly down to the saved position G1 E10 F3600 ; extrude 10mm of filament echo "filament-error.g done"
Gives me
However, filament-error.g having run, the machine is still paused. There's a dialog on the web interface ("Printing paused Extruder 0 reported 'noFilament'") which I have to acknowledge and the "Printing paused at..." message in the console is not my doing. The machine is now paused, but if I click resume in the web interface it does restart.
So it looks like the M291 waiting for user input causes the problem - is it getting tangled with the pause that is apparently triggered? It looks like filament out runs filament-error.g then triggers a pause, except that when filament-error.g contains M291 both get tangled together and end up stuck? (That's uneducated speculation - I haven't looked at code.)
I don't want that extra pause, because (if it worked right) my script already has the user intervention needed. I have tried adding M24 to the end of filament-error.g, but that didn't help - the machine apparently gets my M24 before the pause:
... G1 E10 F3600 ; extrude 10mm of filament echo "filament-error.g done" M24 echo "M24 sent"
gives:
Here, 'M24 sent' is my doing in filament-error.g, and it is in the console before the "Printing paused at ..." which is not my doing. I don't know why there are now two of them, nor why they have differnet coordinates.This also caused such a monumental blockage that I've had to dismantle the hot end and drill solidified plastic out of the cold side of the heatbreak (it did that yesterday during testing too). Possibly my M24 has tried to run resume.g, which includes another 10mm filament feed, but the nozzle is fully primed by my filament-error.g and in contact with the print now so I get a pressurised blob of molten plastic inside the nozzle that then spreads back up into the cool zone? (I'm speculating again).
I'm a bit confused by what it's supposed to be doing, even ignoring the possible M291 issue. I think it goes like this:
- If you don't have filament-error.g, it pauses, which runs pause.g, then you click resume and it runs resume.g and resumes printing.
- If you do have filament-error.g, it runs filament-error.g, then it pauses, but it doesn't run pause.g (I think), then you click resume and resumes without running resume.g.
Is that the intended behaviour?
I'm somewhat loathe to do too much testing of this, since it seems to provoke a need for serious maintenance if it goes wrong!
-
@achrn said in Problems with filament-error.g:
It looks like filament out runs filament-error.g then triggers a pause, except that when filament-error.g contains M291 both get tangled together and end up stuck? (That's uneducated speculation - I haven't looked at code.)
I'm in the same boat as you with that regard. I believe @dc42 and @chrishamm are looking into it though.
-
@phaedrux - Yesterday I tested filament runout ( duet magnetic sensor) whithout problem. Just for info... Print from SD with SBC.
Filament-error0.g
M83 ; relative extruder moves G1 E-10 F3600 ; retract 10mm of filament G91 ; relative positioning G1 Z25 F360 ; lift Z by 5mm G90 ; absolute positioning G1 X50 Y50 F6000 ; go to X=0 Y=0; M291 P"neni" R"Filament" S0 ; display message to change filament Filament has run out
Pause.g
; pause.g ; called when a print from SD card is paused ; ; generated by RepRapFirmware Configuration Tool v3.2.3 on Wed Apr 21 2021 11:35:56 GMT+0200 (Středoevropský letní čas) M83 ; relative extruder moves G1 E-10 F3600 ; retract 10mm of filament G91 ; relative positioning G1 Z5 F360 ; lift Z by 5mm G90 ; absolute positioning G1 X50 Y50 F6000 ; go to X=0 Y=0
Resume.g
; resume.g ; called before a print from SD card is resumed ; ; generated by RepRapFirmware Configuration Tool v3.2.3 on Wed Apr 21 2021 11:35:56 GMT+0200 (Středoevropský letní čas) G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move G1 R1 X0 Y0 ; go back to the last print move M83 ; relative extruder moves G1 E10 F3600 ; extrude 10mm of filament
-
@phaedrux this problem is the exact same i had since a long time on my duet 2 wifi, and then on my duet 3 mini, i think, as long as the filament error script gets complicated, it bugs.
here's mine, and even if i simplify it a lot it still bug.
M291 R"Erreur de filament" P"Déplacement vers la position de parking."S0 T30 if move.axes[2].machinePosition < move.axes[2].max-10 G91 G1 Z5 F500 G90 G1 X{move.axes[0].min+10} Y{move.axes[1].min+10} F6000 M291 R"Erreur de filament" P"Déchargement en cours, veuillez patienter..." S0 T30 G1 E5 F500 ;Extrude 10mm filament at low speed G1 E-100 F3600 ;Retract 100mm filament at high speed M400 while sensors.filamentMonitors[0].status == "ok" M291 R"Erreur de filament" P"Merci de retirer le filament." S0 T30 G4 S0.1 ;attendre 0.1s pour éviter de surcharger le processeur while true if sensors.filamentMonitors[0].status == "noFilament" M291 R"Erreur de filament" P"Filament déchargé, merci d''insérer le nouveau filament." S0 T30 G4 S0.1 ;attendre 0.1s pour éviter de surcharger le processeur else break G4 S0.7 ;attendre 1s pour laisser le temps d'insérer le filament M291 P"Chargement en cours...." R"Changement du Filament" S0 M106 S255 ;mise en route du ventilateur pour refroidir la purge M83 ; mode d'extrusion relative G1 E65 F3600 ; extrude 65mm at high speed G1 E20 F200 ; extrude 10mm at low speed M291 R"Erreur de filament" P"Filament chargé. Vous pouvez relancer l''impression." S2
-
@krohm-koala filament-error.g is current running before the pause, and the pause is not optional right now. see:
https://forum.duet3d.com/topic/25458/filament_runout_distance_mm-or-similar-at-reprap
We are tracking this as something to fix.
-
@t3p3tony thanks, that's a good thing to ear. also, i did something "weird" to my start gcode, i've added filament type checking with the calling of a custom M command, that calls a macro, that was not a great idea as it does the same thing ^^ so for now that on the wait list