RRF 3.0 upgrade - Fans



  • Spent far too much time trying to get my hotend and partcooling fans to work on my DUET 2 so asking here for help.

    My first PWM fan connection does not work (cock up when building my HEVO) so I have to assign the hotend fan to the second connector and the part cooling fan to the third.

    My config.g (from the online config tool) for the fans is -
    ; Fans
    M950 F0 C"fan1" Q500 ; create fan 0 on pin fan1 and set its frequency
    M106 P0 S1 H1 T45 ; set fan 0 value. Thermostatic control is turned on
    M950 F1 C"fan2" ; create fan 1 on pin fan2 and set its frequency
    M106 P1 S0 H-1 ; set fan 1 value. Thermostatic control is turned off

    In my 2.06 config.g I had -
    ; Fans
    M106 P1 S1 I0 F500 H1 T45 C"HotEnd" ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on
    M106 P2 S0 H-1 C"PrintCool" ; suggested by forum

    Running M98 P"config.g" give the following -
    Error: M950: Pin 'fan2' is not free
    Error: M106: Fan number 1 not found
    And the hotend fan then works correctly if I heat up/cool down turning on/off at 45°C

    If I restart the board it fails again and does not spin up.

    The part cooling fan does not respond at all to M106 P1 and give the error "Fan number 1 not found"

    I'm baffled - no doubt it will be a simple error on my part but I can't find it!



  • which version of RRF3 are you running?



  • as in the title RRF 3.0


  • Moderator

    @Simonjb In RRF 3.0, some pins are defined by default on Duet 2; these:

    fan0 -> Fan 0
    fan1 -> Fan 1
    fan2 -> Fan 2
    xstop -> X endstop switch, low end, active high
    ystop -> Y endstop switch, low end, active high
    zstop -> Z endstop switch, low end, active high
    zprobe.in+zprobe.mod -> Z probe 0

    So you need to clear the pin assignment first, with:
    M950 F0 C"nil" ; disable fan 0 and free up the associated pin
    M950 F1 C"nil" ; disable fan 1 and free up the associated pin
    M950 F2 C"nil" ; disable fan 2 and free up the associated pin

    Then your definitions should work.

    NOTE that any newer version of RRF3 will have no default pins (it's a change the community voted for!). Any code clearing pin assignments will be redundant, and the code above will be ignored.

    Ian



  • @droftarts I was right - it was simple. Thanks Ian both fans now working as expected.