Understanding an Inverter Simulation

In summary, this circuit is a 12V DC to 120V AC inverter that uses a transformer to convert the DC to AC. The inverter is parameterised to make juggling timing and output voltage easier. The frequency is set by Ct and Rt, (to about 55 Hz). The two diodes protect the transistor base-emitter junctions from negative voltage breakdown.
  • #1
bob012345
Gold Member
2,066
891
TL;DR Summary
I need help understanding how to model an inverter circuit and what to expect given a circuit diagram.
As a step to a solar powered battery backup system I wish to get a better grasp on how DC to AC inverters work. This circuit shown below is a 12V DC to 120V AC inverter. I am doing ltspice simulations first and I am working from a circuit diagram included below I found online here;

https://www.elprocus.com/dc-to-ac-converter-circuit-working-applications/

It is easy to spice this up in ltspice except for the transformer part. I do not understand how to model the center tap and if the transformer is just inductors or if there are other components. Also, I tried to simulate just the 12V DC to 12V AC without the transformer but get nonsensical results.

1) Can I model just 12V DC to 12V AC without the transformer or is the transformer necessary to the circuit?

2) Will this circuit give a sine wave or a modified sine wave?

3) I need help understanding and modeling the center tap transformer part.
unnamed.png


I'd like to understand how to get a sine wave with only transistor, caps, diodes, inductors and not using IC's if possible. Thanks for any help or advice!
 
Engineering news on Phys.org
  • #2
bob012345 said:
Summary:: I need help understanding how to model an inverter circuit and what to expect given a circuit diagram.

3) I need help understanding and modeling the center tap transformer part.
The transformer symbol in the diagram has been rotated by 90° which makes it really confusing.

The design of a transformer is described in the LTspice FAQ documentation, but it is probably easier to modify your circuit. If you attach your Ltspice filename.asc file to a post we can edit it and return it, hopefully working. Since it is an ascii text file internally, first change it's extension to filename.asc.txt

In a nutshell, place three inductors; primary Lp1, Lp2 and secondary Lsec. Couple them by placing a K command anywhere on the schematic; Kt Lp1 Lp2 Lsec 1.000 ; Notice they now have dots showing polarity.
Set the inductance to specify the turns ratio. Primary side voltage to secondary voltage here will be about 1 : 10; Because L is proportional to n², (turns squared), give Lsec an inductance of 10² = 100 times the Lp inductance. Transformer current will be too high if L is too low.
 
  • Like
Likes bob012345
  • #3
Thanks. The entire circuit as drawn is confusing. The drains of the power mosfets go to the transformer but I assume the wire does not intersect the 12V battery but they don't make that clear. Then, it's not clear how or why the center tap connects to the 12V DC. Here is my netlist for ltspice. Thanks for any help.
 

Attachments

  • Vibrator2.txt
    2.5 KB · Views: 140
Last edited:
  • #4
Your Vibrator2.txt file is a generic spice file, not an LTspice schematic.asc text file.
It should contain the “wire” commands that draw the schematic.

Attached are example .asc and .plt files that demonstrate a centre tapped transformer.
Remove the .txt extensions to get the LTspice schematic to run and plot.
 

Attachments

  • C_tap_0.asc.txt
    1.3 KB · Views: 129
  • C_tap_0.plt.txt
    288 bytes · Views: 128
  • Like
Likes bob012345
  • #5
Here is the cleaned up circuit with the transformer untangled.

I have parameterised most values to make juggling timing and output voltage easier.
The frequency is set by Ct and Rt, (to about 55 Hz).
Given the transformer turns ratio, n=11.0; and the primary inductance, Lp=200mH, Ls=Lp·n² is then computed.

The two diodes protect the transistor base-emitter junctions from negative voltage breakdown, which will occur in the astable for supply voltages over about 5 volts.

A symmetrical circuit simulation may be too well balanced numerically to start cleanly. By specifying an initial condition the simulation starts reliably. The uic flag on the .tran command is needed to use the specified .IC V(A)=5 volts.

Here is the schematic. Attached is the LTspice.asc text file.
DC-AC_Inverter.png
 

Attachments

  • DC-AC_2.asc.txt
    3.3 KB · Views: 127
  • Like
Likes jim mcnamara, bob012345, berkeman and 1 other person
  • #6
Thank you very much! Sorry I sent the txt file. I didn't notice you wanted xxx.asc.txt. I shall run this today.
 
  • #7
I ran it and now I understand a few things better. I see that the transformer is integral to the circuit, not just to step up the voltage but to get to AC in the first place and also that this circuit gives a modified sine wave and not a pure sine wave. As a result, it would not work for my solar inverter. Also the center tap hookup makes sense to me now. Next, I'm going to explore pure sine wave inverters. Thanks for the help Baluncore! I appreciate it very much.
 
  • Like
Likes Windadct, berkeman and BvU
  • #8
I added a filter to the output and turned the modified sine wave (more like a square wave) into a fairly reasonable sine wave but the current out of the 12V DC source spiked some tenfold. I wonder if its possible to buffer the output from the input so I can change the waveform shape from pulse to sine wave without causing this large current spike? Or, change the waveform shape before it gets to the transformer? Thanks.
Screen Shot 2021-06-15 at 5.30.41 PM.png
Screen Shot 2021-06-16 at 1.12.30 PM.png
Screen Shot 2021-06-16 at 12.44.12 PM.png
 
  • #9
bob012345 said:
I added a filter to the output and turned the modified sine wave (more like a square wave) into a fairly reasonable sine wave but the current out of the 12V DC source spiked some tenfold. I wonder if its possible to buffer the output from the input so I can change the waveform shape from pulse to sine wave without causing this large current spike? Or, change the waveform shape before it gets to the transformer? Thanks.View attachment 284557View attachment 284556View attachment 284555
Try removing C3 from your filter.
 
  • Like
Likes bob012345
  • #10
Thanks, I just tried that but the current still spikes about the same.

Also, I really need to model the 12V source as a battery which in my case is about 10Ah with a maximum
current of around 20A.
 
  • #11
bob012345 said:
Thanks, I just tried that but the current still spikes about the same.
OK, then bigger inductor values and smaller capacitor values.

bob012345 said:
I really need to model the 12V source as a battery which in my case is about 10Ah with a maximum
current of around 20A.
That's not so easy. Battery discharge is very non-linear at the end. Can't you just assume that the battery is charged? In that case a voltage source with a small series resistor is a good approximation. If you want to know what happens when the battery voltage drops, you can just decrease the voltage source value. Otherwise, I think you'll have to integrate the current from the battery to get the amount of charge removed, then apply a non-linear function to that to calculate the source voltage. Expect modelling and convergence problems, and use initial conditions, since there is a sort of feedback implicit here.
 
  • Like
Likes bob012345
  • #12
DaveE said:
OK, then bigger inductor values and smaller capacitor values.That's not so easy. Battery discharge is very non-linear at the end. Can't you just assume that the battery is charged? In that case a voltage source with a small series resistor is a good approximation. If you want to know what happens when the battery voltage drops, you can just decrease the voltage source value. Otherwise, I think you'll have to integrate the current from the battery to get the amount of charge removed, then apply a non-linear function to that to calculate the source voltage. Expect modelling and convergence problems, and use initial conditions, since there is a sort of feedback implicit here.
Yes, I can assume the battery is charged. I'm interested in steady state. When I put in a small series resistor, the voltage is no longer a fixed 12 volts.
 
  • #13
@bob012345
Screen shots are big, hard to read, and can contain hidden circuit values such as parasitic R, L and C.
LTspice has pull down menu 'Tools', select 'Copy bitmap to Clipboard'. For a small readable file paste the bitmap into an image file, crop, and save as .jpg or .png.

Also, attach to your post the schematic.asc file renamed as schematic.asc.txt That way we get the circuit with any hidden values that do not display on the schematic.

There are other inverter topologies that will produce a sinewave, and be less load sensitive.
 
  • #14
Thanks. Here is the schematic which I names inverter.asc.txt
 

Attachments

  • inverter.asc.txt
    4.3 KB · Views: 126
Last edited:
  • #15
bob012345 said:
When I put in a small series resistor, the voltage is no longer a fixed 12 volts.
Yes, that's exactly what resistors do. What exactly do you want to model about the battery? What is wrong with a fixed DC voltage source?
 
  • Like
Likes bob012345
  • #16
One problem converting square wave to sine wave with output LC 'T' filters to is that they make an impedance matching network, so the output voltage becomes load dependent. Also, the output filter needs to be selective to the same frequency as the fundamental that was generated by the bi-stable R&C time constant. The sensible way to get the two frequencies to track is to dispense with the bi-stable R&C timing, and take the output of the tuned circuit as feedback to control the power transistors. That is a different topology.
 
  • Like
Likes DaveE, bob012345 and anorlunda
  • #17
DaveE said:
Yes, that's exactly what resistors do. What exactly do you want to model about the battery? What is wrong with a fixed DC voltage source?
I have the battery and want to model the inverter running a 15W AC LED lamp (because those LED bulbs are designed to look like old fashioned lightbulbs and not like flashlights).
 
  • #18
Baluncore said:
One problem converting square wave to sine wave with output LC 'T' filters to is that they make an impedance matching network, so the output voltage becomes load dependent. Also, the output filter needs to be selective to the same frequency as the fundamental that was generated by the bi-stable R&C time constant. The sensible way to get the two frequencies to track is to dispense with the bi-stable R&C timing, and take the output of the tuned circuit as feedback to control the power transistors. That is a different topology.
Understood. Do you think the modified sine wave would run a 15W LED lamp?
 
  • #19
DaveE said:
Yes, that's exactly what resistors do. What exactly do you want to model about the battery? What is wrong with a fixed DC voltage source?
I mean it oscillates not just gives a reduced DC voltage. That suggests any real battery with some series resistance would ruin the circuit. I also want to model the limited current available from the battery which should be about 20A.
 
Last edited:
  • #21
bob012345 said:
I have the battery and want to model the inverter running a 15W AC LED lamp
LED lamps designed to run from AC mains convert the AC to DC with a bridge rectifier, storing the charge in a high voltage capacitor. They then use an efficient buck converter to generate a low voltage stable LED current.

The bridge will rectify AC or DC into the capacitor, so you do not need to generate AC or remove the odd harmonics from a square wave to make it sinusoidal. You can feed the output from a square wave oscillator directly to the LED lamp.

You can find or draw the circuit for the LED lamp, then simulate that with AC sine, square and DC inputs.
 
  • Like
Likes bob012345
  • #22
Baluncore said:
LED lamps designed to run from AC mains convert the AC to DC with a bridge rectifier, storing the charge in a high voltage capacitor. They then use an efficient buck converter to generate a low voltage stable LED current.

The bridge will rectify AC or DC into the capacitor, so you do not need to generate AC or remove the odd harmonics from a square wave to make it sinusoidal. You can feed the output from a square wave oscillator directly to the LED lamp.

You can find or draw the circuit for the LED lamp, then simulate that with AC sine, square and DC inputs.
Thanks. That's good to know . So I don't need to worry about getting pure AC just to make a simple backup for LED room lamps. For running the TV I think I would though. Yes, I'll try that simulation. Thanks again.

The whole idea for me is to have a few small independent backup power systems to make things appear almost normal in the house during a power outage. For example a few lamps, the TV and Internet and possibly the refrigerator. Secondly, to understand how inverters work.
 
Last edited:
  • #23
Svein said:
Thanks. This is a great reference and guide whether I end up building such a system or just buying one. It clarifies the design logic and at the very least I can simulate it for my understanding so thanks again.
 
  • #24
bob012345 said:
Do you think the modified sine wave would run a 15W LED lamp?
Which modified sine wave ?
Can your battery supply 80 amps ?
 
  • #25
Baluncore said:
Which modified sine wave ?
Can your battery supply 80 amps ?
The original circuit discussed at the beginning of this thread output a modified sine wave which is more of a square wave. The battery I have should have a maximum amperage of around 20A. It's not a big battery. You can see the shape from the first image of post #8 above where the red waveform is the inverter circuit output before filtering and the green is a reference since wave.
 
  • #26
The original circuit in post #1 will not work, it had the rotated transformer and no base diodes.
The circuit in post #5 will run the LED, but not a refrigerator compressor.

A “modified sine wave” is undefined in engineering, it is a marketing term for anything that is not a sine wave. If you mean a square wave then say square wave.
 
  • Like
Likes bob012345
  • #27
Baluncore said:
The original circuit in post #1 will not work, it had the rotated transformer and no base diodes.
The circuit in post #5 will run the LED, but not a refrigerator compressor.

A “modified sine wave” is undefined in engineering, it is a marketing term for anything that is not a sine wave. If you mean a square wave then say square wave.
Thanks. By original circuit I was comparing the circuit fixed by you to that with the filter I added. Sorry for the confusion.

I thought the term 'modified sine wave" was a real thing.

https://en.wikipedia.org/wiki/Power_inverter#Modified_sine_wave

However, in the https://en.wikipedia.org/wiki/Talk:Power_inverter page there is debate about that term.

I understand now that in commercial designs for what they call modified sine wave inverters, are better described as modified square waves with some dead spots between positive and negative half-cycles *

What I meant is the waveform that this circuit is producing. If I had to make up a name I'd call it more of a distorted square wave. Thanks again.

* https://www.researchgate.net/publication/293732858_Modified_sine-wave_inverter_enhanced
 

1. What is an inverter simulation?

An inverter simulation is a computerized model that replicates the behavior of an inverter, which is an electronic device that converts direct current (DC) into alternating current (AC). It allows scientists and engineers to study the performance and characteristics of an inverter without having to physically build and test a prototype.

2. How does an inverter simulation work?

An inverter simulation works by using mathematical equations and algorithms to mimic the behavior of an actual inverter. These equations take into account factors such as input voltage, output voltage, and load resistance to accurately predict the behavior of the inverter.

3. What are the benefits of using an inverter simulation?

There are several benefits of using an inverter simulation. It allows for faster and more cost-effective testing and development of new inverter designs. It also allows for easy modification and optimization of the design without having to physically rebuild the inverter. Additionally, simulations can be run under various conditions and scenarios, providing a more comprehensive understanding of the inverter's behavior.

4. What are some common applications of inverter simulations?

Inverter simulations are commonly used in the design and development of renewable energy systems, such as solar panels and wind turbines. They are also used in the design of power electronics for electric vehicles and in the development of uninterruptible power supply (UPS) systems. Inverter simulations are also used in research and education in the field of power electronics.

5. Are there any limitations to inverter simulations?

While inverter simulations can provide valuable insights into the behavior of an inverter, they are not a perfect representation of real-world conditions. Simulations may not account for all external factors, such as temperature and component tolerances, which can affect the performance of an inverter. Therefore, it is important to validate simulation results with physical testing before implementing a design in a real-world application.

Similar threads

  • Electrical Engineering
2
Replies
39
Views
2K
Replies
8
Views
843
Replies
6
Views
2K
  • Electrical Engineering
Replies
13
Views
1K
  • Electrical Engineering
2
Replies
37
Views
3K
Replies
6
Views
1K
Replies
9
Views
4K
  • Electrical Engineering
Replies
10
Views
2K
Replies
38
Views
3K
Replies
1
Views
961
Back
Top