It is currently Wed Aug 20, 2014 12:43 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: Custom microcontroller fan controller - work in progress
PostPosted: Mon Nov 16, 2009 5:23 am 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
Ever since finding out that my Kaze Master have trouble delivering no where near its advertised 1A load I have had the idea of building my own fan controller. Since my degree is in embedded systems naturally it would be something micro-controller based.

So here's my starting point:
Image
Micro: ATMEL XMEGA128A1, this beauty has enough PWM channels to independently control up to 24 fans all at once. With enough ADC channels for 16 temp probs. On top of it it has enough processing power to run a RTOS (real time operating system).

Key specs: IO ports MAX current draw 20mA, PWM frequency from 448Hz all the way up to 125KHz.

The road block is how to let this thing control the fans. Given that this is SPCR we all know the issue with straight PWM voltage control, hence I would like to get a PWM to DC control circuit running.

A few PWM to DC methods have already been discussed is the PWM to Voltage bridge thread arriving at the conclusion that a buck converter is the best way to go. Trouble is I know next to nothing about how to fine tune one, so I would like to enlist the help of fellow SPCR fanatics.

Fan power goals:
-Gentle Typhoon to Delta PFC1212DE (0.015A to 4A)
-No more than 1V drop from the control circuits, range should be 5~11V.

To start with:
From Mr Evil
Image

With the mosfets we get a Id of at least 6A continuous for safety margin of 50%. The other piece of the puzzle is the LC values of the buck converter itself.

So, any ideas?

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 16, 2009 6:51 am 
Offline

Joined: Sat Jan 13, 2007 10:16 am
Posts: 56
Location: Indiana, U.S.A.
Greetings Hypernova
The 2 amp limitation is because of the three pin fan connector {reference Molex 22-01-3037 and 80-50-0114}, with tin over brass contacts 2.5 amps is the max. current handling. Reviewing your project goals, "No more than 1V drop from the control circuits, range should be 5~11V", using a PNP pass transistor could provide 11.7 volts with 12 volt VCC, however the quiescent current loss would be larger than using a MOSFET. With a MOSFET Rds(on) is the major factor affecting max. output voltage. Exploring the buck converter, you may find this link interesting: Power Electronics 661PET23.pdf

You did not say if this would be a multichannel controller or what the target board size is. Using a MOSFET driver with a charge pump, an N-channel could be used as a high side switch, but I don't know how complex you want the circuit to be.
_______
trident


Last edited by trident on Mon Nov 16, 2009 9:44 am, edited 2 times in total.

Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 16, 2009 8:41 am 
Offline

Joined: Fri Jan 20, 2006 10:12 am
Posts: 545
Location: UK
Glancing at the PDF that trident linked to, I realized that you need to use a high-side switch instead of the low-side switch that I put in that diagram above, otherwise the tachometer won't work. Like this:
Image
You'll need an N-channel MOSFET to drive the P-channel one because a microcontroller can't output 12V, or you could use one of those monolithic high-side drivers that you linked to in the other thread (which would probably be a good idea because they have current limits and stuff).

Note that D1 needs to be able to handle the full load current. A Schottky diode is best for efficiency, but it doesn't really matter.

The power dissipated in the MOSFET is approximately Iload * Rdson * duty. This will be very small if you use a MOSFET with low Rdson.

I'll try and find some resources on how to choose L and C. I'm not an expert on switch-mode circuits so I couldn't explain it offhand. The higher the switching frequency you use, the smaller L and C you need, but efficiency will suffer.

Since you're using a uC, you might be interested in the experimental closed-loop fan controller I made a couple of years ago.

_________________
https://mrevil.asvachin.eu/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 16, 2009 10:46 am 
Offline

Joined: Fri Jan 20, 2006 10:12 am
Posts: 545
Location: UK
I had a quick search and found this page: http://powerelectronics.com/power_systems/dc_dc_converters/power_buckconverter_design_demystified/
It gives a pretty good explanation of how to choose component values. Fortunately the criteria are relaxed for a fan controller because it doesn't matter much if the ripple current is high, and the load is fixed (users should only connect/disconnect fans when the power is off).

I also found an interesting application note which shows how you can measure the speed of two-pin fans. It's not really related, but I thought it was ingenious. Fig.9 shows a buck regulator too, but a bit different because it uses a bootstrapped NPN transistor as a high-side switch (it's more complicated that way, but useful if you can't get a PNP transistor [or P-channel for MOSFETs]).

_________________
https://mrevil.asvachin.eu/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 16, 2009 2:14 pm 
Offline

Joined: Sat Jan 13, 2007 10:16 am
Posts: 56
Location: Indiana, U.S.A.
Useful information about controlling fan speed.
Maxim AN1784.pdf

I do not wish to start an argument or claim there is only one best way to go. I offer this as another option. There are many ways to convert PWM to linear voltage, your design goals determine the best method for your application. If you want high efficiency, go with the buck converter. This is a step down charge pump. It is not as efficient as a buck converter, but as with a buck converter power dissipation in the output transistor is low because of switch-mode operation. In addition, fewer components are required and the board layout is also less critical than using multiple buck converters. Regardless of which type of switcher you decide on, select an output capacitor that will handle the ripple current without overheating.
_______
trident
Image


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 16, 2009 4:54 pm 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
Would the output cap ripple current the same as the input or is it the deltaI ripple of the inductor? The powerelectronics.com guide made no mention of this.

So far I have picked out the inductor, input cap and diode.

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 08, 2009 3:11 am 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
Working 7~4:30 is sapping the life out of me...

Anyway some overdue updates:

-Changed PWM freq to 64KHz, a divider of 500 from the XMEGA's 32MHz.
-Don't have a 4A load but so using a 2.9A Delta TFB1212GHE for now for max load.
Image

Current results:
-Voltage drops at 2.9A is about 0.39V, as far as I can tell most of it is coming from the SPP18P06P MOSFET which has a RDs or 0.13 Ohm. Going to try SPP80P06P which has 0.023 Ohm later.
-Heat is good, the mosfet is warm to the touch but as it is I don't think heat sinks are necessary.
-Control is so far so good, on the right screen you can see a realterm window where I tell the mc what frequency and duty cycle to send to the SMPS through FTDI USB serial converters. I can slow the TFB1212GHE down to about 4.7V below which it has a brown out circuit which shut itself down.

That's it for now for the power circuit, next going to start working out getting the EA DIP204-4HNLED 4x80 LCD display running. After that its the fan rpm readings and PCBs.

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 10, 2009 10:46 am 
Offline

Joined: Fri Jan 20, 2006 10:12 am
Posts: 545
Location: UK
Sounds good so far. I've used those FTDI devices before; they're so very useful.

_________________
https://mrevil.asvachin.eu/


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 23, 2010 3:51 pm 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
Well... that went a long time without updates huh?

Long story short I moved to Australia and things got delayed "a bit"

But I'm picking up the project again.

Off to PCB fab house this goes, well see how it turns out in a few weeks.
Image

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2010 11:43 pm 
Offline

Joined: Wed Jul 28, 2010 10:16 pm
Posts: 4
Location: Australia
Hypernova, if you have moved out to Australia you can just buy this kit for $48 from altronics,
http://www.altronics.com.au/index.asp?a ... m&id=K6120
Intelligent Fan Controller Kit

Its a kit you build yourself, can control 8 fans from 4 temp sensors.
Setup is via USB and the software is open source.
Interestingly it uses buck converters to drive the fans.

Creators website http://members.iinet.net.au/~geoffg/fancontroller.html

I’ve built one and use it in my pc, very easy - works well.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 30, 2010 4:30 pm 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
devildevil wrote:
Hypernova, if you have moved out to Australia you can just buy this kit for $48 from altronics,
http://www.altronics.com.au/index.asp?a ... m&id=K6120
Intelligent Fan Controller Kit

Its a kit you build yourself, can control 8 fans from 4 temp sensors.
Setup is via USB and the software is open source.
Interestingly it uses buck converters to drive the fans.

Creators website http://members.iinet.net.au/~geoffg/fancontroller.html

I’ve built one and use it in my pc, very easy - works well.


Mine's using bucks too, you can see from the PCB layout. I also aiming for higher power using discrete components. I'm also aiming for each fan to be controllable through PWM and voltage. RPM sensing I might also try to do it through sensing of the ripples.

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 12, 2010 5:58 pm 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
The PCB have arrived! Nicely shrink wrapped, PCBwing also threw in two 5% coupons valid for a month although I probably won't get to use them that soon.

Parts are still on their way from digikey though. So can't move on to assembly yet.
Image

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Sun Nov 21, 2010 4:28 am 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
Yeah not much updates, had to finish my Master's thesis first.

Anyway here what the board looks like in the PCB design software:
Image

Compare to the physical version: much less glamorous
Image

Here's a little result on the control scheme:
The fan is a Delta PFC-1212DE, The red line is the target 1700RPM and blue is the actual, green is on another y-axis and is the duty cycle of the buck converter.
Image

I plan on having five modes for the fan speed control:
1) Direct voltage where you punch in the desired voltage and it will stay there.
2) Direct PWM where you set the PWM duty for 4wire fans.
3) RPM through voltage where you set the desired rpm and the controller will start tweaking the voltages till it gets there.
4) RPM through voltage direct where you set the desired rpm and the controller will tweak duty cycle of the buck converter directly to reach the target.
5) RPM through PWM where you set the desired rpm and the controller will tweak duty cycle of the 4wire PWM to reach the target.

Haven't gotten around to the thermal part yet, plan is a fuzzy logic based rule set.

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Thu Dec 09, 2010 5:31 pm 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
The LCD and 5.25" sled to fit into the PC has arrived.

The menu interface is going to take a while

Image

Image

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Thu Dec 09, 2010 8:40 pm 
Offline
Site Admin

Joined: Sun Aug 11, 2002 3:26 pm
Posts: 11828
Location: Vancouver, BC, Canada
Quite the project, Hypernova, I'm sure you're having fun w/ it. Being a mild electronics junkie myself, I can understand. 8)

But I have to ask -- what kind of PC system needs 8 independently controlled fans?

_________________
Mike Chin,
Editor/Publisher, SPCR
Support SPCR with your donations!


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Thu Dec 09, 2010 8:59 pm 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
MikeC wrote:
Quite the project, Hypernova, I'm sure you're having fun w/ it. Being a mild electronics junkie myself, I can understand. 8)

But I have to ask -- what kind of PC system needs 8 independently controlled fans?


Future proofing, in the future I might even redirect my graphic cards fan to the controller. It's always good to have spare channels.

It has a serial port connection to the PC so I would be able to tie it into Rivatuner and speedfan once I write the code for them. The temp control won't be limited to the readings from the 8 temperature probes.

This project is part hobby part practice to keep my mind sharp, I'm getting my Master of Engineering Science next Wednesday so it would make a great show piece when I go on job interviews too.

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Fri Dec 10, 2010 8:08 am 
Offline

Joined: Fri Jan 20, 2006 10:12 am
Posts: 545
Location: UK
Congratulations on getting it all together in such a professional looking package.

_________________
https://mrevil.asvachin.eu/


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Fri Dec 10, 2010 8:21 am 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
Mr Evil wrote:
Congratulations on getting it all together in such a professional looking package.


Well I didn't really make the package, only the controller PCB. The LCD and the 5.25" sled are off-the-shelf from Crystalfontz. The LCD module is the CFA635-YYE-KL. I had to mod the sled a bit with a dremel but that was it.

There's plenty of mistakes with the PCB that was only caught only after I started coding. While they were all fixable in software and a few wires I'll do a 2nd version later on.

Once the whole thing actually becomes marginally presentable anyone who is interested can commission one, though I doubt anyone would.

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Fri Apr 19, 2013 12:40 am 
Offline

Joined: Fri Apr 19, 2013 12:38 am
Posts: 1
What ever became of this project? I've been looking to do something like this and would like to see what the final result was after 2 years lol


Top
 Profile  
 
 Post subject: Re: Custom microcontroller fan controller - work in progress
PostPosted: Sun Apr 21, 2013 5:54 am 
Offline

Joined: Sat May 31, 2008 2:33 am
Posts: 124
Location: Australia
Hypernova wrote:
Mr Evil wrote:
Congratulations on getting it all together in such a professional looking package.


Well I didn't really make the package, only the controller PCB. The LCD and the 5.25" sled are off-the-shelf from Crystalfontz. The LCD module is the CFA635-YYE-KL. I had to mod the sled a bit with a dremel but that was it.

There's plenty of mistakes with the PCB that was only caught only after I started coding. While they were all fixable in software and a few wires I'll do a 2nd version later on.

Once the whole thing actually becomes marginally presentable anyone who is interested can commission one, though I doubt anyone would.


I got the code to the point where I can get speed/voltage/PWM/raw buck PWM mode all working as well as the thermister interface, after that I didn't do much more as I graduated and got a job which took up most of my time so I just used it as is.

It's been a great learning project, and is pretty much the golden ticket when ever I bring it to interviews. The ratio of times that I got a job offer with that thing shown to the interviewer vs no job offer is 4:0 :P.

_________________
Hungry? How about a TRIPLE FAN SANDWICH?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group