I am using the Atmel AT32UC3C2512C and looking into the datasheet there are two kinds of PWM modes: Center Aligned and Left Aligned.

I would like to know when one is supposed to use each one of these modes, and pros and cons of them.

up vote 8 down vote accepted

PWM can be symmetric (center aligned) or asymmetric (rising edge / left aligned or falling edge / right aligned):

PWM types (source)

As mentioned in the above referenced Texas Instruments application note:

It has been shown that symmetric PWM signals generate fewer harmonics in the output currents and voltages

  • The advantage of symmetric PWM thus is better utilization of applied power, with less power wasted on undesired harmonics.
  • Disadvantage 1: Slightly more complicated PWM generation mechanism when using timer/counter overflows. It is simply easier to count down and reset-at-zero a timer determining duty cycle to change PWM state, and set (start) the timer based on another timer at the PWM frequency. This gives left aligned PWM.
  • Disadvantage 2: The best resolution available for duty cycle for a symmetric PWM is two clock ticks of the PWM timer/counter, as opposed to 1 clock tick for asymmetric

The first disadvantage may be moot as many modern microcontrollers have symmetric PWM mode built into their PWM modules, so the programmer does not need to do much extra.

For very harmonic-sensitive purposes, such as control of sensitive motors and actuators, the lower harmonic overhead of symmetric PWM is critical. Not so for heating or lighting purposes.


Unconfirmed:

There is one specific situation where apparently symmetric PWM is considered important - though I have not found definitive validation of this premise. This is when PWM is used for driving LEDs for a color graphical "advertorial / entertainment" display such as the big TV-type displays used at railway stations and other public places

It is surmised that the leading or trailing edges of all LEDs on such displays being synchronized causes some people to notice flicker in a moving visual far more than if the edges were to be offset as per intensity of each LED, as happens with symmetric PWM.

  • There can be effects (in both modes, depending on the exact implementation) when you change PWM setting (duty cycle, frequency) while running. Glitches or errors can be introduced, so it's worth reading up about how it's working and pausing to think about how you do it if the output is critical or glitches will be noticeable. – John U Aug 23 '13 at 9:41
  • Thanks for the headsup Jhon, but my MCU already have a built-in protection against PWM glitches (Control Registers double buffering and Write Protections) – mFeinstein Aug 23 '13 at 13:12
  • I believe 'symmetric' is also referred to as 'phase correct', because it doesn't make strange jumps in duty cycle when changing PWM value. – jippie Aug 23 '13 at 16:47
  • That's true @jippie, feel free to edit that in :-) – Anindo Ghosh Aug 23 '13 at 16:51
  • With regard to LED signs, I would expect that having all the lights switch at once (very rapid change in current) could cause a momentary supply-voltage transient. Staggering the switching would alleviate that problem. – supercat Aug 23 '13 at 22:21

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.