150V 45A MPPT - roll your own


Author Message
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 750
Posted: 09:35am 24 May 2020      

Good progress with the code.

bv - battery voltage

vbat_absorb = nominal battery voltage for ABSORB track mode

absorb_tol is how much below the battery can drop below vbat_absorb to trigger
the stop and reset of ABSORB mode and go back to MPPT.

vbat_float is the voltage the battery will be maintained at when in FLOAT mode.
again there is float_tol, which is the amount less than vbat_float the battery may
drop while it can remain in FLOAT.
There is also a timeout that permits short periods of bv less than this
to prevent resetting FLOAT back to ABSORB. (the fridge switches on, etc.)
This timeout is 10 seconds.

EQ is handled the same, with vbat_eq being the battery voltage to be maintained during EQ and eq_reset as the voltage it must be above before a timeout starts counting.


Today I have mainly been hammering on the different modes of operation.
MPPT, ABSORB, EQ and FLOAT.

Default is ABSORB, and this is maintained while bv is within
vbat_absorb and (vbat_absorb - absorb_tol)
While in ABSORB, a timer accumulates the time spent in ABSORB.
The timer will be reset should bv drop below (vbat_absorb - absorb_tol)

Once this time exceeds the absorb_float_time, the controller moves to
FLOAT. And this is now in effect while bv is within
vbat_float and (vbat_float - float_tol)
If bv drops below, then it's back to ABSORB and the absorb and float timers
are reset to zero. Again there is a timout to allow short term excursions below the limit.

MPPT is in effect only when bv is less than (vbat_absorb - absorb_tol)
for longer than a certain time (10 seconds).
It stays in MPPT until bv is greater than (bv_target-nvd.absorb_tol)

EQ is triggered by the user pressing a button to pull down D3 to ground.
Now the controller will take the voltage up to the user input value of
vbat_eq and try to keep it there.
The range of voltages that are deemed to be ok for EQ are vbat_eq to
eq_reset. If the battery drops below eq_reset, then the timeout will permit
up to 30 seconds before EQ is cancelled and back to ABSORB.

This is quite a bit of "if, then, else " stuff.
Testing of the 4 states has shown it all works as required.

The LCD displays the time spent so far in the 3 states of ABSORB, FLOAT and EQ
in the lower right hand corner.

Further tuning of the code has seen a nice and simple approach taken to
making ABSORB and MPPT function well.

Is it happens, ABSORB is really the same as EQ and FLOAT, only using different
battery voltage set points.

It's time to review and clean up the code, add comments and whatnot and show you all the ugly guts of it all. But not yet...

Here is the prototype with the fast over current protection, manual battery voltage
simulator (the potentiometer I drive to test the 4 state changes) and everything.
From such humble stuff a decent charge controller will be born.



You can see The Blue Bucket Of Resistance, the Arduino Uno and DSO probes and everything.

A close up of the Uno. Note that the Nano offers even more inputs useful for this project and that is why I use the Nano for the final brainboard. I just happen to have a Uno lying around..



Don't knock it. If it works (and it works really well) then no problem-emo right?

Things are looking good for the project. I think this will fly well.