The method I mentioned above will give you an almost instantaneous rpm reading, so long as you can figure out how to keep good track of time (that's up to you, I'll help you along, others here will help you along, somebody here might spell it out for you and even write the whole program, but I, for one, am not going to write the complete code for you).
You read one pulse, save the time that pulse happened (read one of the timers), you read the next pulse, save the time the 2nd pulse happened, and subtract the 1st pulse from it. Read the 3rd pulse, subtract the 2nd pulse from it, etc.etc.
After reading a pulse, do the math on it, reciprical functions (i.e. 1 pulse per second = 1 rpm, 2 pulses per second = 2 rpm, etc., less time per pulse = more rpm).
Assuming you use PBP math functions to do the multiplication/division on it, you could easily get a solution within 1/1000 of a second. Use a few look-up tables and a fast PIC, and that number could go down into the microseconds.
As far as controlling whatever you are controlling, you're looking at using a PID control loop to keep the rpm constant under varying loads. It's the same principle with microprocessor controlled voltage regulators, only an electrical load vs. a mechanical load.
And give a hard thought about what you really NEED vs. what YOU want . I can't think of very many things that need instantaneous correction within one us...and I can think of fewer things that can possibly respond inside of a handful of microseconds, much less 10 us.
Bookmarks