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

    Changing to thermostatic control of fans

    Scheduled Pinned Locked Moved
    Tuning and tweaking
    4
    9
    288
    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.
    • Nightowlundefined
      Nightowl
      last edited by Nightowl

      At present, I'm using the following code in the config.g to turn the case fans on when the machine starts up:

      ; Fans
      M950 F0 C"out8" Q500	; create fan 0 on pin out 8 and set its frequency
      M106 P0 S0.5 H-1	; set fan 0 value. Thermostatic control is turned off
      

      ...but I would like to control them thermostatically, when the temperature within the case reaches a certain level, but I'm not sure how to incorporate the sensor probes into the config.g file or how to connect them to the board.

      These are the fans (they're 3-wire, but I'm only using the +ve and -ve wires) and these are the thermal sensor probes.

      I'm using RRF v3.4.4 with a Duet3 MB6HC running a CNC machine.

      Thank you.

      Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
      I'm still on my learning curve, so take everything I say with caution!

      RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

      dc42undefined 1 Reply Last reply Reply Quote 0
      • dc42undefined
        dc42 administrators @Nightowl
        last edited by

        @Nightowl you will need to connect the sensor probe to a spare TEMP input on the Duet and use M308 to configure that port as a thermistor. Then you will be able to read the temperature using the Extras tab on DWC.

        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

        Nightowlundefined 1 Reply Last reply Reply Quote 0
        • Nightowlundefined
          Nightowl @dc42
          last edited by

          Thanks for your reply, @dc42

          So, if I understand it correctly, I could use TEMP0 (I haven't used any of them so far) and the code would look like this:

          M308 S9 P"temp0" Y"thermistor"
          

          Would I then need to write a bit of code to turn the fan on when it reaches a specified temperature, or would this be configured in the M106 line for the fans? Would I also need to configure it to turn off when the temperature drops below the specified temperature, or would occur by default?

          Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
          I'm still on my learning curve, so take everything I say with caution!

          RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

          1 Reply Last reply Reply Quote 0
          • Phaedruxundefined
            Phaedrux Moderator
            last edited by

            Yes, see the entry for M106

            https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m106-fan-on

            Z-Bot CoreXY Build | Thingiverse Profile

            Nightowlundefined 1 Reply Last reply Reply Quote 0
            • Nightowlundefined
              Nightowl @Phaedrux
              last edited by Nightowl

              @Phaedrux and @dc42

              So this is what I've ended up with...

              ; Fans
              M950 F0 C"out8" Q500			; create fan 0 on pin out 8 and set its frequency
              M308 S9 P"temp_0" Y"thermistor" T10000	; create temperature sensor on Temp 0. Thermistor mode. 10k resistor value @ 25degrees
              M106 P0 T40 S1 H9			; set fan 0 value. Thermostatic control is on
              

              I've not tested it yet (later today) but hopefully this is all I need, but I'm assuming M106 will turn the fan on when the temperature inside the case reaches 40 degrees C (although that might be a bit too high)?

              Thank you

              EDIT: changed H1 to H9

              Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
              I'm still on my learning curve, so take everything I say with caution!

              RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

              deckingmanundefined 1 Reply Last reply Reply Quote 0
              • deckingmanundefined
                deckingman @Nightowl
                last edited by

                @Nightowl The way you have it configured, fan 0 will turn on when sensor 1 reaches 40 deg C. I haven't read this entire thread but looking at the code you posted, your created sensor 9 so I think you might need to use H9 instead of H1 in that M106.

                Also, which fan is you part cooling fan? By default that is fan 0 so I assume that you are using a different fan and have this mapped to your M563 tool definition(s) yes?

                Ian
                https://somei3deas.wordpress.com/
                https://www.youtube.com/@deckingman

                Nightowlundefined 1 Reply Last reply Reply Quote 0
                • Nightowlundefined
                  Nightowl @deckingman
                  last edited by Nightowl

                  @deckingman said in Changing to thermostatic control of fans:

                  I haven't read this entire thread but looking at the code you posted, your created sensor 9 so I think you might need to use H9 instead of H1 in that M106.

                  Good spot, thank you. I've now edited it!

                  I'm not cooling any part, per se. It's a pair of fans used to help cool the Duet board's enclosure once the temperature inside reaches 40 deg C. I haven't configured any M563 tool definitions for the fan, but I don't think I need to. The guide for M563 states:

                  "You do not need to, and should not, map thermostatic fans to tools."

                  Thanks

                  Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                  I'm still on my learning curve, so take everything I say with caution!

                  RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

                  deckingmanundefined 1 Reply Last reply Reply Quote 0
                  • deckingmanundefined
                    deckingman @Nightowl
                    last edited by

                    @Nightowl The point about part cooling fans is that the default is when an M106 is encountered in a gcode file, then that command will apply to fan 0 unless you have defined the tool to use a different fan. You might be OK but if a gcode file has M106 in it, then you might get an error message because you've set fan 0 to be thermostatic. It would be safer if you defined the chamber fan to be something other than 0. Fan 9 would logically go well with sensor 9.

                    Ian
                    https://somei3deas.wordpress.com/
                    https://www.youtube.com/@deckingman

                    Nightowlundefined 1 Reply Last reply Reply Quote 1
                    • Nightowlundefined
                      Nightowl @deckingman
                      last edited by

                      Got it, thank you @deckingman

                      I'll have a play and see how it goes - but getting it to 40 deg at the moment, might be a tad difficult. I'll test it at a lower temperature.

                      Thanks again.

                      Few things are more dangerous than taking the advice of someone who thinks he knows what he's doing.
                      I'm still on my learning curve, so take everything I say with caution!

                      RatRig 1075, Duet3 MB6HC, Sorotec SFM 1000 PV-ER milling motor, Hobbyist

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