Simulate synchronous/active rectifier with mosfet

Hello people
i am incredibly new to kicad. I actually installed kicad this Sunday.
I want to simulate this circuit, it is an active grinding with mosfet.
This circuit has the ability to handle large amounts of current without loss due to heat dissipation.

I have been very blocked with the simulation of transformers in kicad. I have read muchotopic in the forum on the subject but in the simulation it does not work! the coupling factor does not work! I have entered different codes the transformer, the one that if it works halfway is this… .subckt mytrafo5 p1 p2 s3 s4 s5
L1 1 0 10u
L2 2 0 10u
L3 3 0 10u
k1 L1 L2 L3 0.13
.ends mytrafo5 what I want to simulate is one is a real transformer of primary 220v and secondary 30v.
The simulation of that code works, it does not abort, but in the output it always shows me 0v, putting what it gives it (resistors, capacitors, l7815, etc.) I have tried to vary the coupling factor, the inductances of the windings and nothing can not make it work!
What am I setting wrong?
regards

The coupling has to be pairwise between two inductors only.

Excerpt from the ngspice manual:

3.3.11 Coupled (Mutual) Inductors
General form:
KXXXXXXX LYYYYYYY LZZZZZZZ value
Examples:
K43 LAA LBB 0.999
KXFRMR L1 L2 0.87
LYYYYYYY and LZZZZZZZ are the names of the two coupled inductors, and value is the coefficient of coupling, K, which must be greater than 0 and less than or equal to 1. Using
the ‘dot’ convention for drawing the coupled inductors, place a ‘dot’ on the first node of each inductor. If you have more than two inductors interacting, pairwise coupling is supported.
Pairwise coupling of more than two inductors:

L1 1 0 10u
L2 2 0 11u
L3 3 0 10u
K12 L1 L2 0.99
K23 L2 L3 0.99
K13 L1 L3 0.98

When there are more than two inductors coupled for interaction, some combination of coupling constants are not possible physically because the magnetic fields then would violate energy conservation. ngspice checks the coupling matrix for such conditions and issues a warning.

1 Like

What manual are you looking for because I found one in the network and there is no point 3.3.11!

If this code proves and I also tried to make many modifications to it but I cannot see a correct simulation of for example 30v at the output. Try adding a diode too and the result is always zero! volt. that’s why I don’t understand! :man_shrugging:

When I google ‘ngspice manual’, the first entry in the resulting list leads to the ngspice user’s manual which definitely has a chapter 3.3.11.

I also do not understand your results because you do not show them. There is no transformer in your sketch, and there is no information on the transformer circuit you have been simulating.

So I cannot be of any help.

I’m picking up a language barrier here. Sounds like he’s using Google Translate, so it’s going to be tough navigating this one. Just a heads up.

@Foton: Can you put your KiCad project folder in a ZIP file and upload it to us?

jaja yes i do not speak or write english very well!

tells me : Sorry, new users can not upload attachments. :man_shrugging:
I leave you, my email, write me and send it to you by there .

Up load now. Never good to leave an email on a forum unless you want lots of spam to that address. :wink:

yes its true!, but i had no other choice! well here is the last file i have tried.
4to proyecto.zip (5.1 KB)
here it is, the synchronous rectifier circuit. it doesnt work wery well in simulation.
5to proyecto.zip (81.7 KB)

There were some problems with your transformer/rectifier circuit.
1.) You need series resistance on the primary otherwise SPICE cannot solve the circuit.
2.) You were missing a diode model for the 1N4007.
3.) Your subckt command needs node names on the first line to match with node names used within the subckt block.
4.) I’m bad with transformers, but I think for 50Hz you need much higher inductance values.
5.) You should be using Transformer_1P_1S or Transformer_1P_SS for this, not Transformer_1P_2S.

Try this, and hopefully it’ll help you understand better.
4to proyecto_fixed.zip (45.9 KB)

Your 2nd attachment is way too large/complicated for me to rework for you. Hopefully you can take what you learn here and fix it yourself.

1 Like

Some additional remarks on transformers:

The coupling ratio k is telling us how good a transformer is constructed, how good the magnetic coupling between primary and secondary windings is. It is typically close to 1. You could start with setting it to 1.

For the output to input ratio you may have a look at https://en.wikipedia.org/wiki/Transformer, especially the box Ideal transformer equations.

The ratio of the number of windings determines the voltage transformation ratio. in ngspice you cannot give the no of windings, but primary and secondary inductances. Therfore you should have a look at eqn. 5. The voltage ratio alpha goes with the square root of the inductance ratio. So to double the voltage at the output you have to quadruple the secondary inductance (and vice versa). For the absolute inductance values you should look up a transformer data sheet.

1 Like

To care for the necessary series resistance of every inductor, you may use the option

.option rseries = 1.0e-3

by adding it to the text box with the .tran command.

1 Like

Oh, man. A+ tip. Thanks for sharing!