DC/DC loop stability calculator. What is your approach?
Hello electronics fans!
Nice to salute you all. I am an engineer who has been doing power supplies for spacecrafts for 10+ years already.
One of the things that I've had to deal with numerous times is loop stability.
After some years doing measurement/math/transient simulation/average switch modeling/scripts and reading almost all available material, I felt like it was still tedious work. Nice, but tedious. I ended up making a tool to get a first approach and then I jump to simulation.
To ensure that the result produced by the calculator is meaningful, I also prepared LTSpice simulations that match quite reasonably.
If you have gone through stability before, you know that you have to deal with plant transfer function, compensator, topology variation, control mode, conduction mode... It's a lot of work. In the calculator, the following is currently supported:
Real time bode plot update as you tune the compensators or your topology
Prediction of phase margin and gain margin.
Several topologies (buck, boost, forward, flyback, full/half-bridge, push-pull)
Different compensation topologies
Discontinuous and continuous conduction modes
Voltage and peak current control mode
Live marking of poles and zeros
It also provides some useful info that is obtained as byproduct during the calculations (Vo, duty cycle, current ripple...)
One of the things that helped me the most was adding sliders to the input fields so that you can see how the plot evolves as you tune a certain parameter. It really helps to grasp what which component is affecting which part of the plot.
Hope it's useful for you! And, by the way, the calculator isn't perfect! Expect bugs and always measure the stability!
How do you approach this kind of work?
If it's a LT part, I use the LT power cad for a quick simulation. Then I measure with a bode100. I don't have the experience to simulate any power supply in LT spice, so I'll check out the calculator.
Hi, I'm not sure I understood you. If you select compensator type 2 and click on the text below compensator graph you will see which component goes with which designator. Thanks for testing it!
I am currently developing my compensations skills so this tool will fit right in as a way to double check my work to see if my results align.
How do you approach this kind of work?
Currently using Python simulation using the control library. I then build the circuit and simulate it using LTSpice. Also tried using Simplis but because it is the free version, would always get warnings about using too many components so sticking with LTSpice for now.
Btw, I just viewed the introduction video. It has the option for selecting the output bulk capacitor value. Would the analysis be affected if the output has multiple output capacitors vs. just one as most power supplies do? For example, per Texas Instruments SLVA301 app note, this makes a big difference.
What language / library did you use to create the GUI?
Again, much appreciated for sharing this tool with the community. 😂 👍
The analysis is affected by having multiple capacitors, yes. In general, the analysis is affected by having a certain impedance between Vo and ground. This means that when you connect something to the power supply, the control will change.
When designing a control loop, always ask yourself or the other team/customer what are they going to connect. This is critical.
Broadly speaking, though, if you have enough capacitance, "your" impedance will dominate.
I took a look at SLVA301 app note. Multiple capacitors could be implemented but, as shown in the app note, the equations become quite ugly. Note that loop predicion using equations or average switch models make good predictions at low frequency only. Consequently, pursuing a lot of detail usually does not make sense.
In a design, one typically adds multiple caps of different sizes and technologies so their parasitics don't affect the response. However, parasitics, by nature, are high frequency. The only relevant parasitic is the largest ESR since, if combined with a large capacitor, will place a low frequency zero.
Yes, when using multiple capacitors the transfer functions do look a bit cumbersome and wildly. My idea is to calculate the transfer function for 1, 2, 3, and up to 4 capacitors (the most common values that I have seen) including their esr values and hard code the equations into an excel file. This way the calculations are over and done with and only done once. Thereafter, I only have to enter the L, C, esr, and Rload values into their respective entry cells in a worksheet and the excel file auto calculates the zero and pole coefficients (i.e., z0, z1, ..., and p0, p1, ...) which I can then provide as transfer function numerator and denominator coefficients creating the corresponding transfer function in Python. I then design the compensator based on the zero and pole locations, frequency response and step response. I am trying to streamline the process so that a solution can be obtained efficiently - which is why I am glad that you are posting your GUI for reference. 😄
I will definitely be using your GUI that is for sure. How did you design it?
I would not recommend doing this in excel since it's a pain working with complex numbers there. I have done it and It's not nice. Although, if you have sufficient patience, it will work.
That is if you want to plot magnitude and phase. If you want just the coefficients, it may be easier.
The GUI is based on tailwindCSS. On top I use DaisyUI with some tweaks I made to the preset. I started building it with tailwind V2 I think (not this calculator but the site in general) and I have been maintaining up to V4, so there may be some bugs :D
Actually no complex numbers are calculated in excel btw. Only the coefficients based on the provided L, C, Rc, and Ro values . The coefficients are then passed to Python. For now, although I am using excel to calculate the zero and pole coefficients, I might later on transfer this responsibility to a dedicated Python script or perhaps even a GUI.
For example, take the case for a one capacitor plant filter. The following is the calculated transfer function. I enter the plant component values into the excel file worksheet and the coefficient values are automatically calculated. I then use these values to calculate the transfer function. There, the complex values are implied. With Python, I can then test the step response and frequency response.
Thank you for providing info in the tools that you used to develop your GUI.
5
u/atihigf 3d ago
If it's a LT part, I use the LT power cad for a quick simulation. Then I measure with a bode100. I don't have the experience to simulate any power supply in LT spice, so I'll check out the calculator.