Author Topic: on-the-fly inductor resonance frequency finding  (Read 7096 times)

0 Members and 1 Guest are viewing this topic.

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
on-the-fly inductor resonance frequency finding
« on: September 19, 2023, 03:42:21 am »
I have a sensor I'm trying to interface that's a variable INDUCTANCE sensor, I have no access to the old interface to reverse engineer, it's basically a steel ring that moves up and down through the core of a coil, changing the inductance.. I've found it to be somewhere in the 60khz range
ONE way to do it is to feed it a steady frequency either above it's max or below it's minimum, and then as the coil moves it'll change the amplitude of the sine wave, though that's not really the best way..
Then you could feed it alternating minimum and maximum frequencies and read the amplitude of the sine wave.. and get two points from which to interpolate from
However, to sweep through the frequency to find the sweet spot is much too slow for this, I'd like to be able to get a reading about every 10ms, though 25ms could still work

So I guess I'd have to be able to find the phase shift between the current and voltage, then step my input frequency proportionally to the phase shift as that would have both direction and quantity information and should be fairly fast.

I'd really like to hear how other people would interface to this... Is there a specialized chip?  At the moment I'm thinking of using a pair of MAX9924 chips (Variable reluctance sensor chips with zero-crossing detection), though there's another in the family (max9927 I think?) that has quadrature output which might be usable for this, though I'd really have to read up on it to see if I could do it
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2088
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #1 on: September 19, 2023, 04:03:59 am »
The simplest is to make a resonant circuit / oscillator and measure the frequency.
You can make a LC circuit, or you can make an L-R oscillator, via the same topology used to make R-C oscillators with gates

Or, you can meter the inductance directly

https://www.ti.com/sensors/specialty-sensors/inductive/overview.html?keyMatch=INDUCTANCE-TO-DIGITAL%20CONVERTER
 
The following users thanked this post: Rx7man

Offline DavidAlfa

  • Super Contributor
  • ***
  • Posts: 6396
  • Country: es
Re: on-the-fly inductor resonance frequency finding
« Reply #2 on: September 19, 2023, 04:14:31 am »
Driving it with a 10-100Hz square wave using a transistor will  show the natural resonant frequency as ringing.
Here you can see some basics.
You can avoid the mcu, if you  have a scope only a square driving signal is needed.
https://danyk.cz/avr_ring_en.html
Hantek DSO2x1x            Drive        FAQ          DON'T BUY HANTEK! (Aka HALF-MADE)
Stm32 Soldering FW      Forum      Github      Donate
 
The following users thanked this post: Rx7man

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #3 on: September 19, 2023, 05:06:10 am »
The resonant frequency will always be changing and I need to know what it is though.. your solution sounds good if you have an unknown inductor on a bench.  I'll think about ways to adapt this though.. in some ways it sounds less processor intensive if I can use an interrupt to do the timing. perhaps with an op amp to give it a square wave..

One thing I'll take note of from that article (I think I've come across it before) is to use a polypropylene cap
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: on-the-fly inductor resonance frequency finding
« Reply #4 on: September 19, 2023, 05:12:39 am »
The canonical approach is an impedance bridge, with I-Q detection.  That is, measuring the sin and cos components of the output, relative to the source (which might be defined as purely sin).  This gives a complex result, i.e. including inductance and resistance.

Depending on the bridge design, I and Q may vary in a straightforward manner, or jointly, as inductance or resistance varies, but in any case there exists a transformation between the measured signals and the element's reactance and resistance.  You could arrange a circuit to read mostly inductance, or impedance, but you might as well go for both, the added effort is small and the complete measurement makes more opportunities for measuring precision.

For more simpler analog approaches, you can arrange an oscillator to run at resonance (no need to track resonant peak), and count the frequency, and measure the current consumption, to find inductance and resistance respectively.  Generally with more sources of error than the bridge approach.  Or even just do a dumb impedance divider and assume voltage sensed corresponds to inductance -- it doesn't, it depends on impedance and phase -- but this gets close enough for most capacitor ESR tester circuits for example.

I'm particularly a fan of doing the I-Q (synchronous detector) method with an MCU, as it's pretty easy to do with a moderately fast ADC (for 60kHz, at least 240kSps is required; many MCUs offer this), and a bit of clever math.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: Rx7man, EugenioN

Online moffy

  • Super Contributor
  • ***
  • Posts: 2210
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #5 on: September 19, 2023, 05:32:23 am »
The article in Silicon Chip: https://www.siliconchip.com.au/Issue/2017/June/Arduino-based+Digital+Inductance+%2526+Capacitance+Meter   gives a simple circuit that works reasonably well for measuring L or C. The relevant formulas are provided, so all you need to do is measure the frequency. If you talk about measuring its frequency at 60kHz that sounds like self resonance, not really inductance though the self resonant frequency will change with inductance and can be calculated as long as the self resonant capacitance is constant and known. The method mentioned should work as long as the Q of the coil is relatively high but you would need to take into account the parasitic or total parallel capacitance also.
 
The following users thanked this post: Rx7man

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #6 on: September 19, 2023, 06:19:48 am »
I've been playing around with spice models, and I think setting it up to self oscillate and counting the oscillations is going to be a good way of doing it for me with adequate resolution and speed of measurement...  I have a bunch of PIC10 chips I could set up to read and divide by lets say 30 and that would give you a source for an interrupt driven every millisecond, give or take and prevent the main processor from going into 60,000 interrupt routines every second

Does this link work?  It actually starts up on its own, though I wouldn't rely on that in the real world
https://www.multisim.com/content/kgDr2u5EN3EuFNynVBr7fS/copy-of-resonant-frequency-by-counted-pulses/open/
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2088
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #7 on: September 19, 2023, 06:25:42 am »
.. I've found it to be somewhere in the 60khz range
is that the self resonance, or does it already have some parallel load cap ?
What range does it change over ?

I have a bunch of PIC10 chips I could set up to read and divide by lets say 30 and that would give you a source for an interrupt driven every millisecond, give or take and prevent the main processor from going into 60,000 interrupt routines every second
Or, you could use a 74AHC1G4208/10/12 as the local oscillator and divider, and keep local loads on the inductor.
your MCU then period measures the lower 10~25ms periods
 

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #8 on: September 19, 2023, 07:23:25 am »
I think it's around 55-65khz with no load cap, so I'll probably add a cap in there to get a bit more predictable capacitance (at this point it was just the capacitance of the coil and wiring), maybe it'll fall to about 30-40khz... exact frequency isn't important as long as it's stable and predictable
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2088
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #9 on: September 19, 2023, 07:53:23 am »
Does this link work?  It actually starts up on its own, though I wouldn't rely on that in the real world
https://www.multisim.com/content/kgDr2u5EN3EuFNynVBr7fS/copy-of-resonant-frequency-by-counted-pulses/open/
The link works, tho asking a LM324 to give large swings at 30-60kHz is optimistic.
You need a higher slew rate opamp if you want to use an opamp.
An ordinary CMOS osc/divider should also work here, choose a division scaled down to your desired update rate, then the host MCU measures period using the SysCLK.

I think it's around 55-65khz with no load cap, so I'll probably add a cap in there to get a bit more predictable capacitance (at this point it was just the capacitance of the coil and wiring), maybe it'll fall to about 30-40khz... exact frequency isn't important as long as it's stable and predictable

Your sim uses 320nF (quite large?) and 60uH, were those just nominal values chosen ?
You should try to measure the inductance range and series resistance of the actual coil, for better sim results.
« Last Edit: September 19, 2023, 07:55:57 am by PCB.Wiz »
 
The following users thanked this post: Rx7man

Offline Infraviolet

  • Super Contributor
  • ***
  • Posts: 1185
  • Country: gb
Re: on-the-fly inductor resonance frequency finding
« Reply #10 on: September 19, 2023, 03:14:51 pm »
"your solution sounds good if you have an unknown inductor on a bench"

The trick in your application is to size the capacitors of your LC oscillator circuit so their resonant frequency is well above the frequency at which you need to track the steel ring's motion. And then to amplify the LC signal in to a square wave between 0V and the Vcc of your microcontroller, so it can be read quickly digitally, not slowly as an analogue level.

You could always have a separate slave microcontroller to count edges for frequency measurement purposes, that way the interrupts on it need not interfere with the timing of other tasks you want to do, you could even have this slave MCU constantly polling the digital input on which the LC square waveform arrives, hence avoiding any time penalty involved in entering an interrupt. A separate interrupt (I2C or something) could let this MCU provide a "count during the last millisecond*" when requested by a master.

Or, if you can find an op amp of the right speed and combine it with some analogue switch ICs then there are ways to make an integrator which would give a sampled-and-held DC otuput level proportional to the length of the LC waveform's ON pulses. I have done this for a metal detecting circuit which had an LC waveform at about 1KHz and was able, as it used the time length of each ON pulse of that waveform to charge up an integrator, to give an analogue DC output proportional to the inductance updated at the same 1KHz frequency as the LC waveform itself ran. I'll explain more if this method interests you.

*or longer or shorter time as appropriate for how fast the ring moves and how fast you need updates on its position
 
The following users thanked this post: Rx7man

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #11 on: September 19, 2023, 04:56:58 pm »
That spice simulator doesn't have much for ready-made op amps in it's library, so I just took the LM324.. I do have an AD712 in my project already.. Is there an op amp you think would be particularly suited for this? I'm thinking of an OPA2677, and it's in a pretty standard SOIC-8 pinout that I could change out if need be, has decent current drive capability.
https://www.ti.com/product/OPA2677

This application has one big fat solenoid coil that actuates linear rod, and on that rod is the position sensor, I need to have a PID loop that modifies the PWM and places it accurately and quickly

I did measure the inductance of it with a cheap chinese meter and it was 25uH,  and the capacitance was 340uF, and resistance was 25 Ohm.. Now if you plug that into the formula it come out to 55khz

I like the idea of the 74AHCwhatever  divider chip and it's so simple to implement I think I'll use that.. probably a divide by 12bit will give me a pulse ever ms at 40khz which should do nicely,

 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2088
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #12 on: September 19, 2023, 06:08:59 pm »

This application has one big fat solenoid coil that actuates linear rod, and on that rod is the position sensor, I need to have a PID loop that modifies the PWM and places it accurately and quickly

I did measure the inductance of it with a cheap chinese meter and it was 25uH,  and the capacitance was 340uF, and resistance was 25 Ohm.. Now if you plug that into the formula it come out to 55khz

I like the idea of the 74AHCwhatever  divider chip and it's so simple to implement I think I'll use that.. probably a divide by 12bit will give me a pulse ever ms at 40khz which should do nicely,
Has this setup been used in linear feedback position control before ?

Since this is an experimental control loop, I’d suggest a 4060, as that has output choices so you can trade off update rate and precision.
The 4060 should manage the oscillate part too, with the right L & C

 The meter numbers sound very suss?
C is totally wrong for just a coil, likely the meter measures mV at 1kHz and calculates C from that.
You should use impulse ringing tests initially as above to find resonance and Q with a chosen added good quality C.
Start with a 1nF ballpark for that L & R
« Last Edit: September 19, 2023, 06:20:11 pm by PCB.Wiz »
 

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #13 on: September 19, 2023, 09:07:31 pm »
The coil is a factory Bosch (diesel fuel injection) part from a Komatsu V12 diesel.. I'm using it on another application.. So I know that the hardware side of it is working and tested, but I have no clue as to the interface Bosch used in the ECU, and you know Bosch isn't going to help a guy out  :palm:

I had designed this originally to use the amplitude of the signal to determine position, and I'll still have that just for informational purposes (IE: make sure the oscillator is working within the correct amplitude range), and just added the binary divider.. I still have an input (through a diode) from the DAC to kick start the oscillator should it be necessary
 

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #14 on: September 19, 2023, 11:33:26 pm »
I had a signal generator hooked up to it through a resistor and watched the peak wave amplitude on an oscilloscope and it was right around 60khz.. No additional capacitors on it... seeing the formula with the given values says 55khz it doesn't seem too far off

Don't know if it helps at all but I attached a couple pictures, the green circled copper square ring moves inward and outward over the green circled laminated center of the pickup coil
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2088
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #15 on: September 19, 2023, 11:39:01 pm »
I had a signal generator hooked up to it through a resistor and watched the peak wave amplitude on an oscilloscope and it was right around 60khz..
How sharp is the peak, and how much does it move over the sense range ?
 

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #16 on: September 19, 2023, 11:45:48 pm »
I didn't test all that and things are kinda boxed up right now, I'll dig it out in a month or so and do some more tests (I'm moving right now)
 

Offline EugenioN

  • Contributor
  • Posts: 36
Re: on-the-fly inductor resonance frequency finding
« Reply #17 on: September 22, 2023, 12:34:39 pm »
I'm particularly a fan of doing the I-Q (synchronous detector) method with an MCU, as it's pretty easy to do with a moderately fast ADC (for 60kHz, at least 240kSps is required; many MCUs offer this), and a bit of clever math.

Tim, do you have any resource I can study?
Google shows me lots of randomness, no exact match for this *very* specific task  :-//

Super thank you!
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22436
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: on-the-fly inductor resonance frequency finding
« Reply #18 on: September 22, 2023, 01:57:37 pm »
Ah, you're looking for synchronous or quadrature detection.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #19 on: September 23, 2023, 04:50:58 am »
I think it's the max9226 (or 9227) that does quadrature encoding, though I think counting pulses with a divider is going to be the way to go.
I got the stuff out again last night (curiosity was killing me), and from my frequency generator I used a scope probe at 10x, then a 1x probe to the scope, without adding any capacitance, resonance was at 70-110 khz, and then I put a 450pF cap across it and it went from about 40-60khz.
Now I'll just have to see about creating a circuit that keeps the resonance going and if possible starts up on its own
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 2210
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #20 on: September 23, 2023, 05:04:46 am »
The article in Silicon Chip: https://www.siliconchip.com.au/Issue/2017/June/Arduino-based+Digital+Inductance+%2526+Capacitance+Meter   gives a simple circuit that works reasonably well for measuring L or C. The relevant formulas are provided, so all you need to do is measure the frequency. If you talk about measuring its frequency at 60kHz that sounds like self resonance, not really inductance though the self resonant frequency will change with inductance and can be calculated as long as the self resonant capacitance is constant and known. The method mentioned should work as long as the Q of the coil is relatively high but you would need to take into account the parasitic or total parallel capacitance also.

The circuit shown with the comparator in the Silicon Chip article will do just that. You can simplify it for your purposes and the micro is only for calculations and display.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2088
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #21 on: September 23, 2023, 07:45:13 pm »
…., resonance was at 70-110 khz, and then I put a 450pF cap across it and it went from about 40-60khz.
Now I'll just have to see about creating a circuit that keeps the resonance going and if possible starts up on its own
How high was the Q ?
Did you feed the generator through a high impedance, so as to not affect the true Q ?
 

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #22 on: September 24, 2023, 03:56:36 am »
I'm not sure how to determine Q
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2088
  • Country: au
Re: on-the-fly inductor resonance frequency finding
« Reply #23 on: September 24, 2023, 04:57:42 am »
I'm not sure how to determine Q

Showing results for determine Q from frequency sweep:

The peak of the response is taken to be the resonant frequency, and then two markers are placed 3 dB down from the peak value. The peak frequency divided by the 3-dB width of the peak is then equal to the Q factor.


3db is 0.707 in voltage.
 

Offline Rx7manTopic starter

  • Regular Contributor
  • *
  • Posts: 124
  • Country: ca
  • Hobbyist/Hack/Farmer
Re: on-the-fly inductor resonance frequency finding
« Reply #24 on: September 24, 2023, 03:35:55 pm »
I've been reading up on it, not sure if with the equipment I have I can measure it.
What I can say is that it was pretty easy to find the resonant frequency +/- 500hz visually on the scope

I'll dig into what my hardware can do and try and find some actual numbers
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf