Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformerPS1S2 Issue #362

Closed
3 tasks done
tomhajjar opened this issue Nov 14, 2023 · 11 comments
Closed
3 tasks done

TransformerPS1S2 Issue #362

tomhajjar opened this issue Nov 14, 2023 · 11 comments
Labels
Milestone

Comments

@tomhajjar
Copy link

tomhajjar commented Nov 14, 2023

I'm having issues trying to get a 6-phase rectifier circuit to work. I sent the netlist over to the ngspice guys and they found a possible error with .SUBCKT Transformers_TransformerPS1S2. The netlist line "R3 nSPlus nSplus {RS1}" is wrong. There may be other errors in the .SUBCKT.

https://sourceforge.net/p/ngspice/discussion/133842/thread/c4ecc7c227/

2023-11-14_105159

6_Phase_Rectifier.zip

TODO list:

  • Fix short circuit in transformer model
  • Add TD parameter for sine source
  • Deprecate red AC source
@ra3xdh
Copy link
Owner

ra3xdh commented Nov 14, 2023

I have fixed the short circuit in the library by the latest commit, but the convergence error remains. I cannot say why this simple circuit still give the convergence error in Ngspice. You can grab the fixed library here: https://raw.githubusercontent.com/ra3xdh/qucs_s/current/library/Transformers.lib

@ra3xdh ra3xdh added the library label Nov 14, 2023
@tomhajjar
Copy link
Author

tomhajjar commented Nov 14, 2023

Holger recommendation is shown below. I cannot find "chgtol" in the Qucs Transient properties settings.

You may add this line to the netlist.
.options abstol=10u chgtol=1e-10 method=gear
Because you have high voltages, chgtol and abstol reduce the precision requirements, especially the gear method here yields a transient solution. It looks strange though, and you should simulate up to 1 s to see the output signal decay.

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 14, 2023

Yes, the options helps. You may use the .OPTIONS device.
image

@tomhajjar
Copy link
Author

tomhajjar commented Nov 14, 2023

Output is wrong. Supposed to look like the following.

Dietmar made the following comment:

"The first gnd node in transformer is obsolete and can removed in subckt definition and call."

If I disable TRAN1, the output is unchanged...

6-phase-rectifier

6-phase-rectifier-out

@tomhajjar
Copy link
Author

tomhajjar commented Nov 14, 2023

Holger said to use Delay instead of Phase for the AC source. This and the changes to Transient Parameters allows the analysis to be correct starting at T=0 instead of having to wait a long time for the system to settle. Holgers explanation points out why I was having so many issues.

#362

Can the new Spice "ac Voltage Source" have VO (offset), VA (amplitude), FREQ (frequency), TD (delay), THETA (damping) and PHASE (phase) added as the default entry parameters? Presently it has "Vac" which is meaningless. The "V source" usage is a bit confusing.

Dietmar pointed out that the "gnd" entry for .SUBCKT Transformers_TransformerPS1S2 as shown below is unused. Is this a mistake?

.SUBCKT Transformers_TransformerPS1S2 gnd nPplus nPneg nSplus nSneg nSPct L1=0.5 L2=0.125 L3=0.125 K12=0.99 K13=0.99 K23=0.99 Rp=2 Rs1=1 Rs2=1

Attached is the "good and bad" schematics.

6_Phase_Rectifier.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 15, 2023

Can the new Spice "ac Voltage Source" have VO (offset), VA (amplitude), FREQ (frequency), TD (delay), THETA (damping) and PHASE (phase) added as the default entry parameters?

Yes, you may use the generic SPICE source for this purpose:
image

Dietmar pointed out that the "gnd" entry is unused. Is this a mistake?

No, this is done intentionally for Qucs compatibility. This node never caused problems before.

@tomhajjar
Copy link
Author

tomhajjar commented Nov 15, 2023

The "ac Voltage Source" at the bottom of the Sources menu is a Spice only component so Qucs compatibility isn't an issue. It has a single default entry of "Vac" which is wrong. ngspice thinks it is a DC source. Why was this device created when "V Source" is already available?

Can you alter "ac Voltage Source" by adding all the parameters to the Menu so the User can change them?

2023-11-15_111458

2023-11-15_111955

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 15, 2023

Yes, I have just added the TD and VO parameters for AC source. This fix will be available since the new release.

image

@tomhajjar
Copy link
Author

The "ac Voltage Source" at the bottom of the Sources menu will still be wrong if not changed or deleted. Why was it created?

2023-11-15_115150

@ra3xdh
Copy link
Owner

ra3xdh commented Nov 15, 2023

Why was it created?

This device was added by @MikeBrinson long time ago. I cannot say what was the purpose for this device. I am also finding two type of source confusing. I may delete it in the next release. The V source device would be sufficient if one need full SPICE definition.

@ra3xdh ra3xdh added this to the 24.1.0 milestone Nov 21, 2023
@ra3xdh
Copy link
Owner

ra3xdh commented Nov 27, 2023

I have deprecated the red AC source. The remaining issues with the transformer library will be fixed in #367 Closing this as completed.

@ra3xdh ra3xdh closed this as completed Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants