sharpie7 / circuitjs1

Electronic Circuit Simulator in the Browser
GNU General Public License v2.0
2.29k stars 633 forks source link

Flyback DC/DC Converter #589

Closed JonasForssell closed 2 years ago

JonasForssell commented 3 years ago

Dear Sir, I am trying to model a flyback DC/DC converter, but I cannot make the transformer operate like a coupled inductor. Is there a reference model available or can I create a coupled inverter somehow with the inductors available?

Thanks for an excellent program! /Jonas

pfalstad commented 3 years ago

Why isn't a transformer working for you?

JonasForssell commented 3 years ago

Hello Paul, I was probably wrong. I have tried replicating this flyback converter (https://youtu.be/ye50mucjI8U) and I am starting to approach the same performance now, but I only get to 7V instead of 12V and with lower output power as a result: Same model done in easyeda simulator (based on LTspice) shows higher output power (10V) compared to my falstad model.

http://www.falstad.com/circuit/circuitjs.html?ctz=CQAgbArCBMB0AsB2ADAZghRqCM1oWgE4wBTAWkRGQV1XSMMWjEIA5ptUR5oQp4uEctmwAoAE4hs8eN1S9ps1GFZUpogO4hiIVsilhd+5KIDG2w9Hj6dy1frjRkzl69fRh+gbGUysHZAJA+1EANwM5BUM9NS8HWWMqWAgJEHojNIJM3gdEUQAVKRkpRENsQl4rLySXXHgoaigyamREQjpsZFZysB7AwiSVTlQeZE7WVDRmJMJZzSLZKosYayp5xTSVZbs1rQ2YjexStYATKQqMydkY3hOSADMAQwBXABsAF3WLo7KLmJNzFdLshFqtjLA3EhtMlZuV0BBWFg2mBDCYtNAmNk0iCsWjsUosul0nj0jEgf9RNgIAMNjsNksHPpOm5XOtigIopFdudKqsMbzjKIAEoGfRA8q8IEOKRjFx8GDJWKwMAg1JAok4hk1KlmZYxHTYFVqbCeEBkcqwRg4ZQqayzVhgLgmSQ6JYGo0OFJ7Yr66KCyT8rGBrUtMZs2Qc-Fckk4yPqrImAD2xrUdppsHwaQzqbUXGgTpgXFQolQqgaNRcDFm1ZrNcoobQIAACuIAJYAW0e4gAngAdADOAEkAHYnZ6md6PYemEgl1TYVSCVwwNwgABi4hIAEdniRp9251Iy1IZfoACLPd59-sAYW7ples6AA

pfalstad commented 3 years ago

You need to swap the secondary polarity like so:

https://tinyurl.com/yhejzgea

See the dots on the transformer symbol?

JonasForssell commented 3 years ago

Works perfectly now Paul. Thanks!

By the way, is there a way to reduce the oscilloscope resolution per division further? I am max zoomed in according to the slider (5us / div) , but would like to be even closer.

pfalstad commented 3 years ago

That is strange because for me, the max zoom is 100 us/div. But in any case, to zoom in closer, you need to reduce the time step size. Go to Options->Other Options and make the time step smaller. It can be as small as you want. It will make the circuit run slower but you will see more detail.

JonasForssell commented 3 years ago

Thank you for the help Paul,

Here are three versions of converters. I am highly impressed by your program:

Flyback: https://tinyurl.com/yf4ogwe3 Forward: https://tinyurl.com/yhgdm5el LLC: https://tinyurl.com/yztjcz66

My next step would be to try to implement digital control of the LLC. I have put in a feature request in able to do this, but are open for other ways if they are available.

many thanks /Jonas