Pulse measurement, timing
jeffjohnvol
Posts: 197
I have a need to count pulses and the time in between. I would be using the falling edge of the pulse, and plan on using the BS2px stamp. I don't care about the width of each pulse, just the time in between falling edges.
I don't believe I can't use the PULSIN command because the pulse width may be quite long, especially if the rotary position magnet finishes up on the sensor. I understand that the PULSIN is limited to 0.13 seconds maximum pulse width, and as the rotation starts slow I could miss several pulses.
I was considering putting a PAUSE 10 (or PAUSE 9) in the loop with counters to 0.01 second each loop. Then by checking the state, watch for a trailing edge. Testing on the PC should reveal how long each loop's processing takes and I may need to adjust my PAUSE value.
Does anyone see an issue with this, or is there a better way?
Thanks.
Jeff
I don't believe I can't use the PULSIN command because the pulse width may be quite long, especially if the rotary position magnet finishes up on the sensor. I understand that the PULSIN is limited to 0.13 seconds maximum pulse width, and as the rotation starts slow I could miss several pulses.
I was considering putting a PAUSE 10 (or PAUSE 9) in the loop with counters to 0.01 second each loop. Then by checking the state, watch for a trailing edge. Testing on the PC should reveal how long each loop's processing takes and I may need to adjust my PAUSE value.
Does anyone see an issue with this, or is there a better way?
Thanks.
Jeff
Comments
Using COUNT in this way provides a number of interesting options. Calculating RPM, determine when a certain· or steady state RPM is reached (you said the pulses might come in slowly at first)·, has rotation·gone above/below·a certain RPM or stopped.
Post Edited (Duffer) : 4/18/2007 11:33:34 PM GMT