Unsolved Issues with macros halting the printer.
-
Just now. Turned on the printer. Did a G32 command (bed.g attached) and clicked at the Z Probe calibration macro (below). And.... Busy doing nothing.....
Just to reinforce: This "busy halt" does not occur if I execute the macro line by line at the console.
Here is the macro:
M291 P"Grid bed compensation map and ZProbe trigger height will be cleared. Ok or Cancel?" R"WARNING" S3 ; User must click OK or cancel. M561 ; Disable any current bed compensation G29 S2 ; Clear mesh bed compensation perameters M291 P"Please wait while the bed and tool is being heated up" R"Please Wait" S1 T0 ; Display message M140 S60 ; Set bed temp to 60 and release G32 ; Home all axis M116 ; Wait for bed heating M104 S210 ; Set nozzle to 210 and release M116 ; Wait for all to heat M292 M98 P"0:/macros/Center_Nozzle"; move to center of bed M291 P"Nozzle will now move to center of bed to reset Z0 and calibrate probe" S2 G31 Z0 ; Reset zprobe trigger height G92 Z25 ; Reset z to 25 to allow jogging up to touch bed to nozzle M98 P"0:/sys/m_set_low_speeds.g" ; set lower Z speeds and accelerations M98 P/MACROS/SUBMACROS/BEEP.G M291 P"Jog the Z Axis until the bed and nozzle are touching and click OK" R"Setting Z=0" Z1 S2 G92 Z0 ; Set z = 0 M291 P"Probe will now measure trigger height 10 times" R"ZProbe Trigger Height Calibration" S2 M98 P"0:/macros/Center_Probe" ;0 move to center of bed G1 Z10 F4000 ; Move probe to center and drop bed for nozzle clearance M401 G30 P0 X189 Y140 Z-9999 G30 P1 X189 Y140 Z-9999 G30 P2 X189 Y140 Z-9999 G30 P3 X189 Y140 Z-9999 G30 P4 X189 Y140 Z-9999 G30 P5 X189 Y140 Z-9999 G30 P6 X189 Y140 Z-9999 G30 P7 X189 Y140 Z-9999 G30 P8 X189 Y140 Z-9999 G30 P9 X189 Y140 Z-9999 S-1 M402 M104 S0 ; Set nozzle to 0 and release M140 S0 ; Set bed to 0 and release M400 M98 P"0:/sys/m_set_normal_speeds.g" ; set normal Z speeds and accelerations M291 P"Probing complete. Turning off heaters and homing axis." S1 M98 P/MACROS/SUBMACROS/BEEP.G
Here is bed.g
; bed.g ; called to perform automatic bed compensation via G32 M671 X-48:326 Y140:140 ; Define positions of lead screws again M561 ; clear any bed transform G28 ; home all axes ; Probe the bed at 2 points M401 G30 P0 X22 Y140 H0 Z-99999 G30 P1 X314 Y140 H0 S2 Z-99999 G28 Z M402
-
Just a reminder that I asked yesterday for your beep.g macro too.
-
@dc42 Here it is!
By the way... I cannot play any "tunes" without adding these timers between each M300. At least with the PanelDue attached.
M300 S2000 P300 G4 P300 M300 S2000 P300 G4 P300 M300 S2000 P300
-
@brunofporto said in Issues with macros halting the printer.:
@dc42 Here it is!
By the way... I cannot play any "tunes" without adding these timers between each M300. At least with the PanelDue attached.
PanelDue has no flow control, deliberately to avoid holding up the Duet. But I could implement a short queue of beeps pending in the PanelDue firmware.
-
@brunofporto said in Issues with macros halting the printer.:
M291 P"Please wait while the bed is being heated up" R"Please Wait" S0 T0 ; Display message
M140 S60 ; Set bed temp to 60
G32 ; Home all axis
M116 ; Wait for heating
M292 Close message
M291 P"Please wait while the bed is being heated up" R"Please Wait" S3 T0 ; Display message
M98 P/MACROS/SUBMACROS/BEEP.GI'm sorry, I can't reproduce the problem using either your test macro or the full macro (I had to make up the contents of 4 more macros thai it called).
By the way, your test macro is missing a semicolon before the comment "Close message" on the M292 line.
How reproducible is the problem?
My best guess as to why it is hanging is that when you cancel the M291 message box, the M292 command to tell the Duet that it has been cancelled is not being received and/or processed. So I have two suggestions:
-
Connect a PC running YAT or Pronterface etc. and send M111 S1 P3 to enable GCodes debugging. Then you will be able to see whether the M292 command is received.
-
Next time it appears to be stuck, try sending M292 and see whether that un-freezes it.
-
-
Just happened again...
Freshly started board.
G32
Sent the macro from the 22/11/2018 message above. Appeared the messages informing that the bed and hotend would be heated. Clicked ok and.... halted.
-
So did you try my suggestions?
-
The complete sequence and used files:
Sent G32 and waited for it to finish:
Executed the Macro:
Clicked ok and then.... halted doing nothing:
Attached bed.g, calibration macro and all sub macros related.
Thanks.
6_1543257949998_bed.g 5_1543257949998_4_Calibrate_ZProbe.g 4_1543257949998_beep.g 3_1543257949998_Center_Nozzle.g 2_1543257949998_Center_Probe.g 1_1543257949998_m_set_low_speeds.g 0_1543257949998_m_set_normal_speeds.g
-
@dc42 I'll..... But the printer is far from a computer and heavy...... As soon as I am able to move it and connect an USB directly I'll try
-
@dc42 Please, in order to avoid moving it unnecessarily, is it possible to monitor via telnet or something?
-
@brunofporto said in Issues with macros halting the printer.:
@dc42 Please, in order to avoid moving it unnecessarily, is it possible to monitor via telnet or something?
Yes, use the M586 command to enable Telnet.
-
@dc42 said in Issues with macros halting the printer.:
Next time it appears to be stuck, try sending M292 and see whether that un-freezes it
ok.... It receives the M292 command, confirms it, but the printer still busy doing nothing
m111 s1 p3
Debugging enabled for modules: GCodes(3)
Debugging disabled for modules: Platform(0) Network(1) Webserver(2) Move(4) Heat(5) DDA(6) Roland(7) Scanner(8) PrintMonitor(9) Storage(10) PortControl(11) DuetExpansion(12) FilamentSensors(13) WiFi(14) Display(15)
ok
m292
ok
m292
ok -
Can you send M122 and get a report?
-
@dc42 Sure! Did while "busy" doing nothing after reproducing the issue:
M122 === Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 2.02RC4(RTOS) running on Duet Ethernet 1.02 or later Board ID: 08DGM-956GU-DJMSN-6J9D4-3SJ6S-1BNHD Used output buffers: 1 of 20 (16 max) === RTOS === Static ram: 27476 Dynamic ram: 98660 of which 12 recycled Exception stack ram used: 496 Never used ram: 4428 Tasks: NETWORK(ready,328) HEAT(blocked,1232) MAIN(running,1660) IDLE(ready,200) Owned mutexes: === Platform === Last reset 00:03:59 ago, cause: software Last software reset at 2018-11-26 17:26, reason: User, spinning module GCodes, available RAM 4436 bytes (slot 1) Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0441f000 BFAR 0xe000ed38 SP 0xffffffff Task 0x4e49414d Error status: 0 Free file entries: 9 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest block write time: 0.0ms, max retries 0 MCU temperature: min 24.7, current 25.8, max 26.3 Supply voltage: min 24.5, current 24.6, max 24.7, under voltage events: 0, over voltage events: 0, power good: yes Driver 0: standstill, SG min/max 0/250 Driver 1: standstill, SG min/max 0/242 Driver 2: standstill, SG min/max 0/162 Driver 3: standstill, SG min/max not available Driver 4: standstill, SG min/max 0/177 Date/time: 2018-11-26 17:30:11 Cache data hit count 546791891 Slowest loop: 51.83ms; fastest: 0.07ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0 === Move === Hiccups: 0, StepErrors: 0, LaErrors: 0, FreeDm: 240, MinFreeDm: 237, MaxWait: 95242ms, Underruns: 0, 0 Scheduled moves: 35, completed moves: 36 Bed compensation in use: none Bed probe heights: -0.024 -0.046 0.000 0.000 0.000 === Heat === Bed heaters = 0 -1 -1 -1, chamberHeaters = -1 -1 Heater 1 is on, I-accum = 0.0 === GCodes === Segments left: 0 Stack records: 3 allocated, 1 in use Movement lock held by null http is doing "M291 P"Please wait while the bed and tool is being heated up" R"Please Wait" S1 T0 " in state(s) 0 0 telnet is idle in state(s) 0 file is idle in state(s) 0 serial is idle in state(s) 0 aux is idle in state(s) 0 daemon is idle in state(s) 0 queue is idle in state(s) 0 autopause is idle in state(s) 0 Code queue is empty. === Network === Slowest loop: 51.30ms; fastest: 0.02ms Responder states: HTTP(0) HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(2) Telnet(0) HTTP sessions: 1 of 8 Interface state 5, link 100Mbps full duplex === Filament sensors === Extruder 0 sensor: position 8.22, ok, framing errors 0, parity errors 0, no calibration data
-
Thanks. I can see two odd things in that report:
http is doing "M291 P"Please wait while the bed and tool is being heated up" R"Please Wait" S1 T0 " in state(s) 0 0
It is still waiting for the M291 message box to be acknowledged, as if it hasn't received M292. So sending M292 should get it running again.
Scheduled moves: 35, completed moves: 36
Doing one more move than was scheduled doesn't sound right. But I don't think this is part of the problem you are seeing.
I'll review the M292 handling and see if there is any way that a M292 command might be missed.
-
@dc42 Thanks!
I am not sure when this issues started (I think it is with this latest 2.02 series of betas and RCs) but I did not have them before with the same macros.
For now I'll just comment all non critical M291 from these macros
-
@dc42 Same issue with RC5 - not using M291 S0 T0, swapped all of them to S1. The first M291 S1 message does not even appear.
-
@brunofporto said in Issues with macros halting the printer.:
@dc42 Same issue with RC5 - not using M291 S0 T0, swapped all of them to S1. The first M291 S1 message does not even appear.
If it doesn't appear, no wonder it gets stuck! It's waiting for the M292 command to be returned from DWC to tell it that you have acknowledged the message box. I can't think why it wouldn't appear, other than a network issue. Does your system have a PanelDue, and if so does the message box appear on it?
-
@dc42 Yes I have a PanelDue. No... it does not appear there even when the macro is executed from PanelDue.
Same behavior as DWC: Right after resetting the macro works (it halts at the end of the macro but works until that). But If I execute anything before it (like a G32) it does halt after the first M291 S3 as Busy and does nothing.