8
\$\begingroup\$

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.

\$\endgroup\$

1 Answer 1

10
\$\begingroup\$

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.

\$\endgroup\$
14
  • \$\begingroup\$ 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. \$\endgroup\$
    – John U
    Aug 23, 2013 at 9:41
  • \$\begingroup\$ Thanks for the headsup Jhon, but my MCU already have a built-in protection against PWM glitches (Control Registers double buffering and Write Protections) \$\endgroup\$
    – mFeinstein
    Aug 23, 2013 at 13:12
  • \$\begingroup\$ I believe 'symmetric' is also referred to as 'phase correct', because it doesn't make strange jumps in duty cycle when changing PWM value. \$\endgroup\$
    – jippie
    Aug 23, 2013 at 16:47
  • \$\begingroup\$ That's true @jippie, feel free to edit that in :-) \$\endgroup\$ Aug 23, 2013 at 16:51
  • 1
    \$\begingroup\$ 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. \$\endgroup\$
    – supercat
    Aug 23, 2013 at 22:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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