Author Topic: Measure the equivalent resistance in a simulator  (Read 5692 times)

0 Members and 1 Guest are viewing this topic.

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Measure the equivalent resistance in a simulator
« on: January 11, 2019, 08:30:55 am »
Hello! Please help me to understand how to properly measure in PSPICE the impedance (real) of this amplifier seen from these points.

As you see I assigned particular values for the capacitors, 1mF for those that should behave like a short circuit and 1pF the open circuits (because want it in passband).

I tried different ways like: putting a current source dc or ac of small value 0.1 or 0.01 and measure the voltage at it's points but it gives me different values of resistance that change depending on the case. But this way the polarization of the transistors is verified at least (Vbe =0.7V).

When trying to apply thevenin instead, I let it run with the power supply only and then measure between those points the voltage and after that I put a short circuit there to measure the current  and it gives me another value of resistance again different from the previous and also the polarization isn't verified so it's not certainly the right way but maybe it's closer? ...

Which way would be the proper one?
*Updated as Zero999 said
« Last Edit: January 11, 2019, 09:09:37 am by bonzer »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: Measure the equivalent resistance in a simulator
« Reply #1 on: January 11, 2019, 08:47:39 am »
I can't see the schematic because it's blocked by the firewall. Please upload it as an attachment, that way this thread still makes sense if the external hosting site goes down.

I haven't used PSpice before, but LTSpice which is based on the same SPICE engine so should be similar. The impedance can be plotted by performing an AC analysis and plotting V/I.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #2 on: January 11, 2019, 09:01:48 am »
In LTSpice: Use 1A AC current source, do AC analysis and set plot to Bode, set the dB axis to Linear.
Attach the 1A current source into the points where you want to measure.
"15kV" then means "15kOhm".
Example below.
« Last Edit: January 11, 2019, 09:42:52 am by imo »
Readers discretion is advised..
 
The following users thanked this post: spec, bonzer

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #3 on: January 11, 2019, 09:15:49 am »
Thanks! This works!
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #4 on: January 11, 2019, 09:55:47 am »
You may use 1uA AC current source, of course.
5mV then means 5kOhm.
Readers discretion is advised..
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 13216
Re: Measure the equivalent resistance in a simulator
« Reply #5 on: January 11, 2019, 10:51:33 am »
In LTSpice: Use 1A AC current source, do AC analysis and set plot to Bode, set the dB axis to Linear.
Attach the 1A current source into the points where you want to measure.
"15kV" then means "15kOhm".
If you have concerns about the unphysicality of applying KV signal levels to devices with models that have only been verified up to tens of volts, it works*  because SPICE .ac analysis linearises the circuit by first finding an operating point then deriving linear small signal models for each active or non-linear device.  i.e. it replaces them with an ideal amplifier or attenuator + any phase shift required.

LTspice can directly display ohms if you use waveform arithmetic in the plot pane and the quantity plotted has dimensions of resistance. e.g. plot V(in)/1A  

This also scales the plot and adds a new Y axis for resistance so an input resistance of (e.g) 15K doesn't 'crunch' all other voltages you are monitoring.

* For some value of 'works', as it wont show any non-linearities in the input impedance due to bias point shifts with signal level.
 
The following users thanked this post: bonzer

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #6 on: January 11, 2019, 11:55:44 am »
Thanks for the information. First I was surprised when I saw those voltages but now I understand how it works. Anyway I know LTSpice is more popular but I've just learnt how to use PSPICE so it's kinda hard for me to switch to LTSpice now because I'm still not familiar enough with this stuff. Also my professor uses pspice.

I have a little problem here: I know (from others who did it) that the equivalent resistance seen by C5 should be 26.67kOhm but it gives me 32 Ohm. I tried it even with smaller currents (even though as you said it wouldn't change for big currents, and in fact it doesn't change). I can't figure out what's wrong. Now it's at higher frequencies with the other capacitors assuming those values because I want them to behave like short circuits in this case.
« Last Edit: January 11, 2019, 12:00:04 pm by bonzer »
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #7 on: January 11, 2019, 12:01:30 pm »
Do you mean "seen by I5", don't you?
Both I5 sides are low impedance, it could be you see low impedance (at kHz freqs).
Also do use 1A current source.
« Last Edit: January 11, 2019, 12:03:25 pm by imo »
Readers discretion is advised..
 
The following users thanked this post: bonzer

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #8 on: January 11, 2019, 12:21:23 pm »
Yes, seen by I5. I replaced C5 with the generator because I need to see what resistance is seen by C5 when opened.
Thanks for the confirmation. So theoretically speaking it should be right. Then those guys were wrong and maybe one copied from the other. Or maybe they measured something else. Whatever, I'm gonna try it out again later from the beginning. 
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #9 on: January 11, 2019, 12:38:48 pm »
With your 100mF caps and the C5=1pF (or 0pF) feedback it is indeed 26.6kOhm :)
« Last Edit: January 11, 2019, 12:59:35 pm by imo »
Readers discretion is advised..
 
The following users thanked this post: bonzer

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #10 on: January 11, 2019, 12:59:04 pm »
 :( Then what do I get? And why?
« Last Edit: January 11, 2019, 01:01:53 pm by bonzer »
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #11 on: January 11, 2019, 01:02:16 pm »
You have to provide an "AC analysis" with the 1A "AC" current source as the Signal Generator.
That is a special SPICE directive:  .AC type np fstart fstop ..

When 1A AC current source is used the AC analysis returns complex "impedance" (R+iX) as the function of frequency. The "R" is your "resistance".

The impedance is returned as seen from the AC current source (PS: also a Voltage source is used with the analysis, but not here).

And you may plot that function in several formats, ie Bode, etc.

Here is something to read:
https://class.ece.uw.edu/cadta/hspice/chapter_9.pdf

In LTSpice: Use 1A AC current source, do AC analysis and set plot to Bode, set the dB axis to Linear.
Attach the 1A current source into the points where you want to measure.

« Last Edit: January 11, 2019, 01:25:27 pm by imo »
Readers discretion is advised..
 
The following users thanked this post: bonzer

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #12 on: January 11, 2019, 01:15:37 pm »
I think I did the same in PSPICE. It worked well for the other cases (for C1,C2,C3,C4 corrspend to the right values).  Only now it gives a different value. I'm gonna try it on LTSpice later, I can't do it now.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20357
  • Country: gb
  • 0999
Re: Measure the equivalent resistance in a simulator
« Reply #13 on: January 11, 2019, 01:31:24 pm »
SPICE assumes capacitors are in Farads and m is the standard SI prefix for 0.001. C2 to C4 are massive. 100mF is 0.1F or 100 000µF.

Are you sure you don't mean 100µF?
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #14 on: January 11, 2019, 01:32:25 pm »
Then you need to plot the AC analysis results properly.
The AC analysis plot in LTspice is done automatically (you do not need to assign the Nodes, as the 2 nodes are given by the nodes where AC source is wired in).

From what I see above you do plot some voltage diffs - that is not good here.

The "Vs2" in your schematics should plot the Resistance.

« Last Edit: January 11, 2019, 01:48:03 pm by imo »
Readers discretion is advised..
 

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #15 on: January 11, 2019, 01:43:56 pm »
I tried it even with other capacitor values (lower) and it's the same.

Well I don't know a better way to measure the voltage there. I measured it even separately without doing the difference letter by my own and it gives me the same values.
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #16 on: January 11, 2019, 01:50:30 pm »
Show me your Vs2 voltage (after the ac analysis finished) - see above my last post schematics..
« Last Edit: January 11, 2019, 01:55:01 pm by imo »
Readers discretion is advised..
 

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #17 on: January 11, 2019, 01:57:39 pm »
Vs2 as you see is at 32V so Vs is close to 0V
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #18 on: January 11, 2019, 02:04:59 pm »
And the Vs voltage?
Mind the Vx are complex numbers, they could be shown as Re+iIm, or Magnitude_Phase. My results are Magnitude with Phase.
« Last Edit: January 11, 2019, 02:17:54 pm by imo »
Readers discretion is advised..
 

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #19 on: January 11, 2019, 03:05:19 pm »
this is the Vs and these are the magnitudes. I've just tried ABS(*) and it gives me the same result so it's not the sum.
« Last Edit: January 11, 2019, 03:08:01 pm by bonzer »
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5570
  • Country: va
Re: Measure the equivalent resistance in a simulator
« Reply #20 on: January 11, 2019, 03:14:22 pm »
Doublecheck whether you are using the "AC Current" source..
It could be you go with Voltage source, when entering into it "1A" it will work but you will get a shit.
 :palm:
« Last Edit: January 11, 2019, 03:52:33 pm by imo »
Readers discretion is advised..
 

Offline bonzerTopic starter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: it
Re: Measure the equivalent resistance in a simulator
« Reply #21 on: January 12, 2019, 09:05:07 am »
No actually it wasn't the problem. Also the different symbol is because of my old free version of spice.

I accidentally found the problem when measuring again. I put those simple voltage samplers instead of putting a net alias like I did before.
It gave me the right values. Then trying again with net alias (Vs, Vs2) it doesn't work. I don't know why. Anyway now I'm gonna always use those simple samplers to feel sure.

**EDIT**
It honestly surprises me because I used Net Alias so many times and they never gave problems. I hope my prof. doesn't get mad if sees them in the schematic as I don't know what they exactly mean or do but I've seen someone using the on the internet. Also I've just discovered another type of reference that doesn't work in this case either giving the same wrong 32V values(that with the empty circles, Vs,Vs2) that was often used by other students but ceirtanly not in this case.

« Last Edit: January 12, 2019, 09:16:20 am by bonzer »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf