This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Measuring RPM by signal width

Hello,
I want to measure RPM not my counting pulses every, say, second, but by the width of the pulses that are generated at the space between them (for better resolution). I expect 6 pulses per revolution. Can you offer a way to do it?

Parents
  • Hello,

    There are 2 distinctive methods of measuring timing characteristics like RPM:

    a) Frequency measurement
    b) Period measurement

    Both are covered in any classical book on instrumentation, e.g., K.B.Klaasen's "Electronic measurement and instrumentation":
    www.amazon.com/.../0521477298,
    the book is also available at books.google.com

    What you are indending to do, is performing type #2 of measurements, namely measurement of a period of a signal. You need so called "filling-in frequency" source (a reference pulse train) which can be e.g., a) n-bit timer with resolution enough to fit technical requirements you have for precision, b) an external counter mapped to MCU's I/O, with integrated logic and reference frequency.

    In terms of implementation Tamir gave a good start point. I would add, you may want to use the free-run timer mechanism with no real timer interrupts involved. The only interrupts could be from the signal in interest - you may want either to capture current timer content, or use timer capture mechanism suggested by Al. It is especially beneficial if the timer's discretization is high enough. In implementation, pay attention that the arithmetic should involve a timer overflow/underflow control mechanism since for the low-frequency signals it is normal that the timer may get overflown/underflown.

    Your measurement interval may be incommensurable if compared against arbitrary wide pulse, long enough to not fit the expected range...

    There are extentions of the period measurements at the top of proposed skeleton: e.g., a) to get a smooth output, use e.g., moving average filter; b) to measure a transient process, you have to avoid skipping any adjacent intervals - so the f/w would keep a track of history - a context associated with when signal fronts come relative to timer events and closings of measurement intervals, etc.

    It is good idea to use 2-threshold discriminator for the input signal (cleans the noise effectively) + ensuring the signal is free of glitches.

    Regards,
    Nikolay.

Reply
  • Hello,

    There are 2 distinctive methods of measuring timing characteristics like RPM:

    a) Frequency measurement
    b) Period measurement

    Both are covered in any classical book on instrumentation, e.g., K.B.Klaasen's "Electronic measurement and instrumentation":
    www.amazon.com/.../0521477298,
    the book is also available at books.google.com

    What you are indending to do, is performing type #2 of measurements, namely measurement of a period of a signal. You need so called "filling-in frequency" source (a reference pulse train) which can be e.g., a) n-bit timer with resolution enough to fit technical requirements you have for precision, b) an external counter mapped to MCU's I/O, with integrated logic and reference frequency.

    In terms of implementation Tamir gave a good start point. I would add, you may want to use the free-run timer mechanism with no real timer interrupts involved. The only interrupts could be from the signal in interest - you may want either to capture current timer content, or use timer capture mechanism suggested by Al. It is especially beneficial if the timer's discretization is high enough. In implementation, pay attention that the arithmetic should involve a timer overflow/underflow control mechanism since for the low-frequency signals it is normal that the timer may get overflown/underflown.

    Your measurement interval may be incommensurable if compared against arbitrary wide pulse, long enough to not fit the expected range...

    There are extentions of the period measurements at the top of proposed skeleton: e.g., a) to get a smooth output, use e.g., moving average filter; b) to measure a transient process, you have to avoid skipping any adjacent intervals - so the f/w would keep a track of history - a context associated with when signal fronts come relative to timer events and closings of measurement intervals, etc.

    It is good idea to use 2-threshold discriminator for the input signal (cleans the noise effectively) + ensuring the signal is free of glitches.

    Regards,
    Nikolay.

Children
No data