using a teensy to "correct" a hall effect sensor output frequency

Status
Not open for further replies.

mikeleslie

Active member
Hi
I have a situation that seems simple to me but I just can’t seem to come up with an approach to properly deal with it. The situation is this:
I have a hall effect sensor with an output frequency in the 1 to 120 Hz range. There are some mechanical issues which require me to make “adjustments” to the output frequency.
So basically I need to have 2 concurrent processes running, one which tracks the input frequency, and one which generates a “corrected” output frequency.
I thought of 2 approaches:
1) setting it up as a PWM output and just change the frequency a couple of times a second, but that looks fairly disruptive to the system. In this case I could just set up the output and then whenever I need to, just change the frequency. Does this seem reasonable?
2) Linking 2 devices together, one to read the sensor and calculate the corrections, the other to read the required frequency and maintain the proper output signal. frequency
I know there must be a better way, any thoughts would be much appreciated. All of my projects have been with the Teensy 3.x.
 
Is the sensor digital or analog output?

You should be able to calculate and output the corrected signal whenever it's needed. For output stability you may want some kind of hysteresis algorithm on your corrected signal.
 
My concern was maintaining a steady output while processing the input and not missing the pulse.
Last night I merged frequencytimer2 and frequencymeasure together into one sketch, and much to my surprise it just worked! no issues.
I know the pulse profile is wrong (the high section is too long) but my guess is that the device reading it focuses on the (high/low or low/high) transition to determine duration and doesn't much care about how long the signal stays high, some testing will be required.

the device just reads the pulses, so it's digital.
 
Status
Not open for further replies.
Back
Top