Inductor-based comparator oscillator?

Thread Starter

THE_RB

Joined Feb 11, 2008
5,438
Hi, I am thinking of building a PIC controlled inductance meter.

The goal is to use the PIC comparator to form an oscillator where the frequency (more specifically the period) is determined by an inductor under test. Then the PIC measures the oscillator period with good accuracy and can give an accurate inductance display.

The minimum inductance can be as high as 470uH and can be built in, and the inductor under test can be placed in series to add inductance (as the PIC can simply deduct the built in value to get the test value).

I've checked some other LC meter designs but they tend to use an LC oscillator and I would prefer a pure L based solution where L is directly proportional to period.

Does anyone know an oscillator format that would work in this situation using one comparator (or two comparators with the same +Vref)?

Thanks!
 

SgtWookie

Joined Jul 17, 2007
22,230
Hi Roman,
Have you looked at Ronald Dekkers' page on flyback converters?
http://www.dos4ever.com/flyback/flyback.html
Partway down the page (roughly half way) he shows an "Inductor Test Bench" - it has an RC oscillator driving a MOSFET gate for comparison of known and unknown inductors.

While it's nothing new or unique, you might use the idea and incorporate it into a PIC program; maybe using the internal PIC oscillator for a timebase, and simply monitoring the time it takes for an inductor to reach a certain current level. That wouldn't take inductor saturation into account, but it might be a starting place.
 

SgtWookie

Joined Jul 17, 2007
22,230
Interesting read but the scope hookup has me baffled. The GND lead of the scope will short the supply to GND.
The 12v supply needs to be isolated from the O'scope ground, or the O'scope needs to be floating - one or the other.

Using a 12v "wall wart" or desktop computer supply (NOT an ATX-type supply) would accomplish the needed isolation.
 

CDRIVE

Joined Jul 1, 2008
2,219
Ha, this could take us back to the recurring issue of the definition of GND but I'd rather have a root canal than do that again. :rolleyes:
The author should have been explicit about this because novices read this stuff.
 

Wendy

Joined Mar 24, 2008
23,429
I've been working on something for the 555 forever. I have a schematic, but not too much confidence. The two comparators idea intrigues me however. I'm thinking in terms of the RL charge curve, creating a sawtooth like the 555 does for the RC circuit.
 

Thread Starter

THE_RB

Joined Feb 11, 2008
5,438
Bertus, thanks but like most DIY LC meters it uses an LC oscillator. They are tried and proven but unfortunately they require a square root in solving the inductance from the measured period; root(LC).

I wanted to explore using an RL oscillator as the goal is to allow a very wide range of inductance values once the period becomes linear to inductance.

SgtWookie and BillMarsden, my first attempts at RL have been disappointing to say the least. I used the PIC digital output (comparator output) through the inductor into a load resistor. The comparator other input is configured 1/3:2/3 like a 555 so it oscillates from 1.6v to 3.3v.

The problem with this is at the lowish currents I tested, 0.5mA, 2mA, 5mA etc the period does not represent the true inductance but largely represents the other properies of the inductor based on size and core type etc etc.

Running larger currents should help but that rules out the one-chip solution using the inbuilt comparator and also rules out 9v battery use.

It's beginning to look like the only good solution might be to go to an LC resonance based oscillator (like other designs) and just live with the problems of the square root.

Unless someone has suggestions for getting the RL oscillator performing much better?
 

Wendy

Joined Mar 24, 2008
23,429
My major problem was, unlike a cap, both ends moved voltage wise.

I do have a solution, though you may not like it. A gyrator, convert it to a capacitance, then measure it.

I've put a lot of skull sweat into this with no joy. There are designs out there, but I wanted to solve this for my own education.

How to measure an inductance

Gyrator for inductance measurement.

It is one of those things I pick back up on now and again.
 

Thread Starter

THE_RB

Joined Feb 11, 2008
5,438
Yes I'm seeing pretty much the same issue. The cap is a much better match for a theoretical cap than the inductor is a match for a theoretical inductor.

So the rate of change of the voltage in a RC charging cap pretty much matches the theoretical cap for most reaonable values of R.

But with the inductor the rate of change of current has a huge variance based on R and the core type of the inductor...

It looks busted from my end; the idea that a couple of milliamps and comparator can make a working RL oscillator where period is linear to inductance. :(
 

Wendy

Joined Mar 24, 2008
23,429
I was studying the Flyback Convertors for Dummies again, and I had a thought based on his measuring ideas for inductors...



I really think this has a chance of working fairly well. R2 is the range select, it will also control current through the inductor under test. The PIC would be needed to translate the frequency into a measurement. I figured the current ranges were too high to use the 555 discharge, though it is a thought.

I got the idea from this schematic on the website
http://www.dos4ever.com/flyback/flyback.html#ind2



A possible problem with my design, I may need to allow a slight delay to discharge the coil completely. Might be worth building to find out.

*******************

I think if I connect Pin 2 (or pin 6) to the bottom of the inductor it will work the way I want it to. I'll research it a bit further and let you know.
 

Attachments

Last edited:

Thread Starter

THE_RB

Joined Feb 11, 2008
5,438
They definitely look workable. I have done similar things when testing and designing SMPS, but the rate of current change "inductance" still is quite dependent on core type and the current chosen. That's fine for SMPS design as you usually know the current range and even have a minimal current for typical operation.

Basically that is exactly what I was doing with the PIC, but was oscillating the inductor at say 5mA, using the PIC internal comparator.

But even from the same circuit and same current trigger thresholds, two 470uH inductors of two different core sizes/types will measure quite differently because their characteristics are very much dependent on current.

And of course the other problem is that it no longer has the benefit of one cheap PIC chip, and little 9v battery. There are plenty of LC oscillator meters using a comparator and PIC and small battery, but of course have to solve for square root, and accuracy becomes very range dependent.

Maybe there is some way to use the "ease" of the LC oscillator, but remove the nonlinearity of the p = root(LC) issue?
 
Top