PC 12V 3 pin fan slows down when trying to connect tacho signal

Discussion in 'The Projects Forum' started by KonradIC, Dec 28, 2015.

  1. KonradIC

    Thread Starter New Member

    Oct 26, 2015
    16
    0
    Hello,

    I have a problem with reading tach signal from 3-PIN PC fan.


    The problem is that as soon as i connect TACH signal from 3-PIN 12V PC FAN to any of MCU input pin or to for example logic state analyzer the fan speed significantly drops.


    Fan is powered with 12V while the speed is controlled by 41kHz (also tested with 10kHz and 20kHz) PWM from MCU trought a N-Mosfet transistor (i know that tach signal will return PWM signal so i was planning to use techinique where before measuring fan speed i would give it 100% PWM for that moment to read real TACH signal).


    The speed drop does not occur when PWM is set to 100%, but it happens at lower PWM, for example, with a TACH signal unconnected the fan can start up when PWM is around 30% but when TACH signal is connected to anything i need at least 60% PWM to start fan. Same goes when im runing fan at 70% just fine but when i connect TACH to anything the speed drops and fan almost stops.


    Im attaching schematic that i used to connect FAN to MCU

    PCFANMCU.png

    The problem happens:
    - Pullup resistor R21 is disconnected from VCC = 5V and i connect TACH signal to any input port of MCU

    - As soon as i connect the pullup resistor to TACH signal

    The problem does not happen when i run fan from constant low voltage like 5V. In this scenario there is no speed drop when connecting TACH pin.

    Also, when the fan speed drops the source voltage remains at 5V (MCU power) and 12V (FAN power).



    And i tested three fans, 2 of same brand and type and one taken out of computer just moment ago.



    And i just noticed that the moment i connect TACH signal to anything including pullup resistor, the current drawn by FAN increases by 30mA from what it was before where normally the slower fan goes, the less current it draws.
     
    Last edited: Dec 28, 2015
  2. crutschow

    Expert

    Mar 14, 2008
    13,003
    3,232
    Try a larger resistor value.
     
  3. KonradIC

    Thread Starter New Member

    Oct 26, 2015
    16
    0
    It works! Switched from 10k to 30k and the treshold at which % of PWM the slow down happens moved to around 40%. Increasing Pullup resistor to further up to 81k removed the "slow down" all the way to the 10% PWM which is basically when the fan stops completely and stalls.


    Also i found out that with the old 10kOhm resistor but pulled up to 12V (instead of 5V that my circuit uses as default pullup) removes the "slow down" effect too, is it relevant?
     
  4. KonradIC

    Thread Starter New Member

    Oct 26, 2015
    16
    0
    Correction, its not working anymore.

    Wanted to go trought with another step of my program but the issue returned, increasing pullup resistor even to 300k is doing nothing now.

    I figured increasing the pullup resistor solved the issue where "slowing down" started as soon as i connected pullup resistor.

    But even after that, when i tried to connect TACH signal to GPIO the slowing down still happened despite trying out 81, 150, 330 and 3.3mOhm
     
    Last edited: Dec 28, 2015
  5. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,797
    1,103
    The problem may not be entirely due to the pull-up resistor. How are you processing the TACH signal? Perhaps taking time to deal with that is preventing the MCU putting out the correct PWM signal?
     
  6. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    762
    Hola Konrad,

    From my notes, that I posted long time ago, after a short and successful test, not exactly as yours:

    From my test on a 4-pins connector fan, having the black wire on your left, you get:

    black - GND
    yellow - +12V
    green - tacho signal - 2 pulses per revolution
    light blue - PWM ctrl (see below)

    The 3-pin fans may be used here knowing that you do not have that PWM ctrl available.


    As per the governing standard (reccomendations?) the PWM control should be a nominal 25KHz signal (0-5V).

    Worth to note:

    In tacho output I used a 10K pull-up resistor to 12V.

    With no signal in pin 4 the fans goes fast.

    0V on pin 4 gets the fan running to a supposed "minimum" of 30%.

    Steady 5V on pin 4 means NO change in speed.

    PWM ctrl (between 20 and 80% that my function generator allows) seems to have a very linear response.


    Hope this could spark an idea.

    Post your outcome.
     
  7. KonradIC

    Thread Starter New Member

    Oct 26, 2015
    16
    0
    PWM is generated by MCU hardware (CTC mode) so it should work somehow independently of main code. TACH measurement unfortunately is made with a blocking routine and takes around 20ms to complete BUT the issue i described was happening the moment i simply connected TACH signal (and didnt measure it at all or connected it to outside logic level analyser).


    Anyway, from discussion in other forum, i think the most probable explanation and cause of problem is the fan internal control circuit and tach/hall sensor inside. The assumption was made that the tacho refers to fan (3pin) ground while in my circuit GND of fan was attached to drain of fet and because of that trying to tame the TACH pin and make it into TTL signal was messing up with FAN internal circuit. This could be eliminated by changing N-Mosfet low side switching into High side switching. A test circuit was created and after tuning resistor values (R3 if too high will block PWM and make fan work in off/on mode) the TACH signal started being readable and speed drops dissapeared. Issue seems to be solved.

    weqweqweqw.png

    I even started reading RPMs with pulse stretching method but now i need to decide on my own how reliable it is, the tach output is very unstable while pulse stretching itself adds an error to RPM reading because even if it sets PWM to 100% for only 20-40ms (to get full pulse from TACH) the fan significantly speeds up during that time (a 20ms 100%PWM pulse given to a otherwise stopped fan every 1 second is still enough to make the fan blades move a little), maybe it was good with old fans but not with new ones with better electronics and response to voltage change..



    Initially i planned to read real RPM from fan at any given PWM/speed but in the end i might go back to initial schematic and stick to only measuring max fan RPM at 100% PWM, set a PWM cutoff point somewhere at around and create an approximated linear curve RPM=f(PWM)
     
Loading...