Measuring transconductance of any circuit - Page 1
Forum section: electronics / beginners

author: promach
author_rank: Frequent Contributor
timestamp: December 14, 2018, 01:32:44 am
content: May I know if the followingtransconductance measurement test circuitis correct ?I suspect that I need to use somederivative functionbecause changing themosfets widthby a large factor does not change the gm result much at all.However, my test circuit is simulated in AC, not DC, therefore I really confuse if I should use derivative function or not ?Note: X1 is a CMOS inverter

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 14, 2018, 02:39:58 am
content: What is your end goal here? Is this a step in solving a larger problem?In small signal,Vout = Vin * gm * Rout.If you have Vin, Vout, and Rout, you calculate gm. For your inverter, gm depends on the dc bias point.You can simulate this using .ac but you want the frequency to be low enough so that there are no reactive effects.

author: promach
author_rank: Frequent Contributor
timestamp: December 14, 2018, 03:30:41 am
content: QuoteSeethis inductor calculationespecially the the small gm valuesHowever, this forum thread is focused on checking whether my transconductance measurement circuit is correct or not.QuoteOK, I will use thisnetlistinstead for biasing the CMOS inverter in saturation mode for both mosfets.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 14, 2018, 02:32:23 pm
content: Quote from: promach on December 14, 2018, 03:30:41 amThis is helpful. You need to simulate the entire circuit using dc operating point analysis (.op). This will bias the inverter properly. Then, simply look at the spice operating point output file. It will give you the gm of all transistors. For the inverter, you will sum the gm of each transistor and that is the total gm for the inverter.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 14, 2018, 02:42:52 pm
content: QuoteFor example...see attached.

author: promach
author_rank: Frequent Contributor
timestamp: December 15, 2018, 01:39:49 am
content: QuoteThis method only works forsmallcircuit (where we have derived the transfer function foroverall Gm)QuoteI needoverallGmof a black-box circuit block, not thegm of every individual mosfets(this is not really helping sinceoverall Gm is not a function of gm alone).Furthermore, unlike in LTspice and Cadence. ngspice does not give user the gm value of each mosfets even after .op analysis.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 15, 2018, 03:09:15 am
content: Quote from: promach on December 15, 2018, 01:39:49 amAre you solving a small-signal problem or a large-signal problem? (You said, earlier that it was SS...have you changed your mind?) Think about it.If ngspice will not give you transconductances, then don't use it. Use LTSpice. Frankly, my money would be on ngspice giving gm values. Hell, it has Berkeley Spice lineage! ---read chapter 13 of ngspice manual---

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 15, 2018, 03:24:12 am
content: "I need overall Gm of a black-box circuit block, not the gm of every individual mosfets (this is not really helping since overall Gm is not a function of gm alone)."Add the gm of the pch and the nch transistors together to get the overall transconductance of the inverter.

author: promach
author_rank: Frequent Contributor
timestamp: December 15, 2018, 05:00:55 am
content: QuoteHuh ? Chapter 13 is aboutverilog-A modelQuoteThis method only works well forsmallcircuit such as cmos inverter (where we have derived the transfer function for overall Gm)Note the title of this forum thread againQuoteThe following is self-biasing for cmos inverter input such thatbothmosfets are insaturationmode.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 15, 2018, 01:41:41 pm
content: Here is the chapter 13 reference:https://www.csd.uoc.gr/~hy121/2013a/datasheets/ngspice-user-manual.pdfDo this.Perform an operating point simulation.Measure the voltage at Node A at full precision.Break connection at wire B.Add a voltage source (V1) to drive Node A with the value measured above.Run another operating point simulation.Measure the voltage at the output of the inverter to full precision.Add a voltage source (V2) to drive the output of the inverter with the value just measured.Convert the first voltage source (V1), above, to a SINE source with dc offset being the same as before. Set amplitude to 1mV. Set frequency to 100 Hz.Run a transient simulation.Measure current in the second voltage source, V2. This current divided by the input ac voltage is your GM.I am pretty sure there is a better way to do this, and I will give it some thought, but this is one way.This can be simplified by just making V2 the same dc value as V1 and skip the second operating-point simulation. The results will be practically the same.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 15, 2018, 04:19:36 pm
content: Here is another way.Build the test setup using current source and controlled source as shown.Run transient analysis.Measure the voltage at the input of the DUT.Since I and V are known, calculate GM.

author: promach
author_rank: Frequent Contributor
timestamp: December 16, 2018, 01:16:32 am
content: Quote1) Is E1 a transconductance simulation element ? If yes, it seems not really practical to assign value of 100 to E1 ?2) Any reason for using "sine" current source ?3) Why transient analysis ? I suppose doing a DC sweep across Vin and doing derivative on Iout and Vin is the definition of Gm ?

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 16, 2018, 01:26:30 am
content: Quote from: promach on December 16, 2018, 01:16:32 amWhy (Why not)?E1 is functioning like an opamp. Something higher than 100 would be better, but I was concerned about convergence.QuoteIt is easy...it worksQuoteYou do not need to do a derivative. Measure delta voltage...you know the delta current. Algebra.

author: promach
author_rank: Frequent Contributor
timestamp: December 16, 2018, 01:30:14 am
content: Did you forget the capacitor which is the important component in a gyrator implementation of inductor ?

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 16, 2018, 01:33:40 am
content: Quote from: promach on December 16, 2018, 01:30:14 amNo. I am calculating Gm. Certainly Gm has some frequency dependence...you can factor that in when you pick the sine frequency.

author: promach
author_rank: Frequent Contributor
timestamp: December 16, 2018, 01:52:00 am
content: QuoteSorry, I still do not get why the capacitor is not included in the test circuit ?Ideal Lequsing gyrator implementation = CL*s/(Gm1*Gm2)Are you saying that the sine frequency of the current source I1helps to emulate a capacitor ?

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 16, 2018, 02:14:57 am
content: Quote from: promach on December 16, 2018, 01:52:00 amIn your equation...is Gm1a function of the capacitor??No, the sine is not emulating a capacitor.

author: promach
author_rank: Frequent Contributor
timestamp: December 16, 2018, 02:31:07 am
content: QuoteThe answer is no. Gm1 is the overall transconductance of cmos inverter. Gm1 is independent of capacitor. Same applies to Gm2

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 16, 2018, 02:33:40 am
content: Quote from: promach on December 16, 2018, 02:31:07 amGreat! We are making progress. That is why my method to calculate Gm has no reactive components.

author: promach
author_rank: Frequent Contributor
timestamp: December 16, 2018, 01:12:17 pm
content: QuoteInvestigate the Gm blocksseparatelyas suggested by the forum title itselfThis is my personal opinion as of now but please bear in mind that I could be wrong as well

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 16, 2018, 01:20:38 pm
content: Quote from: promach on December 16, 2018, 01:12:17 pmThat is perfectly fine to do them separately. What I have shown you, is a method to simulate and find the Gm of any block. I have already shown you an example using the inverter. Here is the diff stage.

author: promach
author_rank: Frequent Contributor
timestamp: December 16, 2018, 04:55:26 pm
content: Why use voltage source for E1 (or E2) negative input terminal ?Why use current source for E1 (or E2) positive input terminal ?

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 16, 2018, 05:18:35 pm
content: Quote from: promach on December 16, 2018, 04:55:26 pmDoes this help?

author: promach
author_rank: Frequent Contributor
timestamp: December 17, 2018, 01:27:29 am
content: Sorry for my post here, but it "seems" like you are still not measuring the overall transconductance of a circuit block separately (and independently) without using any feedback circuit (which is the opamp or E1/E2 in your previous post).I understand that you need to set up the DC operating point from the "feedback" test circuit to emulate the actual gyrator, but if that is the case , you "seems" to miss out the capacitor.Please correct me if I am wrong in any ways.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 17, 2018, 02:36:43 am
content: Quote from: promach on December 17, 2018, 01:27:29 amI set up a Gm analysis test for EACH block (the inverter and the diffamp). Your gyrator analysis requires these two Gms. NO CAPACITOR. The gyrator macro block has the capacitor. The equations call out Gm1 and Gm2 and a capacitor, CL.Gm1 does not depend on CLGm2 does not depend on CLThe gyrator which includes Gm1 and Gm2 and CL certainly depends on CL.The feedback circuit I am using is a TEST CIRCUIT. It is simply measuring the GM of the block (DUT) it is testing. It has NOTHING to do with the gyrator function itself. It is exactly the same as you measuring a resistor with a DVM so that you know what its value is to be used in another circuit. the DVM is not the final circuit...it is the TEST circuit. The final circuit is where the resistor is placed.

author: promach
author_rank: Frequent Contributor
timestamp: December 17, 2018, 12:44:56 pm
content: I can now obtain gm values of each individual mosfets using built-in ngspice command1) For your test circuit, I am still a little bit confused on the need for connecting the output node of DUT circuit to the E1/E2 input terminal ? since the other input terminal is a fixed voltage source, this looks like a voltage comparator to me ?2) What is the purpose of E1/E2 in transconductance measurement ? simply acting as a voltage gain ?3) And is there really a need for the current source (which also connects with the output node of DUT) in the test circuit ?In other words, it "seems" to me that the test circuit connection with the DUT does not correctly reflect the test measurement definition of transconductance which is delta/deltaFeel free to correct my statements though.

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 17, 2018, 01:51:49 pm
content: Lets use this circuit for our discussion.The concept behind this test scheme (which can be broadly applied to other types of circuits) is as follows.Using feedback, I force a known output current from the Gm stage. I force Iout to be equal to I3. I also force the output voltage to be equal to V1 using the opamp, U1. The output of the opamp drives the input to the Gm stage to whatever voltage needed to achieve the current balance with I3.Once I have this established, I vary the input current I3...I have Delta I. This Delta I is the output of the Gm stage because the feedback requires it. The input voltage to the Gm stage needed to achieve the Delta I is simply Delta V. There you have it. dI/dV

author: promach
author_rank: Frequent Contributor
timestamp: December 17, 2018, 02:13:39 pm
content: QuoteIs the current source I3 placed in reverse direction ? the arrow should point to GND since all the current Iout from DUT flows towards I3 and the ideal opamp U1 input terminal does not take any input currentWhy is the current source I3 using sine pattern ?This could easily complicate the computation since sine might involve some 'rms' or 'avg' syntax during Gm calculation ? or are there any specific reasons for choosing sine pattern other than "it works" ?

author: Wimberleytech
author_rank: Super Contributor
timestamp: December 17, 2018, 02:45:41 pm
content: Quote from: promach on December 17, 2018, 02:13:39 pmThe Gm stage is biased to an output voltage of 2.5 volts. Thus the current can point either way. In fact, it is oscillating plus and minus.Yes, opamp takes no current.QuotePick any pattern you want. Sine is convenient. No issue with RMS. Just use peak value or peak-to-peak value. Do the same for the opamp output for consistency.

author: promach
author_rank: Frequent Contributor
timestamp: December 23, 2018, 10:22:29 am
content: Please see the followingtest circuit (for CMOS inverter)that shows gm_pmos + gm_nmos = overall GmQuote