// This routine is the charger state machine. It has four states on, off, bulk and float.// It's called once each time through the main loop to see what state the charger should be in.// The battery charger can be in one of the following four states:// // On State - this is charger state for MIN_SOL_WATTS < solar watts < LOW_SOL_WATTS. This state is probably// happening at dawn and dusk when the solar watts input is too low for the bulk charging state but not// low enough to go into the off state. In this state we just set the pwm = 100% to get the most of low// amount of power available.// Bulk State - this is charger state for solar watts > MIN_SOL_WATTS. This is where we do the bulk of the battery// charging and where we run the Peak Power Tracking alogorithm. In this state we try and run the maximum amount// of current that the solar panels are generating into the battery.// Float State - As the battery charges it's voltage rises. When it gets to the MAX_BAT_VOLTS we are done with the // bulk battery charging and enter the battery float state. In this state we try and keep the battery voltage// at MAX_BAT_VOLTS by adjusting the pwm value. If we get to pwm = 100% it means we can't keep the battery // voltage at MAX_BAT_VOLTS which probably means the battery is being drawn down by some load so we need to back// into the bulk charging mode.// Off State - This is state that the charger enters when solar watts < MIN_SOL_WATTS. The charger goes into this// state when it gets dark and there is no more power being generated by the solar panels. The MOSFETs are turned// off in this state so that power from the battery doesn't leak back into the solar panel. When the charger off// state is first entered all it does is decrement off_count for OFF_NUM times. This is done because if the battery// is disconnected (or battery fuse is blown) it takes some time before the battery voltage changes enough so we can tell// that the battery is no longer connected. This off_count gives some time for battery voltage to change so we can// tell this.
I am an EE as well as a software engineer
....transistors just eat voltage.The only thing they are good for is controlling the current draw rate.
A wind turbine needs mppt where a pv array doesn't
There is one more issue that you didn't notice here, and forgot to mention
If this is how we are doing it, then we are just DIYers, not open source.