Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Counting pulses or measuring pulse width to get RPM/speed?

Status
Not open for further replies.

blapcb

Full Member level 3
Joined
Jan 7, 2007
Messages
188
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,296
Location
Planet earth (most of the time)
Activity points
2,766
calculate rpm from pulse

I am designing a box that is supposed to calculate vehicle speed (from a hell effect sensor, 4 pulses per revolution) and RPM (from tach input). Both are square waves with max frequency of 300Hz or so (in reality much less).

I am wondering what the best way to get the values is (for RPM and speed): to count the pulses or to measure the pulse width. I guess both can be done, but I am wondering what is a more proper/elegant method and also which one would require the least amount of resources from the microcontroller.

One important input is that I would like to know these values at a rate of say 100ms to 1sec (variable).

Perhaps this itself would preclude the counting idea?

Then again, actually if the idea is to measure the pulse width (and derive the values using a formula), would you not need to "count" anyway to measure the pulse width? (i.e. with the internal timer, which I presume should be there).

Hope the question is clear, sorry I am slightly new to this. Thanks for your inputs and ideas.

My the way my micro is running at 6MHz.
 

examples to measure pulse width with 89c2051

Hai

The easiest way is to measure time between pulses and calculate the RPM.

the formula is simple
rpm = (1/time) * 60

comeup with doubts if any

Reagrds
MicroCon
 

measure pulse width

I agree with microcon, measuring the time between between pulses and calculating the RPM is definitely the easiest. However, depending on your applications and the strength of your microcontroller, evaluating RPM = 1/time may not be needed/efficient.

In a past project, in order to determine the speed, I used a pre-generated look-up table of 256 values and essentially did a reverse binary search to find the current speed. Ask me for clarification or for source code.
 

to calculate pulsewidth

microcon555 said:
Hai

The easiest way is to measure time between pulses and calculate the RPM.

the formula is simple
rpm = (1/time) * 60

comeup with doubts if any

Reagrds
MicroCon

Thanks. Yes, I have been reading a lot and this seems the way to go with this type of measurement. But I guess real life is different then lab. So for example, I guess it might be expected that pulses are not quite regular etc. So any type of averaging or other filtration required in this type of application?
 

simple formulas to use in measuring rpm

Hello!

How are you?
You need a frequencymeter.
I did a prog. that count pulses.
I used timer0 to count the seconds, and timer1 to count the pulses.
If you want to know these values at a rate of 100ms to 1sec.
You need to do a rotine that modify the way of timer0 is counting.
And the equation that is calculating the pulses.
It's simple.

Att.
Posser
www.fabioposser.com
 

hello there... i'm interested in counting the pulses.. i want to know the program coding to count it.. i using PIC18 and working in C language.. hope u can help me ...
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top