-
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 6 replies
-
The convergence errors (timestep too small and similar) are generally not related to Qucs-S GUI itself and very hard to debug. There exists no common route. The reasons may be very different. For example wrong model parameters, missing parasitic RC, missing input/output resistance, wrong TRAN simulation parameters. In the presented circuit you have direct connection of the voltage source, LED, and BJT part of the optcoupler. This may cause infinite current and convergence error. Also 2s is may be very long simulation time for Ngspice. You may try to reduce timestep. I guess a simple DC bias simulation would be sufficient for your circuit because you don't have pulsed or AC sources. Also keep in mind that Qucs-S contains TL431 model shipped with application. Use the search function in the libraries. If nothing helps, this error should be reported to Ngspice team providing minimal netlist that fails to converge. |
Beta Was this translation helpful? Give feedback.
-
Also V2-LED-IC1 loop has no connection to ground. This may be trouble for Ngspice, because it can consider it as the floating node. |
Beta Was this translation helpful? Give feedback.
-
SPICE doesn't support different ground. The GND in SPICE is some node which is considered as 0V. Both grounds on the schematic are connected to 0V. |
Beta Was this translation helpful? Give feedback.
-
What would be the right place to ask questions like the above, since they are not related to Qucs-S? I wanted to simulate a simple switched-mode power supply (flyback topology) in which the circuit with TL431 and the optocoupler was partly reused. Unfortunately, I now encounter the same error: "Time step is too small". I am sure that I am again missing something obvious and that an experienced eye will quickly identify it. |
Beta Was this translation helpful? Give feedback.
-
Ask this question in this thread first. Then if nothing help go to Ngspice forum: https://sourceforge.net/p/ngspice/discussion/120973/ The switching power supply is not a simple circuit to simulate. You may require a ferrite core model that is not implemented for Ngspice. Also PWM controller model may be required. |
Beta Was this translation helpful? Give feedback.
-
Okay, here is the circuit. The problem is that the simulation runs for a while and then ends with an error "Timestep too small". The time spent in simulation is enough to plot part of the output voltage (Uout). The entire .sch code is provided at the end of this message. The entire error message is also at the end of this message. Picture "Flyback-ish circuit in Qucs-S" I attempted to simulate this circuit generated by PI Expert (Power Integrations). However, I simplified the circuit. For example, I didn't include the snubber circuit and several other components in the simulation model. I also wasn't particularly meticulous in calculating the values of the components for the simulation. My initial goal was to observe behavior that at least moves in the right direction. In the next step, I thought, I would tweak the component values to achieve the best performance. Picture "SMPS (Flyback) generated by PI Expert" Schematic file Flyback.sch: TL431 model: user_lib.zip Error message:
|
Beta Was this translation helpful? Give feedback.
-
Try putting resistance between the MOSFET gate and ground. The closed BJT part of the optocoupler may have near infinite resistance. Also try the series resistance for PWM source, because the gate is capacitive load. Keep in mind that ideal transformer doesn't simulate the core saturation effect. |
Beta Was this translation helpful? Give feedback.
-
The replacing of the MOSFET device also may help. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
If your going to ask the ngspice guys for help you need to provide a netlist, libraries, .spiceinit and a screenshot of the schematic. The netlist should also have plot statements added. You can look at the ngspice examples for how to format plot statements. I would first "debug" the netlist using ngspice directly. If using Windows you can use the Ngspice GUI for MS Windows. PS There are many TL431 Spice models available. Yours is probably the more "bare bone" one I have seen. This is OK as long as it works. I have tested a number of them that don't work properly especially in ngspice. Also your schematic looks suspect... |
Beta Was this translation helpful? Give feedback.
-
@deralbert You may try to remove the feedback part and check if the convergence error still present. Also try to add snubber circuit. MOSFET may go into breakdown that also may cause convergence issues. |
Beta Was this translation helpful? Give feedback.
-
I would work on the schematic first before worrying about the netlist. The original circuit uses a switching IC. Your circuit doesn't come close to reflecting the ICs function. The values for R7/R9 are totally unrealistic. Transformer inductances don't seem correct. Primary inductance is much smaller that output inductance yet it's a step-down/buck configuration. You should your attach project schematics, models/libraries/subcircuits minus data or PDFs. You didn't send the TL431 subcircuit schematic. |
Beta Was this translation helpful? Give feedback.
Also V2-LED-IC1 loop has no connection to ground. This may be trouble for Ngspice, because it can consider it as the floating node.