TheBachelor
Member
Hello Community,
in my project i want to measure the RPM of a motor with an Inductive Proximity Sensor with 400Hz for further processing.
I am using an Octocoupler to decouple and reduce the noisy electrical signal of the Sensor before processing it to the Teensy 4.1.
The measured output is very strange. With a constant PWM on the motor the measured frequency is given following:
Slow Rotation:
13223.13
137994.48
1034.39
291262.13
460122.69
619834.69
511945.41
397877.97
393700.78
163755.45
7.50
13.82
53.15
8.74
14.17
3.57
62086.09
14.18
310559.00
213068.19
4.30
28.46
281.54
13.00
712.08
360576.94
292968.75
12.97
663716.81
622406.63
563909.75
519031.16
461538.47
539568.38
306122.44
294695.47
265957.44
4.91
14.32
24.44
10.72
Faster Rotation:
9.53
110.51
1.08
85.38
60.99
124.33
110.32
164.87
1.07
90.47
328.13
110.49
250.22
199.73
213.93
230.53
90.76
249.69
249.84
250.01
199.93
250.02
1.08
166.55
142.59
166.11
248.97
1.07
124.37
165.65
175.30
57.36
249.00
66.45
1.08
90.33
165.47
110.32
248.30
248.12
66.13
248.04
198.43
141.80
1.08
124.03
110.35
248.24
63.38
185.90
90.09
61.91
65.93
31.10
1.05
30.37
27.02
Code is just the example code for FreqMeasure-Library:
Input Pin is Pin 22. Ground from the Lower side of the Octocoupler and the Teensy 4.1 are connected.
The sensor and the electric circuit is working. With Pi Pico i can measure the RPM quite well. At this point i think the Teensy 4.1 is causing the problems, but i dont know.
I would be very thankful for some hints or an explanation.
Thanks
in my project i want to measure the RPM of a motor with an Inductive Proximity Sensor with 400Hz for further processing.
I am using an Octocoupler to decouple and reduce the noisy electrical signal of the Sensor before processing it to the Teensy 4.1.
The measured output is very strange. With a constant PWM on the motor the measured frequency is given following:
Slow Rotation:
13223.13
137994.48
1034.39
291262.13
460122.69
619834.69
511945.41
397877.97
393700.78
163755.45
7.50
13.82
53.15
8.74
14.17
3.57
62086.09
14.18
310559.00
213068.19
4.30
28.46
281.54
13.00
712.08
360576.94
292968.75
12.97
663716.81
622406.63
563909.75
519031.16
461538.47
539568.38
306122.44
294695.47
265957.44
4.91
14.32
24.44
10.72
Faster Rotation:
9.53
110.51
1.08
85.38
60.99
124.33
110.32
164.87
1.07
90.47
328.13
110.49
250.22
199.73
213.93
230.53
90.76
249.69
249.84
250.01
199.93
250.02
1.08
166.55
142.59
166.11
248.97
1.07
124.37
165.65
175.30
57.36
249.00
66.45
1.08
90.33
165.47
110.32
248.30
248.12
66.13
248.04
198.43
141.80
1.08
124.03
110.35
248.24
63.38
185.90
90.09
61.91
65.93
31.10
1.05
30.37
27.02
Code is just the example code for FreqMeasure-Library:
Code:
#include <Arduino.h>
#include <FreqMeasure.h>
void setup() {
Serial.begin(57600);
FreqMeasure.begin();
}
double sum=0;
int count=0;
void loop() {
if (FreqMeasure.available()) {
// average several reading together
sum = sum + FreqMeasure.read();
count = count + 1;
if (count > 30) {
float frequency = FreqMeasure.countToFrequency(sum / count);
Serial.println(frequency);
sum = 0;
count = 0;
}
}
}
Input Pin is Pin 22. Ground from the Lower side of the Octocoupler and the Teensy 4.1 are connected.
The sensor and the electric circuit is working. With Pi Pico i can measure the RPM quite well. At this point i think the Teensy 4.1 is causing the problems, but i dont know.
I would be very thankful for some hints or an explanation.
Thanks