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

Stop part cooling fans on pause and restore on resume

Scheduled Pinned Locked Moved
Tuning and tweaking
3
14
618
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.
  • undefined
    Serbitar
    last edited by Serbitar 5 May 2021, 20:46 5 May 2021, 19:04

    I am trying to set my printer to disable part cooling fans when pause is invoked and restore them to the pre-paused state on resume.

    With the pause/resume macros below, pause works perfectly however resume does not restore the fan speeds (but print does continue).

    Am I doing something wrong here?

    sys/pause.g

    G91 ; relative positioning
    G1 Z50
    G90 ; Absolute positioning
    G53 G1 x0 y-999 F60000; Send carriage to rear centre
    M106 S0 ; Turn off part cooling
    T-1 ; Deselect tool so standby temp (0) is requested

    sys/resume.g

    T R1 ; Reselect last tool
    M106 R1 ; Turn on part cooling
    M703 ; Load tool paramaters
    M116 ; Wait for temps
    M83 ; relative extruder moves
    G1 E10 F3600 ; extrude 10mm of filament
    G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move

    config.g

    M550 P"hevort" ; set machine label
    M584 X0.3 Y0.4 Z0.0:0.1:0.2 E0.5 ; Assign drivers to axes
    M669 K1 ; Set system to CoreXY
    M569 P0 S0 D2 ;H0 ; Reverse Z1 motor direction
    M569 P1 S0 D2 ;H0 ; Reverse Z2 motor direction
    M569 P2 S0 D2 ;H0 ; Reverse Z3 motor direction
    M569 P3 S0 D2 ;H0 ; Reverse X motor direction
    M569 P4 S0 D2 ;H0 ; Reverse Y motor direction
    M569 P5 S0 D2 ;H0 ; Extruder motor setup, reverse direction
    M671 X-31:546:257 Y0:0:546 S100 ; Set Z probe points
    M574 X1 S1 P"io1.in" ; Configure X endstop
    M574 Y1 S1 P"io2.in" ; Configure Y endstop
    M574 Z2 S4 ; Use stallguard for Z1 endstop for max Z. Allow each motor to stall independently
    M915 X S3 F0 R1 ; Configure stallguard detection for X
    M915 Y S3 F0 R1 ; Configure stallguard detection for Y
    M915 Z S1 H400 F1 R1 ; Configure stallguard detection for Z
    M915 E S3 F0 R1 ; Configure stallguard detection for E
    M906 X1500 Y1500 Z1500 E1000 I80 ; Motor currents in ma + idle percentage
    M92 X80 Y80 E400 Z800 ; Steps per mm
    M203 Z2500 Y100000 X100000 ; Max feedrate in mm/min
    M201 X1000.0 Y1000.0 Z50.0 E250.0 ; Max acceleration mm/sec^2
    M566 X900.0 Y900.0 Z50.0 E120.0 P1 ; MAx instantaneous speed change
    M308 S0 P"temp0" Y"thermistor" A"Bed" T100000 B3950 ; Set up bed thermistor
    M950 H0 C"out0" T0 Q10 ; Set up bed heater output
    M140 P0 H0 ; Configure bed heater
    M307 H0 A110.3 C221.0 D3.9 V24.0 B0 ; Configure bed heating process parameters
    M304 P91.5 I3.111 D250.3 ; Configure bed heating PID parameters
    M308 S1 P"temp1" Y"thermistor" A"Hotend" T100000 ; B3950 ; Set up hotend thermistor
    M950 H1 C"out1" T1 ; Set up hotend heater
    M563 P0 S"Volcano" D0.5 H1 F2:4; Create new tool for hotend using air pump and hevacs
    M143 H1 S300 A3 ; Set max heater temp to 300C
    G10 P0 X0 Y0 Z0 R0 S200 ; Set default tool temperatures and offsets
    ;M307 H1 A838.7 C467.3 D8.3 V23.9 B0 ; Hotend pid parameters
    ;M307 H1 R1.612 C384.3 D10.70 S1.00 V24.0 ; PID Parameters Volcano, 220C
    M307 H1 R1.752 C200.1 D8.36 S1.00 V24.0 ; PID Parameters Volcano, 220C + full berd air
    M308 S10 P"spi.cs0" Y"dht22" A"Enclosure Temp" ; Set AM2302/DHT22 pin
    M308 S11 P"S10.1" Y"dhthumidity" A"Enclosure Humidity" ; Set AM2302/DHT22 humidity subsensor
    M950 S2 C"io4.out" ; Bltouch servo pin
    M558 C"^io4.in" H20 F600 T6000 P9 ; Configure z probe, Bltouch
    M280 P2 S160 ; Reset BLTouch
    G31 P500 X12 Y-27 Z2.940 ; set Z probe trigger value, offset and trigger height
    M950 C"out2" F0 ; First fan = Water pump can add tacho input later
    M106 P0 S255 T50 C"Water pump" H1 ; Set Fan0 to be thermostatically controlled against hotend temp > 50C
    M950 C"out4+out4.tach" F1 ; Second fan = radiator fan
    M106 P1 S255 T50 H1 C"Radiator fan"
    M950 C"out3" F2 Q30000 ; Third fan = air pump
    M106 P2 C"Air pump"
    M950 C"out9" F3 Q30000 ; Enclosure LED
    M106 P3 C"Lights" S255
    M950 C"!out5" F4 ; HEVACS inverted PWM
    M106 P4 X0.30 C"HEVACS" ; Max 30% PWM
    M591 D0 P1 C"^io0.in" S1 ; Filament runout sensor
    M208 X-265.7 Y-260 Z0 S1 ; Set axes minima
    M208 X249.3 Y240 Z470 ; Set axes maxima
    ;M208 X249.3 Y245 Z500 ; Set axes maxima
    M557 X-250:249.3 Y-262.7:232 S25 ; Set probe grid limits
    M572 D0 S0.025 ; Pressure advance
    M207 P0 S0.2 F2400 ; Retraction 0.2mm at 40mm/s
    ;M955 P0 C"io3.out+io3.in" ; Accelerometer int,CS
    ;M956 P0 S1000 A0
    ;M81 ; PSU Off
    ; Buttons
    M950 J0 C"^io6.in" ; Black
    M581 P0 T0 ; Estop
    M950 J1 C"^io7.in" ; Yellow
    M581 P1 T1 ; Pause
    M950 J2 C"^io8.in" ; Green
    M581 P2 T2 ; Trigger2 (resume)
    m122
    === Diagnostics ===
    RepRapFirmware for Duet 3 MB6HC version 3.3RC1+1 (2021-05-01 21:43:52) running on Duet 3 MB6HC v0.6 or 1.0 (SBC mode)
    Board ID: 08DJM-956L2-G43S8-6J9D8-3S86J-9B36F
    Used output buffers: 4 of 40 (12 max)
    === RTOS ===
    Static ram: 150680
    Dynamic ram: 63820 of which 0 recycled
    Never used RAM 136836, free system stack 121 words
    Tasks: SENSORS(delaying,0.0%,68) SBC(ready,5.4%,282) HEAT(delaying,0.0%,295) Move(notifyWait,0.2%,242) CanReceiv(notifyWait,0.0%,945) CanSender(notifyWait,0.0%,359) CanClock(notifyWait,0.0%,335) TMC(notifyWait,8.2%,59) MAIN(running,86.1%,649) IDLE(ready,0.0%,29), total 100.0%
    Owned mutexes: HTTP(MAIN)
    === Platform ===
    Last reset 00:11:06 ago, cause: software
    Last software reset at 2021-05-05 21:34, reason: User, none spinning, available RAM 136836, slot 0
    Software reset code 0x0012 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x00400000 BFAR 0x00000000 SP 0x00000000 Task SBC Freestk 0 n/a
    Error status: 0x00
    Aux0 errors 0,0,0
    Aux1 errors 0,0,0
    Step timer max interval 700
    MCU temperature: min 42.5, current 47.6, max 47.8
    Supply voltage: min 0.2, current 23.9, max 24.2, under voltage events: 0, over voltage events: 0, power good: yes
    12V rail voltage: min 0.1, current 12.2, max 12.7, under voltage events: 0
    Heap OK, handles allocated/used 99/0, heap memory allocated/used/recyclable 2048/4/4, gc cycles 0
    Driver 0: position 3214, standstill, reads 25339, writes 23 timeouts 0, SG min/max 0/1023
    Driver 1: position 679, standstill, reads 25339, writes 23 timeouts 0, SG min/max 0/1023
    Driver 2: position 5115, standstill, reads 25339, writes 23 timeouts 0, SG min/max 0/838
    Driver 3: position 0, ok, reads 25344, writes 18 timeouts 0, SG min/max 0/1023
    Driver 4: position 0, ok, reads 25346, writes 18 timeouts 0, SG min/max 0/1023
    Driver 5: position 0, ok, reads 25350, writes 14 timeouts 0, SG min/max 0/1023
    Date/time: 2021-05-05 21:45:51
    Slowest loop: 172.77ms; 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 155884ms, bed compensation in use: mesh, comp offset 0.000
    === MainDDARing ===
    Scheduled moves 10298, completed moves 10263, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 2], CDDA state 3
    === 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 0 is on, I-accum = 0.2
    Heater 1 is on, I-accum = 0.6
    === GCodes ===
    Segments left: 1
    Movement lock held by null
    HTTP* is doing "M122" in state(s) 0
    Telnet is idle in state(s) 0
    File* is doing "G1 X15.886000 Y1.369000 E9.200960" 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 5994, send timeouts 5991, received 0, lost 0, longest wait 0ms for reply type 0, peak Tx sync delay 0, free buffers 49 (min 49)
    Last cancelled message type 4514 dest 127
    === SBC interface ===
    State: 4, failed transfers: 0
    Last transfer: 4ms ago
    RX/TX seq numbers: 26806/26806
    SPI underruns 0, overruns 0
    Number of disconnects: 0, IAP RAM available 0x2c90c
    Buffer RX/TX: 432/1688-0
    === Duet Control Server ===
    Duet Control Server v3.3-rc1
    File:
    Buffered code: G1 X15.886 Y1.369 E9.20096
    Buffered code: G1 X13.720 Y3.536 E9.30466
    Buffered code: G1 X11.993 Y1.808 E9.38734
    Buffered code: G1 X8.804 Y1.137 F30000.000
    Buffered code: G1 F6694.566
    Buffered code: G1 X1.320 Y8.621 E9.75648
    Buffered code: G1 X1.320 Y9.214 E9.77717
    Buffered code: G1 X9.214 Y1.320 E10.16654
    Buffered code: G1 X9.807 Y1.320 E10.18723
    Buffered code: G1 X1.320 Y9.807 E10.60585
    Buffered code: G1 X1.320 Y10.400 E10.62654
    Buffered code: G1 X10.400 Y1.320 E11.07443
    Buffered code: G1 X10.929 Y1.320 E11.09286
    Buffered code: G1 X10.961 Y1.352 E11.09445
    Buffered code: G1 X1.352 Y10.961 E11.56840
    Buffered code: G1 X1.649 Y11.258 E11.58303
    Buffered code: G1 X11.258 Y1.649 E12.05698
    Buffered code: G1 X11.554 Y1.946 E12.07161
    Buffered code: G1 X1.946 Y11.554 E12.54556
    Buffered code: G1 X2.242 Y11.851 E12.56019
    Buffered code: G1 X11.851 Y2.242 E13.03413
    Buffered code: G1 X12.148 Y2.539 E13.04876
    Buffered code: G1 X2.539 Y12.148 E13.52271
    Buffered code: G1 X2.835 Y12.444 E13.53734
    Buffered code: G1 X12.444 Y2.835 E14.01129
    Buffered code: G1 X12.741 Y3.132 E14.02592
    Buffered code: G1 X3.132 Y12.741 E14.49986
    Buffered code: G1 X3.429 Y13.037 E14.51449
    Buffered code: G1 X13.037 Y3.429 E14.98844
    Buffered code: G1 X13.334 Y3.725 E15.00307
    ==> 1424 bytes
    Code buffer space: 2264
    Configured SPI speed: 8000000 Hz
    Full transfers per second: 40.37
    Codes per second: 16.57
    Maximum length of RX/TX data transfers: 4992/1640
    File /opt/dsf/sd/gcodes/3DBenchy.gcode is selected, processing
    1 Reply Last reply Reply Quote 0
    • undefined
      Phaedrux Moderator
      last edited by 5 May 2021, 22:38

      In pause.g can you try using M106 S0 P0 and then in resume try using M106 R2?

      Z-Bot CoreXY Build | Thingiverse Profile

      undefined 1 Reply Last reply 6 May 2021, 13:53 Reply Quote 0
      • undefined
        Serbitar @Phaedrux
        last edited by 6 May 2021, 13:53

        @phaedrux

        pause.g

        G91 ; relative positioning
        G1 Z50
        G90 ; Absolute positioning
        G53 G1 x0 y-999 F60000; Send carriage to rear centre
        M106 S0 P0 ; Turn off part cooling?
        T-1 ; Deselect tool

        resume.g

        T R1 ; Reselect last tool
        M106 R2 ; Turn on part cooling
        M703 ; Load tool paramaters
        M116 ; Wait for temps
        M83 ; relative extruder moves
        G1 E10 F3600 ; extrude 10mm of filament
        ;; Move back into pos
        G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move

        In this case pause did not stop the fans and they remained running after resume.

        1 Reply Last reply Reply Quote 0
        • undefined
          Phaedrux Moderator
          last edited by 6 May 2021, 15:03

          Sorry I assumed your part cooling fan was on fan0, but I see that's not the case.

          M563 P0 S"Volcano" D0.5 H1 F2:4

          In that case try M106 S0 P2:4

          What is the format of the fan commands that your slicer is sending?

          Z-Bot CoreXY Build | Thingiverse Profile

          undefined 1 Reply Last reply 7 May 2021, 10:50 Reply Quote 0
          • undefined
            Serbitar @Phaedrux
            last edited by 7 May 2021, 10:50

            @phaedrux
            Slicer is doing M106 S255.

            With M106 S0 P2:4 in pause.g the fans don't stop.
            I'm doing that before deselecting the tool though so won't they be controlled by the virtual tool fan at that point?

            1 Reply Last reply Reply Quote 0
            • undefined
              Phaedrux Moderator
              last edited by 7 May 2021, 15:17

              Thanks for testing but I think I misguided you as I don't think M106 will accept two fan targets.

              M106 S0 P2:4

              But it should be storing and restoring your fan values, but it's not, so possibly a bug. Will see what DC42 says.

              Z-Bot CoreXY Build | Thingiverse Profile

              1 Reply Last reply Reply Quote 0
              • undefined
                Phaedrux Moderator
                last edited by 7 May 2021, 15:26

                Likely bug. On the list to investigate.

                Z-Bot CoreXY Build | Thingiverse Profile

                1 Reply Last reply Reply Quote 0
                • undefined
                  Serbitar
                  last edited by 7 May 2021, 16:07

                  Yep looks bugged to me too.

                  pause.g

                  T-1 ; Deselect tool
                  M106 S0 P2
                  M106 S0 P4

                  correctly stops the fans and

                  resume.g

                  T R1 ; Reselect last tool
                  M106 R2 ; Turn on part cooling
                  M703 ; Load tool paramaters
                  M116 ; Wait for temps

                  resumes the fans but stops them once temps are reached and print resumes

                  undefined 1 Reply Last reply 7 May 2021, 17:32 Reply Quote 0
                  • undefined
                    dc42 administrators @Serbitar
                    last edited by dc42 5 Jul 2021, 17:36 7 May 2021, 17:32

                    @serbitar please try M106 R1 not M106 R2. Also you should use a plain M106 S0 command to turn the fans off in pause.g. But think that's what you were doing originally.

                    Does it make any difference if you remove the M703 command?

                    Duet WiFi hardware designer and firmware engineer
                    Please do not ask me for Duet support via PM or email, use the forum
                    http://www.escher3d.com, https://miscsolutions.wordpress.com

                    undefined 1 Reply Last reply 7 May 2021, 18:33 Reply Quote 0
                    • undefined
                      Serbitar @dc42
                      last edited by 7 May 2021, 18:33

                      @dc42 Ah, that is an artifcact from playing with this last week, well spotted.

                      Changed config as you suggested, and thing still aren't working as desired.

                      Fans stop on pause but are not restored.

                      Is there some way to peek into the stored state?

                      pause.g

                      G91 ; relative positioning
                      G1 Z50
                      G90 ; Absolute positioning
                      G53 G1 x0 y-999 F60000; Send carriage to rear centre
                      M106 S0 ; Turn off part cooling
                      T-1 ; Deselect tool
                      ;M106 S0 P2
                      ;M106 S0 P4

                      resume.g

                      T R1 ; Reselect last tool
                      M106 R1 ; Turn on part cooling
                      ;M703 ; Load tool paramaters
                      M116 ; Wait for temps
                      M83 ; relative extruder moves
                      G1 E10 F3600 ; extrude 10mm of filament
                      ;; Move back into pos
                      G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move
                      undefined 1 Reply Last reply 8 May 2021, 08:33 Reply Quote 0
                      • undefined
                        dc42 administrators @Serbitar
                        last edited by 8 May 2021, 08:33

                        @serbitar I confirm that this is a problem. There is a single set of saved fan speeds used by both pause/resume and tool changes. What's happening is that when you reselect the tool in resume.g, the current fan speed is zero, and that's overwriting the value saved when the pause occurred.

                        Duet WiFi hardware designer and firmware engineer
                        Please do not ask me for Duet support via PM or email, use the forum
                        http://www.escher3d.com, https://miscsolutions.wordpress.com

                        undefined 1 Reply Last reply 8 May 2021, 14:45 Reply Quote 0
                        • undefined
                          Serbitar @dc42
                          last edited by 8 May 2021, 14:45

                          @dc42 Thanks for looking into it, that makes sense.
                          I will change my pause.g to use G10 to turn the hotend heater off instead (for now).

                          undefined 1 Reply Last reply 8 May 2021, 14:47 Reply Quote 0
                          • undefined
                            dc42 administrators @Serbitar
                            last edited by 8 May 2021, 14:47

                            @serbitar I have implemented a fix in RRF 3.3RC2. I have also added a new parameter to M568 that allows you to switch a tool's heaters between off, standby, and active.

                            Duet WiFi hardware designer and firmware engineer
                            Please do not ask me for Duet support via PM or email, use the forum
                            http://www.escher3d.com, https://miscsolutions.wordpress.com

                            undefined 1 Reply Last reply 8 May 2021, 22:13 Reply Quote 0
                            • undefined
                              Serbitar @dc42
                              last edited by 8 May 2021, 22:13

                              @dc42 Wow fantastic! I looks forward to experimenting with it once released!

                              1 Reply Last reply Reply Quote 0
                              4 out of 14
                              • First post
                                4/14
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA