Author Topic: PWM Resolution  (Read 8645 times)

0 Members and 1 Guest are viewing this topic.

Offline corrado33Topic starter

  • Supreme Robot
  • *****
  • Posts: 611
  • Helpful? 11
PWM Resolution
« on: April 22, 2010, 10:00:10 PM »
I've been reading up on PWM lately, and I just need to get something cleared up.  Every PWM tutorial MENTIONS resolution, but no one gives a true definition of it.  Most of the tutorials ALLUDE to it I believe, but I just wanted to make sure I'm right.  Also, there are zero threads on this.

So, PWM resolution is how many settings you can have.  For example, if you had a DC motor, and you were using 8 bit PWM (TOP=255), then you'd have 256 "speeds" at which the motor could go.  Right?  That's the resolution?  256?  Of course, this would be way to much for a DC motor, cause how would you differentiate between 33/256 and 34/256... (Took that from the PWM tutorial on the site). 

So, if I am correct, then what's the best method for choosing the frequency and resolution of PWM to use... (Of course, you'd choose the TYPE of PWM first, Fast vs. Phase Correct(and Frequency Correct))  For example, should I choose the resolution I want first, then choose the frequency?  Or should I choose the frequency I need, then choose the resolution I want?  Those are really the two most important things in PWM right?  Of course duty cycle is important, but that's going to range from 0 to 100 no matter what frequency or resolution I have. 

Oh, so the resolution defines how finely you can define the duty cycle... I just noticed that.  Is that right?

Oh, I also noticed that I have a QFN AtMega8.  Holy bonkers batman that thing is tiny...  And the really funny thing is.. I don't have a socket for it... ;D

Offline tim_wang

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: PWM Resolution
« Reply #1 on: April 23, 2010, 02:26:00 AM »
I've been reading up on PWM lately, and I just need to get something cleared up.  Every PWM tutorial MENTIONS resolution, but no one gives a true definition of it.  Most of the tutorials ALLUDE to it I believe, but I just wanted to make sure I'm right.  Also, there are zero threads on this.

So, PWM resolution is how many settings you can have.  For example, if you had a DC motor, and you were using 8 bit PWM (TOP=255), then you'd have 256 "speeds" at which the motor could go.  Right?  That's the resolution?  256?  Of course, this would be way to much for a DC motor, cause how would you differentiate between 33/256 and 34/256... (Took that from the PWM tutorial on the site). 

So, if I am correct, then what's the best method for choosing the frequency and resolution of PWM to use... (Of course, you'd choose the TYPE of PWM first, Fast vs. Phase Correct(and Frequency Correct))  For example, should I choose the resolution I want first, then choose the frequency?  Or should I choose the frequency I need, then choose the resolution I want?  Those are really the two most important things in PWM right?  Of course duty cycle is important, but that's going to range from 0 to 100 no matter what frequency or resolution I have. 

Oh, so the resolution defines how finely you can define the duty cycle... I just noticed that.  Is that right?

Oh, I also noticed that I have a QFN AtMega8.  Holy bonkers batman that thing is tiny...  And the really funny thing is.. I don't have a socket for it... ;D

Since a brushed DC motor's speed is proportional to its input voltage difference, you want the highest PWM resolution possible to have finest control over its speed. Suppose you want to control an ideal 12V motor with a no load speed of 6000 RPM or 100 revolutions per second. With an 8 bit PWM, this works out to a resolution of 0.047V per PWM count. That might not sound like much, but that is an increase of 0.392 revolutions per second.

I like to use PWM frequencies above 20kHz, the limit of human hearing range. But if you are not bothered by high frequency humming, you can use lower frequencies.

I have personally not noticed any difference between phase corrected PWM and fast PWM when used to power a brushed DC motor.

 

SMF spam blocked by CleanTalk