aplavins / Arduino-MPPT

Arduino based Maximum Power Point Tracking (MPPT) solar charge controller
GNU General Public License v2.0
75 stars 31 forks source link

Functionnal error in PWM adjustment #5

Closed pierre83 closed 3 years ago

pierre83 commented 3 years ago

It seems to be an error in the process (lines 249 - 263) When stepAmount is < 1 then it value is 1, but when (Vcvm - panelVolts) /10 is -50 (for example) then the step is forced to 1, then the PWM is not correctly adjusted because a too little step.

aplavins commented 3 years ago

The step amount has to be an integer number and I don't want it to be zero, which is why it has to be at least 1. The pwm will fluctuate up and down around the ideal point. Line 249 is so that when the target pwn is far away from the current pwm, it takes steps that are larger than 1 to get there in fewer cycles.