Quote:
Originally Posted by tomy
I can get a reading off of it by using the counter class and counter.Get();
|
You seem to be in a sort of no-man's land here with that setup. You should be getting 6 counts per revolution like that. That's not enough counts per second to do any reasonable speed control. On the other hand, it's probably too many counts per second to use 60/counter.GetPeriod() to give you an RPM to control. You can try this method, but I don't think it'll be super stable for your current sensor setup.
What I'd recommend is changing your sensor to this:
http://www.digikey.com/product-detai...330-ND/2075330
Then gluing a small magnet to your wheel with the south pole facing that hall switch. That will work similarly to your current setup, except you'll only get one pulse per revolution, which will make the 60/counter.GetPeriod() RPM value much more stable.
Your other option may be to change out 5 of those screws with flat head screws and countersink the holes so that the you only have one screwhead that will trigger your gear tooth sensor.
Or, if that aluminum hub has a setscrew in it, you might re-orient your sensor to pick up the setscrew as it comes around. Or add a setscrew just for this sensing purpose. The whole idea here is that you only want one pulse per revolution of the wheel.