Shop OBEX P1 Docs P2 Docs Learn Events
How wide is a PWM pulse? — Parallax Forums

How wide is a PWM pulse?

pacmanpacman Posts: 327
edited 2009-06-10 23:36 in General Discussion
People,

I have a question regarding PWM that i can't seem to find a suitable answer for. I looked it up on Wikipedia and am still no wiser...


How wide is a PWM pulse?


If I had a signal that was operating at 1 second high, 1 second low, wouldn't that be PWM? (with a 50% duty cycle)? or how about 4 seconds high, 5 seconds low, or even longer.... wouldn't they all be examples of PWM?


So when someone is 'using PWM' to drive a servo for example - what is the 'accepted' timing of a complete pulse?

Thanks in advance

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
=================
The future is in our hands.
Which way to the future?
=================

Comments

  • W9GFOW9GFO Posts: 4,010
    edited 2009-06-10 14:00
    pacman said...


    So when someone is 'using PWM' to drive a servo for example - what is the 'accepted' timing of a complete pulse?


    Most servos use a 50 hz framerate. Every 20 milliseconds there is a pulse which varies from typically about 1.000 milliseconds to 2.000 milliseconds with 1.500 mS or 1.520 mS being the center. However servos are pretty tolerant, the pulse can come sooner or later than 20 mS and they still work - up to a point.

    Rich H
  • LeonLeon Posts: 7,620
    edited 2009-06-10 14:32
    A PWM pulse can vary from zero width (low all the time) to being high all the time.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • W9GFOW9GFO Posts: 4,010
    edited 2009-06-10 14:47
    I think PWM is not necessarily timed precisely, bad way to put it. In other words, the time high for any single pule can vary yet the average time that it is high would remain the same. Which would not work for controlling servos. Is PWM still the best term to use for the pulses to control a servo?

    Rich H
  • Beau SchwabeBeau Schwabe Posts: 6,572
    edited 2009-06-10 16:59
    pacman,

    There are basically two components to a PWM signal you have a Base Period, and a ratio (or Duty Cycle) of time On verses time Off. The Base Period is usually fixed, but it can vary from Period to Period as long as the On/Off ratio is maintained. As for hobby servos, it is PWM but the Duty Cycle only varies from 5 to 10 percent of the Base Period with the Base Period being fixed at 20ms.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    1073 x 637 - 304K
    PWM.JPG 304.1K
  • skylightskylight Posts: 1,915
    edited 2009-06-10 21:55
    In the UK we call it mark-space ratio
  • LeonLeon Posts: 7,620
    edited 2009-06-10 22:04
    Or duty-cycle.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • pacmanpacman Posts: 327
    edited 2009-06-10 22:15
    thanks ALL for the responses,

    Any particular reason why the 'carrier' frequency 50Hz? (I know it's not really a carrier, but I trust you get the idea)


    Australian mains voltage is a 50Hz cycle - "lets make it that..", it's a round number for "twice the POV frequency of the human eye", "just pick some value at random" ???.

    Not that I'm planning on doing any PWM stuff in the near future, but I would welcome the opportunity to expand my knowledge base...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    =================
    The future is in our hands.
    Which way to the future?
    =================
  • WhitWhit Posts: 4,191
    edited 2009-06-10 23:36
    pacman,

    There is a good discussion of this info (specifically for the Boe-Bot) in the Robotics with the Boe-Bot Book - You can download the pdf here for free - http://www.parallax.com/Portals/0/Downloads/docs/books/edu/Roboticsv2_2.pdf

    It has lots of very useful infomation (as do all Parallax's Education Series books and all are free to download).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
Sign In or Register to comment.