Skip to content

Instantly share code, notes, and snippets.

@pertoft
Last active June 18, 2024 01:07
Show Gist options
  • Save pertoft/333defaa728896b073bd22a51a7ab344 to your computer and use it in GitHub Desktop.
Save pertoft/333defaa728896b073bd22a51a7ab344 to your computer and use it in GitHub Desktop.
Klipper Raspberry PI4 PWM Fan and DS18B20 sensor
[temperature_fan enclosure]
pin: !rpi:gpio12
#pin: rpi:pwmchip0/pwm0
control: pid
sensor_type: DS18B20
serial_no: 28-3c01e07653c6
sensor_mcu: rpi
ds18_report_time: 1.5
min_temp: 0
max_temp: 60
gcode_id: E
target_temp: 0
control: pid
pid_Kp: 40
pid_Ki: 0.2
pid_Kd: 0.1
# The official PC fan spec calls for 21-28kHz PWM frequency, but my Noctua at least was happy with the default 100Hz software PWM. So if your controller doesn't support hardware_pwm then try leaving these two lines out:
hardware_pwm: True
cycle_time: 0.00004 # 25 kHz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment