Controller_fan not turning off

Hi Guys very new here and need some advise pls.

I have a heated Chamber with the following cfg,

`################## Chamber Heater ##################

[heater_generic heater_chamber]
heater_pin: PB11   # HE3
sensor_type: EPCOS 100K B57560G104F # Stock
sensor_pin: PF5    # T1
control: watermark
max_delta: 2.0
max_power: 1.0
min_temp: 0
max_temp: 110
pwm_cycle_time: 0.3

[verify_heater heater_chamber]
max_error: 900
check_gain_time: 900
hysteresis: 5
heating_gain: 2

################ Chamber Heater Fan ###############


[controller_fan chamber_heater_fan]
pin: PD13
max_power: 1.0
heater: heater_chamber
cycle_time: 0.02
kick_start_time: 0.5
idle_timeout: 20
hardware_pwm: False
#heater_temp: 30.0 # fan will turn off below this level
fan_speed: 1.0   # The fan speed (expressed as a value from 0.0 to 1.0) that the fan will be set to when its associated heater is enabled. The default is 1.0


[gcode_macro M141]
gcode:
  #;take the paramater S of M141 and store it as heater_chamber. If S is not provided, set as 35c.
  {% set heater_chamber = params.S|default(35)|float %}
 # ;set heater my_heater_chamber equal to M141 S parameter by setting equal to heater_chamber.
  SET_HEATER_TEMPERATURE HEATER=heater_chamber TARGET={heater_chamber}
`

The problem I am having is the fan switches on as soon as the steppers are activated and then have no way of switching the fan off.

If I activate the hearter chamber it switched on with the fan and when switched off the fan is delayed with 20 sec and it powers off. This any temp is on and 0deg temp is off.

So as soon as I home the printer I have no control over the fan anymore.

I would also like it if the fan could shut down when heater reaches target temp and back on again when temp drops and heater switches on again.

Thanks.

Hello @bigmac !

Can you put the code snippet as code with </> in the editors menu bar.
Without that, characters and spaces get lost and we can’t see if your code is correct.

Hey EddyMI3D,

Thanks did not know that.

You need to use a [fan_generic ...]. Controller fan is tied to the given conditions and cannot be influenced.

Not possible currently IMO. Possibly you could make up something with macros, i.e. compare temps and send fan speeds.

Sineos,

Thanks I have tried that but then the fan is not switched on and off via the chamber heater.

Option 'heater' is not valid in section 'fan_generic chamber_heater_fan'

If I use heater_fan the I cant use idle time out.

controller_fan should work, this is from the KlipperConfig Ref.

 A "controller fan" is a fan that will be enabled whenever its associated heater or its associated stepper driver is active.

#heater:
#stepper:
#   Name of the config section defining the heater/stepper that this fan
#   is associated with. If a comma separated list of heater/stepper names
#   is provided here, then the fan will be enabled when any of the given
#   heaters/steppers are enabled. The default heater is "extruder", the
#   default stepper is all of them.

I have associated the fan with the heater_chamber but yet it is activated with the stepper.

What am I missing here

The point is that you cannot control this type. It is active whenver the condition is active.

Have not tested but try:

[controller_fan chamber_heater_fan]
...
heater: heater_generic heater_chamber

And please use code blocks when posting config snippets

Sorry My Bed.

Will try it.

sorry ment to say my bad.

Error

Unknown heater 'heater_generic heater_chamber'

Sorry, no more ideas. As I do not have an additional heater, I cannot test as well.

No problem Dude, thanks for trying.

I have the same issue. When I investigated the klipper code this is what I worked out:

I have a heater_generic chamber_heater setup and with a controller_fan chamberHeater_fan.

Desired behaviour: The fan should only come on when the heater is on or in its cooldown period, as specified in the controller fan config under `heater: chamber_heater’

## Chamber heater fan - comes on whenever the chamber heater is active
[controller_fan ChamberHeater_fan]
pin: PD15
max_power: 1.0
off_below: 1
shutdown_speed: 0
kick_start_time: 0.5
idle_timeout: 60 # amount of time the fan runs after the heater is turned off
#idle_speed: 0.5
heater: chamber_heater

Observed behaviour: it is on whenever once any stepper is active as well as when the heater is on.

The module controller_fan.py has the following code:

       if self.stepper_names is None:
            self.stepper_names = all_steppers
            return

Thus, if no steppers are specified, all are selected, explaining the behaviour. It is not possible to specify null as they are of course non-existent steppers and fail the code check.

Suggested solution: It would be preferable if the code triggered an error if no heater or stepper at all is specified, but otherwise did not default to all steppers if only a heater was listed.

[SOLVED]
It is a workaround…

I created a manual stepper stepper_fake with all the necessary attributes, associated with an unused stepper driver on the BTT Octopus.

Then for the controller_fan add the lines:
heater: [the one that I want to work]
stepper: stepper_fake

Now the fan only comes on when the heater is activated and not all the steppers, since I never actually use stepper_fake

@IconoclastXYZ
Would you mind sharing your stepper_fake config? I’ve tried making one but always got some errors.

When you say “associated with an ununsed stepper driver” is the stepper driver physically in place or it is the empty position of a stepper driver?