Arduino motor controller high pitch noise

Thread Starter

boonxiong

Joined Oct 17, 2011
52
Hi everyone,

I am controllering a brushed dc motor with a dc motor controller that accepts PWM. Immediately when the controller gets a PWM signal from the arduino, the motor gives off a high pitch noise. I tried this with multiple motors and it does the same thing. I googled the issue and it seems that it's related the output of the Arduino pwm frequency...that it's frequency is too low.

Has anyone overcome this or know of a reason why this is happening?

Is it really the arduino or the motor controller?

Thanks
 

MaxHeadRoom

Joined Jul 18, 2013
23,386
What frequency are you currently using?
Picmicro recommend on starting with 5Khz and go up from there.
Are you sure it is not too high?
Max.
 

MaxHeadRoom

Joined Jul 18, 2013
23,386
It appears that board takes an external PWM signal, This will be set up in what ever you have it set for in the Arduino, I do not use this Arduino, but you need to know the nature of the PWM it is outputting .
Max
 

KeithWalker

Joined Jul 10, 2017
1,858
It appears that board takes an external PWM signal, This will be set up in what ever you have it set for in the Arduino, I do not use this Arduino, but you need to know the nature of the PWM it is outputting .
Max
Pin 9 on the Arduino uno is controlled by timer 2 which has a PWM default frequency of 500 Hz. This is the tone that you can hear coming from the motor. That is quite normal.
500 Hz is a rather low frequency for PWM control of a DC motor and can cause odd control effects at multiples of RPM x number of commutator segments. When the edges of the switching pulses synchronise with the edges of the commutator segments passing under the brushes, back EMF can cause excessive sparking. This can make a lot of noise and cause pitting and wear on the commutator and brushes.
The solution is to change the PWM switching frequency of timer 2 to a much higher frequency. If you are not sure how to do that, check the tutorial at the URL below.
Good luck.
https://arduino-info.wikispaces.com/Arduino-PWM-Frequency
 

Thread Starter

boonxiong

Joined Oct 17, 2011
52
I did a whole bunch of combinations with changing the Arduino frequencies, but still getting the high pitch noise. Is there anything out there that can reduce the frequency from an input?

Say.... Arduino outputs 31khz from Pin 3. Is there a standalone circuit out there that can reduce that to say 5khz?
 

KeithWalker

Joined Jul 10, 2017
1,858
Hi Boonxiong,
If you take the switching frequency from any other source, you will get the same results.
The noise is caused by two different things.
The first is the motor windings. If they are not sealed, the changing current going through them can cause the wires to vibrate audibly at the switching frequency.
The second thing is that the switching frequency will modulate the speed of the motor. This again can be quite audible, especially if the bearings are a little loose. This effect is most noticeable in small motors because the armatures don't have a lot of mass.
Usually, at higher switching speeds these effects are not too noticeable but it will depend on the characteristics of the motor. If you are now using a switching speed that has a frequency in cycles per second that is higher than the maximum revs per second times the number of commutator segments, you will have minimized the wear on the brushes and commutator. Your only other choice will be to use a motor that has a sealed armature and good bearings. Even then, you may still get a little bit of audible vibration at the switching frequency.
Good luck with your project.
 
Last edited:

MaxHeadRoom

Joined Jul 18, 2013
23,386
So far my experience using the Pic and DC motors from fractional to 2.5hp has been successful using 5khz PWM freq. with no perceptible noise, the servo drives I use operate with 20Khz PWM.
Max.
 

shteii01

Joined Feb 19, 2010
4,644
It sounds like you need to modify pwm library. Open the library, find where 500 hz is defined, change it to 5000 hz.

I have done similar thing with i2c library. It is not a big deal.

Do document this or save 5000 hz library under different name.
 

KeithWalker

Joined Jul 10, 2017
1,858
MaxHeadRoom, I have a lot of experience with controlling small DC motors using PWM with Arduino, Pic and other microprocessors. I have also designed a number of PWM speed controllers for radio controlled electric flight DC motors. from very small up to 1 HP. The noise is quite common and is caused as I explained above.

shetii01, as you can see above, Boonxiong has already experimented with varying the switching speed without modifying the PWM library. It is not advisable to change libraries as it can lead to undocumented problems in the future.
 

KeithWalker

Joined Jul 10, 2017
1,858
Max, on a note aside:
Your name brought back memories of an electric plane that I designed, built and flew about 30 years ago to test some home grown retracts. I called it "Max" and it had a plastic pilot who resembled your logo:Max.jpg
 

MaxHeadRoom

Joined Jul 18, 2013
23,386
Max, on a note aside:
Your name brought back memories of an electric plane that I designed, built and flew about 30 years ago to test some home grown retracts. I called it "Max" and it had a plastic pilot who resembled your logo:
I assume you have seen or know of the series with Matt Frewer (1984)?
Max.
 

KeithWalker

Joined Jul 10, 2017
1,858
I assume you have seen or know of the series with Matt Frewer (1984)?
Max.

Yes. I found the show intriguing. I have always been a high-tech nerd. I am an electronics engineer and worked for Hewlett Packard as a technical consultant. At that time, where computers were concerned, they were second only to IBM.
Keith.
 
Last edited:

Thread Starter

boonxiong

Joined Oct 17, 2011
52
Here is a video of the noise in a zip file. I'm not sure if it's the physical winding or not, but without the pwm signal it runs just fine.
** Please ignore the momentary power loss **
 

Attachments

KeithWalker

Joined Jul 10, 2017
1,858
It certainly is noisy but it is about what I would expect with a small, low cost motor at 500Hz. That frequency is far too low. Did you try it at higher frequencies, e.g. 2KHz and up? You can tell when you change the switching frequency successfully because the audible tone will change.
 
Top