Author Topic: Sensing position of conductive part through coil impedance change  (Read 468 times)

0 Members and 1 Guest are viewing this topic.

Offline charliehorse55Topic starter

  • Contributor
  • Posts: 29
I'm working on a PCB motor and I'm trying to build a system to detect the position of the moving part. The board is already pretty much full on all layers between the coils themselves and control logic, so I don't really have space for separate sensing traces.

I first used my scope + sig gen to capture the frequency response of the motor coils, with and without the moving part sitting above them:



The largest swing is at ~600kHz, with the impedance changing from 15 ohms to 9. I can test this manually and see the waveform change amplitude on the scope as I move the part over the coils.

My basic idea to measure it:

  • Generate 600kHz sine wave using MCU
  • Buffer sine wave to an output impedance of 12 ohms (halfway between 15 and 9)
  • Connect buffered wave to coil, forming a voltage divider
  • Rectify the voltage at the middle of the divider to convert the AC amplitude to a DC one. Low pass filter to reduce ripple
  • Amplify voltage difference to match ADC range using the MCU's built-in op amp
  • Measure resultant voltage using ADC

For 1, I've investigated two options - using the MCU's DAC, or using the SPI output with pulse density modulation. The DAC produces lower harmonics, but has an output impedance of ~5k. The SPI option requires more filtering, but the output impedance is that of an MCU GPIO, ~150 ohms.

For 2, for simplicity I'm planning to use a single transistor voltage buffer, such as a common-drain mosfet. Looking at some typical mosfet values, this approach requires a source impedance of <1k, so I can't use it with the MCU DAC directly. An alternative option would be to find an op-amp that buffer the 5k DAC impedance all the way to 12 ohms with a single stage (and drive 50-100mA)

For 4, I'm using 1N4148 + some simple/passive low-pass filter

For 5, I'm going to use the MCU's builtin op amp since it's more than capable for this application (gain=20, bandwidth=50kHz)

So, I think the design is good, the only real question that remains is how to design the filters. I made a 4th order 1 MHz lowpass using 150 ohms + 1nF through hole components on a piece of perf board. It worked well for lower frequencies, but beyond ~30MHz it starts letting a lot through again. Problematic considering the SPI driver runs at 36 MHz (and still looks pretty square at that frequency).

Questions:
  • Is it worth doing anything other than a 3-5th order RC lowpass?
  • Will the typical parasitics for 0402 parts allow such a filter to work well up to hundreds of MHz?
  • The measurement circuit needs an op-amp for gain anyways. What's the ideal way to combine the passive filter with the gain stage?
  • Any other notes/critiques of the general idea
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1666
  • Country: au
Re: Sensing position of conductive part through coil impedance change
« Reply #1 on: June 26, 2024, 01:05:51 am »
I'm working on a PCB motor and I'm trying to build a system to detect the position of the moving part. The board is already pretty much full on all layers between the coils themselves and control logic, so I don't really have space for separate sensing traces.

I first used my scope + sig gen to capture the frequency response of the motor coils, with and without the moving part sitting above them:
Are you using the motor as a sensor, or do you want to sense this change on an operating (driven and rotating)  motor ?
How fast do you need the measurement result  ?

Quote
Buffer sine wave to an output impedance of 12 ohms (halfway between 15 and 9)
Connect buffered wave to coil, forming a voltage divider
You do not need to 'impedance match', if you current drive you get the full % swing, not half of it.


For 1, I've investigated two options - using the MCU's DAC, or using the SPI output with pulse density modulation. The DAC produces lower harmonics, but has an output impedance of ~5k. The SPI option requires more filtering, but the output impedance is that of an MCU GPIO, ~150 ohms.

For 2, for simplicity I'm planning to use a single transistor voltage buffer, such as a common-drain mosfet. Looking at some typical mosfet values, this approach requires a source impedance of <1k, so I can't use it with the MCU DAC directly. An alternative option would be to find an op-amp that buffer the 5k DAC impedance all the way to 12 ohms with a single stage (and drive 50-100mA)
Or, you can get low Cin MOSFETS & high HFE transistors, tho 600kHz is getting Ft limited.
 

Offline charliehorse55Topic starter

  • Contributor
  • Posts: 29
Re: Sensing position of conductive part through coil impedance change
« Reply #2 on: June 26, 2024, 07:07:17 am »
Are you using the motor as a sensor, or do you want to sense this change on an operating (driven and rotating)  motor ?
How fast do you need the measurement result  ?

It has an interactive element, so a part may be placed over the board and I want to detect where it is. I can also briefly shut off the motor drive to measure where something is. Faster is better, but anything less than 1ms is probably fine. That's 600 cycles at 600kHz, should be more than enough.

You do not need to 'impedance match', if you current drive you get the full % swing, not half of it.

Sounds nice, not exactly sure how I'd build a circuit to do that. The tricky thing is that due to other design constraints each coil can only be accessed from a single end, and needs a DC bias. So the voltage at "Measure" must be always between 0 and some +rail (say 10V). 
2296049-0

Or, you can get low Cin MOSFETS & high HFE transistors, tho 600kHz is getting Ft limited.
I looked at this briefly - the datasheet for the MCU lists a max drive of 50pF for the DAC. A quick search found a few mosfets with Cin < 30pF, so that could work.
 

Offline moffy

  • Super Contributor
  • ***
  • Posts: 1894
  • Country: au
Re: Sensing position of conductive part through coil impedance change
« Reply #3 on: June 26, 2024, 07:56:34 am »
For a high speed/high current driver, video amps are a good choice, you can get quads at reasonable prices, they are meant to drive 75R coax so if you paralleled 4 each driving its own 75R resistor you'd have about 19R output impedance e.g. https://www.analog.com/en/products/max4022.html

P.S. I know the 75R is really 150R because of the series and termination resistors, but they do appear to be rated down to 75R at least with 2Vp-p@5MHz.
« Last Edit: June 26, 2024, 08:06:04 am by moffy »
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1666
  • Country: au
Re: Sensing position of conductive part through coil impedance change
« Reply #4 on: June 26, 2024, 08:20:42 pm »

It has an interactive element, so a part may be placed over the board and I want to detect where it is. I can also briefly shut off the motor drive to measure where something is. Faster is better, but anything less than 1ms is probably fine. That's 600 cycles at 600kHz, should be more than enough.
Good, that's sounding more practical.

You do not need to 'impedance match', if you current drive you get the full % swing, not half of it.

Sounds nice, not exactly sure how I'd build a circuit to do that. The tricky thing is that due to other design constraints each coil can only be accessed from a single end, and needs a DC bias. So the voltage at "Measure" must be always between 0 and some +rail (say 10V). 
You do not need a pure sine, you can drive even with a triangle, and get a nominal square wave on the measure point.
Driving from a high enough resistor is close to current drive.
eg if I use your values with a 600kHz 5V swing into 250 ohms, for 20mA peak, that measure point has
5Vpp Sine     = 301.18294mV pp
5Vpp triangle = 235.72546mV pp

To keep things simple, I would just output 600kHz square wave into an integrator, for the triangle, and then sync detect (using that square wave) the measure point into a 1ms filter + x10 gain.


 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1666
  • Country: au
Re: Sensing position of conductive part through coil impedance change
« Reply #5 on: June 28, 2024, 03:24:26 am »
It has an interactive element, so a part may be placed over the board and I want to detect where it is. I can also briefly shut off the motor drive to measure where something is. Faster is better, but anything less than 1ms is probably fine. That's 600 cycles at 600kHz, should be more than enough.
How many channels do you need to capture ?

...The tricky thing is that due to other design constraints each coil can only be accessed from a single end, and needs a DC bias. So the voltage at "Measure" must be always between 0 and some +rail (say 10V). 

An alternative to impedance at 600kHz would be to make that inductor resonate/oscillate at ~ 600kHz - Spice says Fo = 593.5kHz and Q ~ 6 with an 18nF  cap.
You can make a grounded inductor / single terminal osc, using a 2GU04 gate or a Dual PNP ( or maybe a 4069 or 4011UB if you run from a 10V supply ?)
Feeding the oscillator into a part like 74AHC1G4210 gives 0.8625ms between edges, for easy MCU measurement.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf