In school I work on a project. I'm about to make a inertiadyno for model motors, running att speeds up to 30000PRM. thus I have to know the time for every rotation of the "inertiawheel" during the acceleration of the motor and not lose any signals. I use a reflex detector to get a puls from status low to high and read it on pin2 at my arduino atmega328.
The problem is that when I run the test of the motor and plot the graph (Watt over rpm) in my computer after the run the line sort of jumps up very high here and there and sometimes goes to zero. I think im losing information somewhere, maybe in my logger or on to way to my computer. (I count the time for the first rotation and send it directly to the computer, then the second rotation and send that time to the computer and so on..)
(I havent my code here right now)
I ques my code is to simple to do this at those high RPM:s, so i would like to ask someone to give me a idé of how to write a good script that can handle this high rpms and not lose any data.