I have been working on this circuit simulation for a while now, the work is based on the Maximum power point tracking Incremenrtal Conductance Algorithm with a buck-boost converter.
I want to test for various solar irradiation such as 1000w/m2,800w/m2,600w/m2,400w/m2 and 200w/m2. Whenever I run my simulation for 1000w/m2 I realized it will track with the prev_D value that I used, meanwhile, when I run the simulation for other various solar irradiation values it will never track. Then I realized I keep changing my prev_D value manually to be able to track different solar irradiation. I have been on this work for a month and I am not getting the results for this work. Please this has already given me a sleepless night. I don't know what the problem could be with the whole model.
Attached to this is the circuit files , the PV panel PV and IV curve for the PV panel that I used and the flow chart algorithm that should be declared into the c-scrpt block of the MPPT.
Please kindly check and correct me.