Author Topic: Trying to build a PWM fan controller  (Read 6434 times)

0 Members and 1 Guest are viewing this topic.

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Trying to build a PWM fan controller
« on: December 03, 2018, 07:43:29 pm »
Hello Everyone,

first, please know that I'm a total newb, and so I use language which is almost certainly wrong. I do things which are almost certainly stupid. But I'm not all that young anymore, have no one around to teach me and rely on information and hardware gleaned here and there. So please don't bash me...

So. I would like to build a 556-based PWM fan controller. I found this schematic:



on this [url=http://www.overclockers.com]www.overclockers.com page[/url].

I've started breadboarding it and have made some progress, i.e. the PWM output lead does its job (or so it seems to me anyways) but I don't get how the PWM signal is "interpreted" by the fan. The 556-based circuit does change the signal's duty cycle, but fan speed follows some indetermined curve, going slow in the middle and fast at the ends. It also doesn't seem to span the full spread of available speeds, i.e. when it's slow, I think it could actually be much slower.

I've triple checked the circuit and think all is right according to schematics.

Here's a video of my being ignorant with my donated 1-channel oscilloscope: http://www.emyamstein.ch/media/forums/IMG_0410.MOV

The fan is this: https://www.amazon.com/Noiseblocker-.../dp/B00839GBC6

Also, I know that you savvy people know better, more elegant ways to achieve PWM control, but doing this is a lot of fun to me, although certainly clunky-looking for the expert.

Can somebody please tell me what's wrong with the circuit? Or me?
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2851
  • Country: us
Re: Trying to build a PWM fan controller
« Reply #1 on: December 03, 2018, 09:17:23 pm »
Does your fan have a logic-level PWM input, or is it just a plain 2-wire fan?  If 3-wire with PWM input, then check the data sheet to find the optimum PWM frequency and duty cycle range.

If a 2-wire fan, then you will have to run the PWM at a low enough frequency for the fan to work right.  Many 2-wire fans have a start-up mode that they execute every time power comes on to get the rotor started, and this will likely interfere with PWM speed control.

Jon
 

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Re: Trying to build a PWM fan controller
« Reply #2 on: December 03, 2018, 10:24:05 pm »
Thanks for your reply.

It is a 4-wire, tach + PWM input fan. The datasheet unfortunately doesn't say anything about frequency or duty cycle. It boasts about propeller and case material, longevity, low acoustic dB... just about anything but that information.

I've reached out to the company to get the data. I'll see what I get...
 

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: Trying to build a PWM fan controller
« Reply #3 on: December 03, 2018, 10:39:36 pm »
Hi eamoex

Here is a datasheet which shows the fan speed range:
https://www.blacknoise.com/datas/downloads/datasheets/TData_BSP8025_122012_de_en.pdf

It seems odd that your fan has a four-pin connector because the Amazon advert states a P1 version (3 pin Black=0V, red=12V, yellow=taco op). The four pin version is PP.

The schematic for the PWM has no values, which means we can not analyze it.

Also we would need a complete schematic of your circuit from the power source to the PWM to the fan. Presumably you have a 5V and 12V power source.
« Last Edit: December 03, 2018, 10:47:25 pm by spec »
 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2931
  • Country: gb
Re: Trying to build a PWM fan controller
« Reply #4 on: December 03, 2018, 10:53:55 pm »
If it is standard computer 4-wire +tacho there is a specification to which it should adhere.

https://folk.uio.no/kyrrens/diverse/viftekontroller/developer-specs-REV1_2_Public.pdf
« Last Edit: December 03, 2018, 11:01:03 pm by grumpydoc »
 

Offline nemail2

  • Regular Contributor
  • *
  • Posts: 206
  • Country: at
Re: Trying to build a PWM fan controller
« Reply #5 on: December 04, 2018, 12:22:23 am »
just a side note, imho a standard 3 pin fan never incorporates pwm. the 3rd pin is the tacho signal. if you have 4 pins, the 4th pin is the pwm input.

Boron rhymes with moron
 

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Re: Trying to build a PWM fan controller
« Reply #6 on: December 04, 2018, 06:29:48 am »
Hello Everybody, thanks a lot for your replies.

Here is a datasheet […] The four pin version is PP.

Yes, it's the datasheet I found too and my version is the PP. Just hadn't noticed there were two versions when I referenced the Amazon page.

Also we would need a complete schematic of your circuit from the power source to the PWM to the fan.

Okay, I'll draw it later. But basically, the breadboard is powered by a 5VDC 3A USB supply and the 12V fan by my little bench lab supply. And the fan is hooked to the PWM signal lead by the PWM pin (not the tacho one; I only connect to the tacho wire to read fan speed – which gives me horrible wobbly signals by the way, but that is another question probably linked to my not knowing how to reference the oscilloscope, or other interferences…).

[…] there is a specification to which it should adhere.

Thanks for the spec, very useful.

I'll do more testing, draw the full schematic and report back.
 

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Re: Trying to build a PWM fan controller
« Reply #7 on: December 04, 2018, 07:04:09 am »
The whole rig  :)

 

Offline grumpydoc

  • Super Contributor
  • ***
  • Posts: 2931
  • Country: gb
Re: Trying to build a PWM fan controller
« Reply #8 on: December 04, 2018, 07:12:39 am »
Component values would be useful.

I would start with the single 555 circuit from the same page

What test equipment do you have?
 

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: Trying to build a PWM fan controller
« Reply #9 on: December 04, 2018, 07:59:29 am »
The whole rig  :)

Thanks

Try making the connection shown in red on your modified schematic attached below:

I found the component values- they are on the page you linked to in your opening post. :palm:
« Last Edit: December 04, 2018, 08:13:53 am by spec »
 

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: Trying to build a PWM fan controller
« Reply #10 on: December 04, 2018, 08:40:29 am »
Attached below is your modified schematic with component values included.

The first thing I happened to notice is that 1N4148 diodes are called up in the components list, but schottky diode symbols are shown on the schematic. Schottky diodes (BAT48) would be much better because they have a lower forward drop (Vf) than ordinary diodes. This is especially relevant with this circuit when running from a low supply rail, like 5V.

The second thing is that there appears to be an error on the schematic- will describe in next post.

I will have a look at the 556 circuit further.
« Last Edit: December 04, 2018, 09:17:06 am by spec »
 

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: Trying to build a PWM fan controller
« Reply #11 on: December 04, 2018, 09:48:41 am »
Another schematic attached showing a correction in red for the 'error' I mentioned.

On reflection, the original circuit would always work, but the circuit, as I have shown, is much cleaner and better practice.

AFAIK, the fan PW control input is expecting an open collector/drain drive with pull up resistor, but the present 556 circuit is providing source and sink drive. Not sure how happy the fan circuitry would be with that.
« Last Edit: December 04, 2018, 09:52:18 am by spec »
 

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: Trying to build a PWM fan controller
« Reply #12 on: December 04, 2018, 10:21:26 am »
Yet another schematic attached. :)

This schematic only uses the first section of the 556 and provides an open drain drive for the PW input to the fan.

Not sure if a 10K pull up resistor is low enough, but that is easily fixed.
« Last Edit: December 04, 2018, 10:40:06 am by spec »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Trying to build a PWM fan controller
« Reply #13 on: December 04, 2018, 10:37:57 am »
The 556 or dual 555 circuits from overclockers.com are pointless, and only showcase the limited electronic design skillbase at that site. 

Instead of driving the fan from the push-pull signal on the 555's Out in, simply drive the fan PWM input from the 555's Discharge pin, which is open drain if you use a CMOS 555 (and open collector for a bipolar one), so is closer to the Intel 4 wire fan specification drive requirements, and also removes any need for a second 555 or 1/2 556 for buffering.

I'm rather suspicious of the 100K pot and 680pF capacitor as I think the frequency will be outside the 21KHz to 28KHz range called for in the Intel spec. near the ends of pot's travel.

I've attached a LTspice sim of a simplified single 555, single 12V supply circuit, using a potential divider to pull up the Discharge pin to an effective 5V level, with a 50K pot and a 1nF timing cap which should meet the 21KHz to 28KHz range requirement, or at least be far closer to it. 

Edit: it looks like Spec's been working on something similar while I've been typing this.
« Last Edit: December 04, 2018, 10:44:49 am by Ian.M »
 
The following users thanked this post: eamoex

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: Trying to build a PWM fan controller
« Reply #14 on: December 04, 2018, 10:47:39 am »
The 556 or dual 555 circuits from overclockers.com are pointless, and only showcase the limited electronic design skillbase at that site. 
That applies to many circuits you see on the net and to a lesser degree in books ::)
Instead of driving the fan from the push-pull signal on the 555's Out in, simply drive the fan PWM input from the 555's Discharge pin, which is open drain if you use a CMOS 555 (and open collector for a bipolar one), so is closer to the Intel 4 wire fan specification drive requirements, and also removes any need for a second 555 or 1/2 556 for buffering.
Great minds think alike :)
The OP is using a CMOS 556
I'm rather suspicious of the 100K pot and 680pF capacitor as I think the frequency will be outside the 21KHz to 28KHz range called for in the Intel spec. near the ends of pot's travel.
That was my concern too.
I've attached a LTspice sim of a simplified single 555, single 12V supply circuit, using a potential divider to pull up the Discharge pin to an effective 5V level, with a 50K pot and a 1nF timing cap which should meet the 21KHz to 28KHz range requirement, or at least be far closer to it.
Good move. Handy info about the Intel spec frequency range.
Edit: it looks like Spec's been working on something similar while I've been typing this.
Happens to me all the time ;D
« Last Edit: December 04, 2018, 10:53:40 am by spec »
 

Offline spec

  • Frequent Contributor
  • **
  • Posts: 833
  • Country: england
  • MALE
Re: Trying to build a PWM fan controller
« Reply #15 on: December 04, 2018, 11:00:21 am »
By the way, you can replace the 5V PSU brick with a 5V Zener diode and resistor running from the 12V supply.
(time for work now)
« Last Edit: December 04, 2018, 11:01:55 am by spec »
 
The following users thanked this post: eamoex

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Re: Trying to build a PWM fan controller
« Reply #16 on: January 23, 2019, 07:40:00 pm »
Hello All,

I've breadboarded Ian.M's circuit and it works way, way better than what I had before. Fan's speed makes a linear, steady progression throughout pot rotation. Thanks everyone for your help!  :-+

I've checked the PWM pin signal without the fan connected and it is a crisp square wave which goes from almost zero to 100% duty cycle. Frequency tends to drift a little along the pot travel, though, and seems just a bit on the low side, ranging from about 19 to 22 kHz.

Hencewhy I wish to trace the output of the tach pin, to check if the fan goes the whole range of RPMs (from 500 to 2000, roughly). I did connect the oscilloscope probe to the tach pin, but I don't understand what I see. It looks like a garbled version of the PWM signal, which makes no sense, because the tach signal should change in frequency but not in duty cycle (actually I have not read this anywhere but it seems obvious enough).

Where do I have to stick the oscilloscope probe and ground clip to properly read the tach pin signal?
« Last Edit: January 23, 2019, 07:44:01 pm by eamoex »
 
The following users thanked this post: Ian.M

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Trying to build a PWM fan controller
« Reply #17 on: January 23, 2019, 08:45:59 pm »
Try a 4K7 pullup to +5V on the tach pin and see if that cleans up the signal.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Trying to build a PWM fan controller
« Reply #18 on: January 23, 2019, 08:52:18 pm »
Where do I have to stick the oscilloscope probe and ground clip to properly read the tach pin signal?

Intel spec says Tach output is open collector and that the motherboard will have a pull-up to 12V.  So, you can probably connect the output to a 10k resistor connected to 5V.  Probe between ground - the common ground for everything - and the pin.

Ii don't know which schematic you are using.  If you don't have a 5V source, you can probably use 12V and a 10k resistor.  Ground is still ground.
« Last Edit: January 23, 2019, 08:56:15 pm by rstofer »
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9963
  • Country: us
Re: Trying to build a PWM fan controller
« Reply #19 on: January 23, 2019, 09:03:06 pm »
It looks like a garbled version of the PWM signal, which makes no sense, because the tach signal should change in frequency but not in duty cycle (actually I have not read this anywhere but it seems obvious enough).

Where do I have to stick the oscilloscope probe and ground clip to properly read the tach pin signal?

The tach signal, according to the Intel Spec gives 2 pulses per revolution.  Whatever mechanism they use internally, perhaps photoelectric or maybe hall effect, will have an on time proportional to speed.

Without the pull-up resistor, all you're going to see is trash.

 

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Re: Trying to build a PWM fan controller
« Reply #20 on: January 23, 2019, 09:21:54 pm »
Thanks Ian.M and rstofer.

I'm using Ian.M's schematics so I only need 12V (handy!).

Without the pull-up resistor, all you're going to see is trash.

Yeah... struggling a bit to grasp the ideas behind open drain/collector and pull-up/down. I get it when I read about it but then forget what it's about 3 minutes later. I need more practice. By the way, trash very accurately describes what I see. ;D

Will try out the 10K pull-up and report.
« Last Edit: January 23, 2019, 09:24:15 pm by eamoex »
 

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Re: Trying to build a PWM fan controller
« Reply #21 on: January 23, 2019, 09:50:51 pm »
Whatever mechanism they use internally, perhaps photoelectric or maybe hall effect, will have an on time proportional to speed.
When you say "an on time proportional to speed", you mean a linear variation in frequency, not duty cycle, right?
 

Offline aheid

  • Regular Contributor
  • *
  • Posts: 245
  • Country: no
Re: Trying to build a PWM fan controller
« Reply #22 on: January 23, 2019, 10:07:48 pm »
Whatever mechanism they use internally, perhaps photoelectric or maybe hall effect, will have an on time proportional to speed.
When you say "an on time proportional to speed", you mean a linear variation in frequency, not duty cycle, right?

Yes. Emphasis mine:

Quote from: 4-Wire Pulse Width Modulation (PWM) Controlled Fans Specification v1.2
2.3 Tachometer Output Signal
Fan shall provide tachometer output signal with the following characteristics:
Two pulses per revolution
• Open-collector or open-drain type output
• Motherboard will have a pull up to 12V, maximum 13.2V

Note that you're playing the role of the motherboard in this setting, the spec is written from the POV of the fan. You'll pull the line up, and the fan will pulse it low two times per revolution.
 
The following users thanked this post: eamoex

Offline eamoexTopic starter

  • Contributor
  • Posts: 44
  • Country: ch
Re: Trying to build a PWM fan controller
« Reply #23 on: January 24, 2019, 07:26:48 am »
Inserted a 10K pull-up resistor and the tach signal is PERFECT, even cleaner than the 555 one, no overshoot. Fan speed range is almost perfectly in spec, ranging from a perfect 500 to 1950-ish revolutions per minute.

Now this thread is out here for anyone trying to do the same thing!

You guys rock, thank you.  8) :-+

EDIT: when I bought this second hand scope, little did I know about the level of satisfaction that can be brought by watching a green line moving on a 3 inch CRT.
« Last Edit: January 24, 2019, 07:41:07 am by eamoex »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf