.ModelicaDEVS.Examples.Electrical.FlybackConverter.FlybackConverterDEVS

Information

ModelicaDEVS Flyback Converter

In order to be able to model the flyback converter in ModelicaDEVS or PowerDEVS, we need to map the behaviour of the converter to a block diagram, which then can be reproduced by means of the components from the PowerDEVS/ModelicaDEVS libraries. Block diagrams are obtained by causalising the equations of the system (circuit) according to the Tarjan algorithm as explained in [Cellier05].
Unfortunately in our case, the presence of the switch coupled with the directed input-output data flow intrinsic to DEVS models cause an unsolvable problem if we just attempt to build our block diagram from the common set of equations given in FlybackConverterDymola. It is therefore necessary to split the equations in two sets, one for each switch position (for each operation phase of the converter), thereby eliminating the switching component. The following figure shows the respective electrical circuits for the two switch positions (closed/open).



The following sets of equations describe the two operation phases of the converter:

Switch closed

U0 = constant
uL = U0
uL = L * diL/dt
iC = C * uR/dt
uR = R * iR
iR = -iC
i0 = iL
Switch open

iD = iL
iD = iC + iR
uL = L * diL/dt
iC = C * uR/dt
uR = R * iR
uR = -uL
Now we have to causalise the equations, where causalising means to determine which equation we solve for which variable. To this end, we apply the Tarjan algorithm [Cellier05]: we mark all variables appearing in the equations with labels "solve for" and "known". By convention [Cellier91], known variables are underlined and variables for which a certain equation has to be solved are put into square brackets.
The following rules help a) to find a good starting point for applying the algorithm, and b) to choose the next variable to be marked: The causalised version of the two equation sets listed before looks as follows (in order to be able to trace the algorithm, the variables are numbered in the order they were underlined or bracketed):

Switch closed

[U0] (1b) = constant (1a)
[uL] (1d) = U0 (1c)
uL (1e) = L * [diL/dt] (1f)
iC (2e) = C * [duR/dt] (2f)
uR (2a) = R * [iR] (2b)
iR (2c) = -[iC] (2d)
[i0] (1h) = iL (1g)
Switch open

[iD] (1b) = iL (1a)
iD (1c) = [iC](2d)+ iR (2c)
uL (3c) = L * [diL/dt] (3d)
iC (2e) = C * [duR/dt] (2f)
uR (2a) = R * [iR] (2b)
uR (3a) = -[uL] (3b)


The two sets of causalised equations define exactly the way variables depend on each other, and we are able to build the required block diagram(s). In order to illustrate how to get from a set of equations to a block diagram, the subsequent list depicts the various steps during the synthesis of the block diagram representing the first set of causalised equations.

  1. Although it theoretically does not matter with which block/equation we start, it is recommended to first insert the integrators.



  2. Our first equation we want to represent preferably depends on the integrator variables: iC= C * duR/dt



  3. As a next step we include the equations iR = -iC and uR = R * iR



  4. There are no dependencies anymore, so we insert an integrator again.



  5. uL= L * diL/dt



  6. Finally, we represent the equations uL= U0 and i0= iL, and thereby complete the block diagram of the first equation set.
The following figure shows the two (finished) block diagrams, where the second one has been built according to the same method that has been applied for the first one.
Note that the two resulting diagrams are not completely different from each other but share common parts, which will be helpful as we shall see soon.


The last step towards a complete single block diagram representing the flyback converter, is to merge the two partial diagrams presented above. To this end, recall that initially, we split the original set of equations to eliminate the switch, or, in other terms, to obtain a diagram for each switch position. Hence, while merging the two diagrams, we have to re-insert the switching component. The switch can be said to alternate between the two diagrams: when it is open, the first block diagram is valid, when it is closed, the second one becomes active.
Fortunately, the two diagrams share a similar structure, which eases the merging process a lot: normally we would have to build both of the models and in some way deactivate one of them when the other becomes active. In our case however, we just look for a way how to transform one of the diagrams into the other one. We find that the two critical variables are uL and iC since their definition in the first diagram is different from their definition in the second one: Hence, if we place our switching component in such a way that it switches a) the value for uL between u0 and -uR, and b) the value of iC between -iR and iD-iR, we obtain a model that fully represents the flyback converter.
Such a model is shown in the subsequent figure. Note that there are still two switches, which however correctly represent the single switch in the original flyback converter, since they flip at the same time and thus could be coupled.




The corresponding ModelicaDEVS model is built according to the model in the figure above, and hence its structure should be clear to a large extent. Only the switching parts may need a brief explanation.

Output:

The four output variables, Inductor_i_DEVS, Inductor_i, Resistor_u and Resistor_u, give both the original DEVS output and the interpolated version of the current through the inductor and the voltage across the load resistance.


Generated at 2024-05-16T18:15:58Z by OpenModelicaOpenModelica 1.22.4 using GenerateDoc.mos