Is a small high pitched noise normal when using pwmout

Natalie Wilkie

New Member
Hi All,

I was hoping I could get some hints from the experts.

I’m fairly new to the picaxe and programming and was hoping I could get some hints on my program (be gentle please).

What I have is a cabinet I would like to place a fan that will turn on when it reaches a certain temperature and increases in speed as the temp rises. I am using an 8M picaxe, a small 12v brushless fan and controlling its speed with the pwmout command. I am also using the ds18b20 temperature sensor.

My program does work and changes speed as the temp increases as it should, but when it is running at any speed other than flat out (fullon) it makes a small high pitched noise. Is this normal??

I have used the pwmout wizard and used 5000hz as the frequency, and input 25%, 50%, 75% and 100% to get my values. Excuse me for sounding blonde, but how do I know what frequency to use?

Any hints or suggestions would be most appreciated.

Cheers
Nat


Initialise:
high 2
pause 5000
low 2
Main:
readtemp 1, b1
debug b1
if b1 <28 then offf
if b1 >34 then fullon
If b1 >=29 and b1 <=31 then gosub Temp_25
If b1 >=32 and b1 <=34 then gosub Temp_50
If b1 >=35 and b1 <=37 then gosub Temp_75
Temp_25:
pwmout 2 , 199, 200
wait 5
goto main
Temp_50:
pwmout 2 , 199, 400
wait 5
goto main
Temp_75:
pwmout 2 , 199, 600
wait 5
goto main
Fullon:
'high 2
pwmout 2 , 199, 800
wait 5
goto main
Offf:
pwmout 2 , 0, 0
goto main
 

Technical

Technical Support
Staff member
The high-pitched noise is related to the frequency, which is probably too high - try experimenting. Hopefully someone else can suggest a good value for your type of fan!
 

BeanieBots

Moderator
Yes, it is normal. However, as Technical suggests, changing frequency might help to bring it into a range that is not too annoying.
The "best" frequency is impossible to tell without knowing the entire electrical characteristics of your motor. Saying that, going signifcantly higher will take it out of audio range, going lower will take down to a similar level as the noise generated by the fan itself. 3Khz is probably the worst to use. It's close to the same pitch a woman screams at. Male ears are tuned to that frequency. It is unlikely that the fan opperation will be too fussy what frequency you use.
 
Last edited:

Dippy

Moderator
BB, you're gonna get a few MCP ties in the post now.

Experiment with different frequencies as some will be better than others as there are some coily things involved here.
 

gengis

New Member
Your noise is normal with low frequency PWM control of motors. Changing the frequency is all you can do with that particular motor.

Brushless fans don't want to see chopped power from PWM drivers - they have sensors inside the motor that sense the position of the rotor and switch magnets on and off to drive them. In other words, they already have built in pwm circuits making them go - then you add another frequency by rapidly switching power on and off. Not the ideal situation. Something called aliasing takes place - your pulse and the motors pulse drift in and out of synchronization. Brushless motors should see a steady DC voltage.

If efficiency isn't an overwhelming concern, you can control a linear regulator from either the pwm signal by integrating the pulses into a voltage level, or using more outputs to switch between voltages - then using that voltage to set the regulator output (or just a transistor - no regulator required). In that case the motor just sees a steady flow of DC and won't sing.

If efficiency is a concern the pwm signal can drive an inductor at some really high frequency to make a "switch mode power supply." The inductor stores energy between excitation pulses and bleeds it off to the motor as steady DC after an appropriate filter.

You can play and pray and hope to get some combination of motor/frequency that works. If the application is critical, do it up right and supply the motor with DC.
 

hippy

Ex-Staff (retired)
A lot depends on the type of fan.

Most PWM control I've seen uses lower frequencies, 20Hz-100Hz, although 3-wire and 4-wire CPU fans are often designed for kHz PWM. At the other extreme I've seen PWM fan controller datasheets recommending 20kHz-30kHz and even higher.

Too low and the fan drones, higher and it whines, above 20kHz and that's beyond normal hearing.
 

gengis

New Member
Are you referring to the newer CPU fans that take a chopped three phase source from the motherboard and continuously adjust fan speed for minimal noise? That's a nice system.

I ruled out anything that fancy because she already has it working on just two wires.

I have four ten inch 48 volt fans I made into a window fan for the bedroom. I tried various schemes to control them with PWM but was disappointed with the results - noise at all frequencies the motors were happy with - move the frequency up and the noise goes away but the heat and current go up in the motors, at $10 each it was an expensive window fan.

I finally settled for phase control of the AC transformer and feeding them with straight adjustable DC.

If it is a cheap fan and a failure won't kill anything expensive, I'd stay with PWM and tweak it to stop the singing - and probably opt for low frequency first, 20 hertz might be acceptable for a fan. A series choke could help some too - I noticed my fans were noisy with the square wave but got a lot quieter when they weren't being hit with a fast rise time.
 

BeanieBots

Moderator
BB, you're gonna get a few MCP ties in the post now.

Experiment with different frequencies as some will be better than others as there are some coily things involved here.
Yep, coily things for sure and they do weired stuff with PWM.
Except...... (and here's my BIG assumption), I took it to be a nominal 12v fan such as those found in PCs which run off 12v DC and have a speed proportional to the voltage shoved into them. (utilising brushless guts)

If my assumption is correct, then there is a big electrolytic and drive electronics between power in and those coily things. Never had any problems driving such fans with PWM myself except a few which needed >70% to get them started before backing off to 25% or some other low duty.

If however, this is an attempt to drive a brushless motor from a PICAXE then,
I'm out of here sharpish to go play with my very expensive brushless motor controller that arrived a few days ago:D

P.S. Looking forward to the MCP ties.;)
 

gengis

New Member
What, pray tell, is an MCP? Microsoft Certified Professional? MCP search in the forum yielded nothing, and I don't buy the M$ reference.
 

BCJKiwi

Senior Member
Support the suggestion by Flooby back in post #5 as it is the simplest to add to the existing setup;
"you can control ....... the pwm signal by integrating the pulses into a voltage level"
This can be as simple as an R/C combination on the pwmout pin.
 

Natalie Wilkie

New Member
Thanks for all your replys.

Just to confirm it is a small cpu fan with 3 wires and I am just using the Positive and negative. I will experiment further with the frequency settings.

Just one more thing, any comments on the program. I know it's pretting simple but would any of you change anything in the program to improve the way I have written it. In other words could it have been written better, I'm always trying to learn new things.

Thanks again.
Nat
 

BeanieBots

Moderator
The program looks fine. More's the point, if it does what you want, then it's perfect:)
Personally, I'd put the "wait 5" that you have in each temperature section, after the label "main:" to save a few lines of code.

Also, have a look at the "select / case" structure.
It's not a particularly efficient way of coding (with a PICAXE) but I think it makes for much more readable code. Just a personal preference. I'm sure others will have a different opinion.
 

BCJKiwi

Senior Member
A refinement that could be added to the program would be to use the temprature directly to vary the pwm. The fan speed would then vary continually rather than in steps.

e.g.
Code:
Main:
wait 5
readtemp 1, b1
if b1 < 20 then b1 = 0
pwmout 2 , 199, b1
endif
goto main
Some math on b1 would be required to make it a suitable value to use in pwmout e.g.;

Code:
Main:
Wait 5
ReadTemp 1, b1
If b1 < 20 Then b1 = 0
w1 = b1 * 20             'word variable required to hold number in excess of 255
Pwmout 2 , 199, w1
Endif
Goto Main
 

Rickharris

Senior Member
As a small observation I find that the small squeak that arises as I do my projects is either caused by an unexpected success, or the reverse, by the release of the magic smoke from some component or other.
 

BeanieBots

Moderator
As a small observation I find that the small squeak that arises as I do my projects is either caused by an unexpected success, or the reverse, by the release of the magic smoke from some component or other.
Or with larger projects, when it starts to move towards you at a rapid rate:eek:
 
Top