Main Site Documentation

PWM.SetPulse ... Low signal getting eaten into by high signal?


I had a servo driver coded when I first got my Domino that used PWM.SetPulse() to pump the servo signal.

(in case you don’t know, a servo is pumped with a 20ms low then 1-2ms high pulse wave)

When I write the same driver now, it looks like the 20ms low signal is getting eaten into by the high signal.

Note the attached scope trace. As you can see, the entire pulse is measured at 20ms long, which is the first param in the function. Shouldn’t that param say how long the pulse will stay low, not how long the pulse will last?

Here is the code that sets the pulse:

esc.SetPulse(20000000,  1970 * 1000);

Sorry if this post is a little hard to understand ::). It’s late and I’m tired ???’

EDIT: Oops, forgot to include the image. See, I told you I’m tired!
EDIT 2: I’m gettign a MySQL error when I try to upload the image. I just linked it on tinypic, here:


First parameter is period (total time, not low time), second parameter is high time.


Ah, I see. Thanks Mike. So I guess I should really set it to be the sum of both pulse times.