Frequency for motor PWM

Discussion in 'General Electronics Chat' started by sean900911, Mar 5, 2013.

  1. sean900911

    Thread Starter Member

    Jan 28, 2013
    35
    0
    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?
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    Use what ever frequency works.
     
    sean900911 likes this.
  3. sean900911

    Thread Starter Member

    Jan 28, 2013
    35
    0
    what did you mean by whatever frequency ?
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,442
    3,361
    There is not that much difference between 18, 20 and 31kHz for PWM.
    If 31kHz works for you that's ok.
     
    sean900911 likes this.
  5. sean900911

    Thread Starter Member

    Jan 28, 2013
    35
    0
    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
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    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.
     
    sean900911 likes this.
  7. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,052
    3,817
    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.
     
  8. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,052
    3,817
  9. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    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.
     
Loading...