Could DWC fan slider be made to respect M106 Xnn
-
@infiniteloop said in Could DWC fan slider be made to respect M106 Xnn:
@deckingman In my understanding, the L and X parameters of
M106
define the operational limits of the fan. Some fans only start spinning at no less than - let’s say - 10 percent, and my part cooling fans are most effective at 70 percent - above that, only the noise increases, not the effect. With DWC, I don’t have to know the specific properties of a fan, I just have the full range from 0 to 100%. That’s what my slicer expects, too, so when I use another printer (with different fans), I can take the same gcode file, although the fans have quite different operational limits. That's why I think the way L and X work makes sense.Yes L and X work as they should - I'm not asking for that to be changed.
-
Yes L and X work as they should - I'm not asking for that to be changed.
Sure, but if I don’t misunderstand you badly, you want the slider to operate within these limits, say: 10-70%. Which, in my eyes, conflicts with the 100% range the slicer operates in, thus making it hardware-independent. At X=0, 100% are mapped to a range of 0, so I could imagine to disable the slider for this special case (but still showing 0-100%), but generally, I want the slider to reflect the settings of the slicer, not the values RRF computes for the effective voltage range of a fan.
Of course, there’s a second option: DWC could add a display of the L/X values, just as a reminder.
-
@infiniteloop To elaborate in case you still haven't comprehended what I'm asking for.........
When printing a multi part object with different materials, I limit the fan speed using the X parameter in M106 on a per material basis as part of the tool change routine. So for example, bridges might only need 50% fan speed with ABS, but Polypropylene works better with 100%. 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. So I set the slicer to give 100% but the actual fan speed will depend on the X setting for the particular filament in use. But DWC currently does not reflect the actual PWM value. If the slicer asks for 100%, that's what it will display. Yet the true value will be 50% if I'm printing ABS because that's what the "X" parameter is set to. 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%.
I would simply like the slider to reflect the actual PWM percentage value, taking into account the upper limit that has been defined.
-
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.