Fan Allocations and Remapping



  • Hey Everyone,

    I have another one for you configuring gurus.

    Below is the G-CODE I had in my config file just before I added my water cooling setup. Basically I have 2x PWM fans that cooled the board and power supplies, the heatsink fan and my berd air pump.

    ; Fans

    M307 H2 A-1 C-1 D-1 ; Disable the 2th Heater to free up for air pump
    M106 P0 A2 X0.5 B0 F25000 H-1 C"Part Cooling" ; Part Cooling Fan Remap to Heater 2
    M106 P1 F25000 L.5 B1 T40:65 H100:101:102 C"Duet Fan" I1 ; Set fan 2 PWR fan. Turns on when MCU or Driver temp (heater 100:101:102), hits 40C and full speed when the MCU temperature reaches 65C
    M106 P2 F25000 L.5 B1 T40:65 H100:101:102 C"PWR Supply" I1 ; Set fan 3 PWR fan. Turns on when MCU or Driver temp (heater 100:101:102), hits 40C and full speed when the MCU temperature reaches 65C
    M106 P3 H0 B1 L1 T45 C"Extruder" ; Set fan 4 to Extruder.

    So basically I had remapped H2 for the berd air pump as FAN0 so that the slicer could control it. Now what I am not sure about however, is whether I had anything plugged into the FAN0 port when I pulled everything apart the other night. Going off this, I do not believe I did and that my Extruder Fan (Heatsink) was actually plugged into my Duex2 Board. It was a late night. As I have remapped my Heater 2 to FAN0, does this mean that I can not use that FAN output anymore? Or can I do something like

    ;Fan

    M307 H2 A-1 C-1 D-1 ; Disable the 2th Heater to free up for Air Pump
    M106 P4 A2 X0.5 B0 F25000 H-1 C"Part Cooling" ; Part Cooling Fan (4) Remap to Heater 2
    M106 P1 F25000 L.5 B1 T40:65 H100:101:102 C"Duet Fan" I1 ; Set fan 2 PWR fan. Turns on when MCU temperature (heater 100), hits 45C and full speed when the MCU temperature reaches 65C or if any TMC2660 drivers (virtual
    M106 P2 F25000 L.5 B1 T40:65 H100:101:102 C"PWR Supply" I1 ; Set fan 3 PWR fan. Turns on when MCU temperature (heater 100), hits 45C and full speed when the MCU temperature reaches 65C or if any TMC2660 drivers (virtual
    M106 P0 H0 B1 L1 T45 C"Extruder" ; Set fan 0 to Extruder.

    and then in my tools section

    ; Tools

    M563 P0 D0 H0 F4 S"Extruder" ; Define tool 0 Heatert 0 Fan 4
    G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
    G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C

    Would the firmware like the fact that the slicer is sending commands to run FAN0 for part cooling but it is being remapped to FAN4 and I am using FAN0 for something else? or does it still mean that the firmware is merely remapping the FAN0 commands to FAN4 and I still can not use FAN0 anymore? My end goal is to have something like this with my water and air pumps. Getting anything connected and disconnected on my Duex2 is a pain so I would like to try and keep as much as I can on the Duet 2 Board other than maybe a heater output and my 2 stepper drivers.

    ; Part Cooling Air Pump

    M307 H2 A-1 C-1 D-1 ; Disable the 2th Heater to free up for air pump
    M106 P4 A2 X0.5 B0 F25000 H-1 C"Part Cooling" ; Part Cooling Fan Remap to Heater 2

    ;Board Cooling Fans

    M106 P1 F25000 L.5 B1 T40:65 H100:101:102 C"Duet Fan" I1 ; Set fan 1 PWR fan. Turns on when MCU temperature, hits 45C and full when the MCU temperature reaches 65C or if any TMC2660 drivers (virtual
    M106 P2 F25000 L.5 B1 T40:65 H100:101:102 C"PWR Supply" I1 ; Set fan 2 PWR fan. Turns on when MCU temperature, hits 45C and full when the MCU temperature reaches 65C or if any TMC2660 drivers (virtual

    ; Water Cooling

    M305 P103 T10000 R4700 B3950 X2 S"Water Temp" ; Create Virtual Heater for Cooling Water
    ;M305 P104 T100000 R4700 B3950 X1 S"Spare Temp" ; Create Virtual Heater for Other Temp Sensor. (Used to check that P103 is correct as I did not have the B parameter for it)
    M307 H3 A-1 C-1 D-1 ; Disable the 2th Heater to free up for water pump
    M106 P3 A3 H0 L1 T45 C"Extruder" ; Water Cooling Pump Start
    M106 P0 H102 F25000 L.5 B1 T30:45 C"Radiator" I1 ; Set fan 0 PWR fan. Turns on when Radiator temperature (heater 103), hits 45C and full speed when the temperature reaches 65C

    ; Tools

    M563 P0 D0 H0 F4 S"Extruder" ; 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

    Currently I have it running like this, however I have not printed anything and am unsure as to the behaviour of the FAN0 when the G-CODE tries to change its running parameters. Am I best to just leave the FAN0 port alone and shift the radiator Fan to the Duex2 board?

    Sorry this may all be a bit confusing so fire back some questions and I will endeavour to answer them.

    Kind Regards,
    Sam


  • administrators

    There are two things going on here:

    1. Remapping fan numbers to different hardware ports using the A parameter in the M106 command. You can have up to 9 fans on the Duet WiFi/Ethernet, numbered 0 to 8.

    2. Specifying in your M563 too definition command which fan(s) are the print cooling fans for that tool. These are the fans that M106 commands with no P parameter will be directed to. When no tool is selected, M106 commands with no P parameter will be directed to fan 0 (which you may have remapped to a different output connector, see #1).

    The simplest approach if you don't have a DueX in your system is probably to map fan 3 to the heater output, then fans 0-2 will all behave as before.



  • Hi @dc42

    If I map a heater to a Fan like I have with my air pump mapping it to FAN0 with:

    M307 H2 A-1 C-1 D-1 ; Disable the 2th Heater to free up for air pump
    M106 P0 A2 X0.5 B0 F25000 H-1 C"Part Cooling" ; Part Cooling Fan Remap to Heater 2

    this obviously means that the physical FAN0 port can no longer be used? If I was to change it to:

    M307 H2 A-1 C-1 D-1 ; Disable the 2th Heater to free up for air pump
    M106 P4 A2 X0.5 B0 F25000 H-1 C"Part Cooling" ; Part Cooling Fan Remap to Heater 2

    and change my tool parameters to:

    M563 P0 D0 H0 F4 S"Extruder" ; Define tool 0 Heatert 0 Fan 4

    when cura is creating the gcode file it is obviously writing M106 Snn with no fan specified and then does duet interpret this and map it to FAN0 or what is allocated to the tool specified? If I was to use the FAN0 port for my radiator having mapped the air pump to FAN4 as above as well as specifying that FAN4 is the part cooling fan of tool zero, would this work?

    Kind Regards,

    Sam



  • @samlogan87

    I know David is busy so I'll try and help if I can. I think David has answered your question with this

    "When no tool is selected, M106 commands with no P parameter will be directed to fan 0 (which you may have remapped to a different output connector, see #1)".

    So as long as your slicer (Cura) sends a "T0" command at the start of the gCode file, then any subsequent M106 in that file will be directed to whichever fan has been mapped to tool 0.

    Does that help?



  • @deckingman

    Yeah I saw his post late last week about that. He is a busy man.

    Yes that clears things up greatly for me thank you. I just wasn't sure how the Duet interpreted the GCODE file. I will have to specify a tool in my start gcode in Cura.

    Thank you once again. Hopefully this sorts it out.

    Kind Regards,

    Sam



  • I have just seen that Cura now allows you to select the part cooling fan number. I have no idea when this happened but it is in the extruder settings in the machine settings part.

    Sam



  • And it seems to work. I selected fan 3 in the settings and this is what I am getting in the gcode file

    G0 X183.222 Y187.475
    G0 X183.235 Y187.486
    G0 X182.101 Y187.716
    ;MESH:NONMESH
    G0 X182.982 Y187.55
    ;TIME_ELAPSED:19.312879
    ;LAYER:2
    M106 S59.5 P3
    ;MESH:PULLEY Spacer.stl
    G0 F7200 X182.982 Y187.55 Z0.6
    ;TYPE:WALL-INNER
    G1 F1200 X182.927 Y187.594 E0.00211
    G1 X182.733 Y187.746 E0.00738

    This has sorted my issues 😀

    Kind Regards,
    Sam


  • administrators

    @samlogan87 said in Fan Allocations and Remapping:

    Hi @dc42

    If I map a heater to a Fan like I have with my air pump mapping it to FAN0 with:

    M307 H2 A-1 C-1 D-1 ; Disable the 2th Heater to free up for air pump
    M106 P0 A2 X0.5 B0 F25000 H-1 C"Part Cooling" ; Part Cooling Fan Remap to Heater 2

    this obviously means that the physical FAN0 port can no longer be used?

    The FAN0 port would then be free and you should be able to use it as a GPIO or servo output.

    If I was to change it to:

    M307 H2 A-1 C-1 D-1 ; Disable the 2th Heater to free up for air pump
    M106 P4 A2 X0.5 B0 F25000 H-1 C"Part Cooling" ; Part Cooling Fan Remap to Heater 2

    and change my tool parameters to:

    M563 P0 D0 H0 F4 S"Extruder" ; Define tool 0 Heatert 0 Fan 4

    when cura is creating the gcode file it is obviously writing M106 Snn with no fan specified and then does duet interpret this and map it to FAN0 or what is allocated to the tool specified? If I was to use the FAN0 port for my radiator having mapped the air pump to FAN4 as above as well as specifying that FAN4 is the part cooling fan of tool zero, would this work?

    Yes that should work.



  • @samlogan87 I'm glad you are sorted but to be honest, if I were you I'd try and get the configuration right on the printer, so that you don't have to rely on putting the correct fan settings in the slicer. You might change to a different slicer in say a years time, and forget what you did. Or the other slicer that you'd really like to use only supports M106 without any additional parameters. IMO it's generally best if the printer configuration is as "slicer agnostic" as possible.



  • Hi @deckingman

    Yeah you are probably right. In my GCODE test file I did yesterday this is what was at the top of the file

    T0
    M190 S80
    M104 S230
    M109 S230

    As it is specifying T0, I am guessing all I need to do is specify the Fan in the tool configuration and I will be sorted?

    Kind Regards,
    Sam



  • @samlogan87 said in Fan Allocations and Remapping:

    As it is specifying T0, I am guessing all I need to do is specify the Fan in the tool configuration and I will be sorted?

    Yes, exactly so.



  • @deckingman perfect thank you. You are very helpful as always.

    Kind Regards,

    Sam


 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.