|
From: <mic...@in...> - 2020-09-23 08:21:20
|
Hi Florian, I was not aware that Middlebrook updated his method. Thanks for the hint. I’ve just found the paper in the internet. It’s a good idea to implement an ideal balun. Although it could be built easily by controlled sources it is much more handy to have it as a single device. Have a nice day, Michael From: Florian Ballenegger <flo...@an...> Sent: Dienstag, 22. September 2020 12:11 To: Asam Michael (IFAG ATV BP D PD CE) <mic...@in...>; ngs...@li... Subject: RE: [Ngspice-devel] Loop stability analysis Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe<https://goto.infineon.com/SocialEngineering>. Hello Michael, Thank you for your interest in the new stability analysis. Of course it would be great for me if you can test it once you will have time ... Your comments are very relevant, let me add some clarifications: a) What is known as the "Middlebrook's method" was published in 1975. However, Middlebrook published in 2006 a new and more generic method called "The General Feedback Theorem", which is actually posterior to the analysis published by Tian and Kundert and implemented in spectre. As I understand, the new method by Middlebrook is fully accurate and general and do not suffers the shortcomings from the first method from 1975. What I have implemented in ngspice is this new "General Feedback Theorem", not the old "Middlebrook's method". There is a few differences when comparing with Tian's method. Tian define the "true" loop gain T to be the sum of the forward loop gain and the reverse loop gain. This is not the case in the General Feedback Theorem: the probe must be placed in the direction of the gain in the loop. If the probe is placed in the reverse direction, the calculated gain would be very small and no stability information could be extracted. It is however easy to reverse the analyzed direction just by setting a flag to the analysis statement. b) There is also a reference node which can be chosen when applying the General Feedback Theorem, which indeed sometimes can make a difference. It is possible to specify the reference node in the analysis statement, adding refnode="ref". If not specified, ground will be assumed. c) For stability analysis of differential circuits, I added an "ideal balun" device into ngspice. By inserting a chain balun/probe/balun along the feedback loop, the differential loop gain or the common-mode loop gain can be analyzed. The balun/probe/balun insertion do not affect the behavior of the circuit. As all letters of the alphabet was already reserved to specify existing device type, I had to modify the parser and to introduce a new syntax as following: mybalun#balun vinp vinn indiff incm indiff I now realize that maybe it could be a better idea to adopt instead the syntax style from Qucs ? Qucs syntax is: balun:mybalun ... Regards, Florian 21 septembre 2020 18:09 <mic...@in...<mailto:mic...@in...>> a écrit: Hi Florian, great that you are working on a stability analysis! :-) I also thought about doing so but a lack of time was the problem. I also haven’t found the time to look into your git branch, but two things came to my mind: a) Middlebrook’s method has two drawbacks: • It works only for a signal flow in one direction and regards no internal feedback (which is usually always there, e.g. due to transistor capacitances). • It works not if the input or output impedance is zero. I recommend to use a similar method with a modified equation which overcomes those limitations. It was developed by M. Tian, et al., see: https://kenkundert.com/docs/cd2001-01.pdf b) It is crucial to reference the voltages to a node which can be specified. Maybe you have already implemented it. Not all circuit parts have GND as their reference. Example: Simulation of an IC on a board. GND is defined on the board. The IC has an internally closed control loop. For this loop the reference voltage is the IC_GND. Between GND (on the PCB) and IC_GND are bond wire inductances, etc. So both voltages will be different. In this case, for the stability analysis the loop voltages in the equations have to be referred to IC_GND, otherwise the result will be wrong. I stumbled over this issue many years in the past with the commercial circuit simulator spectre, where at that time there was no possibility to specify the reference supply node. I got really weird results and I had to dig into this topic to figure out, what’s going wrong. Many thanks again, and I’m looking forward to test it once I have time. Best regards, Michael Asam From: Florian Ballenegger <flo...@an...<mailto:flo...@an...>> Sent: Freitag, 11. September 2020 18:09 To: ngs...@li...<mailto:ngs...@li...> Subject: [Ngspice-devel] Loop stability analysis Caution: This e-mail originated outside Infineon Technologies. Do not click on links or open attachments unless you validate it is safe<http://iweb.infineon.com/en-US/Support/security/CDC/pse/Pages/pce.aspx>. Hello, I have worked on implementing a loop stability analysis into ngspice, as an alternative to the old and well known SPICE technique using an AC analysis, breaking the loop with huge inductor and injecting a signal trough an huge capacitor. With the new .loop analysis: - only a voltage source "probe" must be added in the feedback loop to analyze. - alternatively, a device and a terminal can be specified for where to insert the probe, without needing to modify the netlist or schematic at all ! - the loop analysis calculates the loop gain function and will extract and print the phase margin, the gain margin, and the unity loop gain frequency. - all existing AC source stimuli existing in the netlist are shut-off during the loop analysis in order not to disturb the results - if an input source and an output port is specified, the loop analysis will calculate all functions defined by the General Feedback Theorem proposed by Prof. R. D. Middlebrook, which can provide valuable insight of the feedback system under test. Francesco, can I push the modified ngspice source into a new "loop_analysis" git branch ? It is independent to the "simd" branch and is based on "master". Best regards, Florian |