
Measuring the rpm of a rotating wheel seems not very difficult but i'm too stupid to do this.
The facts:
Using
pic 16F887
LCD 16x2 characters
an inductive sensor
and a bit of peripherie
i tried more than 5 ways to get a stable output of the rpm of the guide roller but nothing works
i connected the inductive sensor at INT0 Pin (Pin 33)
made an ISR to count the pulses of the sensor while the guide roller turns
okay this seems to work
got the TMR0 at 3276800Hz CPU clock pulse
At a prescaler rate of 1:2 i get an interrupt frequency of 1600Hz so this will give me ticks of 625µsec
so i get 1600 ticks for one second
at the ISR routine i only decrement a counter
at the main routine i wait for 4 turns of the guide roller to stable the output
if the guide roller counts are > than 4 i calculate the rpm
rpm = (1600 ticks * 60sec) / count_of_guide_roller_turns
all this seems to work
but
when i modify the rpm the output at the diaplay shows nonsense
when the speed of the guide roller is low (5-10 turns per second) most time it works but not every time
when i take a higher speed ( >50 turns) the display will show the rpm at 30000 or more
when i step down the speed the display shows no reaction until i reset the pic.
next problem is that the refresh rate of the display is to high
at higher speeds i'm unable to read any number.
Please take my hand and help me to cut this node befor it drives me mad