cancel
Showing results for 
Search instead for 
Did you mean: 

Problem of 3-Wire Fan Speed Measurement & Control

lixiaohai
Associate
Posted on May 13, 2012 at 12:58

Recently I was designing a subsystem of closed loop fan control.  This diagram shows the method: using a channel of PWM to control the speed (GND method), and a channel of capture module to measure fan speed. The box on the left is a STM32 microcontroller.

0690X00000602l3QAA.jpg

The problem is the fan outputs speed wave only when PWM from STM32(GND of the fan) is high, so that I can't use PWM-Input method. Then how can I capture the speed wave at the right time and eliminate interferences.

0690X00000602kyQAA.jpg

I wonder if there is a way to solve this problem.

#3-wire-fan-speed
4 REPLIES 4
Posted on May 13, 2012 at 15:06

I wonder if there is a way to solve this problem.

Depends on what timers, and how they are wired. I suspect you could use a slave gated mode, or add an external OR gate. Look at the Hall Sensor examples, and perhaps the encoder modes too.

The update interrupt also fire at the beginning of the PWM pulse. Might help if the frequency isn't too high.

Is there a prize?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
raptorhal2
Lead
Posted on May 13, 2012 at 16:39

Two suggestions - you will have to decide if practical for your setup.

1. Modify the fan to separately ground the TACH signal circuit.

2. Create a math model in the STM32 of fan speed vs. PWM command. Include lag time for step changes. Then use input capture for the TACH signal and reject capture frequencies that differ from the model by some error amount. This won't require a hardware modification, but will be software complicated. And you will need a model for every different fan.

Cheers, Hal

jpeacock2399
Associate II
Posted on May 14, 2012 at 16:12

Why not switch on the high side, the V+, and connect low side directly to ground?

  Jack Peacock

>> I wonder if there is a way to solve this problem.

raptorhal2
Lead
Posted on May 14, 2012 at 19:49

That would work, but a separate V+ is needed for the tach signal circuit.

Cheers, Hal