Best way to force cool a hot end when active temp changes
-
My multi-material (6 input, dual heat zone, single nozzle) hot end is coming along nicely but I'm looking for some inspiration. When changing from a low temperature filament to high temperature one, the waiting time for the temperatures to stabilise is nice and short due to my using 80Watt heaters. But when changing from a high temperature filament (e.g. Polymide PA6-CF @290 deg C) to a low temperature one (e.g. Polyflex TPU95-HF @ 210 deg C) the waiting time for the hot end to cool by 80 deg C is significant and I want to reduce that if possible by blasting it with cold air.
The heaters are common to all tools and the one I'm interested in is the primary heater (Heater 1). On tool change, the active temperature for that heater changes. So I need the fan to run when the hot end temperature is above the active temperature (which various depending on which tool is active).
If I've read the documentation correctly, I could get the active temperature from heat.heaters[1].active. I know that I can get the actual temperature from sensors.analog[1].lastReading
So one idea I had was to use something like......
while sensors.analog[1].lastReading < heat.heaters[1].active echo "Hot end temp", sensors.analog[1].lastReading M106 P3 S255 ; turn fan on at full speed G4 S2 ; wait a couple of secs M106 P3 S0 ; turn fan off when loop completes.
Would that work? I think maybe I should only run the fan when the actual temperature is a couple of degrees above the active set point. So is becomes
while sensors.analog[1].lastReading < heat.heaters[1].active+2
Do I need to put brackets around that "heat.heaters[1].active +2" ?
Or is there a better way to do want I want to do?
-
@deckingman said in Best way to force cool a hot end when active temp changes:
<SNIP>
So one idea I had was to use something like......
while sensors.analog[1].lastReading < heat.heaters[1].active echo "Hot end temp", sensors.analog[1].lastReading M106 P3 S255 ; turn fan on at full speed G4 S2 ; wait a couple of secs M106 P3 S0 ; turn fan off when loop completes.
Would that work?
The principal would work if you're putting in a "while loop" within demon.g
If it's not in a while loop, it will only run every 10 seconds, so may not give quick results.
However, I think your logic is reversed.
Should it not be "greater than"?
while sensors.analog[1].lastReading > heat.heaters[1].activeI think maybe I should only run the fan when the actual temperature is a couple of degrees above the active set point. So is becomes
while sensors.analog[1].lastReading < heat.heaters[1].active+2
Do I need to put brackets around that "heat.heaters[1].active +2" ?
You shouldn't need brackets in that case, however they don't hurt.
You would need them if you add an && or || conditionOr is there a better way to do want I want to do?
I would add a test to see that the tool state is active so that you don't turn on the fans if the tool is pot onto standby (or off, unless you want to rapidly cool then)
while (sensors.analog[1].lastReading > heat.heaters[1].active+2 ) && (heat.heaters[1].state == "active")
or perhaps
while (sensors.analog[1].lastReading > heat.heaters[1].active+2 ) && (heat.heaters[1].state != "standby")
if you want cooling in both active and off state
EDIT:
BTW, you could also get the readings of current temp from heat.heaters[1].current
Just makes it a bit more readable -
@owend Thanks - I hoped you would respond as your answers are always spot on.
A couple of things.
Why would the loop only run every 10 seconds? I probable didn't make it clear but this would be part of a tool change macro (tpost(n).g) so would be much like using M116 within that macro. In fact I use a very similar command in another macro where I want to wait for a tool to heat but only if it's already below a certain temperature (because M116 would wait for the tool to cool which I don't want to happen) and it seems to respond faster than the 10 seconds you imply.
Ref my logic - there is nothing wrong with it - it's just that my fat fingers didn't follow the logic that my brain used You are of course correct and it should be ">" and not "<".
Thanks for the other tips.
-
@deckingman The daemon.g file is only ran every 10 seconds, so if you want it to run faster, use a while loop.
-
@deckingman said in Best way to force cool a hot end when active temp changes:
@owend Thanks - I hoped you would respond as your answers are always spot on.
A couple of things.
Why would the loop only run every 10 seconds? I probable didn't make it clear but this would be part of a tool change macro (tpost(n).g) so would be much like using M116 within that macro.
My mistake, I didn't realise that's how you intended to use it.
In your usage case it will take effect immediately. -
For the sake of completeness, I just want to post an update that this is all working now. The net result is that when changing from a filament which prints at 290 deg C to one which needs 210, the cool down time is reduced from 122 seconds to 38 by blowing air over the lower part of the hot end with a 40mm blower fan that I had laying around. So a worthwhile upgrade especially as it cost me nothing.
I used the same while loop principal to wait for the nozzle to heat when the opposite happens (i.e. when changing from a low temperature filament to a high temperature one), instead of using M116. There are two reasons for this. Firstly, M116 will wait for all heaters associated with a tool to stabilise and in my application, I don't much care what the secondary heater is doing because it doesn't change between tools and has a wide allowable tolerance. The second reason for not using M116 is that it waits for all heaters to be within 1 deg C which with this hot end, can take a while and is unnecessary - I'm happy if the heaters are with 3 or 4 deg of the set point.
Here is an annotated example of the tpost.g file I've ended up with in case it's of any use to anyone who might stumble upon this thread.
; tpost0.g ; called after tool 0 has been selected G4 S1 ; wait a sec ;the following will force cool the nozzle only to within 4 deg of the active temp if it's too hot while (heat.heaters[1].current > heat.heaters[1].active+4) M291 P"Force cooling nozzle" R"Tool Change Macro" S1 T1; display message M106 P2 S255; turn on force cooling fan G4 S1 ; wait a sec M106 P2 S0 ;turn fan off ; the following will wait for the nozzle only to heat to within 3 degrees of it's active temp if it's too cold ; it won't wait for the combining block temperaure to change while (heat.heaters[1].current < heat.heaters[1].active-3) M291 P"Waiting for Tool 0 to reach temperature" R"Tool Change Macro" S1 T1 G4 S1 M291 P"Purging Tool 0" R"Tool Change Macro" S1 T4 M98 P"0:/macros/SinglePurge.g" ; purge nozzle M291 P"Wiping nozzle" R"Tool Change Macro" S1 T4 M98 P"0:/macros/Nozzle wipe" ; wipe nozzle M400 ; wait for moves to complete G1 R2 X0 Y0 U0 V0 A0 B0 Z0 F18000 ; return gantries to wence they came prior to tool change G11; unretract
-