Temperature controlled always on fan
-
Hi Guys,
I want to have temperature controlled fan that is always at minimum 20% speed.
Temperature range declaration is not good because it would be extracting too much air or not turning on at all.
The fan would be used for hepa filter - it exhaust the air during normal temperature range in the enclosure and needs to flip to full once the temperature is over a certain limit.any ideas would be much appreciated
-
@Aurimas Just for clarification, you can't control a fan connected to "always on " headers.
But I guess, that's not what you wanted.A solution to your problem is a while loop in the daemon.g file:
Pseudo code:
while if tempsensor < thresholdtemp run fan at 20% else run fan at 100%
-
@o_lampe excuse me for my ignorance, but since I have not done this before could you please guide me a bit more?
Can you please point me in the right direction for meta commands?
like how do I define the tempsensor. I was looking for info and cannot find a page that would have all the variables defined.
also while demands for the expression. I assume that it should be something like: "while <print is running>"thanks
-
@o_lampe ok so I think I got some idea how it works.
just need a bit of huidance2 issues:
can't this to work
while get boards[0].state = "running"
what am doing wrong.as a test i got this, but the fan runs 100% all the time
white state.status = "idle"
if sensors.analog[4].lastReading<65
M106 P5 S0.2
else
M106 P5 S1the result is that P5 is 100% all the time
-
@Aurimas said in Temperature controlled always on fan:
@o_lampe ok so I think I got some idea how it works.
just need a bit of huidance2 issues:
can't this to work
while get boards[0].state = "running"
what am doing wrong.Which board are you running?
On my Duet 2, this is showing as "unknown" so I suspect it's not supported on all boards.
It may even only be for toolboards. @DC42 may confirmas a test i got this, but the fan runs 100% all the time
white state.status = "idle"
if sensors.analog[4].lastReading<65
M106 P5 S0.2
else
M106 P5 S1the result is that P5 is 100% all the time
Apart from the type on "while" , I'm not sure your indenting is correct for the else.
while state.status = "idle" if sensors.analog[4].lastReading<65 M106 P5 S0.2 else M106 P5 S1
Should work if in fact the board is in the idle state.
If you're doing this in daemon.g then it would be better to not enter such a closed loop
By default daemon.g runs every 10 seconds. If that is often enough for your purposes then simply do your check.if sensors.analog[4].lastReading<65 M106 P5 S0.2 else M106 P5 S1
If you want it to run more often the use a while loop, but make sure you add a G4 command so that control is returned to the main process regularly.
while true if sensors.analog[4].lastReading<65 M106 P5 S0.2 else M106 P5 S1 G4 S2
If you want to have it happen only when idle, or any other state then you can use that as well, but still use a delay in your loop.
-
@Aurimas said in Temperature controlled always on fan:
I want to have temperature controlled fan that is always at minimum 20% speed.
What's the reason for wanting 20% minimum speed, instead of Off when the temperature is low enough?
The solution proposed by @o_lampe looks good to me, in principle.
-
@dc42 I have a fan on the enclosure - I want it to suck the air out of enclosure and through the HEPA filter. that would create slight negative pressure in the enclosure.
then I want the fan to flip to full power if the enclosure gets over certain temp so that it cools down and prevents overheating. -
@OwenD thank you. I am just learning these things and the syntax is a bit of a mystery for me
like your statement: "while true" - where do i find this info? -
@Aurimas said in Temperature controlled always on fan:
@OwenD thank you. I am just learning these things and the syntax is a bit of a mystery for me
like your statement: "while true" - where do i find this info?Information on meta commands can be found here
while
creates a loop that is typically limited by a boolean expression
while iterations < 10
or as you hadwhile state.status = "idle"
while true
will always resolve to true in a similar way to usingwhile 1=1
would, so it creates an endless loop
When you do so, you have to ensure that you hand control back to the CPU (G4) or have a mechanism to break out or the machine will be unresponsive. -
@OwenD thank you