Converting this Buck code to Buck-Boost for wind project

Hello,

I am trying to convert this code for buck controller into a buck boost. You will see it attached.

I got the code from Soldernerd’s MPPT controller for a solar panel. I am trying to convert it to buck boost for a small wind turbine home project.

Any help would be great!
Thanks

SolarPanel.ino (5.57 KB)

Please post a schematic diagram of the modified circuitry and explain how it is intended to work in boost mode.

Oh of course :sweat_smile:… attached is both the “WindCharger” schematic is for the buck boost and the “SolarCharger” is the buck designed by soldernerd.

Don’t pay attention to the values of the components I have to change them later on in the design.

BB sch.zip (33.7 KB)

Sorry didn't read the second bit, since I'm trying to charge a 24V battery bank I would like it to boost to ~27.6. So like the the buck the duty cycle will increase or decrease by 1/255 depending on the input. The turbine I'm using ranges anywhere between 0-60 volts.