Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Homework Help: Graphing a digit oscillating signal

  1. Oct 20, 2005 #1
    How would I go about graphing a digtal oscillating signal? I don't quite understand what a pulse width is, or rather how to find it given only the oscillation in Hz and a duty cycle. I understand that the duty cycle is the ratio of the pulse width over the total period, but i don't understand what the pulse width or the period is for a digital signal.
  2. jcsd
  3. Oct 20, 2005 #2


    User Avatar
    Homework Helper

    I'm not sure I fully understand the question. One could view a square wave as a "digital oscillating signal", and surely there's no problem with graphing that? The pulse width in that case would simply be the width of one of the "peaks".

    What kind of signal are you dealing with? And, while this may seem an odd question, why are you graphing it? Wouldn't an oscilloscope be an easier way to handle it?
  4. Oct 20, 2005 #3
    I'll try to help you, but I should start by saying that I've only encountered this is programming a servo motor, so I'm not sure if what I'm about to say will help you much.

    A servo motor is a motor that works by taking a digital oscillating signal and translating that into a certain angle. This can be useful for, say, programing a robotic arm - something that needs a motor with angular position control rather than speed control.

    So when I had to program my chip to control the servo motor, I needed to make it send a digital oscillating signal. The servo motor read in a certain frequency. My chip will send a signal for a while and then start over. I want the time that my chip starts over to be the same as the period (1/frequency). Now that I have the frequency, the thing that tells the motor how much to turn is determined by how long during each period that signal is high. This is called the duty or pulse width. For example, say if I were to keep the signal low all the time, the servo motor would be at 0 degrees. But if I tell the chip to make that signal high during the first half of each period (so the signal would be high-low-high-low etc in equal increments), then the motor would turn 180 degrees. Since the amount of time that I leave the signal high is dependant on the period (half the period for 180 degrees, maybe 3/4 of a period for 270 degrees) we talk about duty cycles in terms of the percent of the whole period.

    Here's a site that might help.
  5. Oct 20, 2005 #4
    for example:
    Simulate the digital signal in microsoft excel:
    the signal oscillates at 100 hz and alternates between 0 and 5 volts with a duty cycle of 50%

    I have no idea why I have to do these sorts of graphs to be quite honest. I was given a lab where I had to construct a Pulse Width Modulation motor speed control. It involved measuring resistance and speed of the robot, then at the end they throw in a couple of random questions asking us to graph a bunch of these signals in excel. I guess it sort of relates because that is how the pwm works, but it wasn't something that was covered. There is no useful book for the class, so I have been searching for the past few days trying to figure this out.

    I think I am figuring it out. For that example a 100 Hz frequency gives me a period of 10 ms, and a pulse width of 5ms since my duty cycle is 50%. My high being 5 volts and my low being 0 volts.

    Once i figured out what everything was this isn't too bad.

    thanks for your help
    Last edited: Oct 20, 2005
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook