This simulation is the first of an electrical machine. The transformer has been modeled as controllable voltage sources. The magnetic circuit has not been modeled, instead, the induced emfs at each winding of the transformer has been calculated as a function of the applied voltage at the winding terminal and the current in the winding. An advantage of this method of modeling is that any topology of transformer can be modeled. The disadvantage is that the equations for the transformer will need to be written for every case.
The case being considered is of a three-winding transformer. Let us suppose that there are two voltage sources - one of 120 Volts and the other of 240 Volts that need to be used to feed a load at 120 Volts. Let us also suppose the loads need to be isolated from both sources for an unspecified reason. The two voltage sources need their own separate winding and since the load needs isolation, it needs a winding separate from the sources. This results in a three winding transformer.
Let the voltage ratings of the three windings be V1 = 120 Volts (Source 1), V2 = 120 Volts (Load), V3 = 240 Volts (Source 2). For any set of windings in a transformer, the currents in the windings will be in the inverse ratio of the voltages. That is, I1/I2 = V2/V1, I2/I3 = V3/V2 and I1/I3 = V3/V1. If there were only two windings, and only one voltage source, it would have been a fairly simple matter. However, with two voltage sources and three windings, the question is how will the windings share the load current? To complicate matters further, let there be a linear resistive load and a non-linear diode rectifier load.
In the control code, the maximum of the voltage applied at every winding is calculated for every half cycle. The winding with the maximum voltage will be the winding that sets the transformed voltage at the other two windings. Its own transformed voltage will be such that the current in the winding will be the sum of the transformed currents of the other two windings. By performing this calculation, the simulation takes into account the possibility that any of the source voltages may change in magnitude. Physically, this would mean a change in the flux linkages associated with that winding, which in turn will affect the flux in the transformer core and therefore, the induced emfs in the windings. The magnetic circuit is complicated to simulate and by doing the above, something close to it can be simulated.
Two cases have been simulated. The first case, when the 240 Volts source is at 240 Volts. The second case, when this source sags to 220 Volts. The first result of the first case shows the voltages measured at Source 1, Source 2 and Load. As can be seen, the transformer does not start until 0.01s as it waits for the first half cycle of voltage measurement to occur. After that, the load voltage appears as a 120 Volt waveform very close to the Source 1 waveform.
The result below shows the load current in winding 2. This is the sum total of the current drawn by the linear resistive load and the non-linear diode rectifier load.
The result below shows how the load current in winding 2 is shared by Source 1 in winding 1 and Source 2 in winding 3. Since the voltages of Source 1 and Source 2 are 120 Volts and 240 Volts respectively, they share the load in such a manner that Source 2 in winding 3 supplies majority of the load current.
Let us examine the second case when Source 2 is at 220 Volts. Due to this decrease in Source 2 voltage, now Source 1 becomes the dominant source and supplies not only a majority of the load but also pushes current into Source 2. However, it can be seen that Source 2 still supplies a large amount of the harmonic current of the load. This is because the impedance at that harmonic frequency still makes Source 1 weaker in comparison to Source 2 and therefore Source 2 supplies more of the harmonic content of the load.
The next figure shows the voltages at the three windings. They are similar to the previous case.
Since the plot of voltages above does not make it clear that Source 2 is weaker, let us transform the voltage in winding 3 by 0.5 and plot them all on the same scale. This shows Source 1 voltage to be greater than the transformed Source 2 voltage.
To compare this with the first case, let us plot the first case again with Source 2 transformed to compare all the voltages on the same scale. In this case, Source 1 and Source 2 are almost equal. This shows the difference between the two cases and how it affects the sharing of load in the transformer.
The above case is the simulation of an ideal transformer. The transformer does not draw an inrush current or a steady state magnetizing current. It does not have core loss or for that matter even detailed winding loss. However, the later simulations will attempt to bridge this shortcoming by additions to the simulation. With this ideal transformer, the user can design power electronics circuits that have step-up or step-down transformers and therefore have different parts of the circuit at different voltages. Without a transformer model, the user would have to transform all parameters to one side of the transformer which would be inconvenient and error-prone.