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

Transformer Library Testing #228

Closed
2 tasks done
tomhajjar opened this issue Feb 20, 2023 · 12 comments
Closed
2 tasks done

Transformer Library Testing #228

tomhajjar opened this issue Feb 20, 2023 · 12 comments

Comments

@tomhajjar
Copy link

tomhajjar commented Feb 20, 2023

I cannot figure out how to use some of the transformer models in Transformers.lib and how to use properly use Cores.lib.

First issue is the model XSPICEPS1S2 in Transformers.lib. On the Help web page below, it shows two parameters L and A that don't exist in XSPICEPS1S2 in Transformers.lib. The parameters ntp, nts1 and nts2 cannot be known without knowing L and A.

When I try to use XSPICEPS1S2, it is in saturation as shown below regardless of ntp, nts1 and nts2. (See R5 comments below.)

Also, shouldn't the XSPICE transformer models allow one to choose the core materials mentioned in Cores.lib? How does one use Cores.lib?

Another issue is R5 used in multiple simulations shown on the Help web page below is 2k. No one would use a resistor as large as 2k on the primary. Rp is already in the model. Does the model only work for small input voltages?

Lastly I created a Bridge Rectifier model that would be useful to some and maybe good as a library item.

https://qucs-s-help.readthedocs.io/en/latest/SPICEComp.html#two-winding-transformer-model-with-in-phase-primary-and-secondary-voltages-and-winding-resistance

TODO list from @ra3xdh

  • Add L and A parameters for XSPICEPS1 and XSPICEPS1PS2
  • Fix warning on missing inductor model

2023-02-20_174757

Transformer XSPICE

Transformer_testing.zip

@tomhajjar
Copy link
Author

tomhajjar commented Feb 20, 2023

I looked at Transformers.lib and it seems L, A and core laminate are fixed for XSPICEPS1S2.

XSPICEPS1S2:
.model Steel core length = 0.2 area=2e-4

LossyTransformer2 let's you change L and A but no mention of core laminate.

These limits should be mentioned in the Library "Show model"

2023-02-20_153502

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 21, 2023

I looked at Transformers.lib and it seems L, A and core laminate are fixed for XSPICEPS1S2

Yes, this device should be corrected. The L and A parameters are indeed fixed.

Also, shouldn't the XSPICE transformer models allow one to choose the core materials mentioned in Cores.lib? How does one use Cores.lib

It is not possible to specify the model name as the subcircuit parameter. The only way to attach core is to create your own subcircuit as shown in the Qucs-S manual.

@tomhajjar
Copy link
Author

tomhajjar commented Feb 21, 2023

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 21, 2023

I don't own these schematics. The help was written by Mike Brinson around 2016. I am not sure if some schematics are remaining after seven years passed.

@tomhajjar
Copy link
Author

Mike is going to look. ;-)

@tomhajjar
Copy link
Author

tomhajjar commented Feb 23, 2023

I'm finding multiple issues with this library.

Cosmetic issues:

For ease of drawing schematics or substituting one transformer with another, similar transformer types should use the same symbol and pin locations.

The five, two winding transformers use different symbols and pin locations. .

The two, three winding (center tapped) transformers use an unsymmetrical symbol with one pin in each placed in the wrong location.

Functional issues:

XSPICEPS1S2 output polarity is flipped as shown below. As stated above, parameters N and L are missing and the user should know what the core type is. A lot more work needs to be done to confirm the functionality of the model

I'm trying to test all the models for functionality. The attached files do just a simple check of functionality. Waiting for Mike to send the original files.

XSPICEPS1S2

Transformer_Lib_Test_prj.zip

@tomhajjar
Copy link
Author

tomhajjar commented Feb 23, 2023

I made a first cut at new transformer symbols. They are fully symmetrical with pins on the grid. You can substitute a different model, mirror or rotate devices without having to fix the schematic as is required now.

2023-02-23_120406

symbols_transformers.zip

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 23, 2023

The symbols in the library is not subject of change. The library was fully operational at least until Ngspice-27. And there may be users that designed circuits with old symbols. I don't know how many users used these devices. If we change the symbols in the library, the backward compatibility will be lost and ALL existing schematics will require redesign. This may cause a tons of bugreports why the symbols were changed.

@tomhajjar
Copy link
Author

Understand. People can use the symbols to make new transformer sub circuits.

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 23, 2023

I have attached a TODO list for this issue.

@ra3xdh ra3xdh added the bug label Feb 23, 2023
@ra3xdh ra3xdh added this to the 1.0.2 milestone Feb 23, 2023
@ra3xdh ra3xdh modified the milestones: 1.0.2, 1.0.3 Apr 23, 2023
@ra3xdh ra3xdh modified the milestones: 1.0.3, 1.0.4 Jun 2, 2023
ra3xdh added a commit that referenced this issue Jun 22, 2023
@ra3xdh
Copy link
Owner

ra3xdh commented Jun 22, 2023

I have fixed XSPICE transformers in the library. You can get the latest library from here: https://raw.githubusercontent.com/ra3xdh/qucs_s/current/library/Transformers.lib Closing this as resolved. The solution for #231 will be added separately.

@ra3xdh ra3xdh closed this as completed Jun 22, 2023
@ra3xdh ra3xdh self-assigned this Jun 22, 2023
@tomhajjar
Copy link
Author

tomhajjar commented Jun 22, 2023

I confirmed that the changes to Transformers.lib work however XSPICEPS1S2 still has an inverted output. When you cascade 2 Lcouple elements, the output is inverted.

I recreated the two Mike Brinson XSPICE models, XSPICEPS1 and XSPICEPS1S2 in the online Help.

XSPICEPS1 has it's output pins swapped to correct output polarity but XSPICEPS1S2 doesn't so it's output is 180 out of phase. I fixed it in my recreation and confirmed output polarity is correct. Attached is the fixed Transformers.lib.

2023-06-22_210252
2023-06-22_210448

Transformers.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants