Measuring and Testing a Variable Reluctance sensor? - Page 1
Forum section: electronics / beginners

author: synfinatic
author_rank: Contributor
timestamp: September 23, 2022, 12:45:29 am
content: I have a pair of variable reluctance sensors at a known precise distance apart to be used to measure the velocity of an object passing by both of them (not the more typical single sensor where the object spins near the sensor).My goal is two parts:1. Measure the velocity using a micro-controller like an ESP32 by detecting the two signals and measure the time between them to calculate the speed2. Since testing it in the "real world" is challenging, Id like to be able to test/validate my circuit and code via purely electronic means (ie: I don't want to devise a way to accurately pass an object past the two sensors so I can measure it).Digging through various options and considering price, part availability and circuit complexity, it seems something like an LM139 comparator would be excellent for detecting the voltage cross 0V which should correspond with the object directly above the sensor. Looking at the data sheet:https://www.st.com/content/ccc/resource/technical/document/datasheet/bf/7e/d7/a4/67/86/4e/89/CD00000460.pdf/files/CD00000460.pdf/jcr:content/translations/en.CD00000460.pdfI see two sample circuits which might work? Figure 16 & 20. The latter seems "more correct" since the input is an AC waveform which more correctly corresponds to a VR waveform? That said, it seems to require both positive and negative voltage rails which I'm not really sure of a good way to generate (device is battery operated and I'll have both +5 and +3.3V available).So guess my first question is "Figure 16. Zero crossing detector (single power supply)" viable for this use case or do I need to come up with a negative voltage rail for "Figure 20. Zero crossing detector"If I need the negative voltage rail... any simple/cheap suggestions?Lastly, I'd like a way of testing the accuracy of my circuit & code doing the measuring. Testing it in the real world will be challenging so I was thinking it might be useful to generate a pair of digital pulses with a known time between them to simulate the VR sensor using a 2nd micro-controllers digital outputs. At least I can think of no good way to generate an accurate VR waveform? The closest I can come up with is something like this which I'm not at all convinced is any more useful:

author: ledtester
author_rank: Super Contributor
timestamp: September 23, 2022, 02:53:39 am
content: Does this web page describe the signal you'll be processing?http://logansmith.org/2014/02/a-practical-overview-of-variable-reluctance-sensors-and-associated-hardware/It suggests using a MAX9924 which is designed for measuring the output of a VR sensor.MAX9924 datasheet:https://datasheets.maximintegrated.com/en/ds/MAX9924-MAX9927.pdfQuoteFig. 20 requires a negative supply. Fig. 16 avoids this by biasing the signal at around 0.45V. Both operate on the same idea -- the comparator is set to trigger when the input rises a little above 0V.The 20M resistor in Fig 16. implements hysteresis - something you probably won't have to worry about.The diode is to prevent the inverting input from going negative when the input signal goes negative. In Fig. 20 it is assumed that the input signal will never go below the negative supply voltage and that's why there is no equivalent protection circuitry.

author: synfinatic
author_rank: Contributor
timestamp: September 24, 2022, 01:11:04 am
content: Quote from: ledtester on September 23, 2022, 02:53:39 amYes, that's exactly it other than of course I have two VR sensor circuits.Quote from: ledtester on September 23, 2022, 02:53:39 amI didn't realize that 20 the input of the VR waveform was assumed to never go below the negative value... I have no idea if that would be true in the real world (still need to go "out into the field" and attach my oscilloscope to measure real world data). I found a simple charge pump circuit for negative voltages using PWM or a 555 timer, so that would probably limit me to +/-5V on the power.Since I'm using a pair of VR sensors and calculating a relative time between the two and not trying to perform timing via a single sensor, the bias to trigger at +0.45V should work for me. I also have to deal with running a wire 3-6ft for the sensor so may have to deal with noise so that might help.Thank you! this was helpful!

author: ledtester
author_rank: Super Contributor
timestamp: September 24, 2022, 01:46:35 am
content: Giving it some thought, it is quite likely a chip like the MAX9924 is the best way to go. I suspect the VR signal is going to be very weak -- both in the sense of amplitude and also having a high output impedance, and that's something the MAX9924 would be able to handle.

author: synfinatic
author_rank: Contributor
timestamp: September 24, 2022, 10:28:27 pm
content: Quote from: ledtester on September 24, 2022, 01:46:35 amWell the amplitude should be a function of the speed of the object passing the VR sensor right? In that case, I'm not worried. The impedance is another thing and I'm honestly not sure.The thing that is driving me nuts right now is when I attach my oscilloscope to the sensor and just using my hand to quickly run a screwdriver past the sensor I can only get the scope to detect (and/or trigger) if I connect it "backwards". Ie, rather than the signal rising and then passing through zero towards a negative voltage, it only will show a change in voltage if I connect it so it starts with a negative voltage before swinging back up.If I reverse one (or both) of the channels to be "correct" I'll never see any change in that channel. For a while I thought I was doing something wrong and it was my fault, but I've done enough testing now and consistently reproduced the issue that I've come to the conclusion that it's not me.To be fair, I don't know exactly what if any additional components exist in the "sensor". It's a commercial unit and opening it up would destroy it. At least for my purposes it shouldn't really matter since both VR sensors trigger a positive voltage, but I'm not sure if something like the MAX9924 is expecting a "correct" wave form.

author: ledtester
author_rank: Super Contributor
timestamp: September 24, 2022, 10:45:15 pm
content: Do you have a datasheet for your sensor? From the web page I referenced it seems that the VR signal is a differential signal.

author: synfinatic
author_rank: Contributor
timestamp: September 24, 2022, 11:21:59 pm
content: Quote from: ledtester on September 24, 2022, 10:45:15 pmI do not.The longer story is that the sensor also comes with a microcontroller display/data logger unit which kinda sucks. So I'm designing a new display/logger which uses/connects to the same sensor. The sensor just uses a standard 3.5mm TRS audio jack to connect to the display. Based on the wave form and the fact that all 3 taps show continuity with each other tells me it's a pair of VR sensors with a common ground.Just when I measure, I only get a signal which matches the "inverted polarity" as described here:http://mcs.woodward.com/content/motohawk/Documentation/MotoHawk2015bSP0/HTML/MotoHawk_topics/VRInterfacing.html

author: ledtester
author_rank: Super Contributor
timestamp: September 25, 2022, 02:56:25 am
content: QuoteBy "reversing" the channel do you mean you swap where you attach the ground clip and scope probe?How is your sensor powered?

author: mikerj
author_rank: Super Contributor
timestamp: September 25, 2022, 11:06:31 am
content: Quote from: synfinatic on September 24, 2022, 10:28:27 pmWhen you say "reverse", are you changing the edge polarity in the trigger menu of your scope?

author: synfinatic
author_rank: Contributor
timestamp: September 25, 2022, 04:41:08 pm
content: Quote from: ledtester on September 25, 2022, 02:56:25 amYes, swap which wires the scope probes are connected to.Unlike a hall sensor, there is no power- only two wires: GND and Vout.I'm triggering on the rise.