DC12V fan controlled by PWM => Noise

Hi,

I am controlling a 12V little fan BY PWM in a nano, with this HW configuration:

The PWM signal is generated by pin D6, and I managed the PWM frecuency from 1024 prescaler to 1. In all frecuency values I can listen a noise, depending the frecuency the noise is like a whistle (1khz and higher) or like a "clap-clap" (less than 1khz).

At the moment the best performance for D6 pin is with a 60hz PWM (I still can listen a "clap-clap" little noise). I need to test at 30hz with another pin/timer. I also need to test a 30Khz PWM.

I have read that a CAP should help to eliminate the audible noise...

  • Where I should put the CAP, in the load side (Between FAN pins) , at the mosfets gate or at the optocouplers base?

  • Does anyone know if exists any another techniques that can help me to avoid the noise?

Thanks in advance!!

There could be a few reasons for this.
Most probable is the PWM frequency.

There are ways to overcome this.
Personally I used the timers which can be changed.
See lines 35 to 38 in this project

1 Like

Great It looks that I need, but I dont understand anything. Please could you explain me each line 35 to 38 to can apply It to my project?

Thanks!

Those lines ALTER the timer frequency on almost all the AVR based boards
See both THIS ARTICLE
And THIS ONE

Note that you can also use libraries to accomplish this but they are not always needed.

1 Like

Hi,
What is the fan you are trying to control?
Is it a BLDC fan?
Can you post its model/part number or link to data/spacs?

Thanks.. Tom... :smiley: :+1: :coffee: :australia:

Hi @TomGeorge, it´s this one:

And I am playing with the timer prescaler to change the PWM frecuency, in this way:

Hi,
That is a BLDC fan, and some do not like a PWM power supply, or even a variable supply.
They are designed for continuous speed and supply.

Google;

How does a BLDC fan work?

To properly control one of these fans you need a four wire fan, the wires are;
Power pair (2)
Tacho output (1)
Speed signal input. (1)

Tom... :smiley: :+1: :coffee: :australia:

1 Like

@TomGeorge , thanks a lot! So the problem is the fan technology, I didn´t know about these "inteligent" low consumption fans.

Please, anyone can explain me what means:

TCCR0A = _BV(COM0A1) | _BV(COM0B1) | _BV(WGM01) | _BV(WGM00); // Used to reduce motor harmonics
TCCR0B = _BV(CS01); // Used to reduce motor harmonics from PWM
OCR0A = 180;        // Used to reduce motor harmonics from PWM
OCR0B = 180;        // Used to reduce motor harmonics from PWM

As I read from @Ballscrewbob #4 2nd link:

but I can´t see a clear relation between code and the link information, I don´t understand the low programing code

Here is how I am doing to set PWM frecuency for timer0 (I can´t use other pins because I am using other libraries like IRremote and AltSoftwareSerial), I also don´t understand very well how this works, it´s very low programming for me:

  TCCR0B = TCCR0B & 0b11111000 | 0b101; //Timer 0 (pin 5&6) with 1024 prescaler at 8MHz = 30,5Hz 
                                        // 31KHz   =>  0b001; (preescaler = 1)
                                        // 3,9KHz  =>  0b010; (preescaler = 8)
                                        // 488Hz   =>  0b011; (preescaler = 64)
                                        // 122Hz   =>  0b100; (preescaler = 256)
                                        // 30,5Hz  =>  0b101; (preescaler = 1024)

Then I set the dutty cycle, with analogwrite (pin,dutty-cycle) command.

analogwrite (5,190);

Can I configure more frecuency values that the commented for the different prescaler values? How?

Or this is the most that can be done for controlling PWM frecuency vs PWM noise for motor/fan speed control aplications?

Thanks again!

There are TWO types of BLDC motor.
For all intents and purposes the one you are using can be treated as a regular DC motor in many regards.
One caveat is that they may exhibit noise unless the pwm timing is within acceptable parameters.

This is where the changes to the timer come in useful.
However that change can also come with a small cost in that the use of a standard DELAY command could be shorter or longer than you might expect.
You can either account for that or use MILLIS instead.

The project I linked you to treats computer fans as DC motors and does not need a library.
It has been running here for a few years now unchanged at all in terms of hardware OR software.

Think of the timer as a regular household clock but with an option to select how long the seconds as we know them actually take to complete. Such clocks actually do exist BTW.

Most MCU's have the ability at a lower level to change some parameters and this is just a small example of that. I had no idea what I was doing when I needed to change the harmonic noise on my fans, with each being slightly different due to manufacturer etc.. This was a learning curve for me but by playing with the timers I was able to completely eliminate the noise.
Not only that I learned a new skill with Arduino.

If you want I can move this topic to PROGRAMMING where you may get a better explanation ?

If you want I can move this topic to PROGRAMMING where you may get a better explanation ?

Yes, please. I´ll like to know what I am doing exactly in the timer registres, I know each timer has two registers but I am not able to see the relation between my code and this registers.

Thanks!

@TomGeorge finally I test with another fan type (big fans) and it works perfect. I think that the problem was the little fan, this little fan, with low speed emits a noise, clap-clap, and I think it was produced because the fan bearings or some similar mechanical noise. With the big fans, all works as expected.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.