Why my push-pull is giving 0 V?

Hi,
I am designing a push-pull converter. I copied the control from this example after having tried the control that was in another example made by a user. However, that one wasn't giving a correct closed-loop answer as it was giving an input of 0 to the gates while the output voltage was stable. So someone suggested me to see the example from the first link and now that control is making the output voltage to be 0 V. The control is as shown below:
As you can see, my reference voltage is 350 V and the switching frequency is 50000 Hz. My input voltage is 137.14 V because it will come from another stage that will give at most an output voltage of 137.14 V. It doesn't even work with this control in open-loop when I connect a constant value of 0.159 to the gain of 0.5 and the PI and comparison of the left is not connected.
I know that in a push-pull the transistors conduct the same time but not simultaneously a maximum of 50% each, but could someone explain me how this control ensures this and why is not working for me?
I see that the left transistor is not switching by looking at the waveforms:
The gate_L waveform is the top right one and the top left is for the output voltage.
Also, these are the values I have in the multi-winding transformer (no taps) as I am using the black blocks and not the blue as in the example:
The push-pull looks like this:
Thanks.
Carlos

1 comentario

Umar
Umar el 15 de Nov. de 2025
Editada: Umar el 15 de Nov. de 2025

Hi @Carlos,

I took a look at your setup and I can see what's going wrong here. First thing that jumps out is that your gate_L signal is completely flat in those scope traces - that's your main problem right there. One of your transistors isn't switching at all, which explains why you're getting 0V output.

Now looking at your actual control subsystem diagram (the one with V_ref1 at 350V), I can see the issue. That control implementation is way too complicated and has some fundamental problems. You've got division operations, what looks like modulo or normalization with f_sw, multiple comparators, AND gates - it's all creating a logic mess that's causing gate_L to stay stuck at zero. The way this should work is much simpler - your PI controller gives you a duty cycle, you multiply it by 0.5 to keep each transistor under 50%, then you compare that with a sawtooth carrier. One transistor gets the direct comparison result, the other gets the complement. But your current implementation with all those division blocks and AND gate logic isn't doing that correctly.

Here's what I'd suggest. Honestly, I think you need to scrap that entire control subsystem and rebuild it from scratch with a much simpler approach. The current implementation is trying to do something with f_sw normalization and complex logic that's just not working. What you actually need is maybe 5-6 blocks total. Start with a subtract block for your error (V_ref - V_out), feed that into your PI controller, multiply the output by 0.5 to limit duty cycle, then compare with a simple sawtooth generator running at 50kHz. Use one relational operator set to ">=" for gate_R, and either use "<" for gate_L or just invert gate_R with a NOT gate. That's it. No division by f_sw, no AND gates, no complex normalization. The simpler you make this, the easier it'll be to debug.

Now about that transformer block - those saturation parameters you've got there look really off. The format should be two rows: first row is magnetization current values, second row is flux values. Your entry "[0;8;34221 1.33331e-08]" doesn't make sense to me. For debugging purposes, I'd honestly just set it to something like [0 0.1; 0 0.1] which basically gives you a linear transformer with no saturation. You can always add proper saturation later once you get the basic control working. Also set your magnetization resistance Rm to something high like 500 pu and Lm to maybe 500 pu as well.

The turns ratio looks about right for what you're trying to do. With 137.14V input and wanting 350V output, you need roughly 2.55:1 on the secondary which matches your voltage array [137.14 137.14 350 350]. Just make sure those windings are actually connected the way you think they are in your circuit.

Before you do anything else with that closed loop, I'd actually suggest building a completely new simplified control subsystem alongside your current one. Keep the old one for reference but don't try to patch it - those division blocks and AND gate logic have too many places where things can go wrong. Build the new simple version I described, then disconnect your PI controller temporarily and just feed a constant 0.3 (30% duty cycle) into your PWM generator. You should see both gate signals switching nicely and complementary to each other. If you don't see that with the simplified control, then we know there's something else wrong. But I'm betting once you simplify that control subsystem, both gates will start switching properly.

Quick reality check on your design - push-pull converters absolutely cannot go beyond 50% duty cycle per transistor or you'll saturate the core. That's why the 0.5 gain is there. The complementary operation means when Q1 is on, Q2 is off and vice versa. You also need some dead time between them to prevent shoot-through, usually around 100-200ns. Make sure your control implementation actually has that dead time built in.

One more thing - your solver settings matter here. Use ode23tb or ode15s since power electronics are stiff systems, and set your maximum step size to something like 2e-6 seconds (that's 1/10th of your switching period). If your step size is too large, you'll miss switching events entirely.

That File Exchange model giving you zero gate signals while the output was stable is a classic sign of a broken control loop that's not actually doing anything. The official MathWorks example is definitely more solid, but you've got to adapt it properly to your specs. The fact that even open loop isn't working tells me the issue is in the PWM signal generation itself, not the feedback loop.

Try building that simplified control subsystem first - literally just the blocks I mentioned: subtract, PI, gain of 0.5, sawtooth generator (Repeating Sequence block works great for this, set it to output 0 to 1 at 50kHz), one >= comparator for gate_R, and either a < comparator or NOT gate for gate_L. Get that working in open loop with a constant 0.3 duty cycle, add scopes everywhere - on the PI output, the duty cycle after the 0.5 gain, the sawtooth, both gate signals, the transformer primary currents, everything. Once you see proper complementary switching on both gates and a reasonable output voltage, then close the loop and tune your PI gains. I think you'll find this simplified approach works way better than trying to debug that complex control logic you've got now.

Let me know what you find when you check those PWM signals in open loop. I'm betting that's where your problem is.

Good luck!

Iniciar sesión para comentar.

Respuestas (1)

Umar
Umar el 15 de Nov. de 2025
Movida: Sabin el 15 de Nov. de 2025

0 votos

Hi @Carlos,

I took a look at your setup and I can see what's going wrong here. First thing that jumps out is that your gate_L signal is completely flat in those scope traces - that's your main problem right there. One of your transistors isn't switching at all, which explains why you're getting 0V output.

Now looking at your actual control subsystem diagram (the one with V_ref1 at 350V), I can see the issue. That control implementation is way too complicated and has some fundamental problems. You've got division operations, what looks like modulo or normalization with f_sw, multiple comparators, AND gates - it's all creating a logic mess that's causing gate_L to stay stuck at zero. The way this should work is much simpler - your PI controller gives you a duty cycle, you multiply it by 0.5 to keep each transistor under 50%, then you compare that with a sawtooth carrier. One transistor gets the direct comparison result, the other gets the complement. But your current implementation with all those division blocks and AND gate logic isn't doing that correctly.

Here's what I'd suggest. Honestly, I think you need to scrap that entire control subsystem and rebuild it from scratch with a much simpler approach. The current implementation is trying to do something with f_sw normalization and complex logic that's just not working. What you actually need is maybe 5-6 blocks total. Start with a subtract block for your error (V_ref - V_out), feed that into your PI controller, multiply the output by 0.5 to limit duty cycle, then compare with a simple sawtooth generator running at 50kHz. Use one relational operator set to ">=" for gate_R, and either use "<" for gate_L or just invert gate_R with a NOT gate. That's it. No division by f_sw, no AND gates, no complex normalization. The simpler you make this, the easier it'll be to debug.

Now about that transformer block - those saturation parameters you've got there look really off. The format should be two rows: first row is magnetization current values, second row is flux values. Your entry "[0;8;34221 1.33331e-08]" doesn't make sense to me. For debugging purposes, I'd honestly just set it to something like [0 0.1; 0 0.1] which basically gives you a linear transformer with no saturation. You can always add proper saturation later once you get the basic control working. Also set your magnetization resistance Rm to something high like 500 pu and Lm to maybe 500 pu as well.

The turns ratio looks about right for what you're trying to do. With 137.14V input and wanting 350V output, you need roughly 2.55:1 on the secondary which matches your voltage array [137.14 137.14 350 350]. Just make sure those windings are actually connected the way you think they are in your circuit.

Before you do anything else with that closed loop, I'd actually suggest building a completely new simplified control subsystem alongside your current one. Keep the old one for reference but don't try to patch it - those division blocks and AND gate logic have too many places where things can go wrong. Build the new simple version I described, then disconnect your PI controller temporarily and just feed a constant 0.3 (30% duty cycle) into your PWM generator. You should see both gate signals switching nicely and complementary to each other. If you don't see that with the simplified control, then we know there's something else wrong. But I'm betting once you simplify that control subsystem, both gates will start switching properly.

Quick reality check on your design - push-pull converters absolutely cannot go beyond 50% duty cycle per transistor or you'll saturate the core. That's why the 0.5 gain is there. The complementary operation means when Q1 is on, Q2 is off and vice versa. You also need some dead time between them to prevent shoot-through, usually around 100-200ns. Make sure your control implementation actually has that dead time built in.

One more thing - your solver settings matter here. Use ode23tb or ode15s since power electronics are stiff systems, and set your maximum step size to something like 2e-6 seconds (that's 1/10th of your switching period). If your step size is too large, you'll miss switching events entirely.

That File Exchange model giving you zero gate signals while the output was stable is a classic sign of a broken control loop that's not actually doing anything. The official MathWorks example is definitely more solid, but you've got to adapt it properly to your specs. The fact that even open loop isn't working tells me the issue is in the PWM signal generation itself, not the feedback loop.

Try building that simplified control subsystem first - literally just the blocks I mentioned: subtract, PI, gain of 0.5, sawtooth generator (Repeating Sequence block works great for this, set it to output 0 to 1 at 50kHz), one >= comparator for gate_R, and either a < comparator or NOT gate for gate_L. Get that working in open loop with a constant 0.3 duty cycle, add scopes everywhere - on the PI output, the duty cycle after the 0.5 gain, the sawtooth, both gate signals, the transformer primary currents, everything. Once you see proper complementary switching on both gates and a reasonable output voltage, then close the loop and tune your PI gains. I think you'll find this simplified approach works way better than trying to debug that complex control logic you've got now.

Let me know what you find when you check those PWM signals in open loop. I'm betting that's where your problem is.

Good luck!

35 comentarios

Carlos
Carlos el 17 de Nov. de 2025
Editada: Carlos el 17 de Nov. de 2025
Hi @Umar once again!
Thank you so much for your time, I really appreciate someone cares about this issue :)
I don't know why by copying the structure of the control I saw in the example it didn't work. In fact, I had a simpler control but I consulted someone and told me the control was not right and sent me the Mathworks example. It's true that the push-pull there is the blue blocks one but anyway...
In open loop, the waveforms for the input current and output voltage look like this:
By the way, the output voltage decreases slowly with time, only observed when zooming.
I have three doubts:
  1. I was trying to tune the PI after having changed the solver settings (it's the first time I hear about that). It was taking too long for 5 seconds of simulation (just for the first one, I make 2 with "single integrator"). Does it have to do with the ode23tb step size or just my computer being very slow? It wasn't taking much time previously. It also takes too long for the open loop simulation, that's why I sent the previous screenshots before it ended so I didn't have to wait too much.
  2. I was adding the dead-time delay. I tried first with Transport Delay but it seemed to be incompatible by data type so I put a On-Off Delay block putting the same value for the on-time, off-time and sample time (200 ns). Is it right? I expected 1/fs s for the sample time but the on-time and off-time have to be greater or equal it. And 1/fs isn't. Maybe I am confusing both sampling times but I thought there should be a sample time equal to the one I use for the switching of transistors.
  3. About the transformer parameters, the saturation values were unchanged, the default ones. However, to edit them I had to select the saturation core box, I put the values you said and unchecked the saturation core box. After that, I put 500 pu for Rm amd Lm (in pu menu option) and after "Apply", those values changed automatically to some different ones. I don't understand why it changes sometimes that, but this is what it says eventually when I check it:
Thanks.
Carlos
Umar
Umar el 17 de Nov. de 2025

Hi @Carlos!

Really glad to see you're making progress - those open loop waveforms look pretty good! The output voltage hitting 350V is exactly what you want. Let me tackle your three questions.

So about the simulation speed - yeah, that's totally normal with ode23tb. It's a stiff solver so it takes really tiny time steps to handle all the fast switching events accurately. The good news is there are several things you can try. First thing I'd change is the absolute tolerance - go into your Configuration Parameters, find the Solver section, and bump up the AbsTol from whatever it is now (probably 1e-6) to something like 0.1 or even 1.0. I know that sounds like a huge jump but for power electronics with voltages in the hundreds, it's still very accurate and you'll see a big speedup. Also in that same solver section, look for "Solver reset method" and change it to "Fast" instead of "Robust". Another quick win - you really don't need to simulate 5 full seconds when you're just tuning things. Try 0.5 or 1 second instead, you'll still see the steady state behavior. Oh and one more thing, open your powergui block, go to the Preferences tab, and check the box that says "Disable snubbers in switching devices" - that reduces the stiffness quite a bit.

Now about the dead-time thing - I think you're mixing up two completely different time scales here. Your dead-time is 200 nanoseconds (super short), but your switching period is 1/50000 = 20 microseconds. Those are not the same thing at all! The dead-time is just the tiny gap between when one switch turns off and the other turns on. The switching period is how often the whole PWM cycle repeats. So here's the easiest way to do this. Just use regular Transport Delay blocks. Take your gate_R signal, put a Transport Delay in series with it before it hits the transistor, and set the time delay to 200e-9 (that's 200 nanoseconds in scientific notation). Do the same thing for gate_L with another Transport Delay block. If you get any data type errors with the Transport Delay, just stick a Data Type Conversion block right before it and set it to output "double".

If you really want to stick with the On-Off Delay approach, the problem is you're setting the sample time wrong. That sample time parameter has nothing to do with your switching frequency. It's just how often the block updates internally. You should set On-delay to 200e-9, Off-delay to 0, and Sample time to either 0 or something really small like 1e-8. Definitely not 1/fs.

As for the transformer parameters changing on you - this is actually completely normal and not something to worry about. When you enter values in per-unit mode, MATLAB converts them based on your transformer's rated power and voltages. Your transformer is rated at 946.27 VA with 137.14V primary, so it calculates what 500 pu actually means in that context. The values it shows you after conversion are correct, they're just the actual per-unit values for YOUR specific transformer base quantities. If this is confusing you, honestly just switch the Units dropdown from "pu" to "SI" and enter real values in ohms and henries. Try something like Rm = 10000 ohms and Lm = 0.01 H. Way less confusing and it'll work just fine.

Here's what I'd suggest doing next. Get that dead-time sorted out first with the Transport Delay method - it's really important for preventing shoot-through. Then make that AbsTol change to speed things up. Run a quick 0.5 second open loop simulation and make sure both gate signals are switching nicely with that little dead-time gap between them. Check if your output voltage settles around 350V and actually stays there without drifting down. Once you've got all that looking solid, come back and let us know what you're seeing. Then we can help you close the loop and tune the PI gains.

The fact that your output voltage is slowly decreasing over time could be a few things - might be capacitor discharge, might be the system is still settling, or could be some losses. But get the dead-time working correctly first and see if that changes anything.

Let me know how it goes!

Carlos
Carlos el 17 de Nov. de 2025
Editada: Carlos el 17 de Nov. de 2025
Hi @Umar!
I changed the dead-time delay by the Transport Delay. It seems to be working:
I changed the absolute tolerance to 1.0, the reset solver method was already in Fast and the time to sim is now 0.5 s.
The voltage drift is something that is perceptible even at a short time of sim. But it's true that it doesn't hit 350 V, probably by the voltage drops in the diodes, although it's a few volts. In previous trials, I used to increase the voltage inside the transformer parameters to compensate it but that seems like cheating, so I left it as it is: [137.14 137.14 350 350].
I was also trying to change the values of Rm and Lm by those you told me and the system went down. Even if I put it in SI and then I apply it for 10000 ohm and 0.01 H, the values change. If I run it with those changes, the current goes to 1000 A and the voltage goes to 15 V. So I did again the change in pu with 500 pu and 500 pu and it went OK to the expected waveforms. But, anyway, I still think it's very tricky the configuration window of the multi-winding transformer... I use R2022b, I don't know if subsequent versions fixed this.
So now the transformer parameters are like this:
I have another question. Should I make it winding-tapped? If my transformer is not ideal, I think it should be tapped but I see that new ports arise and I am lost to manage with them. And it's only possible to do it for the left or the right winding. If I had to choose, I would do it for the left one but the typical shematic is not showing a tapped winding for both?
Thank you so much.
Carlos
Umar
Umar el 17 de Nov. de 2025
Editada: Umar el 17 de Nov. de 2025

Hi @Carlos,

Just wanted to let you know that your open-loop results look solid and you have made great progress. I went through your latest screenshots you posted and your GUI parameter settings, and here are a few suggestions that should help with both the voltage-drift issue and the overall simulation performance.

1. Voltage Drift (Root Cause + Fix)

The drift you're seeing is classic flux imbalance in a push-pull converter. When the two switch intervals don’t apply exactly equal volt-seconds, the transformer sees a small DC component, and the core slowly walks toward saturation.

A couple of ways to deal with this:

Add a *DC-blocking capacitor in series with the primary. 10–50 µF *film cap (don’t use electrolytics) *Voltage rating greater than or equal to 200 V *Put it between your center-tap node and ground

This is the quickest fix when using voltage-mode control.

  • Or switch to current-mode control, which naturally keeps the flux balanced.

2. Speeding Up the Simulation

You can make the model much more responsive with a few tweaks:

Solver:

  • Variable-step, ode23tb (you already have this right)
  • Max step size: 2e-6 s
  • Min step size: auto
  • Rel tol: 1e-3
  • Abs tol: auto

Powergui:

  • Set Simulation type to Discrete
  • Sample time: 2e-6 s This makes a huge difference for power electronics models.

Other tips:

  • Keep initial sim time short (e.g., 0.01 s) until things are stable
  • Avoid running multi-second simulations—no need for converter testing
  • Enable Fast Restart so parameter sweeps run much faster

3. Transformer Parameter Clarification

A couple of settings here tend to cause confusion:

  • Turn off saturation for now (uncheck Saturable core).
  • Switch to SI units instead of pu. The pu auto-conversion trips a lot of people up.
  • Set: *Rm = 10,000 Ω *Lm = 0.01 H

This avoids the parameter “jumping” you were seeing.

4. Don’t Enable Tapping

The push-pull configuration with 2 primary + 2 secondary windings doesn’t use the Tap feature. Just leave it off. 5. Feedback Compensation

For converters, you typically want ~45–60° phase margin and keep the crossover below the LC resonance.

If the PID Tuner works in your model:

  • PI block then right-click and then Tune
  • Identify plant using a small step (around 5 V), sample time ~5e-6, stop time ~0.05 s
  • Start with response time ~0.01 s and a balanced transient slider
  • Make sure margins look reasonable and update the block

If manual tuning is easier: Try:

Kp = 0.1 Ki = 100

If it oscillates then reduce Kp If too slow then bump up Ki

Targets:

  • Settling < 50 ms
  • Overshoot < 10%
  • Error < 1 V

6. Fixing the 347 V vs. 350 V Output Issue

This is actually normal when switching between SI and pu because Simulink automatically converts the values. To avoid this behavior:

Set everything in SI (recommended):

  • Nominal power: 946.27 VA
  • Frequency: 50 kHz
  • Winding voltages: [137.14 137.14 350 350]
  • Resistances: [8.2e-3 8.2e-3 5.97e-2 5.97e-2]
  • Leakage Ls: 1e-6 each
  • Rm: 10000 Ω
  • Lm: 0.01 H
  • Saturation: OFF

Also: don’t switch back and forth between SI and pu—that’s what causes the parameter drift.

7. Recommended Test Procedure

Open-loop:

  • Disconnect PI
  • Duty = 0.35
  • Run 0.1 s
  • Check for stable ~350 V and no flux drift

Closed-loop:

  • Reconnect PI
  • Vref = 350 V
  • Apply 50% to 100% load step
  • Should settle to 350 +/- 1V in < 50 ms

Longer run:

  • 0.5 s just to confirm no slow oscillations or drift

Implement these changes by following above guidelines and update me with your latest results by sharing updated screenshots and simulink block model.

Carlos
Carlos el 18 de Nov. de 2025
Editada: Carlos el 18 de Nov. de 2025
Hi @Umar,
Some comments:
  1. Done but with an RC as it was giving an error. C = 50 uF, R = 1e-6 ohm. Have a look at the new diagram:
2. Done. It's true that what I had was not OK as someone in my workplace told me. I guess there is no aliasing issue as 2e-6 s is just the period of my switching frequency.
3. I am having problems with this. Without changing units from SI to pu and vice versa, sometimes it just doesn't accept the values you told me (Rm = 10000 ohm and Lm = 0.01 H). And when I achieve it, then the values of leakage inductances and resistances change. Right now it's as shown here:
But that was possible after a second modification. I ran the simulation and the current went high and the voltage dropped... again. But even with the above values the system is unstable. The voltage starts to fall and the current makes something weird.
So I can't change them to all those values and then the simulation is not realistic.
I am stuck with that. I can't go further with the close loop while this happens in open loop. I will try to recover some values that made it kind of stable.
Anyway, many thanks for your help :)
Carlos
Update: for some reason, the problem of changing the values of the transformer and undoing the previous one is not happening anymore and I could put all the values you told me. But bad news:
Current and voltage are still very unstable. The rest is the unchanged. D = 0.35, the capacitor in series with an ESR in the primary... I am confused with this behavior.
Update #2: Returning to some values I used when I introduced them in pu, the system becomes stable. I am talking about these values:
Now the output voltage is stable as I simulated 3 seconds with the RC of 50 uF and 1 uohm. But as you can see, it still doesn't reach 350 V. This is for open loop:
Umar
Umar el 18 de Nov. de 2025

Hi @Carlos,

Before we go any further to dive deep in troubleshooting. I would like you to add Scope blocks in your controller block diagram and share screenshots of:

1. gate_L signal (full 0.1s view + zoomed to 2-3 switching cycles) 2. gate_R signal (same timebase as gate_L for comparison) 3. PI controller output (to see what duty cycle is being commanded) 4. Sawtooth carrier (f_sw) signal 5. Both gate signals overlaid on same scope to verify complementarity

Reason behind complementarity: Push-pull converters require complementarity gate signals - when Q1 is ON, Q2 is OFF and vice versa, with dead time of 100-200ns to prevent shoot-through.

Carlos
Carlos el 19 de Nov. de 2025
Editada: Carlos el 19 de Nov. de 2025
Hi @Umar,
As you have mentioned PI controller, I assume you want it in close loop. Right now, the values of Kp and Ki are 0.01 and 100 respectively. I will post the screenshots for the values of the transformer when it worked more or less and with the values you said (that weren't working).
With these values in the transformer:
Resistances [1.2737e-09 1.2737e-09 4.6094e-12 4.6094e-12] (pu)
Leakage resistances [0 0 0 0]
Rm 1.2657 (pu)
Lm 1.2492e+11 (pu)
  1. and 2.
3. PI output (after the 0.5 gain)
4. Sawtooth.
5. Gate_L and Gate_R
And with the values you said for the transformer and the same PI gains:
  • Winding voltages: [137.14 137.14 350 350]
  • Resistances: [8.2e-3 8.2e-3 5.97e-2 5.97e-2]
  • Leakage Ls: 1e-6 each
  • Rm: 10000 Ω
  • Lm: 0.01 H
  1. and 2.
3. PI controller output (after the 0.5 gain).
4. Sawtooth.
5. Gate_L and Gate_R
With your values for the transformer, as said previously, the current increases a lot and the voltage tends to zero. Also, have a look at the whole gate_L and gate_R signal where at the beginning there are some periods with saturation.
Thanks.
Carlos
Update: As it was oscillating at the beginning of the simulation, I decided to increase the values of L and C and also add a damping resistance to C. So now I have a L = 0.4766 H (with ESR = 100 mohm), C = 10 uF, Rd = 0.1 ohm. I obtain this in the output voltage for a closed loop (Kp = -0.005, Ki = -10):
But I can see the transistors are saturated. I don't know if that is a real problem. The duty cycle is 0.01 constantly.
Probably it's not perfect, but it's a good point to start. What I am worried about is that the values I picked for the transformer were not realistic (in fact, that is without leakage inductances). The L and C maybe don't exist but by finding those which do exist, it could be possible, I guess.
Umar
Umar el 19 de Nov. de 2025

Hi @Carlos, Thanks for the update. If not too much to ask, could you please share the screenshots of simulink control block diagram with scope and screenshot of your push pull as well.

Carlos
Carlos el 19 de Nov. de 2025
Hi @Umar,
This is the control:
And this is the push-pull:
Thanks.
Carlos
Umar
Umar el 19 de Nov. de 2025

Hi @Carlos,please see attached.

Carlos
Carlos el 20 de Nov. de 2025
Hi @Umar,
No, the period in the repeating sequence was always right. I had it as 1/50000. Please, check the numbers in the time axis in the waveforms I posted previously. It was always 0.2e-5 s.
About the negative gains: that's what the automatic tuning does. But I changed them to positive and I started to play with them until now that I have Kp = 0.019966 and Ki = 1.2768.
About the output saturation, OK. But the anti-windup was already in clamping because for back-calculation I need a coefficient which I don't know to obtain (and I read for digital applications, clamping was a better option).
About the magnetizing inductance, that 1.2492e11 is not in henries but in pu. Probably it's also a high value in henries according to what I obtained when I switched it to see the value but as it trips me up, I am not sure now. In fact, I was trying to recover pu units but it keeps showing up "H" and "ohm" and not even with you values, I am obtaining the response I expected...
This is now the output voltage:
For the values you said:
Please, have a look at the file itself. I can't fix now what was working yesterday.
Thanks.
Carlos
Umar
Umar el 20 de Nov. de 2025

Hi @Carlos,

I don’t have access to Simulink since it requires license. However, my guidance comes from based on years of technical experience and knowledge of simulink block documentation, I can guide you but I do need updated screenshot of your simulink model to help or assist you further. At the moment, I am the only hope you got and so far you have learned a lot about troubleshooting and trying to work out your push pull. Once you will share your push pull converter and control simulink block diagrams, I will be able to help you further.

Carlos
Carlos el 20 de Nov. de 2025
Hi @Umar,
I know. But for some reason, with the values you told me for the transformer, the system was unstable. The units of 1.2492e11 were pu, not H. At this particular moment, the blocks are the same as previously. The only changes I made were the new Kp and Ki (which are giving a fine voltage but a current with a lot of ripple).
If I open the transformer parameters' window I see this, which I am not going to switch to SI because every time I do that, it messes up. I think there should be a fix in the Matlab software itself because sometimes it doesn't change the values after apply, sometimes it does but it saves different values... Please, look carefully, the units are in pu. So it's not 1.2492e11 H. When I tried to answer your previous comment, I switched to SI and then apply and things started to mess up. If I changed to your values (Resistances: [8.2e-3 8.2e-3 5.97e-2 5.97e-2] Leakage Ls: 1e-6 each. Rm: 10000 Ω. Lm: 0.01 H), I could finally save them but it wouldn't work. Current went to very high values in positive and negative (like 800 A or higher) and voltage tended to 0 V.
With that configuration I obtain this warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = [different values]. But yesterday those transformer values and Kp = 0.019966 and Ki = 1.2768 were giving a fine voltage and a fine current signal. So the issues are:
How is it possible that for realistic values in the transformer it becomes unstable and if I put those above it works well? How can I trust the simulation when I eventually manufacture the converter? And why for the same Kp and Ki, yesterday the current ripple was not that big but today it happens as shown above? The other change I did was this to set the limits of the output:
There are no more changes. Values in L and C are the same, no extra blocks... Everything else remains the same.
Thank you.
Carlos
Umar
Umar el 21 de Nov. de 2025

Hi @Carlos,

I've reviewed your screenshots carefully and found the root causes of your issues. Your main problem is a catastrophically wrong magnetizing inductance (Lm = 1.2492e+11 pu, which converts to about 7.9 million Henries in SI units - physically impossible!). This happened when you switched between pu and SI units and MATLAB corrupted the values. This is causing your "Matrix is close to singular" warnings because it makes the system numerically unsolvable. Additionally, your transformer turns ratio is wrong - you have 137.14V:350V windings (2.55:1 ratio) but need approximately 32:1 to step 12V up to 350V, which is why you're only seeing 15-16V output instead of 350V. Here's what you need to do: DELETE your transformer block completely and insert a fresh one. Set it to SI units (never switch again), and use these exact values: Winding voltages [12, 12, 400, 400] Vrms, Winding resistances [0.05, 0.05, 2.0, 2.0] Ohm, Leakage inductances [2e-6, 2e-6, 4e-5, 4e-5] H, Rm = 10000 Ohm, and most critically Lm = 0.0003 H (300 microhenries). For your output filter use 500 micro Henry inductor and 220 microFarad capacitor with 0.05Ω ESR. After fixing the transformer, your current PI gains (Kp=0.019966, Ki=1.2768) won't work because they were tuned for the wrong plant, so start with Kp=0.005 and Ki=8.0 instead. The reason it "worked yesterday" is because your parameters got corrupted today when switching units - the model file saved the wrong values. Set your solver to ode23tb with max step size 1e-7 and relative tolerance 1e-4. Test in open-loop first (fixed duty cycle 0.3) to verify you get about 230V output before enabling closed-loop control. This should completely fix your instability issues and get you to a stable 350V output with minimal ripple.

Let me know how it goes!

Carlos
Carlos el 21 de Nov. de 2025
Hi @Umar,
Before doing any changes, why should I step up 12 V up to 350 V? The push-pull is a second stage following a boost converter which gives a maximum voltage of 137.14 V. I am simulating stage by stage before attaching these two stages and the inverter I will do later. I want to be sure the push-pull works fine. I calculated the turn ratio to be 1:8 as the equation is:
And having a D of 0.159 for the input voltage of 137.14 V. Please, confirm to me this before doing any changes.
Thanks.
Carlos
Umar
Umar el 21 de Nov. de 2025
Editada: Umar el 21 de Nov. de 2025

Hi @Carlos,

Yes, you're absolutely correct - please don't make any changes to your turn ratio. Since you're simulating the push-pull stage in isolation with 137.14V input (not 12V), your 1:8 turn ratio calculation is spot on. Let me verify: with Nps = 1/8 = 0.125, using Vo = (2/Nps) × D × Vi gives us (2/0.125) × 0.159 × 137.14 = 16 × 0.159 × 137.14 ≈ 348V, which matches your target of 350V perfectly. Your winding voltages [137.14, 137.14, 350, 350] are correct.

As mentioned earlier, the instability you're experiencing has nothing to do with your transformer design. The real problem is your magnetization inductance Lm = 1.2492e11 in per-unit, which converts to about 7.9 million Henries - physically impossible. This happened when MATLAB switched between pu and SI units and corrupted the value. This is causing the "Matrix is close to singular" warnings, numerical instability, and the inconsistent behavior you're seeing between runs.

Again delete the transformer block and create a fresh one (safest option). Make sure you're in SI units and never switch to pu again. After fixing this, you'll likely need to re-tune your Kp and Ki values since they were optimized for the corrupted system. Test in open-loop first with D=0.159 to verify you get stable output around 230V, then enable closed-loop control to reach 350V.

Your transformer design is solid - it's just the corrupted Lm causing all the issues.

Let me know how it goes!

Carlos
Carlos el 21 de Nov. de 2025
Hi @Umar,
With these values for a new transformer and in open-loop, it didn't work:
This is the output voltage waveform:
This is the input current waveform:
The control diagram:
The power circuit remains the same: C = 1e-6 F and L = 0.4766 H. I didn't put those you told me before as the specs were not 12 V in the input.
By the way, why such a big Rm?
Carlos
Umar
Umar el 21 de Nov. de 2025

Hi @Carlos,

I've carefully reviewed your screenshots, circuit diagram, and all your comments. Let me address your concerns in the order you raised them.

First, let’s focus on what actually happened is that yesterday's simulation never truly worked correctly. As I mentioned that the corrupted magnetization inductance (7.9 million Henries) created numerical condition where the simulation appeared stable, but it was giving you completely wrong results with only 15-16V output instead of 350V. Today, with the correct Lm value of 300 microhenries, the simulation is now properly revealing the actual circuit problems that were always there but were masked by the corrupted parameters. The old PI controller gains were tuned for that broken system, which is why they don't work now. So the simulation is actually more trustworthy today than it was yesterday - it's correctly showing you something is wrong with the circuit configuration.

Now let me provide my synopsis about trusting the simulation for manufacturing which you are already aware of. The simulation is trustworthy when all component values are physically realistic, the model converges without warnings, currents and voltages are in expected ranges, you see proper switching behavior, and results are consistent across runs. Right now your simulation is correctly telling you something is broken. The 800A current you're seeing is about 114 times higher than the expected 7A for 946W at 137.14V, and this indicates either a short circuit or severe transformer saturation. Once you fix the issues I'll explain below, the simulation will become reliable and will accurately predict real-world performance.

Regarding the current ripple changing between yesterday and today with the same Kp and Ki values - yesterday your model had the corrupted Lm value of 7.9 million Henries along with wrong filter values, and it happened to produce certain results. Today you changed Lm to the correct 300 microhenries value, but the controller gains are still tuned for the old broken system. Additionally, the model file saved different parameter states between runs when you switched units, which MATLAB retained even when you thought you were starting fresh. Once you fix everything, you'll need to retune Kp and Ki from scratch starting with Kp equals 0.005 and Ki equals 8.0.

Now let me address the most critical issue. You mentioned that the power circuit remains the same with C equals 1e-6 F and L equals 0.4766 H, and you didn't put the values Umar told you before because the specs were not 12V in the input. This is a fundamental misunderstanding that's preventing your circuit from working. The output filter values that I gave you - 500 microhenries for L and 220 microfarads for C - are NOT dependent on whether your input is 12V or 137.14V. These values are determined by your output power of 946 watts, your switching frequency which is likely 50 to 100 kilohertz, your acceptable output ripple of 1 to 5 percent, and your load characteristics. Whether you're simulating the complete system with 12V input or just the push-pull stage in isolation with 137.14V input, the output filter requirements remain exactly the same because you're still targeting 350V output, still delivering 946 watts, still switching at the same frequency, and still filtering the same switched waveform. My suggested filter values are correct for your application regardless of which part of the system you're simulating.

Your current output filter has L equals 0.4766 Henries, which is 476,600 microhenries, and C equals 1 microfarad. What you must use is L equals 500 microhenries, which is 0.0005 Henries - that's 953 times smaller than what you have now - and C equals 220 microfarads with an ESR of 0.05 ohms - that's 220 times larger than your current capacitor. This matters enormously because your LC filter cutoff frequency with current values is about 231 Hertz, while the required filter cutoff should be around 1.5 kilohertz for typical 50 kilohertz switching. Your filter is blocking energy transfer to the output and creating a massive impedance mismatch. The 800A you're seeing is because energy cannot flow through your output filter properly, causing it to accumulate in the transformer and saturate it immediately.

Looking at your waveforms, your input current shows a smooth exponential rise to 800A with absolutely no ripple, no switching artifacts, and no discontinuous conduction mode patterns. It looks exactly like a simple RL circuit charging, not a switching converter. This means your switches are likely not operating correctly at all, or the simulation is seeing a short circuit path. Normal operation would show switching ripple in the current waveform with discontinuous or continuous conduction mode patterns and current in the range of 5 to 15 amps, not 800 amps. The complete absence of switching behavior combined with this massive overcurrent strongly suggests either your MOSFETs are stuck in the ON state continuously, creating a short circuit from input through the transformer to ground, or your gate signals aren't reaching the MOSFETs properly.

Your output voltage waveform shows it briefly reaches 30V then decays exponentially to about 5V and stays there. This is not even close to the expected 348V calculated from your turn ratio and duty cycle. The exponential decay suggests energy is being drained or dissipated rather than maintained and built up. With 800A flowing in but only 5V output, the energy is clearly being dissipated somewhere, likely as heat in the saturated transformer core and the MOSFETs if they're stuck on.

About your question on why such a big Rm - actually, Rm equals 10,000 ohms is not big in a problematic way. It's quite standard for a transformer magnetization resistance. At 137.14 volts, the magnetizing current through Rm is only 13.7 milliamps, which is negligible compared to your load current of about 7 amps. This represents about 1.9 watts of core loss, which is very reasonable. If Rm were too small like 100 ohms, you'd have excessive magnetizing current and core losses. If it were too large like 1 million ohms, you'd have almost no core loss representation. 10 kilohms is in the sweet spot and is definitely not causing your problems.

Here's what you need to do immediately. First and most critical, change your output filter values. Change the inductor from 0.4766 H to 0.0005 H which is 500e-6 in scientific notation. Change the capacitor from 1e-6 F to 220e-6 F. Add a capacitor ESR of 0.05 ohms. This single change will likely resolve most of your issues because it will allow energy to actually transfer from the transformer to the output.

Second, verify your gate drive signals are actually working. Add scopes to monitor gate_R signal at the PI controller output, gate_L signal which should be complementary, and critically, monitor both gate signals at the actual MOSFET gates after any gate drivers. You should see square wave PWM at your switching frequency, duty cycle of 15.9 percent matching your D equals 0.159 setpoint, complementary operation where when gate_R is high gate_L is low, and voltage levels appropriate for your MOSFETs which is typically 10 to 15 volts for logic level MOSFETs or 15 volts plus for standard MOSFETs. If you don't see proper switching at the MOSFET gates, that explains the 800A short circuit condition.

Third, check your transformer wiring in the circuit. Verify that your primary windings rated at 137.14V are actually connected to your switches P21F20HP2_1 and P21F20HP2_2. Verify that your secondary windings rated at 350V are connected to your output rectifier diodes MBD1EAQ1_1 and MBD1EAQ1_2. Make sure there are no accidental shorts between windings. Confirm the center tap is properly grounded where appropriate. Verify your MOSFETs are connected correctly with proper drain-source orientation.

Fourth, check the transformer saturation characteristic. I noticed your parameter dialog shows a saturation characteristic that might be causing immediate saturation at startup. Try temporarily using a more linear saturation curve like [0 0; 1000 1] which essentially disables saturation to isolate whether that's causing the short-circuit behavior. If the circuit works without saturation enabled, then you know the saturation curve needs adjustment.

Fifth, verify your solver settings. You probably already using ode23tb or ode15s solver with max step size of 1e-7 and relative tolerance of 1e-4 but still make sure about these settings. With your current massive inductance of 0.4766 H, the solver might be struggling numerically.

After you make these changes, follow this test sequence. First change L and C to the correct values. Then run the simulation for 0.1 seconds. Check that your input current is now in the 5 to 15 amp range with visible switching ripple, not 800 amps with smooth DC behavior. Check that your output voltage starts building up toward 230 to 250 volts in open-loop operation. If you're still seeing 800 amps or smooth current with no ripple, then you have a confirmed gate drive problem and the MOSFETs aren't actually switching.

We already covered your concern about turn ratio, you asked to confirm your 1:8 calculation before making changes. I already confirmed this and he was absolutely right. Your turn ratio of 1:8 is spot on. Using the push-pull equation Vo equals 2 divided by Nps times D times Vi, with Nps equals 1/8 equals 0.125, we get Vo equals 2 divided by 0.125 times 0.159 times 137.14 which equals 16 times 0.159 times 137.14 which equals approximately 348 volts. This matches your target of 350V perfectly. Your winding voltages of [137.14, 137.14, 350, 350] are correct. Do not change these. The problem is not your transformer design - it's solid. The problem is your output filter and possibly your gate drive circuit.

One more thing about the output saturation limits you set. You mentioned setting the output saturation upper limit to 0.9 and lower limit to 0, and integrator saturation upper limit to 0.85 and lower limit to 0.05. These anti-windup settings are reasonable, but they're not going to help if the fundamental circuit isn't working due to wrong filter values and possible switching problems.

In summary, your transformer parameters are entered correctly and your turn ratio is correct. The catastrophic failure you're seeing with 800A overcurrent and 5V output is caused by your output filter values being wildly wrong - your inductor is almost 1000 times too large and your capacitor is 220 times too small. This is preventing energy transfer and likely causing immediate transformer saturation. Additionally, the complete absence of switching ripple in your current waveform suggests your MOSFETs may not be switching at all. Fix the output filter first, verify gate signals are reaching the MOSFETs, and the circuit should start working properly. The simulation is actually doing its job by showing you these problems before you build hardware. Once corrected, it will accurately predict real-world performance.

Please make these changes and report back with new current and voltage waveforms, plus screenshots of your gate signals. Your circuit will work once these fundamental issues are addressed.

You have tremendous effort into it and your design engineering team will appreciate that. I am doing my best to help you as much as I can and wish could afford the simulink license to help you further.

You got this and as a team, we will make sure that your push pull works.

Carlos
Carlos el 24 de Nov. de 2025
Hi @Umar,
Unfortunately, it didn't work with the changes I made which are:
L = 500e-6 H (with also an ESR = 100e-3 ohm a colleague suggested me to make a more realistic L).
C = 220e-6 F with ESR = 0.05 ohm (as you told me).
The gates are driving correctly or apparently correctly for a simulation of 0.1 s (look at it with a zoom and general view):
I added the saturation characteristics: [0 0; 1000 1].
And still with all that, I am obtaining a a high current and 0 V in the output:
There must be something else. Probably I need to select any other option in the measurements of the different blocks? DC Voltage Source has "None". Snubber and Inductor have "Branch current". Capacitor has "None". And load has "branch voltage". Are these OK? The diagram remains the same (with the values changed) and the waveforms I posted are still in open-loop.
You can also see these other waveforms for the duty cycle after and before the 0.5 gain.
Many thanks for your help.
Carlos
Umar
Umar el 24 de Nov. de 2025

Hi @Carlos, Could you please share screenshots of your simulink controller and push pull converter block diagrams as well. Thanks.

Carlos
Carlos el 24 de Nov. de 2025
Hi @Umar,
Nothing changed there, but find it below:
Carlos
Umar
Umar el 24 de Nov. de 2025

Hi @Carlos,

I need your input, it seems that we have spent a lot of time on diagnosis of push pull converter. The results have not been positive so far. Have you consult with your engineering team, what is their opinion? Because I am more reluctant about redesigning whole circuit again. I could be wrong but this is my final analysis at this point. I will take a look at the attachments in few minutes and let you know.

Carlos
Carlos el 24 de Nov. de 2025
Editada: Carlos el 24 de Nov. de 2025
Hi @Umar,
The reason why I appeal to you is because in my team no one knows about power electronics nor simulink. I know, probably I am bothering you too much (and I'm sorry about that), but I don't have any other help apart from some teachers I had which can answer rarely but are not so dedicated as you. I don't know what you mean by "my input". The voltage is 137.14 V, which will be following a boost converter, but I am simulating the push-pull separately before attaching it to the first stage (the boost converter).
Thanks once again.
Carlos
Update: I didn't see this before, there is an algebraic loop in the transformer, as it says in the warnings:
The diagram you are seeing here is Model inside the multi-winding transformer:
And as you see, no changes were made in the transformer (well, they are appearing in pu, but I promise I didn't switch to pu, so I don't why it's happening that again):
I was going to try to simulate it with the blue blocks, copying the structure of the power circuit from an example in Mathworks. Let's try it in that way...
I didn't remember how difficult was to work with the blue blocks... I can't join the gate signal to the mosfet after using the simulink-ps converter. I have been trying it for a while and I don't understand what's wrong.
Carlos
Carlos el 24 de Nov. de 2025
Hi @Umar again,
I decided to put the PI and start with the values you said. For some reason, it reaches 279 V in the output but the current is going like the screenshot below:
I even put again the values in a different transformer, but this time without the saturation characteristics as it was incompatible to have it while changing winding resistors and leakage inductances with the values you said before. As you saw in the last comment, the transformer parameters were in pu again but I can ensure you I didn't do any switch to it, probably when I added the saturation characteristics it switched but I don't know if it's really taking it in pu or SI. The transformer is driving me crazy... I can't understand why it's not going if the calculations are right (you even checked them). Kp = 0.005 and Ki = 0.01 in this particular moment with those results.
Carlos
Umar
Umar el 25 de Nov. de 2025

Hi @Carlos,

I've gone through all your screenshots, circuit diagrams. I can see you've been working really hard on this and the frustration is understandable. The good news is that *your circuit design and parameters are actually correct *- the problem is entirely with how Simulink is handling the transformer's saturation model.

The Root Cause The algebraic loop warning you're seeing is not just a warning - it's actively breaking your simulation. When you enable the saturation characteristic [0 0; 1000 1] in the Multi-Winding Transformer block, Simulink creates an internal feedback loop that includes:

1. A 1-D Lookup Table (for the saturation curve) 2. A Discrete-Time Integrator 3. Discontinuities at the saturation transition points

The solver is struggling to converge because of these discontinuities in the algebraic loop, which is why you're seeing that smooth exponential current rise to 800A with no switching ripple - the simulation is fundamentally unable to solve the system correctly.

Why Your Parameters Are Actually Right

I was absolutely correct about your transformer design. Let me confirm:

  • Turn ratio 1:8 is spot on - With Nps = 1/8 = 0.125, using Vo = (2/Nps) × D × Vi gives you (2/0.125) × 0.159 × 137.14 ≈ 348V, which matches your 350V target perfectly
  • Lm = 300microHenry is correct - The previous 7.9 million Henries was due to a pu/SI unit corruption issue
  • Output filter L = 500microHenry, C = 220microFarad are the right values for 50kHz switching at 350V output
  • Rm = 10,000ohm is perfectly fine - At 137.14V, this gives only 13.7mA magnetizing current and about 1.9W of core loss, which is very reasonable

The issue isn't your design - it's the simulation methodology.

The Solution - Two Options

Option A: Disable Saturation (Immediate Fix) This is the fastest way to get your simulation working: 1. Open your Multi-Winding Transformer block 2. Go to the Configuration tab 3. UNCHECK "Saturable core" 4. Keep all other parameters exactly as they are 5. Run the simulation

This will immediately eliminate the algebraic loop. Your Lm = 300µH parameter will work correctly, and you'll finally see proper switching behavior.

Why this is acceptable: Your saturation characteristic [0 0; 1000 1] is essentially linear up to 1000A anyway. Since your magnetizing current is only 13.7mA (nowhere near 1000A), the saturation model isn't actually doing anything useful - it's just creating numerical problems.

Option B: Keep Saturation But Break the Loop (More Complex) If you absolutely need saturation modeling, you need to access the "Advanced" tab of the transformer block:

1. Open your powergui block (the "Discrete 2e-06 s." block) 2. In the Preferences tab: * UNCHECK "Automatically handle discrete solver and Advanced tab solver settings of blocks" * This makes the Advanced tab visible in nonlinear blocks 3. Expand "Solver details for nonlinear elements": * Verify settings are reasonable (defaults are usually fine) 4. Open the Multi-Winding Transformer block 5. Go to the newly visible Advanced tab: * CHECK "Break Algebraic loop in discrete saturation model" * This inserts a one-sample delay that breaks the loop 6. Run the simulation

Note: This introduces a small time delay (2microseconds in your case since your sample time is 2e-6), which can cause minor numerical oscillations, but it's usually acceptable.

What You Should See After the Fix Once you resolve the algebraic loop, your simulation should show: * No algebraic loop warnings in the Diagnostic Viewer * Visible switching ripple in the current waveform (not that smooth exponential curve) * Current in the 5-15A range during normal operation (not 800A) * Output voltage building up toward your regulated 350V setpoint * The PI controller actually working to regulate the output

The fact that your gate signals are already switching correctly (as shown in your latest plots) means that once the algebraic loop is fixed, everything should fall into place.

About the "pu vs SI" Issue You Mentioned

You mentioned that the transformer parameters seemed to switch to pu when you added the saturation characteristic. This is actually a known behavior - when certain parameters change, MATLAB sometimes tries to "help" by converting units, which can corrupt your values. This is why Umar suggested deleting and recreating the transformer block.

If you go with Option A (disabling saturation), you avoid this issue entirely. If you use Option B, make sure after you check "Break Algebraic loop" that all your parameters are still showing correctly in SI units.

One More Thing About Your Output Filter I noticed in one of your messages you mentioned keeping C = 1e-6 F and L = 0.4766 H because "the specs were not 12V in the input." Just to clarify: the output filter design is independent of the input voltage. The filter must be sized based on:

  • Output voltage (350V)
  • Output power (946W)
  • Switching frequency (~50-100kHz)
  • Acceptable output ripple (1-5%)

Whether your input is 12V or 137.14V doesn't change the output filter requirements. The L = 500microHenryand C = 220microFarad values I gave you are correct for any input voltage that gets you to 350V output through the transformer.

Your latest screenshots suggest you've already made these changes, which is great.

Your circuit is actually well-designed. The issue is purely a simulation problem caused by the algebraic loop in the saturation model. Use Option A to get it working immediately, then if you really need saturation modeling later, you can explore Option B.

The simulation has been giving you misleading results (800A with 0V output is physically impossible through an 8.709ohm load), but once the algebraic loop is resolved, you'll see the real behavior of your converter.

You're very close to having this working. Don't second-guess your component values - they're correct. Just fix the algebraic loop and you should be good to go.

Let me know how it works out!

Additional Resources If you want to verify the saturation isn't needed for your application, calculate the peak flux density. With Lm = 300microHenry and 13.7mA magnetizing current at steady state, you're operating well below any saturation limit. The [0 0; 1000 1]curve you have is essentially saying "don't saturate until the magnetizing current hits 1000A" - which will never happen in your circuit.

Good luck, and I think you'll be pleasantly surprised how well it works once this is fixed!

Carlos
Carlos el 25 de Nov. de 2025
Hi @Umar,
Even if I switch off the saturation, I see this in the input current which makes me think if this is unreal or if it's real, it could be dangerous for the components:
As far as I know, the magnetizing current goes from a maximum to a negative maximum but more than 200 A?
The current in the inductance has this waveform:
Probably I could reduce the ripple of this by increasing the L which is now 500 uH...
And the output voltage, for some reason is not reaching even 300 V, when it used to do it in the past:
While I was waiting for your answer, I tried to simulate this in a newer version of Matlab I had access but something went wrong. I switched to 40000 Hz everything to see if I could reduce the magnetizing current and after seeing no improvement, I returned back everything to 50000 Hz and the output voltage went to 0 V. Impossible to recover it, not even copying the system in a new file by Ctrl+C - Ctrl+V. It became useless that file, and I checked that all sample times were with the new value.
Please, let me know if such big currents in the input are normal and how to make the output voltage reach its real target. The transformer is now with no saturation but the rest of values remain the same.
I really appreciate what you are doing for me, Umar. Thank you so much.
Carlos
Umar
Umar el 25 de Nov. de 2025
Editada: Umar el 25 de Nov. de 2025

Hi @Carlos,

I’ve reviewed the screenshots you shared, and I believe we’ve identified several critical issues affecting your power converter’s performance. Here’s a breakdown of the root causes and the actions needed:

1. Load Resistor Issue (Critical)

The current load resistor value of 8.709 ohm is too small. For proper operation at 350V and 946W, the load should be 129.6ohm. This mismatch is likely causing the output voltage to sag to 270V and resulting in massive input current oscillations (~+/- 250A).

Action: Please change the load resistor to *129.6 ohm to match the design parameters.

2. Startup Inrush Current (45A Spike)

The initial 45A current spike during startup is a result of the inductor charging the output capacitor (220microFarad ) quickly. This is expected, but it can be reduced with a soft-start mechanism.

Action: Implement a soft-start by ramping the reference voltage gradually over 0.1 seconds. You can do this by replacing the constant reference voltage block with a Ramp block.

3. Massive Input Current Oscillations (~+/-250A)

The large oscillations suggest:

  • No soft-start implementation.
  • A potential issue with the PI controller’s duty cycle and initialization of the transformer core flux.

Action: Implement a soft-start by either ramping the reference voltage or the duty cycle. Additionally, ensure initial conditions are set to zero or steady state in the powergui block to prevent instability.

4. Output Voltage Stuck at 270V

This issue is likely due to:

  • PI controller saturation or improper tuning for startup.
  • Incorrect initial conditions or load resistor mismatch.

Action: After fixing the load resistor, verify the PI controller settings and ensure proper limits on the duty cycle output.

Additional Fixes:

1. Initial Conditions: Set pinitial conditions in the powergui block to either "steady state" or "to zero" to ensure the system starts from the correct state. 2. Sample Time: Your sample time of 2microsecond is correct for 50 kHz switching, so no change needed here. 3. PI Controller Tuning: Double-check the integrator windup and ensure the controller output is limited to reasonable values.

Request for Diagrams & Parameters:

To move forward, it would be extremely helpful if you could provide the following:

Full Simulink Block Diagrams for both the power circuit and the PI controller.

  • Component parameter values, especially for:
  • Load resistor (confirm the value)
  • Capacitors, inductors, and transformers
  • Scope Block Configurations: What signals are connected to each scope
  • PI Controller Settings: Kp, Ki values, and saturation limits.

This will help us confirm the issues and ensure we’re on the right track with the fixes.

Next Steps:

1. Change the load resistor to 129.6ohm. 2. Implement the soft-start mechanism. 3. Set initial conditions and check PI controller limits. 4. Send me the requested block diagrams and component parameters.

Once the load resistor issue is fixed, I expect the system to stabilize, and many of the current issues should resolve themselves.

Carlos
Carlos el 26 de Nov. de 2025
Hi @Umar,
The load was always 129.46 ohm, not 8.709 ohm. Why do you think it was 8.709 ohm? Something else is limiting the output voltage to ~315 V and is not the load resistor. Not even changing slightly its value, the output voltage changes.
About the soft-start, the ramp has very limited parameters (slope of signal, start time and initial output). I can't tell the system to go to 350 V in 0.1 s because the slope 350/0.1 = 3500 could be interpreted as many other ways. In fact, that was rushing the current to a million amps after retuning the PI, and it was giving a Kp = 0 and a phase margin of 131º. With a constant reference, Kp = 0 too and the phase margin -161º.
Is my system really feasible? After several messages it seems like this will never work. It never reaches the output voltage, I check everything you tell me but it's always unstable and the retuning doesn't even work.
The block diagrams are like this:
Voltage DC source = 137.14 V; "None" measurements.
C = 220e-6 F with ESR = 1e-6 ohm in the primary.
MOSFETs with these (changed at the beginning):
Multi-winding transformer with 946.27 W, 50000 Hz, V = [137.14 137.14 350 350] Vrms, R = [0.05 0.05 2 2] ohms, L = [2e-6 2e-6 4e-5 4e-5] H, Rm = 10000 ohm, Lm = 300e-6 H.
Diodes with these (changed at the beginning):
L = 500e-6*3 H with ESR = 100e-3 ohm (branch current measurement).
C = 220e-6 F with ESR = 0.05 ohm (none measurement).
R = 140 ohm (branch voltage measurement).
With the ramp as I said before, it makes voltage go to 0 V. Probably I need anything else but I don't know how to implement it.
And this is what it does to the output voltage if I change the ramp by the constante reference:
But it's doing also this to the input current which I think it's not tolerable, very high peak current, I believe it would be dangerous:
The configuration in the PI is as shown below:
Ki value was obtained from the automatic tuning. Kp value was proposed by me to try something was it got 0. I wish this could work eventually but I am pessimistic, it's always showing nonesense waveforms.
Thanks.
Carlos
Umar
Umar el 26 de Nov. de 2025

Hi @Carlos,I was trying to post my answer but it gave me an error again like in the past, so please see attached pdf which addresses your comments. Let me tell you have done a great job, put a lot of tremendous effort into it, it is not wasted. I believe in you that you will get everything working this time.

Carlos
Carlos el 27 de Nov. de 2025
Editada: Carlos el 27 de Nov. de 2025
Hi @Umar,
Step by step, I'll tell you how it's going.
  1. PI parameters: done but a comment. If I limit it to 0.45, then, I don't need the 0.5 gain you told me to add previously. So I removed it.
  2. Remove ramp: done.
  3. Add soft-start: done but unsure if right because you explained how step by step but later in the summary it's contradicting it with the connection of the output of the PI controller (PI Controller> [D from PI] is then attached to Clock which is connected to Gain(10) which is connected to Sat[0,1] connected to × connected to [D_final] connected to PWM Generator (soft-start)). In fact, the clock has no inputs. I put a value of 100 in the sample time thinking that it's possibly 0.1 s but I am not sure. With the following diagram, unfortunately it's still not working:
4. Powergui: was already done from the last interaction.
5. Added here, apart from the current measurement that was in the primary:
6. After running the simulation, you can see that the current is not making what we expected:
Also, the output voltage is increasing by steps and stuck in a value below the reference:
That's for Ki = 1, but for Ki = 8, it was behaving very similar. Kp = 0.005.
Please, tell me if the soft-start is well implemented or what is making it behave wrongly.
By the way, if I changed the components value, could I change the values of input current and output voltage? It seems that it happens for the boost converter, where if I modify L and C, the Iin and Vout change, although I thought it had no impact on that. We want to be able to program the discharging current so the program would change the PI gains depending on it. I thought we would need to overdimension the components to have it for the smallest current possible but I am seeing that is not making it work in simulink as it is not getting the current I want.
Carlos
Umar
Umar el 27 de Nov. de 2025
Editada: Umar el 27 de Nov. de 2025

Hi Carlos,

The issue causing your output voltage to plateau at 320V instead of reaching 350V, along with the stepped voltage response and high current transients, is that your proportional gain is too small. With Kp = 0.005, the controller relies almost entirely on slow integral action which creates the stepped, sluggish behavior you're observing. You need to increase the proportional gain to provide immediate error correction. Change your PI controller parameters to Kp = 0.05 and Ki = 8.0, keeping all other settings the same, then run the simulation for 0.15 seconds. If the output reaches 340-350V, you've succeeded and can fine-tune from there by adjusting Kp between 0.03-0.08 depending on whether you see overshoot or slow response.

If it becomes unstable with oscillations, reduce Kp to 0.02 and work upward more gradually. The soft-start structure you implemented with Clock to Gain(10) to Saturation to Multiply is correct and working as intended. Power electronics PI tuning is inherently iterative and even experienced engineers need several attempts to optimize controller gains, so expect to try 2-4 different combinations before achieving stable regulation. Your design is sound and you're very close to success - this is the normal final stage of converter development, not an indication that something is fundamentally wrong. The stepped voltage response and failure to reach 350V are classic symptoms of insufficient proportional gain in a PI controller, which is a straightforward parameter adjustment rather than a circuit redesign.

I'm highly confident that with Kp = 0.05 you'll see significant improvement, likely reaching at least 340V, and with minor tuning you'll achieve stable regulation at your 350V target within a few iterations.

We are almost there and you can do it.

Carlos
Carlos el 28 de Nov. de 2025
Editada: Carlos el 28 de Nov. de 2025
Hi @Umar,
Sorry but that didn't work at all. The output voltage is always stuck in the same voltage whatever I do. My team has discussed moving to a B plan: just a boost to elevate from 30 V to >50 V. But I am having similar problems. I want to monitor input current. I picked an inductance to have a value enough for the ripple but high values can't tolerate high currents. Eventually I found a value (150 uH) that can tolerate currents of until 8 A but for some reason, no matter what I change in the PI controller, the reference is never reached, the current is 357 A and the output voltage is very low. I don't know where the power is going, the load resistor is consistent with the output voltage and current I obtain but those are values I don't want.
I have L = 150 uH (ESR = 67 mOhm), current ripple = 0.49 A, C = 68 uF (ESR = 1 mOhm (*updated*)), voltage ripple = 0.4 V, load resistor = 13.125 Ohm, Vi = 30 V (and it should be possible to decrease as it comes from a battery), fs = 200 kHz and input current = 7 A. As I say, I need to have those values of L and C, but no matter what I do to the Kp and Ki, the power is going somewhere but not to the load. I even tried to reduce the current with a gain of 1/reference but is not doing anything. See where I placed it in the diagram (I even put it after the comparator and no change):
I am sorry for changing too many times the design but my team is in a rush and I don't know what else to do to make the simulation working. If the calculations are right (and I am 99% sure they are), why the simulation is showing something that has no sense? I also changed the solver settings following your previous advice. The current waveform is very fine but not in the correct reference and I don't know why:
I could say "OK, design is done, let's move on", but I can't be completely sure of this. I couldn't make a power converter that could be damaged if the control is not perfect but the simulation shows that any change is useless. I reviewed the calculations and they are right but not reaching the reference is to be really worried.
Thanks.
Carlos
Update: the transistor I was using wasn't appropriate, I changed values of Vf and Ron and I got smaller current in the input. However, I am still getting smaller current in the output (bottom graph) and high current through the transistor (top graph):
Now, Kp = 3 and Ki = 5. I was trying to use the Ziegler-Nichols method of increasing Kp and Ki but there was no change. And the duty cycle is saturated in 0.05. I believe in real life the behavior would be better than in simulink. But I want to be sure it works fine and the output voltage reaches 52.5 V (as calculated).
Umar
Umar el 28 de Nov. de 2025

Hi @Carlos, before I proceed to provide further assistance with no access to matlab simulink, I would like to know if my suggestions are helpful and getting you close to achieving your desired outcome. It seems that not having access to Simulink defeats the purpose of your outcome. Let me know if you want to redesign the whole circuit and call it good at this point or keep moving forward with discussions and details.

Carlos
Carlos el 1 de Dic. de 2025
Hi @Umar,
Give me some days and I'll tell you something, please.
Thank you.
Carlos
Umar
Umar el 1 de Dic. de 2025

Hi @Carlos,Since we are currently waiting for input from your design engineering team, could you please provide your feedback on the support, analysis, and technical guidance I’ve provided so far? Your comments will help ensure we remain aligned. After receiving your feedback, we can move forward.

Iniciar sesión para comentar.

Comunidades de usuarios

Más respuestas en  Power Electronics Control

Categorías

Más información sobre Simulink en Centro de ayuda y File Exchange.

Preguntada:

el 14 de Nov. de 2025

Comentada:

el 1 de Dic. de 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by