M106 precision in S parameter
-
Hi
I've been working on some modifications to my printer recently and I'm wondering if it's possible to increase the precision for a command like M106 P3 S0.01 to M106 P3 S0.0001
is it hardware limited or is there a workaround for this? I would need this because I would like to control something other than a fan with the M106. If not, is there another option to control a device via the duet using a command other than M106?Thanks for your help
-
@Seba7890 If you have set up the output as a fan with M950 F#, the pwm frequency is usually set to 250Hz. This may be limiting the resolution you can get when setting the pwm speed. You can change this by setting the M950 Q parameter (see https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m950-create-heater-fan-spindle-led-strip-or-gpioservo-pin) though the maximum pwm frequency is 65535Hz. I doubt the MCU can achieve more precision than this.
Rather than setting it as a fan, you can set it as an 'output' with M950, and control it with M42 (see https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m42-switch-io-pin). It's much the same as controlling a fan with M106, but may make the distinction between fans and other outputs clearer.
Ian
-
@Seba7890 the available PWM resolution depends on the PWM frequency, on which Duet you are using, and on which output you are using. You will get higher resolution at lower frequencies. The maximum resolution you will ever get is 16 bits.