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

    Time-delay a 12v fan output based on heater output?

    Scheduled Pinned Locked Moved
    Gcode meta commands
    3
    5
    226
    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.
    • brumsterundefined
      brumster
      last edited by

      Hi peeps, just a quick one - is there any way I can configure a fan output to turn off after a time delay from a related heater output turning off?

      I've got a 12v fan that will be on a 240v PTC enclosure heater. The fan needs to always be running when the PTC has power to it, which is easy enough as I could drive the 12v fan from the heater output. But what would be cool (no pun intended) would be if, when the heater output turns off (as the enclosure is up to temperature) I could "run on" the 12v fan for 30 seconds or so, just to provide a little passive cooling of the PTC element afterwards.

      No big deal if not, just wondered before I started wiring it up.... (nb: I don't have a temperature probe on the PTC itself, the enclosure heating will be controlled by a PTC sensor half-way up the enclosure measuring ambient temperature)

      T3P3Tonyundefined 1 Reply Last reply Reply Quote 0
      • Phaedruxundefined Phaedrux moved this topic from General Discussion
      • T3P3Tonyundefined
        T3P3Tony administrators @brumster
        last edited by

        @brumster does the PTC element have its own temperature sensors? if so then you can configure a thermostatic fan, that way you are not using time, but temperature to control the fan.

        www.duet3d.com

        brumsterundefined 1 Reply Last reply Reply Quote 0
        • brumsterundefined
          brumster @T3P3Tony
          last edited by

          @T3P3Tony hiya, thanks for the reply. The PTC doesn't have a sensor on it no, it is ultimately controlled by the enclosure temperature sensor which is mid-way in the enclosure - it will control the power to the PTC heater to maintain the enclosure temperature, cycling it on and off as necessary.

          I think I'll just rely on the fan being wired into the 12v signal that activates the solid-state relay for the PTC. That way, PTC is on means fan is on. Accepted that there will be a short period of switching the PTC off where it's hot with no fan, but I suspect it will be OK.

          OwenDundefined 1 Reply Last reply Reply Quote 0
          • OwenDundefined
            OwenD @brumster
            last edited by

            @brumster
            If you must have a timed delay then you can use daemon.g
            You will need to create in your /sys directory.
            By default it will run every 10 seconds.
            If that maximum latency between turning on the heater and the fan activation is acceptable, then use the first section of the code below.
            If you need it to check more frequently, then delete the first section and un-comment the second section.
            If you need to manually control the fan at some point you must set the global variable autoChamberFan to false. set global autoChamberFan = false in the console.
            You will need to adjust the fan and heater numbers you wish to use in the appropriate variables.

            ; 0:/sys daemon.g - by default will run once every 10 seconds
            ; ******************************************************************************
            if !exists(global.autoChamberFan)
            	global autoChamberFan = true ; create a global so we can opt out and manually control fan if needed
            var heaterNumber = 1 ; set to whichever heater you're monitoring or hard code it belo
            var fanNumber = 0 ; set to whatever fan you'recontrolling or hard code it below
            var fanOffDelay = 60 ; delay to turn off the fan in seconds
            
            if !exists(global.fanTimeOut)
            	global fanTimeOut = (state.time  - 1) ; create our variable and set the initial value so the fan is off
            if heat.heaters[var.heaterNumber].state != "off" ; heater is on, standby or tunin
            	M106 P{var.fanNumber} S255  ; turn the fan on
            	set global.fanTimeOut = state.time + var.fanOffDelay ; reset our timeout value
            else  
            	if global.fanTimeOut < state.time ; the fan is off, so we check if we've reashed teh timeout
            		M106 P{var.fanNumber} S0 ; turn off the fan
            ; **********************************************************************************
            
            
            ; ************************************************************************************		
            ; use this code to run code every X seconds
            ; 0:/sys daemon.g - using a loop to run at less than 10 second intervals
            ;if !exists(global.autoChamberFan)
            ;	global autoChamberFan = true ; create a global so we can opt out and manually control fan if needed
            ;var loopTime = 2 ; set to number of seconds between checks
            ;var heaterNumber = 1 ; set to whichever heater you're monitoring or hard code it below
            ;var fanNumber = 0 ; set to whatever fan you'recontrolling or hard code it below
            ;var fanOffDelay = 60; delay to turn off the fan in seconds
            ;
            ;
            ;if !exists(global.fanTimeOut)
            ;	global fanTimeOut = state.time  - 1 ; create our variable and set the initial value so the fan is off.  Using a global so you can see it in object model
            ;	echo "initial timeout = " , global.fanTimeOut
            ;while true
            ;	if (heat.heaters[var.heaterNumber].state != "off") && (global.autoChamberFan = true) ; heater is on, standby or tuning
            ;		set global.fanTimeOut = state.time + var.fanOffDelay ; reset our timeout value
            ;		echo "time = " ^ state.time ^ "  :  New timeout = " ^ global.fanTimeOut  
            ;		M106 P{var.fanNumber} S255  ; turn the fan on
            ;	else  
            ;		if (global.fanTimeOut < state.time) && (global.autoChamberFan = true) ; the fan is off, so we check if we've reashed the timeout		
            ;			M106 P{var.fanNumber} S0 ; turn off the fan
            ;	G4 S{var.loopTime}
            ; *****************************************************************************************
            
            brumsterundefined 1 Reply Last reply Reply Quote 2
            • brumsterundefined
              brumster @OwenD
              last edited by

              @OwenD that is awesome, thankyou! I will wire it up in order to try this and see how it goes... cheers...

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