M106 handling of X (max fan speed) parameter
-
Hi, I think there is a small error/confusion in the M106 documentation. The latest doc for M106 describes how the X parameter (max fan speed is handled as):
The L parameter defines the minimum PWM value that is usable with this fan. If a lower value is commanded that is not zero, it will be rounded up to this value. The X parameter defines the same for a maximum PWM value. If a higher value is commanded, it will be rounded down to this value.
But looking at the code:
https://github.com/Duet3D/RepRapFirmware/blob/3.4-dev/src/Fans/LocalFan.cpp#L76reqVal = (val <= 0.0) ? 0.0 : max<float>(val * maxVal, minVal); // scale the requested PWM by the maximum, enforce the minimum
It looks like the requested value (from the S parameter) is scaled to be between 0..<max value> and that value is then rounded up to the minimum. Which seems to make more sense than the rounding down described in the docs.
-
@gloomyandy Thanks Andy, I'll check with @dc42 (though I'm sure you are correct!) and amend.
Ian
-
M106 entry updated.
Ian
-
-