I'm trying to use the FreqMeasure library to measure the shaft speed of a motor, and received a bit of help from the forum earlier pertaining to the circuitry necessary to get a good, clean digital signal. Now I have a nice signal and I am getting readings in the right ballpark. I am now wondering what might be causing about 1-3 Hz of error in the readings.
Here is my setup:
And here is the signal in green after filtering and using a Schmitt trigger (signal in purple is after filtering alone). Low is 0V and high is 3.1V:
My signal (seen on the scope) is really clean, and the scope's frequency reading only varies by about .3 Hz max. So I'm also pretty confident that the motor is keeping its speed constant.
I am using the Serial_Output example, and have tried to increase the number of samples taken before a reading is given. Here is the output (the first number is RPM, the second is Hz):
Interestingly, increasing the number of samples taken before outputting the frequency (from 30 to 100, even to 900) does not make the readings more acccurate.
Should this amount of variation be expected? Is 30Hz too quick for the Teensy? I know basically how the FreqMeasure library works, but not enough to know how this problem could be happening.
Here is my setup:
And here is the signal in green after filtering and using a Schmitt trigger (signal in purple is after filtering alone). Low is 0V and high is 3.1V:
My signal (seen on the scope) is really clean, and the scope's frequency reading only varies by about .3 Hz max. So I'm also pretty confident that the motor is keeping its speed constant.
I am using the Serial_Output example, and have tried to increase the number of samples taken before a reading is given. Here is the output (the first number is RPM, the second is Hz):
Interestingly, increasing the number of samples taken before outputting the frequency (from 30 to 100, even to 900) does not make the readings more acccurate.
Should this amount of variation be expected? Is 30Hz too quick for the Teensy? I know basically how the FreqMeasure library works, but not enough to know how this problem could be happening.