Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers
-
@wilriker said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@snowcrash said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
> > M106 P1 S0.5 I1 F25000 L0.5 B4 H101 T0:100 CDuet_Fan
Which means the fan will normally be running at 50% (i.e. when all drivers are under 100°C).
But this leaves the question of how to ramp the fan up to 100% if the temp of any of the drivers goes above 100°C?
Usually this ramp-up would be progressing as the temperature progresses. Here we have special case as this is a virtual heater with only 3 fixed temperatures and jumps between them. This also means that as soon as one of the TMC drivers will go into warning state, the temperature will jump from 0°C to 100°C - so will the fan jump from its initial 50% speed to 100% speed without ramp-up.
Cool, will try it out.
About the documenation part:
More detailed explanation on virtual heaters can be found at M305 which also explains how to add your own. So this part is already there.Fair enough, but then I'd have a note in M106 like the one in M143 saying:
"(refer to M305 for further details on how to set this up)"
Regarding the other parts you mentioned about
M106
: it is a wiki after all. How about you propose in this thread a new text with all the changes you think should go in there and we do a peer-review here? Afterwards one of us can update the wiki. I think that would be a great idea with input from a lot of people.
Maybe even start a new thread about it so that everyone can spot the purpose of it right away.I just walked straight into this one, ha? Man, I've got to learn when to keep my big mouth shut...
Although I don't feel even marginally qualified to write/edit wiki's on the Duet, I can also see a certain advantage to the 'newbie writes the guide' approach. It will definitely keep things at the very basic level Plus, I'm a big believer that one of the best ways to learn something is to try explaining it to someone else.
The biggest question in this context is time. If I go about doing it, I'll try to do the best I can and that means investing time into it. Having multiple projects in the air atm, it won't be easy, but I promise to put this on my TODO list and hopefully get it in done as soon as time allows.
Edit:
@wilriker, I just had a quick look at the M305 section of the Wiki and it says there that:
"Channel 1001 represents the temperature warning and overheat flags on the TMC2660 drivers on the Duet Wif/Ethernet."
This means my M106 with H101 is not right, no?
How sure are you about your description above of the virtual heaters' code designations?
Edit of the Edit:
Ok, it was a very quick look... from the text that follows that quoted above, it looks like you have it right.
Sorry to have doubted you
-
Update:
Hooked-up the fan as per the (corrected) schematic above and edited config.g to have the latest formulation of the M106 command, namely:
M106 P2 S0.5 I1 F25000 L0.5 B4 H101 T0:100 CDuet_Fan
(Note that I've changed the fan header to FAN2 both in the above command and in the hardware connection).
... but the fan isn't running.
I believe the problem lies somewhere within the thermostatic-mode and/or triggering-range parameters, because when I tried running the fan in regular PWM mode with:
M106 P2 S0.5 I1 F25000 L0.5 B4 H-1 CDuetFan
I can manually control the fan's speed with the slider and it runs exactly as is it should.
Another issue - which I don't know if related to the above - is that FAN2's name as defined in the M106 command (i.e. 'Duet_Fan'), doesn't show in the 'misc' section of DWG:
I deleted all the browsing history, cookies, etc., and reloaded DWG, but the name still doesn't appear.
I've attached the complete config.g and config-overdrive.g files below.
Help please?
-
@snowcrash Let's start at the end: naming fans is currently only possible in @chrishamm's fork of RRF. In the regular version this will only be available from version 2.02 (note that 2.01 is next to come).
About the fans not spinning: I just tested the same command (except the
I1
part) on my machine and can confirm that it is not working this way - but if you lower the start value of the temperature to -1°C, i.e.T-1:100
it will work.
I thought I had a theory why that is but in the middle of writing it here I realized it doesn't make sense. So: no clue why it has to be like that but it works.And the last part: never be sorry to doubt me! I mean it. I'd rather have you doubt me all the time than expecting I know everything. When I got the email notification of your post I was also thinking about the possibility that in this case out of some reason the heater channel would have been required instead of the virtual heater, so I also doubted myself here.
-
The name (like many other string parameters in RRF) probably needs to be enclosed in double quotes.
-
@SnowCrash
@wilriker said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:@snowcrash Let's start at the end: naming fans is currently only possible in @chrishamm's fork of RRF. In the regular version this will only be available from version 2.02 (note that 2.01 is next to come).
This is true, however, @chrishamm released a version of the firmware with the fan name change included. You can find it here. And I can confirm as @dc42 says that you will need to enclose the name in double quotes. Ex: C"Duet_Fan". Once that's done it works as advertised.
-
@phaedrux said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@SnowCrash
And I can confirm as @dc42 says that you will need to enclose the name in double quotes. Ex: C"Duet_Fan". Once that's done it works as advertised.I just updated the wiki accordingly to reflect this as well.
P.S.: I have not tried it but when enclosed in double-quotes I at least guess this can then also contain whitespace.
-
@phaedrux We are going to upvote each other into the hall of fame of reputation.
-
@wilriker said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@phaedrux said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@SnowCrash
And I can confirm as @dc42 says that you will need to enclose the name in double quotes. Ex: C"Duet_Fan". Once that's done it works as advertised.I just updated the wiki accordingly to reflect this as well.
P.S.: I have not tried it but when enclosed in double-quotes I at least guess this can then also contain whitespace.
Just tested and I can confirm that white space is allowed when enclosed with quotes.
-
Very cool, guys! thank you very much! great job and upvotes all around
I'll test both the modified M106 formulation and fan naming tonight on my machine so as to (hopefully) add a nice 'solved' to the title of this tread.
p.s. this has been nagging at me for a while now so have to ask: what do the little pin buttons next to each fan name in DWC actually do?
-
@snowcrash The pins let you lock the fan speed. Useful for gcode controlled fans if you set the speed too high or too low in the slicer.
-
Thanks, @Phaedrux
I can also happily confirm @wilriker's solution (T-1:100) works great (Thanks @wilriker!)
(though obviously I can only affirm this for the initial 50% speed and not the jump to 100% if temps go above 100°C - unless someone knows of a way to do this?)
However, a final snag remains as the fan's naming still eludes me.
I added double-quotes to the fan's name in the C parameter as instructed:
M106 P2 S0.5 I1 F25000 L0.5 B4 H101 T-1:100 C"DuetFan"
Reset the Duet and re-loaded DWC, But the name remains 'FAN2' like before.
That's my M115 data:
M115
FIRMWARE_NAME: RepRapFirmware for Duet 2 WiFi/Ethernet FIRMWARE_VERSION: 1.21 ELECTRONICS: Duet WiFi 1.02 or later FIRMWARE_DATE: 2018-03-2So my firmware is 1.21, but perhaps my specific version of that release isn't up-to-date enough?
-
@snowcrash to get the renaming to work you would need to use the DWC version 1.22.1 v2 and the special firmware version 2.01 (b1.5?) from here https://forum.duet3d.com/topic/5485/duet-web-control-wishlist-notes-and-priorities/25
But at this point it might just be worth waiting for the next official release of 2.01 and associated DWC version.
-
If the TMC chip does not report temperatures correctly, isn't it better to measure the temperatures with a sensor yourself (e.g. at the heat sink of the controller which is under max load, so X or Y controller) and take this temperature to decide how to handle fan speed?
-
@joergs5 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
If the TMC chip does not report temperatures correctly, isn't it better to measure the temperatures with a sensor yourself (e.g. at the heat sink of the controller which is under max load, so X or Y controller) and take this temperature to decide how to handle fan speed?
If the drivers get hot, they will heat the CPU through the PCB. So you could use a combination of the CPU temperature and the driver warning to handle fan speed.
-
@phaedrux said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@snowcrash to get the renaming to work you would need to use the DWC version 1.22.1 v2 and the special firmware version 2.01 (b1.5?) from here https://forum.duet3d.com/topic/5485/duet-web-control-wishlist-notes-and-priorities/25
But at this point it might just be worth waiting for the next official release of 2.01 and associated DWC version.
Yeah, I think you're absolutely right. It's just a convenience anyway, so I'll wait with this.
@joergs5 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
If the TMC chip does not report temperatures correctly, isn't it better to measure the temperatures with a sensor yourself (e.g. at the heat sink of the controller which is under max load, so X or Y controller) and take this temperature to decide how to handle fan speed?
Excellent suggestion, @JoergS5, thanks.
Whenever possible I prefer to use the internal circuitry, but in this case external sensor/s do seem like the best solution. The downside would be the need to devise suitable hardware to interface with the Duet (either ready-made or custom) and the additional wiring & clutter.
I'll look into this more closely when I get some free time
@dc42 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@joergs5 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
If the TMC chip does not report temperatures correctly, isn't it better to measure the temperatures with a sensor yourself (e.g. at the heat sink of the controller which is under max load, so X or Y controller) and take this temperature to decide how to handle fan speed?
If the drivers get hot, they will heat the CPU through the PCB. So you could use a combination of the CPU temperature and the driver warning to handle fan speed.
Thanks, @dc42! Sounds great. Could you please give an example of how to accomplish this?
-
@dc42 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@joergs5 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
If the TMC chip does not report temperatures correctly, isn't it better to measure the temperatures with a sensor yourself (e.g. at the heat sink of the controller which is under max load, so X or Y controller) and take this temperature to decide how to handle fan speed?
If the drivers get hot, they will heat the CPU through the PCB. So you could use a combination of the CPU temperature and the driver warning to handle fan speed.
For info, using a thermistor stuck to a driver chip controlling a fan to blow air onto the back of the boards, after an hour or more of printing, I typically see the driver temperature reporting about 15 degrees higher than the CPU temperature. More specifically, with the fan running in thermostatic mode between 40 and 50 deg C, I might see 47 degrees on the driver but only 32 being reported for the CPU. I did calibrate the cpu temperature by using M912 so they both read the same at an ambient of about 22 deg C.
-
@deckingman said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@dc42 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@joergs5 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
If the TMC chip does not report temperatures correctly, isn't it better to measure the temperatures with a sensor yourself (e.g. at the heat sink of the controller which is under max load, so X or Y controller) and take this temperature to decide how to handle fan speed?
If the drivers get hot, they will heat the CPU through the PCB. So you could use a combination of the CPU temperature and the driver warning to handle fan speed.
For info, using a thermistor stuck to a driver chip controlling a fan to blow air onto the back of the boards, after an hour or more of printing, I typically see the driver temperature reporting about 15 degrees higher than the CPU temperature. More specifically, with the fan running in thermostatic mode between 40 and 50 deg C, I might see 47 degrees on the driver but only 32 being reported for the CPU. I did calibrate the cpu temperature by using M912 so they both read the same at an ambient of about 22 deg C.
Awesome, @deckingman, thanks!
In that case, I might switch to monitoring the cpu temp instead of the drivers as it would give me the gradual fan speed ramp up I'm looking for.
How do you monitor that particular temp? (virtual heater number?)
And could you please tell me how you calibrated the cpu temp?
-
https://duet3d.dozuki.com/Wiki/Calibrating_the_CPU_temperature
M106 P2 F100 L0.2 B0.5 T35:40 H100:101:102 ; Set fan 2 Duet case fan. Turns on when the MCU temperature (virtual heater 100) ; reaches 45C and reaches full speed when the MCU temperature reaches 65C or if any TMC2660 ; drivers (virtual heaters 101 and 102) report that they are over-temperature
This is what I use to control the dual case fans for my enclosure. Works quite well. You can modify the set point to keep the cpu relatively cool and be confident the drivers are fairly close.
-
@snowcrash said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@deckingman said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@dc42 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
@joergs5 said in Help Configuring PWM Fan in Thermostatic Mode for Duet Drivers:
If the TMC chip does not report temperatures correctly, isn't it better to measure the temperatures with a sensor yourself (e.g. at the heat sink of the controller which is under max load, so X or Y controller) and take this temperature to decide how to handle fan speed?
If the drivers get hot, they will heat the CPU through the PCB. So you could use a combination of the CPU temperature and the driver warning to handle fan speed.
For info, using a thermistor stuck to a driver chip controlling a fan to blow air onto the back of the boards, after an hour or more of printing, I typically see the driver temperature reporting about 15 degrees higher than the CPU temperature. More specifically, with the fan running in thermostatic mode between 40 and 50 deg C, I might see 47 degrees on the driver but only 32 being reported for the CPU. I did calibrate the cpu temperature by using M912 so they both read the same at an ambient of about 22 deg C.
Awesome, @deckingman, thanks!
In that case, I might switch to monitoring the cpu temp instead of the drivers as it would give me the gradual fan speed ramp up I'm looking for.
How do you monitor that particular temp? (virtual heater number?)
And could you please tell me how you calibrated the cpu temp?
What I do is stick a thermistor onto whatever it is want to monitor with a dab of epoxy adhesive - in this case a driver chip. I did a bit of a write up on my blog but it's a little out of date with current firmware. https://somei3deas.wordpress.com/2017/04/18/stepper-motor-and-electronics-cooling/
The relevant lines from my current config.g are:
M305 P103 X2 S"Duet\Duex" T100000 B4725 R4700; Set thermistor + ADC parameters for "heater" 2 - this is used to measure stepper chip temperature on Duet
and
M106 P2 S255 I0 F100 H103 T40:50 L125; Set fan 2 value (Duet and Duex fans), PWM signal inversion and frequency. Thermostatic control is turned on
The fan is set to start when then chip temperature is 40 deg C rising to fully on at 50 deg C. However, at very low speeds, the buzzing sound was bit distracting so I added the "L" parameter to inhibit really slow fan speeds. Essentially it comes on at half speed at 40 deg c and ramps up to full speed between 45 and 50. That and PWM frequency are just some things that you have to play around with to suit your particular fan(s).
The calibration of cpu temperature is just applying an offset. The quick and easy way is to you leave the printer say overnight, after which time all temperatures should be more or less at ambient. Turn the printer on and very quickly note the bed temperature, the hot end temperature and the cpu temperature - do it quickly before the cpu starts to warm up. The bed and hot end should be more or less the same - if not, one or other thermistors isn't calibrated correctly. Compare these temperatures with the cpu temperature. Then simply add a positive or negative offset to M912 P0. In may case, the cpu was reading 9.1 degrees high I use M912 P0 S-9.1. (not the minus sign). Now when I first turn the printer on, all temperatures read the same ambient value (within a degree or so).
HTH
-
Thank you very much, @Phaedrux & @deckingman!
Definitely something I'd like to try out, but it's a lot to chew on (at least at a glance), so I'll add it to my TODO list and report back once I've had a chance to study it carefully and test it out