Announcement

Collapse
No announcement yet.

SPICE Simulation Challenge

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • SPICE Simulation Challenge

    SPICE Simulation Challenge


    I've spent the last few days attempting to solve two related problems.

    Here's the first one:
    If you've ever tried to simulate a metal detector circuit with a balanced coil, you will have noticed that the theoretical behaviour deviates somewhat from practice.
    Let's take a Tesoro coil as an example. The TX loop is 6mH and the RX loop is 6.5mH. By applying a mutual coupling coefficient (K) between the TX and RX loops of 100u (for example) the residual voltage at the RX coil and the phase offset are quite close to reality. By adding a target model (consisting of an inductor and resistor, and suitable coupling coefficients), the effect of various target time constants (tau) can be investigated. Now this is the first issue. When the targets are introduced, the phase of the RX signal always shifts to the right, and the amplitude always increases.
    In tests I have performed with real Tesoro coils, DD coils shift the phase to the right, and the amplitude decreases for non-ferrous, and increases for ferrous. For a concentric coil, the opposite is true. All targets shift the phase to the left, non-ferrous cause an increase in amplitude, and ferrous causes a decrease. So the question is: "How to simulate a concentric coil construction in LTSpice with the correct behaviour?".

    To start with I began my investigation with the usual TX and RX loops, but with a coupling coefficient of K=0.35 to account for the TX and RX loops being separated by around 6cm. Then I added a third (nulling) loop in series with the TX loop, but in anti-phase, with a coupling coefficient to the RX loop of 1 (since the nulling coil is wound directly on top of the RX). Result ... failure:

    "The inductors Lnull, Lrx and Ltx comprise a transformer with a non-physical winding possibility. Note that it's usually less error prone to simply use a single K-statement of the form K1 Lnull Lrx Ltx 1".

    I'm sure most of you have encountered this error message before.

    OK ... so what to do next?
    I added a 100H inductor across the TX loop and a second one across the RX. The idea here is to decouple the magnetizing and coupling inductances by using a large enough inductance not to have any practical effect on the accuracy. Unfortunately this method did not seem to work as advertised. Try it yourself if you want to see the problems associated with this approach.

    After testing several other methods, such as trying to trick the simulator by using a CCCS element to couple the nulling loop into the RX, these all either gave some unexpected [bad] result, or the same "non-physical winding" error message. At the point of almost giving up, I decided to revisit the original method and see if there was some way to get around the "non-physical winding" problem.

    This time I had some reasonably good results. Using a coupling coefficient of K=0.29 for the TX and RX loops, plus a nulling to RX coefficient of 0.918, the simulation was successful. With no target present, the peak-to-peak residual RX voltage was approximately 16mV, with a phase offset of 6us (21.6 degrees). The value of the TX to RX coupling coefficient was a "guess" based on the magnetic field strength at the RX loop with respect to the TX, and the nulling loop coefficient was adjusted to provide 16mV residual voltage in the RX loop. It appears that the nulling coefficient must not go above 0.93 to prevent the dreaded "non-physical winding" error from occurring. As 0.93 was the maximum, I stepped the value between 0.9 and 0.93 to find the correct nulling point. It was interesting to see how the residual RX signal flips over as it passes the point of complete nulling, just how it happens in practice.

    Obviously the simulation is unlikely to match reality exactly, as electromagnetic coupling between the loops is more complicated than SPICE can handle with the simple inductor models.

    So, on to the second problem:
    Davor posted a simulation of various targets (including iron) here → https://www.geotech1.com/forums/show...for-simulation

    Using these targets in my own simulation (attached), all targets gave a phase-shift to the left and an amplitude increase, which is incorrect for iron. The iron target should provide a decrease in amplitude. However, this represents major progress, as the simulation is now responding correctly to non-ferrous targets for a concentric coil.


    Target Vpeak Phase-shift In-phase Quadrature Degrees

    ---------------------------------------------------------------

    Silver 48mV 5us 4mV 44mV 85

    Gold 48mV 4us 6mV 45mV 82

    Brass 32mV -5us 20mV 32mV 58

    Foil 12mV -6us 8mV 11mV 54

    Iron 10mV -18ms 9mV 6mV 34

    None 8mV 6us 0mV 7mV 0

    The attached LTSpice simulation is based on the Raptor transmitter and preamp running at 10kHz.



    Hence I have a couple of questions for Davor:
    1) How did you derive the target models?
    2) What can be done to the iron model to produce the expected amplitude decrease?


    Now ... in case you're wondering ... I'm investigating this because I wanted to have some target models that work correctly in a known VLF detector, and then use these same models in a PI simulation with a mono coil. Last week I was talking to a friend who told me about someone who claims to have a PI detector with a mono coil that can discriminate iron. I told him that this would be yet another example of conductivity discrimination (and not ferrous/non-ferrous discrimination) working on the same principle of highjacking the ground balance control as can be done with White's TDI. Since this method can only eliminate ferrous targets of similar size, shape and orientation (such as small nails), I asked if he had seen it eliminate iron targets of different sizes. It turns out [apparently] that he only saw an air test of the detector, and the designer admitted that there were problems when used in mineralized conditions. Clearly this would be the case if the GB function was no longer being used for ground balance. Given the number of times I've heard such claims, and not being able to see any discrepancy myself between ferrous and non-ferrous targets on a standard PI detector with a mono coil using an oscilloscope, I wanted to keep an open mind and explore this idea in the simulator. But the lack of any "working" target models is a barrier to making this happen.

    The coupling coefficients for the various targets in the attached simulation are commented out. Simply uncomment them as appropriate to include any desired target.

    Discuss.


    Attached Files
    Last edited by Qiaozhi; 04-04-2019, 05:41 PM. Reason: Apostrophes, double quotes, and ellipses were replaced by question marks during copy and paste.

  • #2
    Looked at the screen. You have not correctly powered receiver modeled ... two minuses on virtual ground.

    Comment


    • #3
      I assure you that the circuit is correct.
      The RX coil connection to ground is actually made inside the coil housing. It's exactly the same method used by Tesoro.

      Comment


      • #4
        Originally posted by Artyom View Post
        Looked at the screen. You have not correctly powered receiver modeled ... two minuses on virtual ground.
        One supply is +5V the other -5V?

        Comment


        • #5
          This query has nothing to do with the simulation challenge, but I'll explain anyway.

          The opamp is configured as a differential pre-amp. The TX loop is connected via two wires to the PCB, one of which is the shield of the cable. The RX loop is connected to the PCB via two wires, with one of these wires (the one that goes to the non-inverting input of the pre-amp) being connected to ground inside the coil shell. In this way, any common mode noise picked up by the RX wires is eliminated.

          The same circuit is shown in Fig 9-22 in ITMD, although the ground connection is not explicitly shown. However, it is included in Fig. 9-2 which shows the internal connections of the Tesoro coil. i.e. pins 3 and 5 are shown connected by a dotted line to indicate that this connection is made within the search coil housing. Although Fig 9-22 does not include the connection, the LTSpice simulation needs to have it, otherwise it will not work correctly.

          Comment


          • #6
            I'm skeptical of using an LR model for ferrous targets. The LR model is valid for eddy targets which are limited to a phase response from 90-180 deg. Magnetic responses have a range from 0-90 deg which the LR model can't do, plus have a different frequency response. You need to figure out how to implement a B-H curve in Spice, some simulators support this and some don't.
            Last edited by Carl-NC; 04-05-2019, 04:02 PM.

            Comment


            • #7
              All targets have an inductance value that's added to the inductances of the Tx and Rx coils thorugh the coupling coefficients. The issue with magnetic targets is that besides an inductance they also have a magnetic permeability that contributes a further increase of all inductances.

              My approach to the simulation of ferrous targets is to step the Tx and Rx inductances from their nominal values to higher than nominal due to the increase of . Then you will see a decrease of the amplitude because the Tx inductance is higher, and a lag in the phase because the frequency of the Tx oscillator goes down.

              In the sim the assumptios are:

              - The of the ferrous target increaases the inductances by 5%
              - Silver target is 1uH, 1 Ohm.
              - Ferrous target is 10uH, 2 Ohms.

              I've also inverted the connections of Ltx to get the correct phases.

              Attached Files

              Comment


              • #8
                Thanks Teleno.

                I can see what you're trying to achieve in your simulation, and the theory behind it. In particular, the "table" syntax is interesting, as I've never used that in LTspice. This is a very useful feature which allows multiple values to be stepped in unison. I could have used that several times in the past. By the way, there's also an undocumented feature of LTspice called "ako" (A Kind Of) alias that allows you to substitute different models into a simulation to make comparisons. I can visualize many ways to combine "ako" and "table" for some fun and games.

                My first comment is that (for a concentric coil) the FE amplitude should be lower than the residual voltage with no target, and the non-FE should higher. However, the simulation shows that both targets have a higher amplitude than the residual, and the FE target is greater than the non-FE.

                My second comment is that an increase of 300uH in the loop inductances seems rather high. To test this in practice I took a Tesoro concentric coil and measured the inductance change with a rusty 33mm long bolt placed directly onto the coil. The change of inductance in the TX loop could not be measured, and the RX loop inductance increased by 20uH. In conclusion, I think this is an interesting "fudge", but the results don't really match reality.

                My next step is investigate the LTspice core model as suggested by Carl.

                Comment


                • #9
                  Supply rails are actually +5v and -6.2v.
                  ...
                  Quite good decision Q. !
                  You can develop proper math on this and form quite good basics for some emulator, eventually later?
                  And usually what's done good in math; can be easily ported to mcu later.
                  Do i see some ambitions here... !?


                  Comment


                  • #10
                    Another great thread. I have also tried getting the target models to show what I see on real PI detector.
                    I will be trying suggestions.

                    Also working on a new PI detector that uses IB coils and a PIC32 to sample and analysis both TX on and TX off wave forms. Hoping to do FE discrimination from the TX on.
                    I haven't yet started a thread on this but plan to in the near future.
                    Good simulation models will be helpful.

                    Comment


                    • #11
                      Originally posted by Qiaozhi View Post
                      Thanks Teleno.

                      I can see what you're trying to achieve in your simulation, and the theory behind it. In particular, the "table" syntax is interesting, as I've never used that in LTspice. This is a very useful feature which allows multiple values to be stepped in unison. I could have used that several times in the past. By the way, there's also an undocumented feature of LTspice called "ako" (A Kind Of) alias that allows you to substitute different models into a simulation to make comparisons. I can visualize many ways to combine "ako" and "table" for some fun and games.

                      My first comment is that (for a concentric coil) the FE amplitude should be lower than the residual voltage with no target, and the non-FE should higher. However, the simulation shows that both targets have a higher amplitude than the residual, and the FE target is greater than the non-FE.

                      My second comment is that an increase of 300uH in the loop inductances seems rather high. To test this in practice I took a Tesoro concentric coil and measured the inductance change with a rusty 33mm long bolt placed directly onto the coil. The change of inductance in the TX loop could not be measured, and the RX loop inductance increased by 20uH. In conclusion, I think this is an interesting "fudge", but the results don't really match reality.

                      My next step is investigate the LTspice core model as suggested by Carl.
                      In my sim I had the bucking coil change with mu in the same proportion as the Tx and Rx coils, which is probably less since the coupling with the target is much lower.

                      Ive modified the parameters as follows:

                      .step param Mu list 1 2
                      .param Ltx table(Mu,1,6m,2,6.03m)
                      .param Lnull table(Mu,1, 600u, 2, 601u)
                      .param Lrx table(Mu,1, 6.5m, 2, 6.5325m)
                      .param Ltgt table(Mu,1, 1u, 2, 1u)
                      .param Rtgt table(Mu,1, 1R, 2, 2R)

                      Inductange change with ferrous target: 0,5%
                      Null coil change with ferrous target: 0.15%
                      Fe and non-Fe having the same shape, same inductance, same resistivity.

                      This is what I get (blue trace = Fe):




                      The amplitude without a target is 7.6mV, so I believe this better mimics your real life tests.
                      Attached Files

                      Comment


                      • #12
                        Originally posted by Qiaozhi View Post
                        SPICE Simulation Challenge




                        Now ... in case you're wondering ... I'm investigating this because I wanted to have some target models that work correctly in a known VLF detector, and then use these same models in a PI simulation with a mono coil. Last week I was talking to a friend who told me about someone who claims to have a PI detector with a mono coil that can discriminate iron. I told him that this would be yet another example of conductivity discrimination (and not ferrous/non-ferrous discrimination) working on the same principle of highjacking the ground balance control as can be done with White's TDI. Since this method can only eliminate ferrous targets of similar size, shape and orientation (such as small nails), I asked if he had seen it eliminate iron targets of different sizes. It turns out [apparently] that he only saw an air test of the detector, and the designer admitted that there were problems when used in mineralized conditions. Clearly this would be the case if the GB function was no longer being used for ground balance. Given the number of times I've heard such claims, and not being able to see any discrepancy myself between ferrous and non-ferrous targets on a standard PI detector with a mono coil using an oscilloscope, I wanted to keep an open mind and explore this idea in the simulator. But the lack of any "working" target models is a barrier to making this happen.

                        The coupling coefficients for the various targets in the attached simulation are commented out. Simply uncomment them as appropriate to include any desired target.

                        Discuss.


                        What I get with my PI. Don't how to simulate ferrous targets either. Simulation kind of compares with my detector circuit with a 143usec TC target(clad quarter). Simulation straight line decay linear log chart(signal amplitude similar at beginning of coil on and target decay after coil off) where quarter is not straight line decay until after 150us so signal is higher at beginning of decay compared to coil on amplitude. Think ferrous simulation should look similar to what I get with my detector. Simulation_143us target and 1ns target(no target).

                        Not awake again! scope pictures labeled wrong for Rx coil size, should be reversed.
                        Attached Files
                        Last edited by green; 04-05-2019, 06:01 PM. Reason: added sentence

                        Comment


                        • #13
                          Hi Teleno,

                          The results look more realistic than before. However, I can't help thinking that this is more of a "fudge" than actually what happens in practice. Although the target affects the coil inductance to some extent, the small change I measured was with a large iron bolt in contact with the coil.

                          In reality, the differences between ferrous and non-ferrous targets has more to do with the phenomena of absorption and redistribution.
                          Non-ferrous conductive targets will have eddy currents generated in the surface, which (according to Lenz's law) will generate their own opposing magnetic field. The produces an imbalance that can be detected by the RX loop. In addition there is a phase shift produced when compared to the applied TX field, and the amount of phase shift depends on the conductivity of the target. Different targets also have a resistive element that causes some of the transmitted energy to be absorbed. Likewise this can be detected by the RX loop.

                          I suspect that a core model may be the only way to go.
                          More later ...

                          Comment


                          • #14
                            Hysteretic core model for LTspice. Perhaps close to what is needed.

                            http://ltwiki.org/LTspiceHelp/LTspic...L_Inductor.htm

                            http://ltwiki.org/index.php?title=The_Chan_model

                            Comment


                            • #15
                              Great stuff.
                              I am reminded of the fact that the behaviour of an IB search head presents a unique radio magnetic and inductive set of parameters.
                              Modelling such an arrangement accurately is perhaps a most difficult challenge.
                              Good luck.
                              "........comprise a transformer with a physical non winding possibility."

                              Comment

                              Working...
                              X