PWM (was Re: Anti-lock braking systems...)

Paul E. Campbell pecampbe at
Mon May 29 19:54:35 GMT 1995

> PWM 
> How does one determine the optimum freq. for pwm.  Common sense (as 
> opposed to theory) tells me that I would want the period of the pwm less 
> than the time constant (T.C.) of the mechanical devive.  In the non-famous 
> words of one of my profs., how much is how much? Is an order of magnitude 
> sufficient/too much/too little.  Or should I go with 5 * T.C.  Or am way 
> off on this kind of thinking?  I am planning on using an hc11 and using 
> the output compares, but if my period is so low, I fear that I'll run out 
> of CPU time.  Motorola makes an hc11k4 that has PWM built in that pretty 
> much takes care of itself, however, as many (maybe all of you know) 
> getting these special uP's from motorola isn't always a walk in the 
> park.  Asking other individuals the same question has produced some 
> varied answers from they agree to thinking to "I just picked a freq. and 
> went with that" to "I chose 20 kHz since that way I can't hear the 
> high pitched noise".  Any suggestions/recommendations on the above?

Easy..remember, your pulses are probably square waves or similar in nature.

Those nasty "edges" will be producing "spikes" at harmonics of the fundamental
(minimum period) frequency.

Nyquist sampling theory says that to perfectly emulate anything you want, you
need to be running at least twice your maximum desired frequency.

In practice, at least 3-4 times that is desirable. It greatly depends on how
good your filtering is.

There are also some really nice "magic PWM patterns" if you can do ternary
patterns and higher rates (see the last 3-4 months of Radio-Electronics in
Don Lancaster's articles).

It mostly depends on what you need pulse width modulation for. Theory says
that twice your maximum frequency is an absolute minimum boundary, but
anything higher than this is better as long as it is still easy to work with.

More information about the Diy_efi mailing list