I am trying to build MPPT block on C-script, there is no error in code. But still not getting out put duty cycle. Attached is the algorithm i implemented on C-script. Please guide me what changes i need to make?

Best Wishes

MPPT.docx (294 KB)

I am trying to build MPPT block on C-script, there is no error in code. But still not getting out put duty cycle. Attached is the algorithm i implemented on C-script. Please guide me what changes i need to make?

Best Wishes

MPPT.docx (294 KB)

1 Like

Your chances to get an answer will highly improve if you attach a model rather than screenshots of source code.

Okay! I will attach it

See the PLECS documentation for a demo model called â€śGrid-Connected Single-Phase Solar Inverterâ€ť, which implements MPP tracking. Also, read the documentation on C-Scripts and try easier examples before attempting to implement an MPP tracker.

This should get you started.

here is the attached file. Need serious help in solving this problem. Thanks

Beta.plecs (59.3 KB)

At t=0, both inputs of the C-Script are 0. Dividing IK by VK results in NaN (Not a Number).Any mathematical operation involving NaN results in NaN

Thanks. Itâ€™s obvious because of logarithm function. But what after t=0? Can you please tell me how to solve it?

After t=0 you are adding values to delta, which is NaN, and therefore stays NaN.

Thank you very much. I will try according to that