Shop OBEX P1 Docs P2 Docs Learn Events
RPM Gage??? — Parallax Forums

RPM Gage???

krazyideaskrazyideas Posts: 119
edited 2008-12-06 03:04 in Propeller 1
Hello

I'm building an RPM gage.·
I have a intervol that I know is 10 degrees of rotation.
I think that the following program will work.

I reset the PHSA to zero each loop,· I think I have CTRA set to count at the same speed as the system clock.
Then I Moniter pin 21 and get the PHSA·value when·pin 21 goes high and·then again when pin 21 goes low.
Then I subtract the two PHSA values to get the amount of time it took for 10 degrees of rotation ·to pass.
Then I multiply that by 36 to get the time it takes for one rotation, Then I divide·that by clkfreq (Which·I think is·the # of Clock ticks in one second) then multiply that by 60 to get Rotations Per Minute.

I think that·will work??

Any help or thoughts would wonderful.
I got help for this same questions a couple months ago but I lost it some how. So sorry to ask the same question twice.
Thanks take care all


PUB RPM

CTRA := %10101 << 26

repeat
·
· PHSA := 0
·
· waitpeq (| < ·21, | < 21, 0)
· measure1 := PHSA
· waitpne (| < 21, | < 21, 0)
· measure2 := PHSA
··RPM := (((measure2 - measure1) * 36) / clkfreq) * 60)

·

Comments

Sign In or Register to comment.