Fan controle with board temp?



  • Hi,

    I connected the case fan to my Duet3 and I can pwm control it. I have now the idea to control the speed of the fan with the temperature of the Duet. Is that somehow possible?

    Cheers, Chriss



  • automatic adjusting. no

    what you can do is turn it on to a certain speed when for example the hotend reached 50C.

    (technically you could create a macro based on conditional code that you would execute each layer during printing)



  • Assuming RepRapFirmware 3

    M308 S9 P"mcu-temp" Y"mcu-temp" A"mcu"        ; define sensor 9 to be mcu temperature
    M950 F2 C"!out4" Q25000                       ; configure fan 2 
    M106 P2 S1 L0.25 B0.5 H9 T35:50 C"mainb"      ; cooling electronics space thermostatic on sensor 9 35 to 50C
    

    The first line defines a sensor 9 ('S9') to be the internal temperature sensor of the processor on a Duet 3 MB6HC.

    The second line defines fan number 2 ('F2') on OUT4 with settings suitable for a standard 4-wire PWM case fan.

    The third line controls fan 2 ('P2') according to sensor 9 ('S9'), with it starting at 35C and running at full speed above 50C, and varying (roughly) linearly in between. The L and B values are just what my fan needs to start reliably.

    Is that what you are trying to do?



  • @achrn

    Is that what you are trying to do?

    Yes, that is exactly what I'm trying. I was not aware that the "S9" is available and the internal temperature.

    @Veti Your approach was my first idea. The second idea was to start the fan in the startcode and stop it in the stop code. I will go with achrn's approach. 🙂


  • Moderator

    It can also make sense to tie it to the temp of the hotend and bed since if those are running, chances are a print is running, or is at least being preheated/idle.

    MCU temp is a good proxy for the board temp. Just be sure to calibrate your CPU temp reading and adjust the temp set point to run the fan fast enough to matter.

    https://duet3d.dozuki.com/Wiki/Calibrating_the_CPU_temperature

    https://duet3d.dozuki.com/Wiki/Mounting_and_cooling_the_board



  • @Chriss said in Fan controle with board temp?:

    Yes, that is exactly what I'm trying. I was not aware that the "S9" is available and the internal temperature.

    S9 is just what I use (because it's away from the other temperature sensors). It could (I assume) be any S number not being used for something else.

    I realise my gcode is correct, but explanation of it is wrong - I should have said "according to sensor 9 ('H9')", the S parameter in that line is fan speed.


Log in to reply