Supplying PWM signals to the DC motor of an actuator is a common method for adjusting travel speed, however, some cases may result in acoustic noise through motor whining. At some point during the testing phase of your project, you may have noticed your same DC motor may generate motor whining at varying loudness when you connect it to different speed controller devices. This may be due to the different PWM frequencies that were set in each speed controller or Arduino program. In this article, we will cover the pros and cons of adjusting PWM frequency and how it affects motor whining.
Common and Frequently Asked Questions

Below is an overview of the common and frequently asked questions we get to help briefly cover the basics of duty cycle, PWM, and what changes to PWM frequency have what effects on DC motors.
What is Duty Cycle?
What does PWM mean?
What is PWM frequency and how does it affect DC motor performance?
Is it possible to eliminate motor whine entirely, or is some degree of noise to be expected?
Can adjusting the PWM frequency to reduce motor whine have any negative effects on the motor or the overall system performance?
What Causes DC Motors to Whine?

We will be covering the motor’s acoustic noise which is audible to the human ear and not electrical noise. The equivalent circuit of a running DC motor is seen above. Due to back electromotive force (EMF), voltage in the opposite direction to current flow will result from the motor’s coils moving relative to a magnetic field. At rest or low speeds, the brushed DC motor equivalent circuit has little to no back EMF and is like that of a first-order RL circuit seen below.

The motor whining noise we hear is caused by the torque ripple that was generated from current (i) ripple. We also know that the upper cutoff frequency for an RL low pass filter has the formula seen below:
Frequency cutoff = 1 / (2π𝜏)
Where:
𝜏 = L / R
L = inductance (H)
R = Resistance (Ω)
𝜏 = time constant (seconds)
The theoretically ideal PWM frequency will depend on the inductance and resistance of a motor circuit but is expected to be greater than or equal to 5 times that of the cutoff frequency. This higher range of PWM frequency will allow the current running through the DC motor to reach 99.3% (close to 100%) of the maximum current value to avoid current ripple and reduce motor whining.

H-Bridge Power Loss and Heat Dissipation

As a switch transitions from on and off, the voltage and current are nonzero and result in power being dissipated by the switches. An H-bridge has both voltage and current present as they are switching, so a higher switching frequency from increasing PWM frequency means more heat and power dissipated. Installing heat sinks or fans onto motor driver boards that do not already come included with these cooling devices is recommended to avoid damage and ensure proper operation.

Our LC-81 MegaMoto GT H-bridge Arduino Shield has a built-in cooling fan and heatsinks to further reduce overheating, making it ideal for high loads of current. For actuators with lower current draw requirements, we also offer the LC-80 MegaMoto Plus H-bridge for Arduino. Both H-bridge can be used with Arduino microcontrollers and have PWM Frequency ratings that go up to 20kHz for DC voltage.
How to Reduce DC Motor Whine by Adjusting PWM Frequency with Arduino?

The speed of a counter’s clock determines the output signal’s PWM frequency. For our most popular Arduino Uno, the system clock will be divided by a prescaler value to result in the counter's clock. CS02, CS01, and CS00 are the three least significant bits of the Timer/Counter registers which store the prescaler’s 3-bit value.
Set or clear these three least significant bits in the relevant TCCRnB register found in the void setup() segment of your Arduino code. By altering the timer prescalers through coding, the PWM frequency can be adjusted as seen in this reference video.
Arduino PWM Tutorial #1 - How to Change PWM Frequency:
The average human will usually hear sounds between 20 Hz and 20,000 Hz.
Frequency = cycle/time
1 Hz = 1 cycle/second
20 Hz = 1 cycle / (Time)
20 Hz * (Time) = 1 cycle
Time = 1 cycle/ 20 Hz
Time = 0.05 seconds
Time = 50 ms
For a PWM frequency of 20 Hz, one cycle will happen over a period of 50 milliseconds as seen below.

At frequencies above 20 kHz, each cycle becomes shorter than an average human’s reaction time and will result in most individuals not being able to hear any motor whining. The PWM frequency range of 16kHz to 20kHz will generally solve most issues of DC motor whining. This range can be used as a starting point for testing before making gradual adjustments to fine-tune for PWM frequency optimization specifically for your motor behavior and characteristics.
Frequency = cycle/time
20 kHz = 1 cycle / (Time)
20000 Hz * (Time) = 1 cycle
Time = 1 cycle/ 20000 Hz
Time = 0.00005 seconds
Time = 50 µs
For a PWM frequency of 20 kHz, one cycle will happen over a period of 50 microseconds as seen below.

IN SUMMARY
Adjusting PWM frequency can help to minimize the unwanted sound of motor whining, however, we need to be aware of the pros and cons of doing so. It is important to find the suitable PWM frequency that has the best balance of motor driver power loss, heat dissipation, and motor whining which works for you.
We hope you found this as informative and interesting as we did, especially if you were looking to know more about DC motor whining at lower PWM frequency. If you have any queries or wish to discuss our products further, please do not hesitate in reaching out to us! We are experts in what we do and will be happy to assist in any way we can.
sales@progressiveautomations.com | 1-800-676-6123