Comments welcomed on test fixture PCB for impedance measurements

Hi @Moto, I spent some time with this, and also ChatGPT and Wolfram to see if the circuit could be solved symbolically. ChatGPT does a good job of determining the node equations and putting them into a form for entering into wolfram. And then you have 3 equations and 3 unknowns, and Wolfram will then solve for whatever you want. But the resulting equations got really unwieldy. I think there’s got to be some simplifications to help. BTW, asking ChatGPT to solve the system of equations was not good. It never got the right answer.

In short, I need to study more. If anyone wants to take a crack, please do.

Great @matt! Can you publish the chatgpt prompts you used and the resulting equations?
I do have a chatgpt 4 subscription and have had miserable luck with computations unless I ask it to explain each step at an atomic level. I’ll be interested to see how you structured it.

Hi @matt,

I was wondering the same and had a go last night.

Following your circuit and approach I get the apparent DUT impedance to be,

image

Where

  • Rd is the DUT impedance
  • Rq is the input impedance of the QA40x
  • Rs is the current sense resistor

image

Does that give similar results to what you found in LTSpice?

You can feed ChatGPT a spice netlist. So, start with this:

image

And ask LTSpice to generate a netlist:

V1 N001 0 1
R1 N001 N002 10k
R2 N002 0 90k
R4 0 N002 50k

And then the prompt for ChatGPT4:

Here's a spice netlist. Write the equation for node 2, using generic values (eg R1) instead of the actual values: V1 N001 0 1
R1 N001 N002 10k
R2 N002 0 90k
R4 0 N002 50k

It responds (pasting as picture so equations aren’t lost)

And then prompt: Solve for Vn002

image

And then prompt: Can you put the expression for kcl equation into a format wolfram can understand?

And the response:

image

Now, this doesn’t work on Wolfram because it will read V_N001 as a variable V_N times 001. So, re-prompt:

image

And that gives:

Which (I think) is the same result arrived at by ChatGPT4

In any case, ChatGPT does well on simpler circuits. And its ability to solve symbolically (that is, using R4 instead of 100K) is pretty impressive to me.

In any case, it tends to make a lot of mistakes, but fewer mistakes than I would using pencil and paper. But I’m pretty rusty in KVL and KCL.

Yes, it looks like it does! Thanks very much!

ChatGPT4: Given Za = Rd(2Rq+Rs)/(Rd+2Rq), solve for Rd

image

Looks like a minus sign is missing in GPT’s response, but this works for the cases I’ve tried. I’ll experiment some more and put into the plugin.

Excellent! I left the last step for you :rofl:

Did not know ChatGPT could do all that.

1 Like

That netlist capability of chatgpt is cool. I was unaware of it. Thx for the detail. I hate to be stupid but, you assume away R3 in the original diagram because R1 is small compared to it, right? Why do you omit R6 in you final simplified schematic?
Or is the simplified diagram just (R5+R6)||50k?

Tried some experiments.
1K DUT, 100 ohm sense. Calculated 1003 ohms
27K DUT, 100 ohm sense. Calculated 33293 ohms
27K DUT, 996 ohm sense. Calculated 26878 ohms
27K DUT, 2693 ohm sense. Calculated 27055 ohms
So could be sensitive to the ratio of dut to sense.

In this very limited look, 10% seems good. How do you go about generalizing that?

@Dan what is apparent impedance and how did you derive this? I’m not understanding what the dependent variable being plotted against Rs is.

Hi Moto,

The QA40x measures the apparent impedance of the DUT. This is normally so close to the actual DUT impedance we don’t care. But this is not always the case, as you have seen.

The equation in my post predicts what you should measure with the QA40x in its current form at the time of writing, “Za” in Matt’s equation.

Matt rearranged it to back out the actual impedance of the DUT, Rd, given the other parameters. Using his equation you should get something closer to the DUT. He said he will add it to the plug-in.

I’ll do a blog post on how I found that. But basically, just finding the voltages at the nodes across the DUT and sense resistors, writing them in an expression that gives the apparent DUT impedance, and simplifying it; just following what Matt did.

What equation are you using for the calculated column here? Could you also add a column for what the QA40x measures and a corrected column using the backed out Rd impedance?

I just used @matt equation to generate the values.

image

I wiil do as you suggest and add columns and differing dut and sense values.

I ran your equation through wolfram and had it solve for Rd.
Rd=2Rq*Z/(2Rq+Rs-Z)

@Dan I still don’t understand how you got the graph. Your apparent impedance equation is linear in Rs but the graph is a curve.

These are all with 27k dut resistor

Sense. QA calc. Revised

99.6 17050 33326
556 17395 27860
996 17450 26916
2693 17495 27070
5088 17460 26736
9996 17520 26811

QA software will not allow sense resistor greater than 10k. Not sure what you meant about the corrected column.

@matt what did you conclude on all of this?

My 2 cents, the values you measured don’t agree with the LTSpice model nor the analytical expression. But there is still some doubt about comparing apples to apples. I was going to run the experiment myself following what you did, but I have not managed to do anything for a week. The can of worms might go deeper!

I used matt’s new formula to calculate the dut impedance from my measurements. My calculations agree very closely with the 27k resistor I used for the dut.
The only really odd one is using the 99.6ohm sense resistor.
What doesn’t agree with the model?
I’d say the new formula @matt came up with works unless you start to get the ration of sense to dut too large as in the 99.6 ohm sense case.

Just to be clear those dut numbers I show above were with @matt new formula.

Well in that case everything is in agreement! Typo in the table confused me.

I just re-arranged Dan’s formula. The 1.188 release HERE has the ability to apply the formula IF you check the User Analyzer Input Z Compensation. I haven’t spent any time on verifying it yet, but please try if you have a setup in place and let me know what you see. If that box is unchecked, the plug-in should work precisely as before.

image

@matt it doesn’t work for me. The same 27k resistor now shows around 19k with the box checked.
I don’t think you want @Dan formula as from what I understood from him, that describes apparent impedance which is your old way of calculating.
I used the one you got from chatgpt and wolfram and that gave me the correct answers in the table I previously posted.

I used (V1-V2)/Rsense=V2/Rdut + V2/50000

Where Rsense= value of sense resistor and Rdut = impedance of dut.
V voltages are as described in what @matt wrote above.

@Dan did you try the new version of software?

Not yet.

I’ll make a summary. Matt’s equation (not the one from ChatGPT) agrees with the LTSpice model but the data you collected seems not to agree with that.

So assuming your measurements are correct, something must be wrong with the LTSpice circuit we are using to derive the equation? Could that be the case?

@Dan I think things are consistent.

  1. I redid @matt circuit in Tina( the one he used for chatgpt analysis).
  2. Exported netlist for analysis in chatgpt and wolfram
  3. Solved in wolfram for Rdut.
  4. Rdut=50,000xRsensexVdut / (50,000xVsense-RsensexVdut)

Here Rsense is the value of the sense resistor, Vdut is the voltage across the device under test, and Vsense is the voltage across the sense resistor.

My measured voltages agree with the Tina model to about 1mv if I use 150ohms for the qa402 dac which I left in the Tina model but did not use in the netlist analysis.
The equation above yields correct results for Rdut to about .2% using your pcb and a sense resistor of around 10% of the value of Rdut. I will do more measuring today though.

After more measuring, its clear that the sense resistor needs to be above say 5% of the value of Rdut to get really good results. In any case though the results for calculating Rdut are much better than what is in the software today.
I did validate that the Tina simulated numbers provide very good results using the formula given above.