Description of Pulse Width Modulation
Last Modified: 2007-11-12
find:

basket

Acroname Robotics PDF webpage version Description of Pulse Width Modulation PDF
 

PWM or Pulse Width Modulation refers to the concept of rapidly pulsing the digital signal of a wire to simulate a varying voltage on the wire.  This method is commonly used for driving motors, heaters, or lights in varying intensities or speeds. 

A few terms are associated with PWM:

  • Period - how long each complete pulse cycle takes
  • Frequency - how often the pulses are generated.  This value is typically specified in Hz (cycles per second). 
  • Duty Cycle - refers to the amount of time in the period that the pulse is active or high.  Duty Cycle is typically specified as a percentage of the full period. 
Image example of duty cycle at 50 percent.

In the above diagram, the duty cycle is shown at 50%.  The pink line shows the average output and you can see that at 50% duty cycle, the output averages is roughly 6V or 50% of full power.  Below is a diagram of what a 25% duty cycle PWM signal looks like:

Image example of 25 percent duty cycle.
Example of a 25 percent duty cycle.
Note

The human ear can hear frequencies up to roughly 20kHz.  When using PWM at frequencies below this, the device being driven can often be heard to buzz.  Higher frequencies avoid this. 

Note

When controlling motors, much greater PWM efficiency is achieved at frequencies above 20-30 kHz.  This is because the current (induction) in the windings of the motors doesn't get a chance to collapse and leave the motor when the OFF-period is short.  The collaps of this induction field takes some time; driving the motors at high PWM frequencies keeps this induction current in the motors at all times, resulting in much higher efficiencies. 

PWM signals may also be used to approximate time-varying analogue signals.  This can be seen in the graph below, where a PWM wave varying from a roughly 25% to a 75% cycle approximates a sinusoidal wave.  The actual output, in blue, does not attempt to perfectly mimic a sine wave, but rather form a set of local averages which act as a sine wave. 

A simple method of obtaining the characteristics of the PWM signal is to split the analogue signal into a number of discrete segments equal to the length of the PWM period.  Then, the PWM cycle for this period can be set equal to the average of the analogue signal over this same interval. 

Accuracy varies with


A PWM used to generate a varying analogue equivalent. Taken from Wikipedia; used under the GPL.
 

Related Links:

Articles: Back-EMF Motion Control Feedback

Moto 1.0 PWM-Encoder Mode Description

Moto 1.0 Module A/D Velocity PID Mode Description

Moto 1.0 Module PWM Mode Description

Moto 1.0 Module Encoder PID Description

Moto 1.0 Encoder Velocity PID Mode Description

BrainStem Moto 1.0 Module PWM A/D Mode Description

Related Examples:

MD03 Motor Driver Interface to Moto Board Example

Generating Low Frequency PWM Signals with a BrainStem GP Example

Creating Four Low Frequency PWM Channels on a Brainstem GP Example

voice: 720-564-0373, email: sales@acroname.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy
© Copyright 1994-2008 Acroname, Inc., Boulder, Colorado. All rights reserved.