Measure the equivalent resistance in a simulator - Page 1
Forum section: electronics / beginners

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 08:30:55 am
content: 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

author: Zero999
author_rank: Super Contributor
timestamp: January 11, 2019, 08:47:39 am
content: 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.

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 09:01:48 am
content: 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.

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 09:15:49 am
content: Thanks! This works!

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 09:55:47 am
content: You may use 1uA AC current source, of course.5mV then means 5kOhm.

author: Ian.M
author_rank: Super Contributor
timestamp: January 11, 2019, 10:51:33 am
content: Quote from: imo on January 11, 2019, 09:01:48 amIf 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. plotV(in)/1AThis 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.

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 11:55:44 am
content: 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.

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 12:01:30 pm
content: 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.

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 12:21:23 pm
content: 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.

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 12:38:48 pm
content: With your 100mF caps and the C5=1pF (or 0pF) feedback it is indeed 26.6kOhm

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 12:59:04 pm
content: Then what do I get? And why?

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 01:02:16 pm
content: 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.pdfQuote from: imo on January 11, 2019, 09:01:48 am

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 01:15:37 pm
content: 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.

author: Zero999
author_rank: Super Contributor
timestamp: January 11, 2019, 01:31:24 pm
content: 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?

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 01:32:25 pm
content: 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.

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 01:43:56 pm
content: 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.

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 01:50:30 pm
content: Show me your Vs2 voltage (after the ac analysis finished) - see above my last post schematics..

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 01:57:39 pm
content: Vs2 as you see is at 32V so Vs is close to 0V

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 02:04:59 pm
content: 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.

author: bonzer
author_rank: Regular Contributor
timestamp: January 11, 2019, 03:05:19 pm
content: 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.

author: iMo
author_rank: Super Contributor
timestamp: January 11, 2019, 03:14:22 pm
content: 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.

author: bonzer
author_rank: Regular Contributor
timestamp: January 12, 2019, 09:05:07 am
content: 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.