Why am I getting a near 0 current in the flyback converter?

119 views (last 30 days)
Carlos
Carlos on 30 Oct 2025 at 10:41
Edited: Umar about 4 hours ago
Hi,
I am simulating this flyback converter where Vin is 48 V, Vout should be 380 V, the mutual inductance has L1 = 1e-5 H, L2 = 0.036 H, VF in the diode is 2.1 V and C = 87e-6 F. As you can see in the diagram, I tried to control it first by close-loop but as I couldn't get the right values, I tried by fixing a constant which is 0.116564 which is the calculated duty cycle for Vin= 48 V. The problem I get is the values of V_out which is -1.428 V and I_out near 0 but negative. I tried moving the current measurement block to the bottom and the top branch, changing the connection with the secondary inductance or the polarity in the voltage measurement. I never get positive voltage and positive current with high values. According to my calculations, I_out should be 2.53 A and V_out, as I said 380 V. Could someone with knowledge in power electronics and simulink help me with this issue? It's R2022b version.
Thanks.
Carlos
  3 Comments
Carlos
Carlos on 30 Oct 2025 at 11:15
Edited: Carlos on 30 Oct 2025 at 12:30
@Antonino Riccobono but why should I put a load if I am measuring the current after the secondary winding? Anyway, I put a load in parallel with the capacitor and anything changed. There must be anything else.
Update: This is (with the last update) how the diagram looks like. V_out and I_out are positie but for some reason the V_out increases very slowly and I don't know if it will reach the voltage I expected (380 V). The current is still almost 0 (but positive).
Antonino Riccobono
Antonino Riccobono on 30 Oct 2025 at 13:39
I see that you placed the load in a wrong location - it must be placed in parallel to the output capacitor.
Also pay attention to the connection to the transformer secondary side to either make a noninverting or inverting topology.
Please, refer to the following example: https://www.mathworks.com/help/sps/ug/flyback-converter.html

Sign in to comment.

Answers (4)

Umar
Umar on 3 Nov 2025 at 18:43

Hi @Carlos,

After going through your plots and comments, I would like to pinpoint some important points which are critical and I did mention earlier in my comments.

Let’s talk about your initial problem where you were getting near-zero current and negative voltage, the main issues were related to load placement and duty cycle calculations. When Antonino and I pointed out that you needed the load resistor in parallel with the output capacitor, that was critical because without it, the converter had nowhere to deliver energy. Your original duty cycle calculation of 0.116564 for 48V input to get 380V output was actually correct. The transformer turns ratio you calculated from the inductances (square root of 36 milliheneries divided by 10 microheneries equals 60:1) was spot on.

The breakthrough came when you divided your inductances by 7. What happened there is really interesting from an engineering perspective. Your turns ratio stayed the same because you divided both primary and secondary inductances equally, but the smaller inductances allowed much faster current ramps during each switching cycle at 24kHz. The original inductances were simply too large for your switching frequency, preventing complete energy transfer in each cycle. By reducing them, you enabled the magnetic field to build up and collapse fast enough to actually deliver power to the output. Regarding your plots showing the voltage hitting 380V intermittently but not stabilizing, this is actually revealing something important about flyback converters. They have what's called a right-half-plane zero in their transfer function, which makes them notoriously difficult to stabilize with simple PI control. This is why your linearization attempts failed - the system behavior changes significantly with operating conditions, and standard linearization tools struggle with this. The voltage oscillations you're seeing are the PI controller hunting for the setpoint but overshooting and undershooting because the compensation isn't properly designed for the flyback's complex dynamics. When you increased the capacitor to 330microfarads you improved the ripple because you gave the system more energy storage to smooth out the switching frequency variations. This is good practice and shows you're thinking correctly about the output stage design.

Now, here's where things get really important. You've realized that your application actually needs constant current control, not constant voltage control. This is a fundamental shift in your design philosophy, and honestly, it changes everything. For battery discharge applications, constant current is absolutely the right approach. The battery voltage will naturally drop as it discharges, and you want to maintain a steady current flow to ensure controlled, safe energy extraction.

However, there's a significant concern I need to raise based on your power level requirements. You mentioned wanting 20A output current. If this is at 380V, that's 7,600 watts. Your current design with the 150-ohm resistor is sized for about 1,000 watts (380V divided by 150 ohms gives 2.53A, which matches your original calculation). Flyback converters are typically used in the range of 50 to 100 watts, and while special designs can push to a few hundred watts, they're generally not recommended beyond that. The literature consistently points out that flyback converters become impractical above about 60 watts for standard designs, with special multiphase designs potentially reaching a few hundred watts.

The reason flyback converters have this limitation is fundamental to how they work. Unlike other topologies that transfer energy continuously, a flyback stores all the energy in the magnetic field during the switch-on time and then releases it during the switch-off time. This means the transformer has to be sized to store the entire energy packet for each cycle, which makes it much larger and more expensive than transformers in other topologies at the same power level. The current stress is also much higher because all the power flows through a single switch that's only on part of the time.

For your constant current requirement of 20A at multi-kilowatt power levels, you really need to reconsider your topology. Looking at your three options, I would strongly recommend Option B: Flyback at constant current plus Boost at constant voltage plus Inverter to grid. Here's why this makes sense for your application.

The boost converter stage can efficiently handle the high current constant current regulation. Boost converters are excellent at this because they have continuous input current, which is exactly what you want when drawing from a battery. The inductor in a boost converter naturally limits and smooths the current, making constant current control much more straightforward than in a flyback. You would implement the boost stage with a PI controller that measures output current and adjusts the duty cycle to maintain 20A regardless of input voltage variations as the battery discharges.

The flyback or isolated converter stage then provides the voltage regulation and galvanic isolation you need for grid connection. This stage would operate in constant voltage mode at 380V, which is actually what flyback converters do well. The isolation is important for safety when connecting to the grid, and splitting the functionality this way allows each converter to operate in its optimal range.

For implementing constant current control in Simulink, you need to make several key changes to your existing model. First, change your reference from voltage to current. Instead of V_ref equals 380V, you need I_ref equals 20A. Second, redirect your feedback signal from the voltage measurement to the current measurement that you already have in your model. Third, and this is crucial, you'll need to retune your PI controller gains because current loop dynamics are completely different from voltage loop dynamics.

Current loops generally need higher bandwidth than voltage loops because current responds faster to duty cycle changes. The proportional gain typically needs to be lower than what you had for voltage control, while the integral gain might need to be higher to eliminate steady-state error. A good starting point for tuning would be to use the Frequency Response Estimator in Simulink to get the actual plant response, then design your compensator based on that measured frequency response rather than trying to linearize the model.

One thing that will actually work in your favor with constant current control is that you won't have the right-half-plane zero problems that plague flyback voltage control. The current loop is more direct and generally easier to stabilize. However, you still need to be careful about your output capacitor size. For constant current operation, you typically want a smaller output capacitor than for constant voltage operation because you're not trying to maintain a stiff voltage - the voltage is allowed to vary with the battery state of charge.

Regarding your PI controller parameters, the Kp of 0.0135 and Ki of 12.52 were tuned for voltage control and won't work for current control. You'll need to start fresh with the tuning. Since the Transfer Function Based approach failed due to linearization issues, I'd recommend using the Frequency Response Based tuning method, but you need to ensure your model is at a reasonable operating point first. Make sure the converter is running in steady state before attempting to extract frequency response data.

Looking at your block diagram, the structure is actually good. You have the sawtooth generator for PWM, the PI controller for feedback, and proper measurement points. The main changes needed are in the controller logic and reference values, not the overall structure. Keep the mutual inductance block approach since it's working for you now - there's no need to switch to the Linear Transformer block if the mutual inductance is giving you the control you need. For your specific application of battery discharge to grid, you need to carefully consider the battery voltage range. If your battery pack voltage varies from, say, 300V down to 200V as it discharges, your converter output voltage will also vary (in constant current mode). This is normal and expected. The grid-tie inverter on the output needs to be able to handle this variable DC bus voltage, so make sure your inverter specifications match your actual operating range. One more thing about the power level: if your battery pack is 48V as you mentioned, then 20A at 48V is only 960 watts, which is much more reasonable for your current design. However, this creates a huge turns ratio requirement if you're boosting to 380V. Make sure you've clearly defined your input voltage range, output voltage requirements, and actual power level because these fundamentally determine whether your approach is feasible.

The MathWorks documentation includes several relevant examples you should review. There's a battery charging and discharging example that shows constant current and constant voltage algorithms, which demonstrates exactly the control strategy you need. There are also current-controlled bidirectional converter examples that show how to implement PI-based current control, which would be directly applicable to your needs.

For debugging your current issues, I'd recommend these steps. First, verify your actual power requirements with your team because the 20A at 380V (7.6kW) seems inconsistent with a 48V input and the component values you've chosen. Second, if you're staying with the flyback approach for now, implement current-mode control with proper feedback from your current sensor rather than voltage. Third, use much more conservative PI gains initially - start with very small gains and slowly increase while monitoring stability. Fourth, add current limiting to your reference signal so you don't try to draw more current than your components can handle during transients.

If you decide to go with the two-stage approach (Option B), the design becomes cleaner. The first stage boost converter operates in constant current mode with the battery as input, outputting whatever voltage is needed to maintain 20A at the intermediate bus. The second stage flyback or LLC converter operates in constant voltage mode to regulate the 380V needed for your grid inverter. This separation of functions makes each stage simpler to design and control.

For simulation purposes, I'd suggest starting with lower power levels to verify your control strategy works, then scaling up once you've proven the concept. Simulink can absolutely handle the power levels you need, but you need to ensure your component values are realistic for those power levels. At multi-kilowatt power, you need inductances in the range of tens to hundreds of microhenries, capacitors in the hundreds of microfarads to millifarads, and switching frequencies typically in the 20-100kHz range.

Finally, regarding the plots you shared, the fact that your voltage reaches the target intermittently tells me the power stage is capable of delivering the energy, but the control system isn't maintaining regulation. This is actually good news because it means your hardware design is fundamentally sound. The solution is in the control strategy, which is much easier to fix than rebuilding the entire power stage.

Your journey from voltage mode to recognizing the need for current mode shows good engineering intuition. Many people would have kept forcing the voltage control approach to work without stepping back to ask whether they were solving the right problem. The fact that you caught this and are now asking the right questions about current control shows you're thinking like an engineer, not just following formulas.

I hope this helps clarify where you are, why things have behaved the way they have, and what your path forward should be. Don't hesitate to ask more specific questions about any aspect of the implementation. The transition from voltage to current control is absolutely doable, but it requires rethinking several aspects of your design, especially at the power levels you're targeting.

  6 Comments
Carlos
Carlos 12 minutes ago
Hi @Umar,
But the intention is to deep discharge the batteries. I can't finish at 36 V... It should reach close to 0 V.
I have just tested the boost converter for a 48 V input voltage and it's reaching 20 A (well, almost, by decimals) with a fix D (0.65). But if I decrease that voltage, I have to change the load. In a real flyback converter, the load can't be changed dynamically (or can it?). So the purpose is to modify the duty cycle? With my calculations, D = 0.65. I calculated it from the input and output currents and with it, I calculated the output voltage for both input voltages (2 and 48 V). As it should be controlled by constant current, I supposed that D is calculated first by fixing the output current I want. Or am I doing it wrong? Please, correct me :)
After that, I will follow the next steps you told me.
Thank you!
Carlos
Umar
Umar about 4 hours ago
Edited: Umar about 4 hours ago

Hi @Carlos,

Please see my detailed response to your latest comments below — I’ve double-checked the relevant Simulink documentation to ensure accuracy.

Your comment: “But the intention is to deep discharge the batteries. I can’t finish at 36 V… It should reach close to 0 V.”

My feedback: The MathWorks documentation suggests modelling realistic battery behaviour and converter limits, rather than driving the input all the way to 0 V. Below a certain voltage, gate-drive circuits and switching devices lose proper bias, and the inductor current can rise uncontrollably.

In Simscape, converter blocks assume a non-zero, physically meaningful input voltage and require a defined electrical reference. There’s no native support for a “battery to 0 V” condition in the converter library.

So yes — while you can model a low-voltage cutoff, it’s best to design the boost stage to stop converting below about 20–36 V, as you previously suggested. Treat anything below that as an intentional shutdown rather than continuing to boost.

Your comment: “I have just tested the boost converter for a 48 V input voltage… it’s reaching 20 A… but if I decrease that voltage, I have to change the load. In a real flyback converter, the load can’t be changed dynamically (or can it?). So the purpose is to modify the duty cycle?… With my calculations, D = 0.65.”

My feedback: Exactly — in constant-current operation, you don’t fix the duty cycle. It will continuously vary as the input voltage or load changes to maintain the desired current.

According to the [Average-Value DC-DC Converter documentation][1]: “If you set the Control input parameter to ‘Current reference’, the converter sets the output current and computes the voltage.”

This means the converter (or your control loop) dynamically adjusts duty cycle to achieve the commanded current. Similarly, the [Boost Converter block][2] supports several modelling modes such as “Average model (D-controlled)”, allowing you to connect your PI controller output directly to the duty-cycle input.

So your idea of using a PI loop on the input current is exactly right — you use design calculations (like D ≈ 0.65) only for initial sizing, not as a fixed value during simulation.

As for varying the load: in your two-stage setup, the flyback converter and inverter together act as the “load” seen by the boost stage. The boost current-control loop adapts automatically to that, so there’s no need to manually adjust the load during operation (though it can be useful for testing).

Your comment: “I was designing the first stage only… and when that works, I’ll design the flyback at constant-voltage control, with another PI. I believe it’s just one [loop], the output current control…”

My feedback: You’re absolutely correct — this is a classic two-loop architecture.

The first stage (boost) regulates input current, and the second stage (flyback) regulates output voltage. As confirmed in the [Average-Value DC-DC Converter block documentation][1]: “If you set the Control input parameter to ‘Voltage reference’, the converter sets the output voltage and computes the current.”

So, configure the boost converter for current-reference mode and the flyback for voltage-reference mode. Each stage will have its own PI controller.

Be aware that because the intermediate DC bus connects both stages, transient coupling can occur when loads change or when the inverter starts drawing current. It’s worth running dynamic simulations to verify stability.

Your comment: “I calculated from the input and output currents and with it, I calculated the output voltage for both input voltages (2 V and 48 V)… As it should be controlled by constant current, I supposed that D is calculated first by fixing the output current I want. Or am I doing it wrong?”

My feedback: You’re on the right path for design calculations — using current, voltage, and duty-cycle relationships helps size components. However, once in simulation or hardware, the control loop manages D dynamically.

The [*Boost Converter* documentation][3] gives the familiar steady-state relationship for ideal operation:

     V_out = V_in / 1 - D

That equation is useful for sizing and estimating extremes, but in your constant-current design, the controller continuously adjusts D to hold the commanded current as V_in and load vary.

Keep in mind that if V_in drops too low (e.g., 2 V), D approaches 1, which is physically impractical. Device losses and saturation become dominant. Therefore, implement a realistic minimum voltage cutoff or derate the current as V_in decreases.

Implementation notes (based on Simulink documentation):

  • Boost stage:use Current reference mode.
  • Flyback stage: use Voltage reference mode.
  • Include current and * voltage sensors* (from Simscape > Foundation Library > Electrical Sensors) to feed the PI controllers.
  • For faster simulation, start with Average model (D-controlled) mode; switch to switch-level mode for detailed studies.
  • Include protection logic,e.g., undervoltage cutoff using Simulink logic or protection blocks.
  • Limit the duty-cycle command within a safe range (e.g., 0.05–0.85).
  • Test the full system with input-voltage and load transients to confirm loop interaction and stability.

In summary: You’re following the right design path, and the MathWorks documentation fully supports your two-stage control concept — boost converter in constant-current mode, flyback converter in constant-voltage mode, each with independent PI loops.

Just remember:

  • Don’t fix the duty cycle — let the current-loop control it.
  • Choose the correct control mode for each converter block.
  • Use a realistic minimum input voltage instead of 0 V.
  • Simulate dynamic events to verify stable behaviour.

References:

[1]: [ https://es.mathworks.com/help/sps/ref/averagevaluedcdcconverter.html ]

[2]: [ https://www.mathworks.com/help/sps/powersys/ref/boostconverter.html ]

[3]: [ https://www.mathworks.com/help/sps/ug/boost-converter.html ]

Sign in to comment.


Umar
Umar on 30 Oct 2025 at 19:49

Hi @Carlos,

I went through your entire thread carefully, including all your updates and the changes you made along the way. I have good news: there's nothing wrong with your Simulink circuit topology or block connections. Your model is actually built correctly. The problem is a duty cycle calculation error.Let me walk through what happened based on your comments.

In your initial post, you mentioned trying both closed-loop control and a fixed duty cycle of 0.116564, which you calculated for 48V input to get 380V output. You were getting negative 1.428V output and near-zero negative current. You tried moving the current measurement block around, changing secondary connections, and reversing polarity measurements, but never got positive voltage and current at the magnitudes you expected.

When Antonino suggested placing the load in parallel with the output capacitor and checking your transformer connections, you responded explaining your thinking. You said you thought having a resistor in a different location would be beneficial for biasing, and since an inverter would follow the flyback, you weren't initially adding a load resistor. You decided to try a random value of 250 ohms. You also mentioned you thought it should work by measuring current before the diode without any load, which shows a misunderstanding of how flyback converters need to be loaded to operate properly.

Then you described several changes you made. You changed the PowerGUI step size so it wasn't the same as the switching period of one divided by 24000 seconds. You reduced the reference voltage from 380V down to 70V for testing. And here's the critical part: you said the fixed duty cycle is now 0.024 as you calculated for an input of 48V. You also changed the diode forward voltage from 2.1V, which is your actual spec, to 0.7V, and reduced the capacitor from 87 microfarads to 12.5 microfarads. Even running the simulation for 100 seconds, the output voltage remained too small and the output current was nearly zero, though you noted the output current was switching with an upper limit almost at zero, and the output voltage was increasing very slowly.

You also mentioned that the MathWorks example Antonino shared used the blue Simscape blocks, which were incompatible with your PID controller ports, so you had to stick with the black Simulink blocks.

Here's what I found after analyzing everything. Your circuit topology is completely correct. The transformer polarity with dots on opposite ends is exactly right for a flyback converter. Your diode orientation is correct, your load placement is correct, and all your block connections are proper. The problem is purely in the parameter values, specifically your duty cycle calculation.

When you said you calculated duty cycle equals 0.024 for a 48V input to get 380V output, this is where the error occurred. Let me show you the correct math.

Your transformer turns ratio is the square root of L2 divided by L1, which equals the square root of 0.036 divided by 0.00001, which equals 60.

For a flyback converter, the duty cycle formula is: duty cycle equals the sum of output voltage plus diode forward voltage, all divided by the sum of turns ratio times input voltage plus output voltage plus diode forward voltage.

For your original 380V target with 2.1V diode, the calculation is: duty cycle equals 380 plus 2.1, divided by 60 times 48 plus 380 plus 2.1, which equals 382.1 divided by 3262.1, which equals 0.117 or 11.7 percent.

This matches your very first calculation of 0.116564. That was correct! But when you recalculated and got duty cycle equals 0.024, you actually calculated the correct duty cycle for a 70V output, not 380V. The calculation is: duty cycle equals 70 plus 2.1, divided by 60 times 48 plus 70 plus 2.1, which equals 72.1 divided by 2952.1, which equals 0.024 or 2.4 percent.

So here's what happened. You calculated duty cycle equals 0.024 thinking it was for 380V output, but it's actually only correct for 70V output. You then reduced your reference voltage to 70V for testing, which would match that duty cycle, but you were still expecting much higher voltages and couldn't understand why the output was so small.

This explains everything you observed. With duty cycle equals 0.024, your switch is only on for 2.4 percent of each cycle. This stores very little energy in the primary inductance. When the switch opens, minimal energy transfers to the secondary. That's why you saw near-zero current and why the output voltage was increasing extremely slowly. The converter is actually working correctly, it's just operating with five times less energy than needed for 380V.

The 250 ohm load resistor made things worse. For 380V at 2.53A, which is your design spec, you need resistance equals 380V divided by 2.53A, which equals 150 ohms. With 250 ohms, even if the voltage reached 70V, you'd only draw 0.28A, which explains why you saw current values close to zero.

The reduced capacitor from 87 microfarads to 12.5 microfarads also compounds the problem. A smaller capacitor requires many more switching cycles to build up the DC voltage, especially when combined with insufficient energy transfer from the too-small duty cycle. This explains the very slowly increasing voltage you described.

To fix your circuit and achieve the original 380V output goal, make these changes. First, change duty cycle from 0.024 to 0.117, this is the critical fix, go back to your original calculation. Second, change load resistor from 250 ohms to 150 ohms to match your 2.53A design spec. Third, change capacitor back to 87 microfarads from the 12.5 microfarads you're using now. Fourth, set reference voltage back to 380V. Fifth, restore diode forward voltage to 2.1V, your actual component specification.

With these changes, your simulation should reach steady state in two to three seconds instead of requiring 100 plus seconds.

If you want to test at 70V first before attempting full 380V, you can keep duty cycle equals 0.024 since that's actually correct for 70V. But you must change the load resistor to about 28 ohms, which is 70V divided by 2.5A, to draw meaningful current and properly load the converter. With 250 ohms at 70V, you'll continue seeing near-zero current.

About the Simscape blocks issue you mentioned, you're absolutely right that the black Simulink blocks and blue Simscape blocks have incompatible ports. You made the correct choice sticking with Simulink blocks for your control system. Your block diagram structure is fine.

The reason this was so confusing is that you made multiple changes simultaneously. You reduced reference voltage to 70V, changed the capacitor, changed the diode forward voltage, picked a random load resistor value, and recalculated the duty cycle. These combined changes made it nearly impossible to isolate that the root cause was simply the duty cycle being wrong for your intended 380V output voltage.

Your original instinct with duty cycle equals 0.116564 was absolutely correct. That's the value you need for 380V. The confusion happened when you recalculated and accidentally computed the duty cycle for a different output voltage.

The slow voltage rise and near-zero current you observed are exactly what you'd expect from a correctly functioning flyback converter that's operating with a duty cycle five times too small for the desired output. The converter is working, it's just the parameters that need correction.

Let me know if you need clarification on any of these calculations or have questions about implementing the changes.

  4 Comments
Carlos
Carlos on 31 Oct 2025 at 10:48
Edited: Carlos on 31 Oct 2025 at 10:57
Hi again @Umar,
I have a new update.
The Lm in the mutual inductance has been changed to be a bit less than the sqrt(L1*L2) --> Lm = 0.0005.
With that in mind, I see a V_out of around 90 V. It's still not 380 V, that I don't know why.
Also, measuring the current I find it's not 2.53 A. But at least is positive and not close to 0:
What else could be wrong?
I must comment that for my application, Vin would change so the duty cycle would change. For 2 V, which is the lower limit, I have a similar problem, the current and the voltage are not enough, even for the new load I calculated. Vo/Io=380/0.105 = 3610 ohms.
Carlos
Carlos
Carlos on 31 Oct 2025 at 11:11
Edited: Carlos on 31 Oct 2025 at 12:07
Hi @Umar,
If I increase L1, I should change L2 and Lm being sqrt(L1*L2) too? Because I have to keep the relation with N12 as L2 depends on that. I believe the diode is working according to my previous update. Please, have a look at it. It's close to be working well but it's not reaching the 380 V and 2.53 A yet.
Update: it seems that if I decrease the inductance by a constant factor in L1, L2 and Lm, keeping L2 proportional to N21 and Lm to both L1 and L2, it gets even closer to the V_out I want but I don't know how I will ensure that I get 380 V by trial and error changing the inductances as I do it in open-loop. Will it work properly for close-loop? And as I say, I am decreasing the values, not increasing it... If I increased L1 while keeping constant L2 or even adjusting it to N21, V_out would decrease even more.
Thanks for your help.
Carlos

Sign in to comment.


Mpho Lencwe
Mpho Lencwe on 30 Oct 2025 at 13:50
Good day, @Carlos,
Thank you very much for your question and the figure.
As mentioned by @Antonino Riccobono earlier, if you do not have the load, you will have no output.
Second, you have placed the resistor in the wrong location. It must be parallel to the output capacitor. If you do not know the resistor value, it would be beneficial to use a range of values (e.g. using a slider).
Please refer to the link that @Antonino Riccobono has shared. It should give you a direction.
I hope the above information will help you with your project.
  3 Comments
Carlos
Carlos on 31 Oct 2025 at 10:36
Thanks for the suggestion but my team can't afford it.
Carlos

Sign in to comment.


Umar
Umar on 31 Oct 2025 at 12:12

Hi @Carlos, I was having technical difficulties while replying to your post. Please see attached.

  6 Comments
Umar
Umar about 1 hour ago

Hi @Carlos,

Good to hear from you. Thanks for sharing the scope plots, in addition to these plots, could you please share screenshot of your block parameters GUI along with your updated Simulink block diagram, I want to see the scope setup and provide details of what have you exactly tried so far. Also, please provide details on what has worked for you so far based on my provided instructions and what has not worked for you.

Carlos
Carlos 31 minutes ago
Hi @Umar,
I am not sure what you mean by the "block parameters GUI"... Do you mean for each block (mutual inductance, diode, capacitor, transistor, ramp, etc. parameters)?
For the simulink block diagram, right now I have it like this:
It's not fine because the PI wasn't working properly for the values I proposed: Kp = 0.0135 and Ki = 12.52. I was trying to tune it first by the Transfer Function Based. But it said it was not possible to linearize the plant. After that, I decided to use the Frequency Response Based but I wasn't sure of the parameters I should set so I gave it up.
I think my design was taking the wrong path as I was doing it for constant voltage but my application needs a constant current, which means the output voltage would vary. So I have three options knowing that the application is to discharge batteries deeply:
A) Flyback at CC + Inverter to grid.
B) Flyback at CC + Boost at CV + Inverter to grid.
C) Boost at CC + Flyback at CV + Inverter to grid.
By the moment, I want to know if just one flyback (option A) before the inverter is possible and if so, if there are many changes to do in the design of the block diagram I did :) If not, I will move to option B or C. The input current would be 20 A and I would like to have 20 A in the output too.
So far, the values I have in my design are these:
C = 330 uF; R = 150 ohms. V_ref = 380 V (but I think it should be dependent on D as I want constant current). The ramp in the sawtooth comparator is 1/24000 s and the PI has this setup with Ts = 1.67e-5 s:
I think I'm not missing anything. But let me know if you need anything else :)
Thank you so much.
Carlos

Sign in to comment.

Communities

More Answers in the  Power Electronics Control

Community Treasure Hunt

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

Start Hunting!