Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Printer executes start.g mid-print when resuming with PanelDue

    Scheduled Pinned Locked Moved
    PanelDue
    2
    5
    264
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • omtekundefined
      omtek
      last edited by

      First some details about my setup:

      • Duet 3 Mini 5+ running 3.5.2 in SBC-mode
      • SAMMYC21-powered CannedERCF board running 3.5.2 (acting as CAN-FD passthrough, no configuration pushed)
      • Fly-SHT36 Max V3 toolboard running 3.5.2

      Last night during a print I had a very strange occurrence; I had a print running with a filament change (M600) inside. The printer ran pause.g without issue(raise Z, move toolhead out of the way, wait for filament change). I changed the filament using the extrusion menu on the PanelDue (retract 100mm at 50mm/sec, then extrude 100mm at 2mm/sec to load). I pressed the resume button on the PanelDue, and the printer didn't respond. I clicked on the Resume button in DWC, and the printer resumed printing.

      This was the second time I encountered this specific interaction. However I was unable to extract any debugging information at that time.

      This time I was ready.

      Here is an M122 captured shortly after resuming the print:

      7/8/2024, 1:16:12 AM: m122: === Diagnostics ===
      RepRapFirmware for Duet 3 Mini 5+ version 3.5.2 (2024-06-11 17:14:16) running on Duet 3 Mini5plus WiFi (SBC mode)
      Board ID: NTK2Z-J196U-D65J0-40KMN-1V03Z-ZJMGF
      Used output buffers: 27 of 40 (40 max)
      === RTOS ===
      Static ram: 103368
      Dynamic ram: 111760 of which 0 recycled
      Never used RAM 22280, free system stack 122 words
      Tasks: LASER(5,nWait 7,0.0%,254) SBC(2,rWait:,2.1%,772) HEAT(3,nWait 6,0.0%,325) Move(4,nWait 6,2.3%,241) CanReceiv(6,nWait 1,0.1%,771) CanSender(5,nWait 7,0.1%,327) CanClock(7,delaying,0.0%,348) TMC(4,nWait 6,1.5%,67) MAIN(2,running,93.0%,570) IDLE(0,ready,0.0%,29) AIN(4,delaying,0.9%,255), total 100.0%
      Owned mutexes: HTTP(MAIN)
      === Platform ===
      Last reset 21:30:00 ago, cause: Vdd brownout
      Last software reset at 2024-07-05 16:17, reason: User, none spinning, available RAM 22896, slot 2
      Software reset code 0x6013 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00000000 BFAR 0xe000ed38 SP 0x00000000 Task SBC Freestk 0 n/a
      Error status: 0x04
      Aux0 errors 0,1,0
      MCU revision 3, ADC conversions started 77430712, completed 77430710, timed out 0, errs 0
      MCU temperature: min 27.5, current 32.0, max 44.3
      Supply voltage: min 24.3, current 24.4, max 24.4, under voltage events: 0, over voltage events: 0, power good: yes
      Heap OK, handles allocated/used 99/12, heap memory allocated/used/recyclable 2048/1588/1352, gc cycles 1
      Events: 0 queued, 0 completed
      Driver 0: ok, SG min 0, read errors 0, write errors 0, ifcnt 72, reads 62385, writes 26, timeouts 0, DMA errors 0, CC errors 0
      Driver 1: ok, SG min 0, read errors 1, write errors 0, ifcnt 72, reads 62385, writes 26, timeouts 0, DMA errors 0, CC errors 0
      Driver 2: standstill, SG min 0, read errors 0, write errors 0, ifcnt 10, reads 62411, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 3: ok, SG min 0, read errors 1, write errors 0, ifcnt 64, reads 62394, writes 16, timeouts 0, DMA errors 0, CC errors 0
      Driver 4: ok, SG min 0, read errors 0, write errors 0, ifcnt 63, reads 62394, writes 17, timeouts 0, DMA errors 0, CC errors 0
      Driver 5: ok, SG min 0, read errors 0, write errors 0, ifcnt 70, reads 62388, writes 24, timeouts 0, DMA errors 0, CC errors 0
      Driver 6: standstill, SG min 0, read errors 0, write errors 0, ifcnt 10, reads 62411, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Date/time: 2024-07-08 01:16:11
      Cache data hit count 4294967295
      Slowest loop: 341.37ms; fastest: 0.09ms
      === Storage ===
      Free file entries: 20
      SD card 0 not detected, interface speed: 0.0MBytes/sec
      SD card longest read time 0.0ms, write time 0.0ms, max retries 0
      === Move ===
      DMs created 83, segments created 48, maxWait 4434083ms, bed compensation in use: mesh, height map offset 0.000, max steps late 0, min interval 0, bad calcs 0, ebfmin 0.00, ebfmax 0.00
      next step interrupt due in 40665 ticks, enabled
      Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0
      === DDARing 0 ===
      Scheduled moves 615833, completed 615793, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 24], CDDA state 3
      === DDARing 1 ===
      Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === Heat ===
      Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0
      Heater 0 is on, I-accum = 0.2
      Heater 1 is on, I-accum = 0.0
      === GCodes ===
      Movement locks held by null, null
      HTTP* is doing "M122" in state(s) 0
      Telnet is idle in state(s) 0
      File* is idle in state(s) 3
      USB is idle in state(s) 0
      Aux is doing "M409 K"move" F"v"" in state(s) 0 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
      File2 is idle in state(s) 0
      Queue2 is idle in state(s) 0
      Q0 segments left 2, axes/extruders owned 0x0000807
      Code queue 0 is empty
      Q1 segments left 0, axes/extruders owned 0x0000000
      Code queue 1 is empty
      === CAN ===
      Messages queued 1317753
      === Duet Control Server ===
      Duet Control Server version 3.5.2 (2024-06-12 07:12:47, 64-bit)
      HTTP+Executed:
      > Executing M122
      Aux+ProcessInternally:
      > Executing M24
      File 0:/gcodes/kaye -path_charms_0.25n_0.15mm_PLA_VC3_300_3h26m.gcode is selected, processing
      File:
      Buffered code: G2 X178.001 Y156.023 I8.151 J3.736 E.03316
      Buffered code: G2 X177.762 Y157.78 I23.092 J4.042 E.02337
      Buffered code: G3 X177.465 Y158.821 I-3.308 J-.382 E.01433
      Buffered code: G3 X176.806 Y159.555 I-2.192 J-1.303 E.01308
      Buffered code: G3 X175.151 Y160.166 I-2.179 J-3.358 E.02344
      Buffered code: G3 X174.119 Y160.057 I-.224 J-2.809 E.01375
      Buffered code: G3 X172.879 Y158.716 I1.01 J-2.177 E.02469
      Buffered code: G3 X172.92 Y157.388 I5.445 J-.498 E.01755
      Buffered code: G3 X173.443 Y156.613 I2.603 J1.192 E.01237
      Buffered code: G1 X173.995 Y156.209 E.00901
      Buffered code: G1 X174.302 Y156.098 E.0043
      Buffered code: G1 X175.111 Y156.048 E.01068
      Buffered code: G1 X175.662 Y156.154 E.00739
      Buffered code: G3 X176.507 Y156.771 I-1.301 J2.672 E.01386
      Buffered code: G1 X176.845 Y157.007 E.00543
      Buffered code: G1 X176.971 Y156.933 E.00193
      Buffered code: G3 X178.045 Y153.923 I26.995 J7.94 E.04213
      Buffered code: G1 X178.281 Y153.491 E.00649
      Buffered code: G1 X178.431 Y153.308 E.0037
      Buffered code: G3 X179.152 Y152.534 I8.096 J6.817 E.01917
      Buffered code: G1 X179.353 Y152.397 E.00441
      Buffered code: M204 P1000
      Buffered code: G1 X179.234 Y152.616 F10800
      Buffered code: G10 ; retract
      Buffered code: G1 X174.776 Y157.083
      Buffered code: G11 ; unretract
      Buffered code: G1 F2700
      Buffered code: G3 X175.536 Y157.254 I.187 J.949 E.01056
      Buffered codes: 1464 bytes total
      Aux:
      Buffered code: M121
      Buffered codes: 24 bytes total
      > Number of flush requests: 1
      Code buffer space: 1320
      Configured SPI speed: 8000000Hz, TfrRdy pin glitches: 0
      Full transfers per second: 38.64, max time between full transfers: 652.3ms, max pin wait times: 59.2ms/8.0ms
      Codes per second: 8.71
      Maximum length of RX/TX data transfers: 4440/1684
      

      And here is another M122 captured ~10 seconds later, after the printer picked up the KlickyPCB probe and began performing G32 mid-print.

      7/8/2024, 1:16:24 AM: m122: === Diagnostics ===
      RepRapFirmware for Duet 3 Mini 5+ version 3.5.2 (2024-06-11 17:14:16) running on Duet 3 Mini5plus WiFi (SBC mode)
      Board ID: NTK2Z-J196U-D65J0-40KMN-1V03Z-ZJMGF
      Used output buffers: 11 of 40 (40 max)
      === RTOS ===
      Static ram: 103368
      Dynamic ram: 111760 of which 0 recycled
      Never used RAM 22280, free system stack 122 words
      Tasks: LASER(5,nWait 7,0.1%,254) SBC(2,rWait:,3.4%,772) HEAT(3,nWait 6,0.0%,325) Move(4,nWait 6,3.1%,241) CanReceiv(6,nWait 1,0.1%,771) CanSender(5,nWait 7,0.2%,327) CanClock(7,delaying,0.0%,348) TMC(4,nWait 6,1.6%,67) MAIN(2,running,89.3%,570) IDLE(0,ready,1.4%,29) AIN(4,delaying,0.9%,255), total 100.0%
      Owned mutexes: HTTP(MAIN)
      === Platform ===
      Last reset 21:30:13 ago, cause: Vdd brownout
      Last software reset at 2024-07-05 16:17, reason: User, none spinning, available RAM 22896, slot 2
      Software reset code 0x6013 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00000000 BFAR 0xe000ed38 SP 0x00000000 Task SBC Freestk 0 n/a
      Error status: 0x04
      Aux0 errors 0,0,0
      MCU revision 3, ADC conversions started 77442980, completed 77442979, timed out 0, errs 0
      MCU temperature: min 31.8, current 32.0, max 32.0
      Supply voltage: min 24.3, current 24.3, max 24.4, under voltage events: 0, over voltage events: 0, power good: yes
      Heap OK, handles allocated/used 99/10, heap memory allocated/used/recyclable 2048/1588/1416, gc cycles 1
      Events: 0 queued, 0 completed
      Driver 0: ok, SG min 0, read errors 0, write errors 0, ifcnt 72, reads 1115, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 1: ok, SG min 0, read errors 0, write errors 0, ifcnt 72, reads 1115, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 2: standstill, SG min 0, read errors 0, write errors 0, ifcnt 10, reads 1115, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 3: standstill, SG min 0, read errors 0, write errors 0, ifcnt 64, reads 1115, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 4: standstill, SG min 0, read errors 0, write errors 0, ifcnt 63, reads 1115, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 5: ok, SG min 0, read errors 0, write errors 0, ifcnt 70, reads 1115, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Driver 6: standstill, SG min 0, read errors 0, write errors 0, ifcnt 10, reads 1115, writes 0, timeouts 0, DMA errors 0, CC errors 0
      Date/time: 2024-07-08 01:16:23
      Cache data hit count 4294967295
      Slowest loop: 45.44ms; fastest: 0.11ms
      === Storage ===
      Free file entries: 20
      SD card 0 not detected, interface speed: 0.0MBytes/sec
      SD card longest read time 0.0ms, write time 0.0ms, max retries 0
      === Move ===
      DMs created 83, segments created 48, maxWait 2541ms, bed compensation in use: none, height map offset 0.000, max steps late 0, min interval 0, bad calcs 0, ebfmin 0.00, ebfmax 0.00
      next step interrupt due in 21960 ticks, enabled
      Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0
      === DDARing 0 ===
      Scheduled moves 27, completed 66, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state 3
      === DDARing 1 ===
      Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1
      === Heat ===
      Bed heaters 0 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0
      Heater 0 is on, I-accum = 0.2
      Heater 1 is on, I-accum = 0.0
      === GCodes ===
      Movement locks held by File, null
      HTTP* is doing "M122" in state(s) 0
      Telnet is idle in state(s) 0
      File* is idle in state(s) 51 0 3, running macro
      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
      File2 is idle in state(s) 0
      Queue2 is idle in state(s) 0
      Q0 segments left 0, axes/extruders owned 0x0000807
      Code queue 0 is empty
      Q1 segments left 0, axes/extruders owned 0x0000000
      Code queue 1 is empty
      === CAN ===
      Messages queued 869, received 359, lost 0, errs 0, boc 0
      Longest wait 1ms for reply type 6013, peak Tx sync delay 9, free buffers 26 (min 25), ts 62/62/0
      Tx timeouts 0,0,0,0,0,0
      === SBC interface ===
      Transfer state: 5, failed transfers: 0, checksum errors: 0
      RX/TX seq numbers: 63310/63310
      SPI underruns 0, overruns 0
      State: 5, disconnects: 0, timeouts: 0 total, 0 by SBC, IAP RAM available 0x0cd38
      Buffer RX/TX: 56/200-0, open files: 0
      === Duet Control Server ===
      Duet Control Server version 3.5.2 (2024-06-12 07:12:47, 64-bit)
      HTTP+Executed:
      > Executing M122
      File+ProcessInternally:
      >>> Macro bed.g: Executing echo "Current rough pass deviation: " ^ move.calibration.initial.deviation
      File 0:/gcodes/kaye -path_charms_0.25n_0.15mm_PLA_VC3_300_3h26m.gcode is selected, processing
      File:
      Buffered code: G30 P0 X20 Y20 Z-99999 ; probe near a leadscrew
      Buffered code: G30 P1 X170 Y275 Z-99999 ; probe near a leadscrew
      Buffered code: G30 P2 X280 Y40 Z-99999 S3 ; probe near a leadscrew and calibrate 3 motors
      Buffered codes: 176 bytes total
      > Suspended code: G3 X173.673 Y152.422 I.845 J14.728 E.02787
      > Suspended code: G3 X175.22 Y152.925 I-.838 J5.205 E.02152
      > Suspended code: G1 X176.838 Y153.732 E.02382
      > Suspended code: G1 X176.67 Y154.213 E.00671
      > Suspended code: G1 X176.493 Y154.725 E.00714
      > Suspended code: G1 X175.97 Y154.583 E.00714
      > Suspended code: G2 X173.687 Y154.185 I-2.56 J7.947 E.03063
      > Suspended code: G1 X172.943 Y154.259 E.00985
      > Suspended code: G2 X171.672 Y154.712 I1.377 J5.866 E.01782
      > Suspended code: M204 P1000
      > Suspended code: G1 X171.672 Y154.712 F10800
      > Suspended code: G1 X171.745 Y154.917
      > Suspended code: M204 P500
      > Suspended code: G1 F1200
      > Suspended code: G2 X171.718 Y154.93 I2.586 J5.265 E.00039
      > Suspended code: G2 X170.797 Y155.727 I2.02 J3.266 E.01612
      > Suspended code: G2 X170.445 Y156.504 I2.073 J1.408 E.01129
      > Suspended code: G1 X170.341 Y157.041 E.00721
      > Suspended code: G2 X170.449 Y158.818 I7.46 J.436 E.02351
      > Suspended code: G2 X171.033 Y160.69 I18.269 J-4.668 E.02585
      > Suspended code: G3 X170.196 Y159.541 I6.484 J-5.599 E.01875
      > Suspended code: G2 X168.637 Y156.686 I-57.583 J29.59 E.04286
      > Suspended code: G2 X167.688 Y155.573 I-4.472 J2.852 E.01933
      > Suspended code: G1 X167.23 Y155.306 E.00699
      > Suspended code: G1 X166.599 Y155.149 E.00857
      > Suspended code: G2 X164.292 Y155.396 I-.523 J6.012 E.03076
      > Suspended code: G2 X162.393 Y156.113 I4.673 J15.247 E.02676
      > Suspended code: G3 X168.218 Y153.005 I14.781 J20.689 E.08724
      >> Doing macro start.g, started by system
      >> Suspended code: M703 ; load filament-specific config.g
      >> Suspended code: M98 P"0:/sys/setInputShaping.g" ; pull in input shaping parameters
      >> Suspended code: G90 ; absolute Positioning
      >> Suspended code: M83 ; extruder relative mode
      >> Suspended code: M98 P"0:/sys/setDefaultProbePoints.g" ; reset probe points, just in case
      >>> Doing macro bed.g, started by G32 ; 3-point bed leveling
      >>> Number of flush requests: 1
      Code buffer space: 3896
      Configured SPI speed: 8000000Hz, TfrRdy pin glitches: 0
      Full transfers per second: 40.80, max time between full transfers: 39.7ms, max pin wait times: 33.8ms/3.2ms
      Codes per second: 11.51
      Maximum length of RX/TX data transfers: 4440/1684
      

      You can see the G1/2/3 commands for the actual print still present in the suspended gcode, and the contents of bed.g present in the buffered gcode along with the notation Doing macro start.g, started by system.

      I was up until 3am duplicating my setup to run in standalone mode and I'm currently printing the same gcode to see if the error occurs there, or is exclusive to SBC mode.

      Attaching relevant configurations in next post because of character limits.

      omtekundefined 1 Reply Last reply Reply Quote 0
      • omtekundefined
        omtek @omtek
        last edited by omtek

        config.g

        
        ;=== initialize variables ===;
        M98 P"0:/sys/init_pre.g"                                  ;; set some variables that we need for configuration
        ;=== discard if necessary ===;
        
        ;=== configuration - initial networking setup ===;
        M586 P0 S1                                                ;; enable http, disable ftp, disable telnet, set printer name, wait 5s for expansion boards
        M586 P1 S0
        M586 P2 S0
        G4 S5
        M550 P"legionXY"                                          ;; in SBC mode, M550 goes in dsf-config.g, not config.g
        ;M552 S1                                                         
        G4 S5
        
        ;=== configuration -  PanelDue init ===;
        M575 P1 S1 B57600
        
        ;=== configuration - printer ===;
        G90                                                       ;; absolute coordinates, relative extruder moves
        M83
        M669 K1                                                   ;; Kinematics type: 1 = CoreXY
        
        ;=== configuration - drive ===;
        M569 P0.0 S0 D2                                           ;; Z-axis motors, 0.driver0,0.driver1,0.driver2
        M569 P0.1 S0 D2
        M569 P0.5 S0 D2
        M569 P0.3 S1 D2                                           ;; Left and right motors (X- and Y- axis), 0.driver3,0.driver4
        M569 P0.4 S1 D2
        M569 P20.0 S1 D2                                          ;; Extruder, RRF36.driver0
        
        ;=== configuration - drive - axis mapping ===;
        M584 X0.3 Y0.4 Z0.1:0.0:0.5 E20.0                         ;;  map E-axis here as toolboard will be connected
        
        ;=== configuration - drive - microstepping ===;
        M350 X16 Y16 Z16 I1
        
        ;=== configuration - drive - steps/mm, current, idle timeout ===;
        M92 X80 Y80 Z800                                          ;; set steps/mm, current (mA), idle timeout
        M84 S30                                                   ;; set idle hold 30s
        
        ;=== configuration - drive - speed, acceeleration, jerk ===;
        M98 P"0:/sys/setMaxSpeed.g"                               ;; set all the max speeds below as these are adjusted during home moves so we only want to adjust in one spot
        
        ;=== configuration - axis - min/max ===;
        M208 X0 Y0 Z0 S1
        M208 X310 Y300 Z300 S0
        
        ;=== configuration - axis - endstops ===;
        M574 X1 S1 P"20.io2.in"                                   ;; configure active high (S1) X endstop at X- (X1) on RRF36.io2.in (20.io.in)
        M574 Y2 S1 P"0.io2.in"                                    ;; configure Y active high (S1) endstop at Y+ (Y2) on duet.io2.in (0.io2.in)
        M574 Z1 S2                                                ;; configure Z-probe (S2) endstop at low end (Z1)
        
        ;=== configuration - axis - z-probe ===;
        M558 P8 C"^20.io0.in" H5:1 F300:120 T6000 A20 B0          ;; klicky pcb probe installed on RRF36.io0.in (20.io0.in)
        
        ;=== configuration - axis - mesh compensation and bed dismensions ===;
        M98 P"0:/sys/setDefaultProbePoints.g"                     ;; define mesh grid with allowance for mesh generation on printed area only
        if !exists(global.bedCenterX)                           ;; calculate bed center, insert into object model
        	global bedCenterX = floor(move.axes[0].max / 2)
        if !exists(global.bedCenterY)
        	global bedCenterY = floor(move.axes[1].max  / 2)
        
        ;=== configuration - axis - lead screw position ===;
        M671 X-4.5:150:304.5 Y-4.52:305:-4.52 S5
        
        ;=== configuration - sensor - bed heater & thermistor  ===;
        M308 S0 P"0.temp0" Y"thermistor" T100000 B3950 A"Bed"     ;; create sensor S0 on duet.temp0 named "Bed"
        M950 H0 C"0.out0" T0 Q11                                  ;; create heater (H0) for bed
        M307 H0 B0 S1.00                                          ;; on bed H0 disable bang-bang mode and set PWM limit
        M140 H0                                                   ;; map heated bed to heater 0 (H0)
        M143 H0 S120                                              ;; set heater H0 temperature limit to 120C
        
        ;=== !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ===;
        ;; run bed PID tune using code below
        ;;; ;;; H0 = heater 0, or bed
        ;;; ;;; S = temperature in C (90C)
        ;;; ; M303 H0 S90
        ;;;
        ;;; replace M307 below with results from M303
        ;;; M307 may have a Vnnn included with it
        ;;;  if you're using mains (AC) bed heater on your bed, omit it
        ;=== !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ===;
        M307 H0 R0.480 K0.256:0.000 D2.03 E1.35 S1.00 B0          ;; this is my M307, find your own
        
        ;=== configuration - sensor - accelerometer ===;
        M955 P20.0 I16 R10                                        ;; create accelerometer on RRF36
        ;;; I = accelerometer orientation, expressed as 2-digit number. see
        ;;;  https://www.dropbox.com/s/hu2w5mk57l4zqpg/Accelerometer%20Orientation.pdf
        ;;;  for all possible permutations
        
        ;=== configuration - sensor - chamber monitoring ===;
        M308 S5 P"0.io4.out+0.io4.in" Y"dht22" A"Chamber"         ;; DHT22 setup
        M308 S8 P"S5.1" Y"dht-humidity" A"Humidity[%]"
        M308 S11 Y"mcu-temp" A"MCU"                               ;; MCU temperature, with offset
        M912 P0 S-1.2
        M950 F2 C"0.out3" Q250                                                       ;; create fan 0 (F0) on pin 0.out2
        M106 P2 C"mainboard cooling" S0 H1 T155 L255                                 ;; set fan 0 (P0) to thermostatic control (45C), full-speed (L255) named "mainboard cooling"
        ;=== configuration - LEDs, chamber & toolhead ===;
        M950 P0 C"0.out5" Q1000                                   ;; configure Dayspring LEDs P0 on duet.out5 (0.out5)
        
        ;=== configuration - overrides ===;
        ;M501                                                     ;; config-override.g should remain empty      
        
        ;=== configuration - gizmo1 ===;
        M98 P"0:/sys/gizmo1.g"
        M568 P0 R0 S0 A0                                          ;; turn tool0 heater off
        M140 S-273.1                                              ;; turn bed off
        T0 P0                                                     ;; select T0, don't run any toolchange macros
        ;=== configuration ===;
        
        ;=== configuration - housekeeping ===;
        M98 P"0:/sys/init_post.g"                                 ;; set the last few variables we need that rely on loaded configuration
        M98 P"0:/sys/setBuildPlate.g"                             ;; see setBuildPlate.g for Z probe trigger value, offset, trigger height
        ;=== discard if necessary ===;
        

        init_pre.g

        if !exists(global.runDaemon)
        	global runDaemon = false 
        
        if !exists(global.bedPreheatTemp)  
        	global bedPreheatTemp = 60
        	
        if !exists(global.cancelled)  ; global variable for exiting out of loops
        	global cancelled = false 
        
        if !exists(global.filamentDistance)
        	global filamentDistance = 0
        
        if !exists(global.filamentFeedSpeed)
        	global filamentFeedSpeed = 1800
        
        if !exists(global.filamentRetractSpeed)
        	global filamentRetractSpeed = 3600
        
        if !exists(global.filamentDistance)
        	global filamentDistance = 0 ; global for use to allow filament to feed for set distance after sensor trips 
        else
        	set global.filamentDistance = 0
        

        init_post.g

        ;;;;===== global variables for preheating, review, extract, and extrapolate for filament load/preheat macros);;;;
        ; extrusion
        if !exists(global.loadedFilament) || global.loadedFilament=null; global variable to hold filament name
        	global loadedFilament="No_Filament" ; create a filament variable
        G4 P10
        
        if move.extruders[state.currentTool].filament=""
        	echo "No filament loaded.  Cold extrude & retract set to defaults"
        	M302 S190 R110 ; Allow extrusion starting from 190°C and retractions already from 110°C (defaults)
        	set global.loadedFilament="No_Filament"
        else
        	set global.loadedFilament=move.extruders[state.currentTool].filament ; set the variable to the currently loaded filament
        	echo "Loading config for " ^ global.loadedFilament ^ " filament"
        	M703 ; if a filament is loaded, set all the heats and speeds for it by loading config.g
        G4 P10
        

        setDefaultProbePoints.g

        ;setDefaultProbePoints.g
        M557 X5:275 Y5:275 P20 ; set values as you would normally do in config.g.g
        

        gizmo1.g

        ;; gizmoN.g is the comprehensive definition of a tool (extruder, hotend, heater, thermisistor, filament monitoring, input shaping, tool and part cooling fans)
        ;; includes hotend (thermistor, heater), fan (tool, part), extruder (axis, microstepping), tool assignment and offset
        
        ;=== gizmo1 - fan ===;
        M950 F1 C"!0.out4+0.out4.tach"                                                ;; create fan F1 named "4028" with duet.out4+duet.out4.tach (0.out4+0.out4.tach)
        M106 P1 C"4028" S0 H-1
        
        ;=== gizmo1 - hotend thermistor ===;
        M308 S1 P"20.temp0" Y"thermistor" T100000 B4725 C7.060000e-8 A"e3drevo"       ;; configure sensor 1 (S1) on pin RRF36.temp0 (20.temp0) as thermistor
        M950 H1 C"20.out0" T1                                                         ;; create heater output (H1) on RRF36.out0 (20.out0) and map to sensor 1 (T1)
        M307 H1 B0 S1.00                                                              ;; set PWM limit (S1.00)
        M563 P0 S"revo" D0 H1 F1                                                      ;; define tool0 (T0)
                                                                                      ;; assign fan F1, extruder drive D0 (E0) and heater H1 to tool T0 named "revo"
        G10 P0 X0 Y0 Z0                                                               ;; set axis offsets, max temperature, initial temperature
        M143 H1 S290
        G10 P0 R0 S0
        
        ;=== !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ===;
        ;; run hotend PID tune!! using code below
        ;;; T0 = PID tune tool0
        ;;; S210 = temperature in C (210C)
        ;;; F0.45 = Fan PWM value; 0.45 = 45%
        ;;; ; M303 T0 S210 F0.45
        ;;; replace M307 below with results from M303
        ;=== !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ===;
        M307 H1 R3.611 K0.702:0.541 D1.95 E1.35 S1.00 B0 V23.5                        ;; this is my M307, find your own
        
        ;=== gizmo1 - fan - hotend ===;
        M950 F0 C"20.out2" Q250                                                       ;; create fan 0 (F0) on pin RRF.out2 (20.out2)
        M106 P0 C"tool" S0 H1 T45 L255                                                ;; set fan 0 (P0) to thermostatic control (45C), full-speed (L255) named "tool"
        
        ;=== gizmo1 - extruder ===;
                                                                                      ;; Orbiter v2 with LDO motor
        M906 E1600                                                                    ;; set extruder motor current
        M350 E16 I1                                                                   ;; set microstepping to 16 with interpolation
        M92 E671.64                                                                   ;; set extruder steps per mm
        M203 E7200                                                                    ;; set max speed, jerk, acceleration
        M205 E5.0
        M201 E3000
        
        T0 P0                                                                         ;; select T0, don't run toolchange macro
        
        M703                                                                          ;; load filament specific gcode
                                                                                      ;; I keep filament-specific PID tuning, retraction, and pressure advance 
                                                                                      ;; settings here.
        
        ;=== configuration - scanning z-probe ===;
        M558 K1 P11 C"20.i2c.ldc1612" F18000 T36000
        M308 A"SZP" S4 Y"thermistor" P"20.temp1" T100000 B4092; thermistor on PCB/coil
        M558.2 K1 S16 R217324
        
        ;=== gizmo1 - options ===;
        M955 P20.0 I12                                                                ;; accelerometer on RRF36
        M950 E0 C"20.rgbled" T2 U2 Q3000000                                           ;; configure toolhead LED E0 on FLY36.rgbled (20.rgbled)
        

        setBuildPlate.g

        ;; check mesh.g and mesh.prusaslicer for setting on how to only create heightmap where printing
        
        ;=== configuration - bed - mesh compensation ===;
        ;M376 H3                                                ;; fade mesh compensation at 3mm
        
        ;=== configuration - bed - z-probe offset ===;
        ;;set in config.g, but change here // old offset: G31 K0 P500 X-27.8 Y-12.0 Z1.55
        G31 K0 P500 X-23.34 Y-20.49 Z1.84                         ;; klickyPCB with stock switch
        G31 K1 X0.0 Y-16.00 Z2.000                                      ;; Mellow SZP
        

        bed.g

        ; bed.g
        ; called to perform automatic bed compensation via G32
        
        M290 R0 S0                                                                                 ;; clear baby stepping
        M561                                                                                       ;; reset all bed adjustments
        M400                                                                                       ;; flush move queue
        
        
        if !move.axes[0].homed 
          echo "not all axes homed, homing axes first"                                             ;; Home XYZ, if not already
          G28
        
        M401
        
        ;=== probe sanity check commands ===;
        ;; G1 X{ 20 - sensors.probes[0].offsets[0] }  Y{ 20 - sensors.probes[0].offsets[1] }
        ;; G1 X{ 170 - sensors.probes[0].offsets[0] }  Y{ 275 - sensors.probes[0].offsets[1] }
        ;; G1 X{ 280 - sensors.probes[0].offsets[0] }  Y{ 40 - sensors.probes[0].offsets[1] }
        
        
        ;=== rough pass estimate, can skip ===;
        G30 P0 X20 Y20 Z-99999          ; probe near a leadscrew
        G30 P1 X170 Y275 Z-99999        ; probe near a leadscrew
        G30 P2 X280 Y40 Z-99999 S3      ; probe near a leadscrew and calibrate 3 motors
        echo "Current rough pass deviation: " ^ move.calibration.initial.deviation
        
        while move.calibration.initial.deviation > 0.005
            if iterations >= 10
                echo "Error: Max attempts failed. Deviation: " ^ move.calibration.initial.deviation
                break
            echo "Deviation over threshold. Executing pass" , iterations+1, "deviation", move.calibration.initial.deviation
            G30 P0 X20 Y20 Z-99999 ; probe near a leadscrew
            G30 P1 X170 Y275 Z-99999 ; probe near a leadscrew
            G30 P2 X280 Y40 Z-99999 S3 ; probe near a leadscrew and calibrate 3 motors
                echo "Current deviation: " ^ move.calibration.initial.deviation 
                continue
        echo "Final deviation: " ^ move.calibration.initial.deviation
        
        G0 X150 Y150 F10000
        ;G1 X{global.Bed_Center_X - sensors.probes[0].offsets[0] } Y{global.Bed_Center_Y - sensors.probes[0].offsets[1]} F12000
        
        ; rehome Z as the absolute height of the z plane may have shifted
        G28 Z
        
        M402
        

        pause.g

        ; pause.g
        ; called when a print from SD card is paused
        ;
        ; generated by RepRapFirmware Configuration Tool v3.3.5 on Sat Nov 20 2021 00:56:13 GMT-0500 (Eastern Standard Time)
        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 X150 Y280 F6000 ; go to X150 Y280
        

        resume.g

        ; resume.g
        ; called before a print from SD card is resumed
        
        G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move
        G1 R1 X0 Y0 Z0       ; go back to the last print move
        M83                  ; relative extruder moves
        G1 E10 F3600         ; extrude 10mm of filament
        

        start.g

        T0         ; ensure the tool is selected
        
        M220 S100  ; set speed factor back to 100% in case it was changed
        M221 S100  ; set extrusion factor back to 100% in case it was changed
        M290 R0 S0 ; clear any baby-stepping
        M106 P0 S0 ; turn layer fan off if it is on
        M400       ; finish all moves, clear the buffer
        
        M98 P"0:/sys/setBuildPlate.g" ; pull in build plate parameters 
        							; heightmap, probe height, etc.
        
        ; chamber LEDs on
        M98 P"0:/macros/LEDs/led_on.g"
        		
        G32		   ; 3-point bed leveling
        
        ;M501	   ; load config-override.g
        M703	   ; load filament-specific config.g
        
        
        M98 P"0:/sys/setInputShaping.g" ; pull in input shaping parameters
        
        G90        ; absolute Positioning
        M83        ; extruder relative mode
        
        ;=== DuetLapse3 control ===;
        ;M291 P"DuetLapse3.start" S2
        ;M292
        ;G4 S10
            
        M98 P"0:/sys/setDefaultProbePoints.g" ; reset probe points, just in case
        
        ;=== slicer start code ===; 
        

        Please let me know if there's any other information I can provide or troubleshooting steps I can take to help narrow this error down.

        ~oM

        droftartsundefined 1 Reply Last reply Reply Quote 0
        • droftartsundefined
          droftarts administrators @omtek
          last edited by

          @omtek Thanks for the report. I have passed this on to @dc42 who is investigating issues with macros.

          Ian

          Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

          omtekundefined 1 Reply Last reply Reply Quote 0
          • omtekundefined
            omtek @droftarts
            last edited by omtek

            @droftarts Thank you for that.

            I wanted to add that after switching to standalone mode, I was able to run the same gcode 3 times without any issue.

            droftartsundefined 1 Reply Last reply Reply Quote 0
            • droftartsundefined
              droftarts administrators @omtek
              last edited by

              @omtek Okay, thanks, this might be one for @chrishamm to have a look at, in that case.

              Ian

              Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

              1 Reply Last reply Reply Quote 0
              • omtekundefined omtek referenced this topic
              • omtekundefined omtek referenced this topic
              • First post
                Last post
              Unless otherwise noted, all forum content is licensed under CC-BY-SA