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

Go To Last Post
15 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 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 or i simply connect TACH signal to pullup resistor to 5V the fan speed significantly drops.

 

 

The speed drop does not occur when PWM is set to 100%, but it happens at lower PWM, for example, with a TACH signal is unconnected the fan can start up when PWM is around 30% but when TACH signal is connected to anything (even just pullup resistor) it needs at least 60% PWM to start fan.

 

Same goes when im runing fan at 70% just fine with TACH pin unconnected but when i connect TACH to anything the speed drops so much that fan almost stops.

 

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 when fan will be powered with PWM =/= 100 the tach signal will return PWM signal instead of actual tach so i was planning to use techinique where before measuring fan speed i would give it 100% PWM for a moment untill i read its speed and then slow it down to desired speed).

 

Im attaching schematic that i used to connect FAN to MCU

 

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.

 

Attachment(s): 

Last Edited: Mon. Dec 28, 2015 - 06:44 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just tested it, issue still happens when i connect TACH signal directly to input pin with a small 160ohm transistor to limit current.

Also when i was doing tests with simply powering fan with constant DC source if there was no pullup logic analyser would pick only rubbish, signal constantly high with us low spikes, adding pullup cleared signal up to 50% duty PWM with variable frequency.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The tacho refers to ground. And you have gnd (black wire of PCfan) to pwm fet.

You need a pwm fet on the +12V.

 

And Tacho is open collector.

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tricia, and Ulyana. You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As Plons said,

ground is your reference. You should put your PWM switching on the +12V supply.

then your tacho signal can be an open collector that you can attach through a pull-up to your MCU. But I have had one fan that was actively driving the pin, so I would suggest to connect a scope to the line and see if you get a nice block without the pull-up attached, or if you need to actually add a pull-up.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meslomp wrote:

As Plons said,

ground is your reference. You should put your PWM switching on the +12V supply...

Plons wrote:

The tacho refers to ground. And you have gnd (black wire of PCfan) to pwm fet.

You need a pwm fet on the +12V...

 

So as now i have N-Mosfet switching on the low side, i should modify my circuit to move the FET to the high side (and cut off the power supply) like this? (and use P-Mosfet instead of N-Mosfet)

 

Is schematic good? Is it allowed that GATE voltage will be 5V while source is 12V?

 

R21 is TACH pullup to 5V (to make it logic level), D7 free wheeling diode, R19 current limiting resistor and R20 is pullup resistor to make sure that P-FET is turned off when there is no output from MCU, here im not sure if it should be pulled up to 12V or 5V

High Side P-FET switch

Last Edited: Tue. Dec 29, 2015 - 12:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

is the FET closed when the source voltage is 12V and the gate voltage is 5V? What does its datasheet say?

 

personally for readability I would move the 5VPMW + 12Vsupply stuff to the top of the schematic and the ground connection to the bottom.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

meslomp wrote:

 

is the FET closed when the source voltage is 12V and the gate voltage is 5V? What does its datasheet say?

 

personally for readability I would move the 5VPMW + 12Vsupply stuff to the top of the schematic and the ground connection to the bottom.

 

 

 

The datasheet (im using IRF9332 http://www.irf.com/product-info/...) says that Vgs(th) is from -1.3V to -2.4V and i found some document (http://www.onsemi.com/pub_link/C...) that says in order to turn on P-Mosfet that to turn it on VS >= Vg + Vth but this makes no sens (12 >= 0 + -2.4 is true on with low level; 12 >= 5 +-2.5 is true and on with high lvl?)

 

But in transistor datasheet i found this graph:

 

 

Which would read as following:

 

- when my gate voltage is 0 or 5V and my source voltage is 12V then:

* in low state on gate 0V he difference would be -12V so Rds(on) would be very low and transistor would conduct current which is ok

* in high state on gate 5V he difference would be -7V so Rds(on) would be still very low and transistor would conduct current which is not ok, because it is perma open

 

and in scenario where:

- when my gate voltage is 0 or 12V and my source voltage is 12V then:

* in low state on gate 0V he difference would be -12V so Rds(on) would be very low and transistor would conduct current which is ok

* in high state on gate 12V he difference would be 0V so Rds(on) is out of curve/"not literally infinite" therfore therfore transistor is not conducting current which is ok

 

 

That would mean in my scenario, when the source voltage is 12V and the gate voltage is 5V the FET is not closed

 

 

That would be also confirmed by experiment i did just now, i had few pieces of IR9332 and i put together that circuit. With 5V on gate and 12V on source the transistor indeed was always open but when i put 12V on gate and 12V on source it worked as intended, same happened when changed source voltage to 5V.

 

 

So i think now i need another transistor but this time N-type that would be controlled by 5V on gate, and would deliver 12V on P-Mosfet gate and that would control the fan.

 

Last Edited: Tue. Dec 29, 2015 - 01:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So i think now i need another transistor but this time N-type that would be controlled by 5V on gate, and would deliver 12V on P-Mosfet gate and that would control the fan.

 

Yes. The 5V micro controls a transistor that controls the gate of the PFET and works with the 12V that is needed to make PFET function correctly. You have it!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

jaydhall wrote:

So i think now i need another transistor but this time N-type that would be controlled by 5V on gate, and would deliver 12V on P-Mosfet gate and that would control the fan.

 

Yes. The 5V micro controls a transistor that controls the gate of the PFET and works with the 12V that is needed to make PFET function correctly. You have it!

 

I just put together a circuit like below and complelety lost PWM control. When PWM is set to 0 the N-Mosfet is off and so is P-Mosfet and the fan is not moving but as soon as i increase PWM even slightly to 3-10% the fan starts up already at full speed instead of speeding up gradually as i slowly increase PWM (normally the fan should remain still until PWM is around 30-40%)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like R3 is too large to discharge Q1's gate capacitance at your PWM frequency.  Try something  around 2 to 3k ohms.

Letting the smoke out since 1978

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sounds like R3 is too large to discharge Q1's gate capacitance at your PWM frequency.  Try something  around 2 to 3k ohms.

Same for R2, I'd think (although CISS on the IRLL014 is only about 30% of that on the IRF9332).

 

R1 can be much lower, as well.  Try 150 ohms.  R19 can be lower still.  Try 10 ohms.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
Same for R2, I'd think (although CISS on the IRLL014 is only about 30% of that on the IRF9332).

Very true, but I was guessing that the mcu PWM pin was push-pull rendering R2 pretty much moot (except for possibly guaranteeing U7's gate completely discharges on power off).

 

Letting the smoke out since 1978

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Very true, but I was guessing that the mcu PWM pin was push-pull rendering R2 pretty much moot (except for possibly guaranteeing U7's gate completely discharges on power off).

A good guess ;-)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello and thank you,

 

i think the issue has been resolved (tho the solution increased number of part needed).

 

After changing R3 to as low as 120Ohm PWM started being responsive again. 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 itsself adds an error to RPM reading because even if it sets PWM to 100% for 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 and create an approximated linear curve RPM=f(PWM)