Switch fan between thermostatic and non thermostatic modes
-
My latest hot end design has two heat zones and I have a fan which will come on thermostatically if the secondary zone exceeds a pre-determined value. But I also need to rapidly cool that secondary heat zone when a print ends. One way to do it would be to change the thermostatic settings but then I'd need to restore them to their original settings once the zone has cooled and before I start another print (which I guess I could do in my pre-print macro). I think a better way might be something like the following but I'd be pleased to hear if anyone has a more elegant solution.
Here is what I'm thinking of doing.....
M106 P3 H-1 ; dissable thermostatic mode for fan 3 M106 P3 S255 ; set fan to max speed while sensors.analog[3].lastReading < 50; (Note to self - check that "3" is the correct sensor) M291 P"Waiting for combi block to cool" echo "Combi block temp", sensors.analog[3].lastReading G4 S5 ; wait 5 secs M106 P3 S0; turn fan off M106 P3 T150:180 H3; restore fan to thermostatic mode for sensor 3 from 150 to 180.
Do I need to use the "T" values in that last command or will the firmware "remember" them if I simply do M106 P3 H3 (without the "T" parameters)? I'm conscious that I might change the "T" values in config.g so if the firmware does not "remember" the values, I'd need to remember to change them here as well.
One thought that crossed my mind is that I'd be locked out of doing anything with the printer while that "while" loop is running but that might not be a big deal as long as it's the last thing that happens when a print ends.
-
@deckingman said in Switch fan between thermostatic and non thermostatic modes:
Do I need to use the "T" values in that last command or will the firmware "remember" them if I simply do M106 P3 H3 (without the "T" parameters)?
I just did a test running through your proposed solution (not including the while loop) and the T values were restored in the test.
Overall this is how I would do it, even with the disadvantage of being "locked out". The alternative (which I have not tested) would be more complicated a prone to things happening out of order. That would be to set a global variable to trigger this process, and then have deamon.g check to see if that variable was set, if it was then deamon.g carry out the same actions as your macro there. The disadvantage is that you would in some danger of starting another print/ heating/purging etc while this process is not yet finished.
-
@t3p3tony Thanks for that Tony. It's good to know that the "T" values get restored to their initial configured values without explicitly entering them again in a subsequent M106 command. That means I can set or change them in one place only and that will effectively be a global setting.
I'm not overly concerned about the while loop locking me out - I'll know it's happening because of the M291 and echo statements (and there is always my big red kill switch if I get desperately impatient).
-
@deckingman said in Switch fan between thermostatic and non thermostatic modes:
One way to do it would be to change the thermostatic settings
Can this be done also by setting the fan's min/max speeds? E.g. 0-100 for thermostatic vs 100-100 to force cooling.
-
@zapta said in Switch fan between thermostatic and non thermostatic modes:
@deckingman said in Switch fan between thermostatic and non thermostatic modes:
One way to do it would be to change the thermostatic settings
Can this be done also by setting the fan's min/max speeds? E.g. 0-100 for thermostatic vs 100-100 to force cooling.
Possibly - but I might be misunderstanding what it is you are trying to say. AFAIK, and the last time I tested it, the min/max speeds (L and X values) override the variable speed which would apply to thermostatic mode. For example, if one used H50:100 then the speed would ramp up proportionally from 0 speed at 50 deg C to full speed at 100 deg C. But if one also set an L values of say 0.5, then what would happen is that the fan would run at 50% speed at all temperatures from 50 degrees to 75 degrees, then ramp up to 100% speed between 75 and 100 deg C. At least that is how it use to work the last time I tried it.
So I guess if one were to change the "L" value from say 0 for "normal" thermostatic cooling to say 1.0 for forced cooling, this would effectively change the minimum fan speed to 100%. BUT that is unlikely to work for me because the L parameter only applies when a non-zero fan speed is requested. In this case, between 50 and 100 deg C. In my case, the thermostatic control range would be from about 150 deg upwards. So any temperature below this would mean that the requested speed is zero and therefore the L parameter would not be acted upon. What I need to happen at the end of a print is for the fan to run at full speed all the way down to about 50 deg C, but then be reset to thermostatic cooling from 150 deg upwards for any subsequent prints.