Could DWC fan slider be made to respect M106 Xnn
-
If it looks like I have too much cooling, I might change the slider setting from 100% to say 70% but it won't have any effect because the fan is actually running at 50%.
Sorry to object, but that's not what I observe: instead of simply clipping the fan's speed at 50%, my fan turns with 70% of the range I have set with
M106 L0 X50
. -
@deckingman said in Could DWC fan slider be made to respect M106 Xnn:
Now I can set my slicer to only use the fan on bridges but it isn't clever enough to give different fan speeds on an individual filament basis for bridges.
I think it depends on the slicer you use.
The PrusaSlicer can control its own fan speeds for each filament that is in its filament list.
In the future, however, you would not have to manage your files with the DWC but solely with the PrusaSlicer.If you still want to manage your filaments with the DWC, then one solution would be... if the DWC displays the fan settings of the filaments managed with DWC next to the speed slider (e.g. a numerical display of the min and max values) but you can also change them during printing can.
Example (Photoshop) :
Is this what you imagined ? -
@infiniteloop said in Could DWC fan slider be made to respect M106 Xnn:
If it looks like I have too much cooling, I might change the slider setting from 100% to say 70% but it won't have any effect because the fan is actually running at 50%.
Sorry to object, but that's not what I observe: instead of simply clipping the fan's speed at 50%, my fan turns with 70% of the range I have set with
M106 L0 X50
.Sorry to object to your objection but that's not how it works. Take a look at the documentation. The X parameter limits the maximum speed where a non zero value for M106 is used. So it does clip and you might think you can use the slider to go up to 70% but from 50% upwards, there will be no change in fan speed. The slider ignores the X parameter but the firmware respects it. Try it yourself. Set X to a low value like 10 or even zero. The slider will still go from 0 to 100 but the fan won't run above 10% if it spins at all, regardless of what you set the slider to.
-
The X parameter limits the maximum speed where a non zero value for M106 is used.
Right.
So it does clip …
Or, as I say, it limits the max. PWM for the fan to that value.
… and you might think you can use the slider to go up to 70% …
The question is: 70% of what? Of 100% PWM, or of the range I’ve defined in M106? Spoiler: it’s the latter one. The slider operates within the range you set with M106 Ln Xn, so it maxes out at 100% of the PWM rate defined in X.
… there will be no change in fan speed …
Tested that yesterday to be sure not to tell you nonsense: there IS a change in fan speed.
Set X to a low value like 10 or even zero. The slider will still go from 0 to 100 but the fan won't run above 10% …
What I say. But with the slider at 10%, the fan runs at 10% of the 10% PWM limit, i.e. 1% PWM.
…if it spins at all …
True. That’s the trap you ran into when you used X to prevent the fan from cooling a specific filament at all. Good idea, but it counters the intention of the L and X parameters to define an operational range best suiting the physical capabilities of a specific fan.
I think if you want to override the fan settings of the slicer for a given filament, there should be an explicit way to achieve this - be it a flag or a limit value. But, as I have no experience with filament directories, I’m the wrong one to make a proposal how to implement this in RRF.
-
@infiniteloop That's not how it appears to be working on my machine. As far as I can tell, the slider is giving me 0 to 100% PWM but clipped at whatever the X value is set to and not 0 to 100% of the range specified by the L and X parameters. So using an X value of 0.5, sending M106 P0 S0.4 runs the fan at 40% and setting the slider to 40% gives the same speed. If it worked as you describe (which would be fine), the slider should give 40% of 50% = 20% but that's not what I'm seeing.
-
If it worked as you describe (which would be fine), the slider should give 40% of 50% = 20% but that's not what I'm seeing.
I've just looked up my settings: other than stated yesterday, my M106 limits the part cooling fans to a range from 0 to 60%. Within that range, the DWC slider covers 0-100%, and the fan reacts accordingly. Moving the slider from 0 to 100% increases the fan's RPM audibly, so I'm pretty sure that works as intended.
If you encounter a different behaviour (and be sure I don't doubt your words), this might be due to the specific fan you have installed: Some of my two-wire fans react somehow erratically on the PWM signal, some of them even ignore my settings completely, rendering any analog slider useless. These blowers are purely digital: either on or off.
-
@infiniteloop I guess we need @chrishamm to confirm if the DWC sliders respects the L and X parameters or not. If it does (or should) then that renders this request irrelevant as it's already implemented and I therefore need to look elsewhere for the cause of the behaviour that I'm seeing.
ref fans - yes I do know as I've done an awful lot of work on part cooling fans. These particular ones require a very low PWM frequency of 10Hz. Using that value, I am able to get the full range of speed from almost zero up to 100%.
-
@deckingman This may or may not help...
Looking at the code for DWC it seems that it always sends an M106 command based upon the slider value, so a slider position of 0 sends M106 S0.0 100% sends M106 S1.0:
https://github.com/Duet3D/DuetWebControl/blob/master/src/components/panels/FanPanel.vue#L64In the firmware that value eventually makes its way to LocalFan::InternalRefresh, which performs the following calculation on it...
reqVal = (val <= 0.0) ? 0.0 : max<float>(val * maxVal, minVal); // scale the requested PWM by the maximum, enforce the minimum
https://github.com/Duet3D/DuetWebControl/blob/master/src/components/panels/FanPanel.vue#L64
So basically it takes the requested value (0.0...1.0) and scales that by the maximum set value, it then compares that with the minimum set value and uses the larger of the two.
You can see this all in action by using the Object Model plugin in DWC. It will show the requested value and the actual value. So for instance if I set the maximum to be 0.5 and then via DWC using the slider I request that the fan is set to 75% I get the following (which is how I would expect it to work)...
-
@chrishamm just refers to the object model. I’ve looked that up: with the DWC slider at 50%, the effective value for my fan is 0.3 (which is 50% of my X being set to 0.6). So it’s RRF which calculates the PWM according to the limits of M106 Ln Xn. I can confirm @gloomyandy to be right. What might go wrong is the fan not following the PWM value.
-
Thanks. That seems to confirm that the DWC slider does respect the X parameter, so my OP can be ignored and I need to look elsewhere to understand the behaviour that I'm witnessing.