Electronics > Beginners

A/C pulse polarity detection?

(1/2) > >>

Tom18991:
I'm working with a variable reluctance sensor to measure RPMs.  The sensor produces an ac pulse in the shape shown below, once per revolution, so let's say about 5 to 10 pulses per second for this purpose. Each pulse is maybe 2 milliseconds in length total.  I am using a cool little chip, the MAX9926, to take that raw signal and turn it into square digital pulses that I can use to drive an interrupt on a microcontroller.  All of that is working great, no problem.  Here is my challenge:  depending on the direction of the wheel (and/or the polarity of the wiring), the pulse will either start on the upslope (as shown on top) or will start on the downslope (as shown on the bottom).  The MAX9926 will trigger the same either way it seems, so I am trying to think of an approach that will let me detect whether it is starting on the upslope or downslope.  The raw pulse can spike with much higher voltage than is safe for an interrupt pin on a microcontroller, so it seems to me I need some circuitry that will go high or low depending on the pulse, but I'm wondering if there is a traditional way to do this and/or if anyone has suggestions?  Thanks!

soldar:
I am not sure I totally understand but a couple Schmit triggers could each detect the up and the down and the order will tell you the direction of rotation if that is what you are trying to determine.

Tom18991:
Thanks.  What I'm actually concerned about is detecting when the sensor is wired backwards, which would have the same effect as reversing the direction of the wheel.  The raw AC signal probably spikes too much voltage for a typical Schmitt trigger, but I was thinking along the same lines by using an additional MAX9926 (which is kind of a fancy Schmitt trigger for these sensors).  That chip has two input channels, so if I reversed the polarity of the sensor leads on those two channels, I could use a microcontroller to see which triggers first.  I was hoping for a way that didn't consume processor power, so open to suggestions on some kind of latching gate that would signal which channel triggered first?

macboy:

--- Quote from: Tom18991 on March 06, 2019, 11:14:39 pm ---Thanks.  What I'm actually concerned about is detecting when the sensor is wired backwards, which would have the same effect as reversing the direction of the wheel.  The raw AC signal probably spikes too much voltage for a typical Schmitt trigger, but I was thinking along the same lines by using an additional MAX9926 (which is kind of a fancy Schmitt trigger for these sensors).  That chip has two input channels, so if I reversed the polarity of the sensor leads on those two channels, I could use a microcontroller to see which triggers first.  I was hoping for a way that didn't consume processor power, so open to suggestions on some kind of latching gate that would signal which channel triggered first?

--- End quote ---
The signal already drives an interrupt. So in the ISR just check which signal is active. If the pulse is as slow (relatively speaking) as you suggest, the ISR can certainly catch the one causing the interrupt before the other fires.  The ISR can either intelligently reject the second trigger when it arrives shortly thereafter, or you could use a timer to re-arm the interrupt input, or come up with something else.

Tom18991:
Not sure I follow that sorry. The MAX9926 produces a single square 5v pulse when it is triggered, and it only triggers once on the rising edge between 0 and 5v.  So the interrupt on the microcontroller will only know that it's been triggered, not whether it started on the upslope or downslope.  If I used both channels of the MAX9926, and triggered them both off the same sensor but with the polarity reversed, and fed each channel to a separate interrupt, then the interrupt that triggers first would be the polarity with the upslope first.  Is that what you were suggesting?  If so, it should work, but it consumes two interrupts and both channels of the MAX9926.  Seems like there should be a more elegant way, though my brain isn't coming up with it...

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod