Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Inductive Proximity Sensor (from NV March/April) design questions — Parallax Forums

Propeller Inductive Proximity Sensor (from NV March/April) design questions

DogPDogP Posts: 168
edited 2009-05-01 01:25 in Propeller 1
Hey,

I've been wanting to play with inductive proximity sensors for a while, and when I saw this article in Nuts and Volts about using a Prop to do it, it got me excited. So, I'd like to build this, but rather than just building it blindly (just following the steps in the article), I'd like to understand the design, and maybe modify it for my needs. The part I'd really like some clarification/theory on is the size/number of turns of the coil, and the capacitor used (basically how the RLC circuit design affects the properties of the sensor). Of course I understand that they can't waste a bunch of space in a print article explaining everything, but 25 turns wrapped around a AA battery seems arbitrary to me wink.gif (even though I'm sure it's not).

The main property I'd like to change is the stated 5-10mm range, if possible. I'd like a larger range, but precision isn't very important. Is that possible? I'd imagine scaling this design to a larger coil (and probably changing the capacitor value) would do this for me, but I guess I'd like some pointers from people who are familiar with this kind of thing. I'm imagining something with a coil size somewhere between the one shown in the article and the head of a metal detector (like used to find stuff on the beach). I'd like my range to be somewhere between those as well (a small coil with larger range would of course be preferred, but I assume size and range are closely related).

Sorry if there's an official thread on this article, but I tried searching and couldn't find one. I also couldn't find any good tutorials on this kind of thing. Anyway, I'd appreciate any input you can provide.

Thanks,
Pat

Comments

  • virtuPICvirtuPIC Posts: 193
    edited 2009-04-07 06:46
    I don't know this NV sensor. However, Microchip offers inductive touch sensors. They work by placing an electrically conductive plat or foil near to a coil with some compressible material in between. I've seen at least one Webinar on this technology. They probably offer more info on how to build them. And you should be able to apply this technology to a proximity sensor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • DogPDogP Posts: 168
    edited 2009-04-07 07:05
    Thanks... I don't think the inductive touch sensors will work for what I'd like to do. The overall goal is to be able to track a pinball on a pinball machine. I'd like to place inductive sensors below the playfield, and detect the ball rolling overhead (detection from multiple sensors at once would be great so I know direction rather than just within 10mm of the sensor). And larger range would also be nice so I don't need a hundred sensors to do this wink.gif. Of course there's a lot of other metal objects on a pinball machine, but they should calibrate out since they don't move... the only worry is interference from some of the higher powered coils (like the flippers or pop bumpers).

    I don't know that this will work, but I think it'd be fun to at least give it a try.

    BTW, if you haven't seen the articles, you can preview them here: http://nutsvolts.texterity.com/nutsvolts/200903/?folio=36 and http://nutsvolts.texterity.com/nutsvolts/200904/?folio=32 .

    Thanks,
    Pat
  • Gerry KeelyGerry Keely Posts: 75
    edited 2009-04-07 07:50
    Hi

    Use this link to search for inductive sensors on the propeller forum· http://search.parallax.com/



    Regards



    Gerry
  • virtuPICvirtuPIC Posts: 193
    edited 2009-04-07 08:11
    Well, on a different way I found obex.parallax.com/objects/416/.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Airspace V - international hangar flying!
    www.airspace-v.com/ggadgets for tools & toys
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-04-07 16:57
    DogP,
    ·
    Thanks for the interest in the article.
    ·
    The LC combination you choose can vary widely.· What you need to consider is where the resonant frequency of your LC combination is and adjust the program accordingly so that it sweeps the frequency in the appropriate range.
    ·
    Once you determine the Inductor value and the Capacitor value, you can use one of a number of web-sites to determine the calculated frequency... (Alternatively you could just measure it)
    ·
    http://www.deephaven.co.uk/lc.html
    ·
    You can use this Coil calculator that I have attached to find the approximate inductance of a coil based on its geometry. (See attached)... for the particular coil in the article, refer to the "Special Case Multi-Layer where l equals b" coil.
    ·
    Note: The form is not locked, so the "green" fields are the only place you should alter the numbers or formulas unless you find there is an error.· The values given are usually within 5%
    ·
    ·
    With the values given, the Coil in the article measures about 17uH
    ·
    In this particular circuit, the diode (D1 and D2) in combination with C3 and the I/O pin, add an additional 8pF of loading so the frequency ends up being about 9MHz.· The Sweep frequency in the program goes from 8MHz to 10MHz so it's able to capture the resonant frequency pretty easily with 20 kHz sweep increments.
    ·
    ·
    As for a large scale metal detector, these coils are really passive and just don't contain that much energy...· They would be good for a pulse induction type metal detector acting as the sensing element.· You would need an additional coil set in the 'NULL field' of the sense coil that you are driving at the sense coils resonant frequency to make them practical.
    ·
    ..For sensing metal pin balls they should work fine the way they are, maybe a little bit bigger.· ... A pancake coil or spiral coil would be best for this.· Something like that can be etched on a circuit board though instead of wound.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 4/7/2009 5:04:08 PM GMT
    1024 x 768 - 135K
  • DogPDogP Posts: 168
    edited 2009-04-08 13:45
    Awesome... that's exactly the info I was looking for! I'm going to play around with this for a few days and see what I can come up with.

    Thanks,
    Pat
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-04-08 15:55
    Pat,

    Just to confirm any calculations, an oscilloscope is an essential tool when dealing with coils. There are many factors that can contribute to the end design that can't easily be calculated. Sometimes empirical data sampling is the best approach.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • DogPDogP Posts: 168
    edited 2009-04-09 04:01
    Yup... I'll definitely hook it up to my scope when I get these built and see if I can tweak them to be just right.

    Your PCB etched coils are interesting too... I usually etch stuff on flat flex cable since it's more convenient for me (I can just use masking tape to hold it to sheet of paper and send it through my laser printer, then dip in etchant), and on FFC I could probably put it on top of the playfield so I don't lose the range from the thickness of wood (although I'd need to put tape or something to insulate it). Or I guess I could just print contacts for switches that the pinball shorts as it rolls over... but that's not as fun wink.gif . Is the range on the etched coils equivalent to the hand-wound ones like in the article?

    Anyway, I appreciate the help and the great tips. Thanks,
    Pat
  • Nick McClickNick McClick Posts: 1,003
    edited 2009-04-09 05:13
    Hey Pat - If you're in California, you should show off your table at California Extreme. I'm a pinball fan myself, and the guys there do a lot of fun stuff with tables (made out of plastic, powered by an exercise bike, etc).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Gadget Gangster - Share your Electronic Projects - Sign up as a Designer and get a free 4-pack of Project Boards!
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-04-09 06:41
    DogP,
    The etched coils were just an example to show you an alternative "repeatable" method for constructing coils.· The coils are experimental for an idea I am toying with.· They were constructed using ExpressPCB and it's pure coincidence that at the end of my April Nuts and Volts article, it has an advertisement for ExpressPCB.
    What you’re looking at are center tapped coil with various tap ratios.· The frequency of those coils are much higher (about 50MHz with a 22pf cap) since the largest coil tap only amounts to 5 turns.· That puts the center coils at about 0.5uH which agrees with the formula for a spiral wound inductor since the radius of them is about 0.1875 inches.· Keep in mind that the addition of any metal causes the resonant frequency to shift upwards, effectively lowering the inductance.· (<-- Which has always seemed backwards to me and I have to check and re-check it every time.)· Depending on the type of metal and the proximity of the metal to your coil, the inductance can change by 25% or more.
    As the frequency gets higher and/or the inductance becomes smaller, it becomes harder for the electronics to directly determine a subtle inductive change without heterodyning of some kind to create a beat frequency, using a null balance, or simple amplitude detection.· In other words, the 0.5uH coils will be trickier to pick a signal off of then the 17uH coil described in the article.
    You might also look at the PE Labs Fundamentals Book (.pdf)··On pages 169 to 171 take a look at the lab "Metal Detection with PLL and POS Detector Modes and an LC Circuit" ... This project was the result of brainstorming to see what I could come up with based on a kit with a set number of components already determined.· In other words I could only use what was already available·in the kit.· The result was a "metal detector" based on using a 3 inch piece of hookup wire as the sense coil and a handful of resistors and caps... everything we needed.· Thanks to Andy for massaging the circuit a little bit and putting the final touches in.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 4/9/2009 6:11:16 PM GMT
  • DogPDogP Posts: 168
    edited 2009-04-09 17:44
    Nick:
    I'm in the DC area, so I definitely won't be bringing a pin w/ me... but I've already got plans to be at CAX again this year (I try to go to CAX or CGE every year). Some of those custom pins are awesome... the Whirlwind with the high power fan is my favorite. I'd like to do that mod to my Whirlwind one of these days. I'm actually thinking of slightly changing my goals on this project... rather than just tracking the pinball throughout the entire playfield, I think I'm going to just track it near the flippers, determine the position/velocity, and make it self-playing. With the relatively small range of the sensors, that seems more logical, plus it's cooler IMO (make it play itself in attract mode, or play against the "computer"). If I do that, and the CAX guys don't mind, I could bring the "kit" and slap it on one of their pins for the show.

    Beau: Thanks for that info... that makes sense. I don't mind winding the coils by hand... I built up the design as shown in the article last night and it wasn't too difficult or time consuming. Unfortunately, I think I broke my prop. I need to look into it more, but I couldn't get stuff to work last night, and when I started throwing stuff and yelling at 3AM, I decided it was time to just go to bed and worry about it later.

    Not to hijack my own thread, but I'm using the proto boards (the ones that used to be $20, but are now $30... ouch), and it seems that if I do CLKMODE = XTAL1 + PLL16X _XINFREQ = 5_000_000 it doesn't work, but removing that makes it work (which runs RCFAST IIRC). The programs load fine, and I tested it with the standard blinking LED demo without that statement and it works, but with the statement it doesn't. I was playing with some other code several weeks ago, and the same sort of thing happened to my other prop board. It loads just fine, but just won't run. Being resourceful like I am, I made my own USB programmer cable with a FTDI board I already had laying around (MM232R)... now I'm suspicious that I'm frying my props with that :/ (both stopped working on a re-program). Well, I guess I'll take advantage of the cheap Prop chips and replace them, and while I'm at it, stop being cheap and just buy a Prop Plug wink.gif.

    Pat
  • DogPDogP Posts: 168
    edited 2009-04-29 04:28
    Okay... I got my new prop chips and replaced them... worked great, so I'm back in business [noparse]:)[/noparse] . I've been playing with it some more... for fun I decided to try a bunch of inductors that I ripped off of old monitor boards. Surprisingly, several of them worked REALLY well. The best ones are what looks like a coil wrapped around ferrite with a magnet on the top. When the pinball gets within an inch or so of the magnet, the prop goes crazy! Attached is a pic if case anyone is interested, although I don't know the proper name for it, and playing w/ my handmade coils w/ magnets didn't seem to help. These inductors only worked on ferromagnetic materials (like a steel pinball, but not a quarter).

    Anyway, after playing some more, I decided to try tweaking some of the code, and it seems like changing the value "cycles" from 3300 to something larger seems to help sensitivity. Does this make sense? Changing it from 3300 to 330000 seems to double the detection range. Is there any reason I shouldn't change that, and how could I figure out what the optimal number would be? It seems like there's a maximum number, because when I go too high I lose sensitivity.

    Thanks,
    Pat
    800 x 669 - 86K
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-04-29 06:41
    DogP,

    The value for cycles basically indicates how many times the Sigma Delta ADC goes through it's loop before returning a value. A 12-Bit ADC would typically use a value of 4095 for this value with a returned value of 0 for 0V and 4095 for 3.3V, and then you have to scale the number to figure out what the actual voltage is... Why not save a step and change the value of cycles to 3300? That way a returned value of 0 would represent 0V while a returned value of 3300 would represent 3.3V .... that's all this number means.

    The value of 3300 is a way to scale the sigma delta ADC into an approximate "more human readable" voltage level. 3300 would indicate a voltage from 0V to 3.3V with mV (just under full scale 12-Bit resolution) to represent the value. By using 330000 the output would indicate a voltage from 0V to 3.3V with nV (just under full scale 19-Bit resolution) to represent the value, but I would imagine there is enough noise, that your numbers are jumping all over the place. As far as a number that's too high, I think that it's technically 16-Bit, but I'm not positive. The Sigma Delta ADC needs some bit overhead to work properly, but I'm not sure what that is exactly.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 4/29/2009 6:50:29 AM GMT
  • BADHABITBADHABIT Posts: 138
    edited 2009-04-29 10:47
    Just like it was coincidence that there was a probotix ad at the end of the fireballCNC article?
  • DogPDogP Posts: 168
    edited 2009-04-30 06:06
    Cool... thanks. From reading the comment in the code, I kinda thought that 3300 was meant for convenience... just wanted to make sure. The value does jump around a little, but I definitely get more range out of the sensor.

    BTW, if I wanted to hook up two independent sensors, can I get them to run on seperate cogs, or do I just have to re-Synth() with a pause in a loop (like in the differential sensor code)?

    Thanks,
    Pat
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2009-04-30 14:15
    DogP,

    Take a look at "Inductive Proximity Sensor Part2.Spin"... You don't need a separate cog, but because of the nature of coils, it is best to sample each coil one at a time to avoid any parasitic coupling effects.

    http://obex.parallax.com/objects/416/

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • DogPDogP Posts: 168
    edited 2009-05-01 01:25
    Thanks... yup, that's the code I was looking at... I see it's set to sample one at a time, just wanted to make sure that's the best way (I figure I've got a few cogs doing nothing, maybe I should put them to work [noparse];)[/noparse] ). I have it set up like that now and it seems to be working great!

    Pat
Sign In or Register to comment.