Changing to thermostatic control of fans
-
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.
-
@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.
-
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?
-
Yes, see the entry for M106
https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m106-fan-on
-
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
-
@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?
-
@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
-
@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.
-
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.