Disable inactive fans during tool change on RRF v3

Discussion in 'Tool heads & ToolChanger' started by Adam Haile, Nov 15, 2020.

Tags:
  1. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    I've been pulling my hair out over PCF fans for like 5 hours now.
    I'm running RRF v3.1.1 and and having a hell of a time getting the PCF fans to start/stop when the tool changes. The way I've got it setup now it's mapped correctly - I can select a tool and then call "M106 S255" and the fan on that tool starts right up. The problem is that if I swap tools, the now inactive tool's fan stays on and the new tool stays off until I call "M106 S255" again. But now BOTH fans are on. And so on for all 4 tools. My config is based on Joe Spanier's config and he tells me that his works as expected. So I'm really not sure what I'm doing wrong here. The only real difference is that he has T3 disable so I added that. All the wiring is correct as I can control all of them (and the hotend fans are thermostatically controlled with no issues). I just simply can't get the PCF fans to enable/disable automatically when the tool switches. config.g below. Any insight greatly appreciated.


    Code:
    ; Configuration file for Duet WiFi
    ; executed by the firmware on start-up
    
    ; General preferences
    M111 S0                         ; Debugging off
    G21                             ; Work in millimetres
    G90                             ; Send absolute coordinates...
    M83                             ; ...but relative extruder moves
    M555 P2                         ; Set firmware compatibility to look like Marlin
    
    ; Network
    M550 P"ToolChanger"             ; Set machine name
    M552 S1                            ; Enable Networking
    M586 P0 S1                         ; Enable HTTP
    M586 P1 S0                         ; Disable FTP
    M586 P2 S0                         ; Disable Telnet
    
    M667 S1                         ; Select CoreXY mode
    
    ; XY Endstops
    M574 X1 Y1 S3                         ; Set X / Y endstop stall detection
    
    ; Z Endstop
    M574 Z0 P"nil"                        ; Set Z endstop probe
    M558 P5 C"zstop" H5 F360 T20000     ; Set Z probe type to switch, the axes for which it is used and the dive height + speeds
    G31 P200 X0 Y0 Z0                    ; Set Z probe trigger value, offset and trigger height
    M557 X10:290 Y20:180 S40                 ; Define mesh grid
    
    ; Drive direction
    M569 P0 S0                         ; Drive 0 X
    M569 P1 S0                         ; Drive 1 Y
    M569 P2 S1                         ; Drive 2 Z
    M569 P3 S0                         ; Drive 3 E0
    M569 P4 S0                         ; Drive 4 E1
    M569 P5 S1                         ; Drive 5 E2
    M569 P6 S1                         ; Drive 6 E3
    M569 P7 S0                         ; Drive 7 COUPLER
    M569 P8 S0                         ; Drive 8 UNUSED
    M569 P9 S0                         ; Drive 9 UNUSED
    
    M584 X0 Y1 Z2 C7 E3:4:5:6                                ; Apply custom drive mapping
    M208 X-35 Y-49 Z0 C0 S1                                    ; Set axis minima
    M208 X328.5 Y244 Z300 C260 S0                            ; Set axis maxima
    M350 E8:8:8:8 C8 I0                                     ; Configure microstepping without interpolation
    M350 X16 Y16 Z16 I1                                        ; Configure microstepping with interpolation
    M92 X100 Y100 Z1600 C100 E417:417:417:417                ; Set steps per mm
    M566 X400 Y400 Z8 C2 E2:2:2:2                            ; Set maximum instantaneous speed changes (mm/min)
    ;M203 X35000 Y35000 Z1200 C5000 E5000:5000:5000:5000        ; Set maximum speeds (mm/min)
    M203 X20000 Y20000 Z1200 C5000 E5000:5000:5000:5000        ; Set maximum speeds (mm/min)
    ;M201 X6000 Y6000 Z400 C400 E2500:2500:2500:2500            ; Set accelerations (mm/s^2)                           
    M201 X700 Y700 Z400 C400 E2500:2500:2500:2500             ; Set accelerations (mm/s^2)
    M906 X2000 Y2000 Z1330 C400 E1680:1680:1680:1680 I30     ; Set motor currents (mA) and motor idle factor in percent
    M84 S120                                                 ; Set idle timeout
    M204 P900 T1600 R3300
    
    ;Stall Detection
    M915 X Y S2 F0 H200             ; X / Y Axes
    
    ; init tool detection
    ;M98 P/macros/tool-detect/tool-detect-init
    
    ; Heaters
    M308 S0 P"bedtemp" Y"thermistor" A"Bed" T100000 B4138 C0    ; Set thermistor
    M950 H0 C"bedheat" T0                                       ; Bed heater
    M140 H0                                                     ; Add heater to bed after RRF3.01 RC10
    M143 H0 S120                                                ; Set temperature limit for heater 0 to 120C
    
    M308 S1 P"e0_temp" Y"thermistor" A"0.4mm #1"                ; Set thermistor
    M950 H1 C"e0_heat" T1;                                        ; Assign heater
    M143 H1 S300                                                 ; Set temperature limit for heater 1 to 300C
    M307 H1 A559.7 C283.1 D3.5                                  ; v6, 30w results from m303 h1 s275
    
    M308 S2 P"e1_temp" Y"thermistor" A"0.4mm #2"                ; Set thermistor
    M950 H2 C"e1_heat" T2;                                        ; Assign heater
    M143 H2 S300                                                 ; Set temperature limit for heater 2 to 300C
    M307 H2 A559.7 C283.1 D3.5                                  ; v6, 30w results from m303 h2 s275
    
    M308 S3 P"duex.e2temp" Y"thermistor" A"0.6mm"                ; Set thermistor
    M950 H3 C"duex.e2_heat" T3;                                    ; Assign heater
    M143 H3 S300                                                 ; Set temperature limit for heater 3 to 300C
    M307 H3 A559.7 C283.1 D3.5                                  ; v6, 30w results from m303 h3 s275
    
    M308 S4 P"duex.e3temp" Y"thermistor" A"1.0mm"                            ; Set thermistor
    M950 H4 C"duex.e3_heat" T4;                                    ; Assign heater
    M143 H4 S300                                                 ; Set temperature limit for heater 4 to
    M307 H4 A559.7 C283.1 D3.5                                  ; v6, 30w results from m303 h4 s2
    
    ; Tools
    M563 P0 S"T0" D0 H1 F1                ; Define tool 0
    G10 P0 X0 Y0 Z0                     ; Reset tool 0 axis offsets
    G10 P0 R0 S0                         ; Reset initial tool 0 active and standby temperatures to 0C
    
    M563 P1 S"T1" D1 H2 F3                ; Define tool 1
    G10 P1 X0 Y0 Z0                     ; Reset tool 1 axis offsets
    G10 P1 R0 S0                         ; Reset initial tool 1 active and standby temperatures to 0C
    
    M563 P2 S"T2" D2 H3 F5                ; Define tool 2
    G10 P2 X0 Y0 Z0                     ; Reset tool 2 axis offsets
    G10 P2 R0 S0                         ; Reset initial tool 2 active and standby temperatures to 0C
    
    M563 P3 S"T3" D3 H4    F7                ; Define tool 3
    G10 P3 X0 Y0 Z0                     ; Reset tool 3 axis offsets
    G10 P3 R0 S0                         ; Reset initial tool 3 active and standby temperatures to 0C
    
    ; Fans
    M950 F0 C"fan1"
    M106 P0 S255 H1 T50                    ; T0 HE
    
    M950 F1 C"fan2"
    M106 P1 S0                             ; T0 Part Cooling Fan
    
    M950 F2 C"duex.fan3"
    M106 P2 S255 H2 T50                    ; T1 HE
    
    M950 F3 C"duex.fan4"
    M106 P3 S0                             ; T1 Part Cooling Fan
    
    M950 F4 C"duex.fan5"
    M106 P4 S255 H3 T50                    ; T2 HE
    
    M950 F5 C"duex.fan6"
    M106 P5 S0                             ; T2 Part Cooling Fan
    
    M950 F6 C"duex.fan7"
    M106 P6 S255 H4 T50                    ; T3 HE
    
    M950 F7 C"duex.fan8"
    M106 P7 S0                             ; T3 Part Cooling Fan
    
    
    M593 F50                            ; cancel ringing at 50Hz
    
    G29 S1
    
    ;M575 P1 S1 B57600                 ;Enable PanelDue 7i
    
    ;tool offsets
    G10 P0 X-9 Y39 Z-5                    ; T0
    G10 P1 X-9 Y39 Z-5                    ; T1
    G10 P2 X-9 Y39 Z-5                    ; T2
    G10 P3 X-9 Y39 Z-5                    ; T3
    
    ;deselect tools
    T-1
     
  2. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    162
    Likes Received:
    57
    This is usually because the PCF fans haven’t been associated with the tools using the M563 command in the config. Could that be your issue? I posted that answer in another thread with example config here.
     
  3. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    toolchange_test.gcode
    I did see your post while researching this as well. I have the exact same setup as far as I can tell. M106 will control the correct fan while that tool is active it just doesn't automatically turn the correct fan on or off when switching tools.... unless I'm missing something about how this is supposed to work?

    The relevant section of my config with extraneous bits removed:

    Code:
    ; Tools
    M563 P0 S"T0" D0 H1 F1                ; Define tool 0
    M563 P1 S"T1" D1 H2 F3                ; Define tool 1
    M563 P2 S"T2" D2 H3 F5                ; Define tool 2
    M563 P3 S"T3" D3 H4    F7             ; Define tool 3
    
    ; Fans
    M950 F1 C"fan2"
    M106 P1 S0                             ; T0 Part Cooling Fan
    
    M950 F3 C"duex.fan4"
    M106 P3 S0                             ; T1 Part Cooling Fan
    
    M950 F5 C"duex.fan6"
    M106 P5 S0                             ; T2 Part Cooling Fan
    
    M950 F7 C"duex.fan8"
    M106 P7 S0                             ; T3 Part Cooling Fan
    @dc42 I also based mine on a config for RRF 3 that you posted and if anyone's would work it'd be yours ;) I really am starting to feel more like I'm just making an incorrect assumption about how this feature is supposed to work - but the official e3d guide just says that the fans should turn on and off when running toolchange_test.gcode even though that file has no M106 commands in it.
     
    #3 Adam Haile, Nov 15, 2020
    Last edited: Nov 15, 2020
  4. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    480
    Likes Received:
    213
    Please post your tool change files.

    You can turn the fan off for the outgoing tool by including M106 P# S0 in the tfree file for that tool, where # is the fan number.
     
  5. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    Hmm, ok - I've seen multiple RRF 3 profiles from various people that had absolutely zero fan manipulation in their tool change files so it seemed like it was not necessary. And even when I did include it, I had the same issue. As you can see, I had it in there and commented it out when it didn't seem to change anything.
    Here's my T0 change scripts. All the rest are the same except offsets:


    Code:
    ; tfree0.g
    ; called when tool 0 is freed
    
    ;Drop the bed
    G91
    G1 Z4 F1000
    G90
    
    ;mesh levelling off
    G29 S2
    
    ;Purge nozzle
    ;M98 Ppurge.g
    
    ;Move In
    G53 G1 X-10.5 Y150 F50000
    G53 G1 X-10.5 Y200 F50000
    G53 G1 X-10.5 Y220 F50000
    G53 G1 X-10.5 Y243 F5000
    
    ;Open Coupler
    M98 P/macros/Coupler - Unlock
    
    ;fan off
    ;M106 P2 S0
    
    ;Move Out
    G53 G1 X-10.5 Y175 F50000
    
    ++++++++++++++++++++++++++++
    
    ; tpost0.g
    ; called after tool 0 has been selected
    
    ;heatup
    M116 P0
    
    ;prime nozzle
    ;M98 Pprime.g
    
    ;mesh levelling on
    G29 S1
    
    ;PCF fan on
    ;M106 P2 R2
    
    ++++++++++++++++++++++++++++++++++++++++
    
    ; tpre0.g
    ; called before tool 0 is selected
    
    ;Ensure no tool is selected
    ;T-1
    
    ;Unlock Coupler
    M98 P/macros/Coupler - Unlock
    
    ;Move to location
    G1 X-10.5 Y200 F50000
    
    ;Move in
    G1 X-10.5 Y230 F50000
    
    ;Collect
    G1 X-10.5 Y242.5 F2500
    
    ;Close Coupler
    M98 P/macros/Coupler - Lock
    
    ;WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING!
    ;if you are using non-standard length hotends ensure the bed is lowered enough BEFORE undocking the tool!
    G91
    G1 Z20 F1000
    G90
    
    ;Move Out
    G1 X-10.5 Y150 F4000
    
    
    
     
  6. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    162
    Likes Received:
    57
    My tfreeX.g files do indeed have the M106 call in them to turn off the fan and my tpostX.g has the M106 R2 command to restore the fan.

    If you manually pick the tool and turn on the fan in the Gcode console then issue tool change calls does the fan then follow the tool around? That definitely works for me. I wouldn't use the toolchange_test.gcode file to confirm this is working since as you say it doesn't have any M106 commands, actually I am curious how your fans would turn on at all with that code.

    I think the supplied files have changed now, but if I recall when commissioning mine at first the fans would always come on full with every tool selection and that behaviour needed to be changed. I think the example RRF2 configs were fixed some time later. In RRF3 though I haven't had any issues.

    Would definitely be interested though on what happens when you do the tool changes by hand in the console.
     
  7. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    Behavior from the console is identical to what I described when turning the fans on via M106
     
  8. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    @Paul Arden for sanity's sake, would you mind sharing your full config?
     
  9. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    162
    Likes Received:
    57
    @Adam Haile attached, but please keep in mind it's WIP as I am still bringing it fully up for RRF3 so don't assume everything else works.

    I did notice you defined the fans and pins a bit differently to me.
     

    Attached Files:

  10. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    @Paul Arden
    I *finally* got it working!
    And as crazy as it sounds - my config is basically the same except instead of having: M950, M106, M950, M106, etc....
    I changed it to all M950 together then all M106 together, like you have, and now it works.
    Oh, and I ritually sacrificed one of my older printers to the elder printer god that is the ToolChanger :p
    Makes no real sense to me that it should work differently that way, but it does. Especially when I know other ToolChanger owners that have it configured the way I did before and it works.
    I did also add the M106 commands to the tool change scripts but even that didn't work until I made the change mentioned about.
    For posterity's sake, you can see the config changes I made here: https://github.com/adammhaile/ToolChanger/commit/7df9c94a9840a6523ce8d99f5535a916305c8662
     
    Rene likes this.
  11. Paul Arden

    Paul Arden Well-Known Member

    Joined:
    Aug 28, 2019
    Messages:
    162
    Likes Received:
    57
    So the difference was interleaving vs grouping the M950/M106 calls, that is super strange, probably one for @dc42 or posting an issue for RRF if it turns out to actually be the cause somehow.
     
  12. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    Yeah - super weird. I can even search for the lines from your file and confirm they showed up exactly the same in my config from before. Just in a different order. And I confirmed I'm running the 3.1.1 release version.
     
    Paul Arden likes this.
  13. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    480
    Likes Received:
    213
    The order should not matter, as long as for each fan you use M950 to create it before you refer to it in a M106 or M563 command.
     
  14. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    @dc42 I don't doubt you are right - but I can reproduce it by doing nothing more than changing how they are grouped. Should I file a bug?
     
  15. dc42

    dc42 Well-Known Member

    Joined:
    Aug 16, 2016
    Messages:
    480
    Likes Received:
    213
    Only if you are absolutely certain, and you provide config.g files that do and don't demonstrate the problem, along with relevant tool change files.
     
  16. Adam Haile

    Adam Haile Member

    Joined:
    Nov 9, 2020
    Messages:
    13
    Likes Received:
    2
    @dc42 I'll do some further A/B testing to be 1000% sure - I've been backing my configs up to git so I can easily get back to what I had.
     

Share This Page