PWM Fan control - Page 1
Forum section: electronics / general

author: RR
author_rank: Contributor
timestamp: May 28, 2014, 10:23:55 am
content: HiI want to generate 16 PWM to regulate computer fans and though that it would be great way to learn some CPLD/FPGA programing.So what i need-16x PWM (25kHz frequency, 10bit resolution)8x Tach counter (2pulses per rpm so about 0-150Hz)Some interface (SPI or I2C) so i can control it with mcuWill it be difficult for me to do as i have totally no experience with it?How many logic it will need?What chip do you recommend for it?

author: enggricha
author_rank: Newbie
timestamp: May 28, 2014, 02:36:27 pm
content: Depends on too many factors.. but the bigger question is if you are just experimenting to learn shouldn't you start with the hardware you already have?

author: RR
author_rank: Contributor
timestamp: May 28, 2014, 05:28:14 pm
content: I dont have anything yet. As i dont know what to get. Thats why i asking

author: Zbig
author_rank: Frequent Contributor
timestamp: May 28, 2014, 06:55:53 pm
content: Generic brushless DC fans don't like to be PWM'd. You'll get all kind of weirdness like the RPM range between the fan not working at all and running full speed being severely limited, fans emitting strange noises, etc. They're not like brushed DC motors which wouldn't care. There's a control circuitry inside for switching the windings in just the right sequence which needs DC. Either use the fans of the special PWM-controlled type with four wires (DC power, tachometer, PWM control input, GND) or provide actual variable DC.

author: Carrington
author_rank: Super Contributor
timestamp: May 28, 2014, 07:04:35 pm
content: Quote from: Zbig on May 28, 2014, 06:55:53 pmHowever, there are very few PMIC with linear output, for example the MAX6650/1 or the MAX6620. Most of them are PWM-Output.http://www.analog.com/library/analogdialogue/archives/38-02/fan_speed.pdf

author: Dongulus
author_rank: Regular Contributor
timestamp: May 28, 2014, 07:06:55 pm
content: This sounds pretty doable for a newbie in programmable logic. Do you want a development board or are you planning on doing PCB design?Your requirements are pretty easy as far as what a FPGA can provide. You will need at least 28 IO pins which is hardly difficult to find. A PWM running at 25 kHz with 10 bits of resolution means you need a device that can run with a clock rate of at least 25 MHz, which again isn't an issue.The logic you're looking at is 16 10-bit counters for the PWM, 8 X-bit counters for the Tach (bit number depends on what sort of measurement resolution you require), some 10-bit registers to control each PWM output, and some SPI/I2C control logic. All of this should fit into a relatively small FPGA or a CPLD.For a FPGA, I would recommend a Spartan-3. I'm not really experienced at estimating the number of logic gates needed for a design, but my guess is that you wouldn't need any more than 5k. A CPLD is probably much more cost effective for this particular design, but I've never used a CPLD so I won't make any recommendation.

author: Carrington
author_rank: Super Contributor
timestamp: May 28, 2014, 07:18:15 pm
content: A good CPLD KIT:http://www.digikey.com/product-detail/en/LC4256ZE-B-EVN/220-1146-ND/2641947

author: tszaboo
author_rank: Super Contributor
timestamp: May 28, 2014, 08:20:08 pm
content: Im not sure why would you ever need 1024 speed setting on a fan, though. Isn't like 10 of it enough?

author: 128er
author_rank: Regular Contributor
timestamp: May 28, 2014, 10:06:30 pm
content: Quote from: Zbig on May 28, 2014, 06:55:53 pmMaybe a R2R ladder with opamp buffer? Or a PWM signal with lowpass filter and a opamp? Could be fun for a beginner.

author: RR
author_rank: Contributor
timestamp: May 28, 2014, 10:45:08 pm
content: Thats exactly what i have in my head- one pwm signal to pwm control and one for variable DC so i can choose what way i want it to regulateQuote from: NANDBlog on May 28, 2014, 08:20:08 pmIts a part of ATE for testing computer coolers so many different fans with diferent rpm on 12V and if i want later make graphs for thermal resistance depend on RPM,voltage or whatever i need more resolution.

author: thm_w
author_rank: Super Contributor
timestamp: May 28, 2014, 10:49:12 pm
content: Quote from: 128er on May 28, 2014, 10:06:30 pmI had a silent fan controller, which was basically a bunch of buck converters:http://www.techwarelabs.com/reviews/cooling/vantec_nexus/pcb.JPGThis looks like the same idea:http://geoffg.net/fancontroller.htmlbut lower power.

author: Evil Lurker
author_rank: Regular Contributor
timestamp: May 28, 2014, 11:22:39 pm
content: Quote from: Zbig on May 28, 2014, 06:55:53 pmYou are 100% correct. If you are going to PWM most computer fans you need to have full buck or linear regulator for the reasons you mentioned.Most fans nowadays have their own special PWM controller complete with resistor/capacitor timers for setting the duty cycle along with hall element feedback sensors so it knows if the fan is actually turning or not and how fast. A couple of ICs that I have seen are the LB1861 and LB1668 if you want to check out their datasheets. You go throwing a raw pulsed power to one of those ICs and the best way I know to explain what happens is it just totally confuses the hell out of it. Of course if your switching frequency is high enough the effects are somewhat mitigated as there are some ceramic capacitors on the fan PCBs which will absorb a lot of the ripple, but still it isn't good for them.If you want to control a fan you might look into getting one with an onboard NTC thermistor which sets the fan speed based upon ambient temperature flowing through the fan. NTCs are used as part of a voltage divider the fan controller ICs use to set the duty cycle... when the temperature increases the resistance decreases and the feedback voltage changes. If you can find one with an NTC that isn't too hard to get to you can desolder it and use something else to control your fan speed. That something else being a potentiometer which changes your "smart" fan into a "dumb" fan that is easily controlled manually. I'm thinking that along the same lines you can even probably just feed a voltage into it and it would work just like one of those four wire fans that take the special PWM signal. So basically instead of driving the fan with a PWM signal you would be using your microcontroller's digital to analog converter to control your fan speed.Of course you would still have your rotation detect signal coming off the white wire which from what I gather is basically a transistor tied to an internal op-amp or comparator of the fan driver IC. That would make it an open collector so you would need a pull up resistor off the microcontrollers power supply to get a signal. And you would want a nice linear ramp from near stall at ambient temperature to dustbuster at the maximum temperature you want whatever it is your cooling to reach. That would require multiple NTC voltage dividers connected to your microcontroller in each "zone" you want to cool. Then there is the prerequisite buzzer circuit which would indicate fan failure/over temperature conditions and the external LCD that tells you the temperature of each zone and how fast each fan is going (hell if your going to to build the damn thing you might as well go all out)...Oh well I will shut up for now.

author: C
author_rank: Super Contributor
timestamp: May 29, 2014, 05:48:18 pm
content: You might what to think on what those 16 PWM's are going to do to your power source. With all 16 set at 50% your power source will go from 0 load to full load at your 25k rate unless you stager the times of the PWMs.You have 160 bits (16 * 10 ) input.You also have 1024 (10 bits ) states each with 16 bits.So if you had a 1k *16 bit memory chip driven by a counter that cycles through those locations you could compute the best contents for that memory for the power source. To keep power supply ripple lower might mean adding additional transitions to some outputs.In place of a memory chip you could use logic to get close to the same results. In place of 16 locations containing 10 bits think of 10 locations containing 16 bits.C

author: tszaboo
author_rank: Super Contributor
timestamp: May 31, 2014, 09:47:49 am
content: Oh, that makes sense! In that case, I would rather use multiple microcontorllers to achieve the task. I dont think a single, even a Cortex M3 category microcontroller would have 16 PWM channels, but who knows? I've seen 6 of it on motor control families. But it is probably more time efficient to design it one channel way, and put one microcontroller on every channel, connect them on I2C or SPI, and have a backplane connect each. If it is a ATE, than the cost of hardware is not important, you only make so much of it, but having only one channel makes life easier when it comes to programming/ designing. Dont go CPLD way if you haven't used it yet. The learning curve is not nice for new projects.