Frequency for motor PWM

Thread Starter

sean900911

Joined Jan 28, 2013
35
why Frequency for motor PWM is usually 18kHz to 20kHz range ? can it set to 31khz as well? because arduino micro controller PWM output frequency is fixed. i cannot adjust anything ~ right?
 

Thread Starter

sean900911

Joined Jan 28, 2013
35
There is not that much difference between 18, 20 and 31kHz for PWM.
If 31kHz works for you that's ok.
what will be the effect to the motor or something else by changing the frequency? why we need to set a proper frequency for the PWM? Thank you
 

thatoneguy

Joined Feb 19, 2009
6,359
If more exact information is needed, the datasheet from the motor manufacturer for that motor would be needed. Then some information on PWM frequency response/efficiency is known.

Generally, a frequency above audio range is chosen so the motor doesn't "sing" with the PWM frequency.

The motor won't respond much differently for a change between 20-40kHz, compared to changing the frequency to, say 400kHz.
 

GopherT

Joined Nov 23, 2012
8,009
For a given microprocessor speed, as the Pwm frequency goes higher, you reduce the resolution of Pwm control.

In a PIC running at 4MHz, Then, for 10 bit resolution (1:1024), you must run at a frequency of 1MHz/1024 = 3906 HZ. Normally, 16 or 20MHz crystal is selected for Pwm to get the full Pwm resolution to allow operating above audible frequencies. 4 or 5x 3906 Hz.

Note that most PICs can operate PWM at low resolution and use only 8 or even 7 bits of resolution. It it up to you but a 400kHz PWM frequency will only allow a few bits of resolution, a Microcontroller can only turn on and off in sync with crystal pulses, and, therefore higher frequency pwm limits the possible duty cycle options as an infinite gradient of time options in crystal pulses just don't exist.
 

John P

Joined Oct 14, 2008
2,026
PIC processors can use the crystal frequency directly to drive the PWM timebase, not the 1:4 clock. So if your crystal was 4MHz, you could have 1% resolution at a PWM frequency of 40KHz. But if you wanted the full 10 bits of resolution, you'd have to go down to about 4KHz.

If you really wanted to run at 400KHz, you could still have 2% resolution with a 20MHz crystal, but switching losses mount up with power transistors at high frequencies. Once you're above the audio range, there's no advantage to going faster, so that's where most systems run.
 
Top