Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse engineer inductance

Status
Not open for further replies.

ssozonoff

Computer
Jun 11, 2006
13
Hi Guys,

I am trying to build a PIC based controller for the trim tabs on my boat.

IMG_0014.JPG


I bought the sensors for the tab position indicators without the electronics and I am trying to figure out how to interface these to a PIC. As seen in the picture the sensor is made up of a steel rod and a coil. There are only two wires coming from the sensor. I have no other information about these. Anyone have any suggestions about how I can figure out what the inductance of this sensor is? Could this be a half-bridge LVDT? The sensor is used to indicate position based on the lenght of rod in the coil.

Kind thanks for any pointers.

Serge
 
Replies continue below

Recommended for you

Hello ssozonoff, I don't see how it can be an LVDT if there are only two wires. Four are needed, or three if it has built-in electronics.

Maybe it is a simple inductive sensor. Of course there are instruments that directly measure the inductance, as for measuring it approximately with simple apparatus I'd have to think about that. You are most likely going to need a low frequency sine-wave oscillator.
 
Hi Pete,

Thanks, I don't think its and LVDT either!! I was just hoping it was ;-) (would have been more accurate I think) I also could have used a simple chip like the AD698 to get a nice anlog signal for my PIC. sigh....

I do have a sine-wave generator built into my Picoscope but I am not sure what the frequency range is. I found a link here which suggests a way of measuring the inductance but I have not tried it.

What do you think?

Thanks,
Serge
 
Serge, sorry about the delay in replying (haven't had my computer on as I'm heavily commited to watching the world cup).

Having looked at the link, yes the method is absolutely correct, though is it easy to automate? At each sample time, the oscillator has to be varied until the correct voltage is found. Maybe it could be made simpler - if you feed it with a convenient fixed frequency, you should be able to determine a relationship between voltage (across either the series resistor or the inductor) and displacement. It probably won't be linear and it may not have great resolution, but it may do the job. All you need then is an analogue to digital converter for the PIC to read from.

Incidentally, is there a permanent magnet fitted within the sensor you bought? I ask the question as there is a type of displacement sensor that uses a fixed permanent magnet and a variable airgap (or moving rod, in your case) to provide a varying magnetic flux that causes a variation in the permeability of the core. A coil is wound around this core, and it's inductance is used to give a position signal. Not sure about it's advantages over the simple inductance device though.
 
Hi Pete,

No worries, I have been following as well. Yesterday was France-Switzerland and living in Switzerland I had to watch, but it was a pretty lousy game I thought.

With regards to my problem at hand. At the moment I am not trying to build the circuit yet to convert the movement into a voltage between 0 and 5v. Below was an idea given to me from on another forum for doing this.

So the idea is: experimentally find the inductance then calculate a sqaure wave output to satisfy .5(period of wave) < di/dt. Then you can use the inductor formula v= L(di/dt) and a full wave rectifier to find an analog voltage that corresponds to the position of the inductor. Find the smallest inductancs of the coil, which would be the inductance without the rod. But that's the hard part.

If I use this idea then my first step is to calculate the actual inductance of the coil without the iron rod. I am also checking with a friend to see if he has access to an LRC meter which might be more accurate and easier than the method mentioned in my previous email.

I don't think there is a permanent magnet fitted inside, but as you can see by the picture I don't have access to much either... I do however keep asking myself why they did not use an LVDT concept which in my opinion would have been more accruate!

Also there are actually 3 wires coming from the sensor but one of them seems to be the shield!

Thanks,
Serge




 
Just a thought.... Why don't you just calibrate the system yourself and not worry about the inductance ie. provide signal, measure, note position(s) of transducer and create a table in you PIC?
 
Hi,

Surely I need to do some basic calculations first.
You mention the correct concept but no detail.
I need to figure out the ideal signal to use.
In turn I need to produce a signal which is easy to measure, ideally a volateg in the range 0-5v.

At the moment I don't have anything but the inductor and an iron rod.

Thanks,
Serge
 
If you have visited the link suggested, then you have the basic concept of arriving at an inductance. You can use the same method to determine linear position. Apply the frequency to the resistor and inductor and measure the voltage across the resistor while you vary the position of the core of the inductor.
 
Hi Clyde,

Agreed and that is the plan of action. The only difference being that to connect to the AD converter of my PIC I need a DC voltage within the range of 0-5v.

Thanks for the input,
Serge
 
Serge,
You can rectify and filter the voltage. Of course you will pay in accuracy, but you will be "calibrating" the system so it shouldn't be and issue.
Best regards,
Clyde
 
Hi Guys,

I did some testing tonight and I am not really sure what I am seeing on the oscilloscope. This does not look exatcly like what I should be seeing according to the reading I have been doing. I have attached 3 pictures showing the inductor without the rod, with the rod inserted 50% and with the rod fully inserted.

Any thoughts?

Thanks,
Serge

no_rod.jpg

half_rod.jpg

full_rod.jpg
 
It looks like a simple inductive device - that's for sure. And you can very easily measure inductivity without using any conversion at all. Arrange a series resistor and a switch transistor - you may even use a 24 mA output on the PIC, if it is available.

Then connect an input to the point where resistor and coil meet. Switch and watch the voltage rise (or fall). It will reach the Vth of the input (usually somewhere between 1 and 2 V) and it is then a simple task to measure the time between switching and threshold. You can do that twice - once switching on and once switching off - and take the mean value of the two. That usually makes things more linear and also reduces temperature sensitivity. The latter is not a big problem with most PICs, the threshold voltage is quite constant with temperature.

Do not forget the free-wheeling diode to avoid inductive kickbacks.

BTW, IKEA land will kill the beer-guzzlers.

Gunnar Englund
 
Hi Gunnar,

Thanks! Thats an interesting idea I had not thought about. Basically I can simply supply 5v DC to the inductor via the transistor, use an output on the PIC to trigger the switch transistor and then measure the time to reach the threshold which I presume I have measured and dialed in before hand.

How would you rate the accuracy of this method vs others?

Basically if I want to make continuous measurements of the position of the rod I need to program a tight loop which repeates the cycle over and over again, right?

Thanks,
Serge
 
Gunnar,

One more thing that I don't understand when looking at the scope traces I did. I don't see a consistent threshold voltage reached for each of the three cases. The first one is clear an peaks at just under 300mV but the other never reach that which makes things kind of hard to measure? Also the time of the voltage drop seems to be 1ms for all of them?

Sorry for these newbie questions if I am missing the obvious.

Thanks,
Serge
 
Germany kicked us out of the game...

Anyhow, your circuit: I do not know what signal you are driving your coil with in the pictures shown. It doesn't look like a TTL signal to me, perhaps you are using a 10:1 probe without saying so?

I do not see a 1 ms "voltage drop time". I see three distinctly different time constants. One being around 0.05 ms when rod is out of the coil, one about 0.3 ms when rod half-way in and one around 0,6 (maybe more) when rod fully in.

You have to read up on time constants and inductivity. Then you will understand how to do the measurement.

Gunnar Englund
 
Hi Gunnar,

Yeah and we might get kicked out this evening by Ukraine...

I drove the circuit with a 5v square wave. I think the probe was on 10x by mistake for this measurement...

I have now done some more reading on LR time constants. Basically you are refering to the 1st time constant. You mention in your first post "Vth of the input" because there are 5 time constants. Now I get it.

Instead of the transistor switch I can use an ouput pin on the PIC so supply the signal, right?

With regards to the diodes, what would be a good diode to use for this, or does it not make much difference.

Since I need to ultimately calculate the travel of the rod within the inductive sleeve, will the time to reach the 1st time constant voltage vary linearly with regards to the amount of rod in the core?

In the next couple of days I will attempt to make the circuit and write some code to see if I can get some results. Thanks very much for your input, it has been most useful!

Serge

 
Hi again, Ukraine did that to you? Or not?

The time it takes to get from zero to any voltage is proportional to the time constant - and it looks like your L/R (time constant) is fairly linear with rod position.

You can probably use the PIC output. It depends on what current the coil draws. If it is too much, you need to use a transistor. You can use any small diode (like the 1N4148, aka 914 type).

Gunnar Englund
 
Hi,

Yes, we did get kicked out in the end during the penality kicks. I must say we did a rather poor job getting the ball in the goal!!

Anyway thanks for the info. My last worry is will the A/D on my PIC be quick enough to measure a voltage rise when we are talking about 0.05ms. My understanding is that the A/D's can be a little slow to produce a result? Maybe some PIC's are better than others?

Thanks,
Serge
 
No, you didn't get it!

Use no A/D at all. Count the time from releasing the pulse to the time it crosses the input threshold voltage. Then you will have a very good resolution at no cost at all. If you use a dual polarity technique (letting the pulse go high, measure, then letting it go low and measure) and add the two results, you will get almost no temperature influence.

Gunnar Englund
 
Hmmm, no I guess I am not yet getting it.

Are you saying that I could use a simple input pin on the PIC to measure at which point the pulse reaches the threshold voltage?

This would not work with a Schmitt Trigger input using 5v since the point at which the pin registers as high would be around 4v?

I guess using a non-Schmitt Trigger input the high should be around 2v?

Hmmmm .. off to do some more reading.

Thanks,
Serge
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor