M106 X parameter breaks proportional thermostatic fan
-
I believe setting an X parameter in M106 stops proportional thermsotatic control of the fan. If the M106 command contains an X parameter, the fan only ever runs at the setting defined by the L parameter, regardless of the temperature.
I have a delta, with attached RPi 4
Board: Duet 3 MB6HC (MB6HC)
DSF Version: 3.3.0
Firmware: RepRapFirmware for Duet 3 MB6HC 3.3 (2021-06-15)I have defined a thermistor and a fan (standard PC 4-wire):
M308 S6 P"temp3" Y"thermistor" T4701 B4266 C1.048787e-7 A"trailing" M950 F4 C"!out5" Q25000
If I set the fan to thermostatic control with no minimum or maximum, it behaves as expected:
M106 P4 S1 H6 T25:35
Fan signal comes on at 25C, gets faster as temperature increases, and is running full speed at 35C (at least, according to the object model values, and I can see / hear that the fan accelerates - I haven't put an oscilloscope on the output).
One oddity I notice from the object model values is that L seems to default to 0.1, even though it is not specified: fans[4] is {"actualValue":0,"blip":0.1,"frequency":0,"max":1,"min":0.1,"name":"","requestedValue":1,"rpm":-1,"thermostatic":{"heaters":[6],"highTemperature":35,"lowTemperature":25}}
A default value is not mentioned at https://duet3d.dozuki.com/Wiki/Gcode#Section_M106_Fan_On
If I set the fan to have a minimum value, e.g. L0.4, it also behaves as expected:
M106 P4 S1 L0.4 H6 T25:35
Fan comes on at 0.4 duty at 25C, stays at 0.4 duty until I'm at about 29C, then ramps up smoothly to 1.0 duty at 35C.
However, if I set it to also have a high value limit, it doesn't work right.
M106 P4 S1 L0.4 X0.8 H6 T25:35
It comes on at 0.4 duty at 25C, then stays there. It's still 0.4 duty at 35C, and indeed as high as I tested it (only 60C or so).
Object model looks OK (except that it's stuck at 0.4 duty): {"actualValue":0.4,"blip":0.1,"frequency":0,"max":0.8,"min":0.4,"name":"","requestedValue":1,"rpm":-1,"thermostatic":{"heaters":[6],"highTemperature":35,"lowTemperature":25}}
If I set only a high value limit (ie no L value)
M106 P4 S1 X0.8 H6 T25:35
I get the same behaviour as an explicit L, except now it's using the default L of 0.1, so I only ever get 0.1 duty (which incidently does not turn my fan).
I've tried specifying L and X parameters in integer terms (ie in range 2 to 255) and get the same behaviour - setting an X value means the fan never runs at anything but the L value (whetehr that's explicitly set, or the apparent default value of 0.1). I note the object model still reports as floating point (e.g. setting X250 results in fans[4].max = 0.98).
-
@achrn I believe this is already fixed in the latest RRF 3.4beta. https://github.com/Duet3D/RepRapFirmware/wiki/Changelog-RRF-3.x-Beta-&-RC#reprapfirmware-340beta3