Shop OBEX P1 Docs P2 Docs Learn Events
PWM question — Parallax Forums

PWM question

roverfixerroverfixer Posts: 3
edited 2010-04-20 23:37 in Accessories
I'm using the old Parallax USB Oscilliscope (Item code 28014) and I'm trying to measure a 5V PWM Analog signal (alleged by manufacturer). This signal carries the RPM signal from an engine management control unit to the car's tachometer in the instrument cluster as well as several other control units.

I understand the concept of PWM well enough I thought but when I use the scope, the signal isn't at all what I expect to see. I assumed the duty cycle would be proportional to engine speed but according to the scope, the duty cycle remains constant at 50% regardless of RPM. What happens is that when I rev the engine, the square waves tighten up and squish together. Is this right? Is the system really using the frequency rather than the duty cycle to control RPM?

I've experimented with the rising, falling edge; the 10-50-90% to no avail.

I don't have any data as to what the frequency of the output is.

sorry if I post this to the wrong area and sorry if I'm not asking a very well defined question...
TIA

Comments

  • Shawn LoweShawn Lowe Posts: 635
    edited 2010-04-20 14:41
    Try this:

    http://en.wikipedia.org/wiki/Pulse-width_modulation

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    When all else fails.....procrastinate!
  • roverfixerroverfixer Posts: 3
    edited 2010-04-20 14:50
    Thanks for the reply.· There's good information on this site but I'm still at a loss as to the Oscilliscope settings to see the duty-cycle change.

    TIA
  • electronguyelectronguy Posts: 5
    edited 2010-04-20 16:38
    Hi,

    It sounds to me like what you're seeing is a change in frequency of the waveform, not a change in the duty cycle (like you've already pointed out).

    The reason you see the signal squishing together on the 'scope display is because the horizontal timebase is fixed and when the frequency of the incoming square wave increases, you end up getting more full periods over the given time range. Similarly, if your time base is much shorter than the incoming period of the input, it will appear to be stretched out because you will get fewer and fewer complete periods for the given time range.

    With PWM, you should be able to set the horizontal time range to a value that would allow you to see the complete period of the PWM signal (i.e., you should be able to see the initial L-H, then the H-L of the high period, followed by the low period, then see the start of the next cycle--the L-H transition). Assuming positive PWM (high duty cycle/total period, positive), one would see the "high" time proportionally fill the total "frame" that makes the PWM period. At 0% PWM, you would see 0V continuously, and 100% you would see +5V continuously (or whatever the signal level was).

    It sounds like you've answered your own question re: PWM, but I wanted to help you understand why the signal would seem squished when the frequency increased.

    If you want to measure the frequency, you can either use the cursors or try to have a few periods of the waveform on the 'scope and there is a data field that looks like a square wave with an arrow on the first L-H transition and on the 2nd L-H transition--this contains the frequency of the incoming waveform.

    BTW, are you using the 'scope or the digital inputs? My reference above assumes the 'scope inputs (haven't played with the digital inputs so I don't know what the screens have as measurements).

    Good luck,
    --Scott
  • roverfixerroverfixer Posts: 3
    edited 2010-04-20 23:37
    Scott, After reading you post the third time, I did some moer research and found out today that the signal I'm looking at is "It is a digital signal at 2 pulses per engine revolution." Your info plus this info makes it all clear as a bell. At 3000 RPM, there would be 6000 pulses per minute or 100 pulses per second, etc.

    It is looking for the frequency. Knucklehead-me, I was assuming because it was PWM it was going to be looking for the duty cycle info.

    Thanks for your input.
Sign In or Register to comment.