From 16d85d1a78bbd29d0177c98754b9a8ccb9f10b42 Mon Sep 17 00:00:00 2001 From: Adrian Keet Date: Sat, 6 Feb 2021 15:11:29 -0800 Subject: fan: Add tachometer support This adds new config options for fans: 'tachometer_pin' to specify the GPIO pin, and 'tachometer_ppr' (default 2) to specify the number of signal pulses per revolution. The rpm is also exposed by get_status for command templates and the API server. For fast fans (at least 10000 RPM), the polling interval can be shortened using the 'tachometer_poll_interval' option. There is a new mcu object for a generic edge counter, which repeatedly polls a GPIO pin and periodically reports the count to the host. Signed-off-by: Adrian Keet --- docs/Config_Reference.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'docs/Config_Reference.md') diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 60f344d4..48ba7d32 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -2226,6 +2226,19 @@ pin: # input speed which reliably drives the fan without stalls. Set # off_below to the duty cycle corresponding to this value (for # example, 12% -> 0.12) or slightly higher. +#tachometer_pin: +# Tachometer input pin for monitoring fan speed. A pullup is generally +# required. This parameter is optional. +#tachometer_ppr: 2 +# When tachometer_pin is specified, this is the number of pulses per +# revolution of the tachometer signal. For a BLDC fan this is +# normally half the number of poles. The default is 2. +#tachometer_poll_interval: 0.0015 +# When tachometer_pin is specified, this is the polling period of the +# tachometer pin, in seconds. The default is 0.0015, which is fast +# enough for fans below 10000 RPM at 2 PPR. This must be smaller than +# 30/(tachometer_ppr*rpm), with some margin, where rpm is the +# maximum speed (in RPM) of the fan. ``` ## [heater_fan] @@ -2244,6 +2257,9 @@ a shutdown_speed equal to max_power. #hardware_pwm: #kick_start_time: #off_below: +#tachometer_pin: +#tachometer_ppr: +#tachometer_poll_interval: # See the "fan" section for a description of the above parameters. #heater: extruder # Name of the config section defining the heater that this fan is @@ -2277,6 +2293,9 @@ watched component. #hardware_pwm: #kick_start_time: #off_below: +#tachometer_pin: +#tachometer_ppr: +#tachometer_poll_interval: # See the "fan" section for a description of the above parameters. #fan_speed: 1.0 # The fan speed (expressed as a value from 0.0 to 1.0) that the fan @@ -2317,6 +2336,9 @@ additional information. #hardware_pwm: #kick_start_time: #off_below: +#tachometer_pin: +#tachometer_ppr: +#tachometer_poll_interval: # See the "fan" section for a description of the above parameters. #sensor_type: #sensor_pin: @@ -2362,6 +2384,9 @@ with the SET_FAN_SPEED #hardware_pwm: #kick_start_time: #off_below: +#tachometer_pin: +#tachometer_ppr: +#tachometer_poll_interval: # See the "fan" section for a description of the above parameters. ``` -- cgit v1.2.3-70-g09d2