Project Journals > Oztules

Using old grid tie inverters to charge batteries

<< < (2/7) > >>

oztules:
Well it has finally become a full digital arrangement. The LCD readout does volts, and what part of the charge cycle we are in... ie bulk, absorb or float. It also outputs the current number of mins that we have been in that cycle.
It also has three status lights do do the same thing without the mins of course, but it will signal from a distance the stage we are in... had the spare pins to play with didn't  I...

Here is a pic of the new board.... getting some made in China... 5 dollars for 10 boards  I cant do it for any where near that ( pcbway.com) a on special deal apparently...much dearer to buy more than 10.



and here is the program for the nano micro.


// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins


LiquidCrystal lcd(12, 11, 10, 9, 8, 7); //10-7 data.12,11 control

long fullTime=0;
long bulkTime=0;
int ledPin = 6; // fet gate connected to this pine via totem
int stage1pin =2;
int stage2pin =3; //three pins for stage leds
int stage3pin =4;
int analogPin = 3; // divided voltage from battery or transformer
int val = 0; // value of voltage query
int count=0;
int pulseVal = 0; // initilise the pulse width to zero of 255.... won't help really as the thing will run for three minutes before kick off
long floaTime=0; // initialise the time to zero for the absorb
int floatVolts = 969; // compared to the figure of the bulk and absorb...
int bulkCharge = 1000; // figured that half way ( 1000 ) would do as the set point for absorb voltage
int absorbCharge =1000; // voltage equivelent for the absorb voltage.... same as bulk.... funny about that.
int startAllOverAgain = 862; // probably in the 49v range
long timedOut = 107000; // time delay and step rate will change this...107000=2hrs
int increment = 10;
int weAreHereNow=0;

void setup() // this is where the story starts...
{

pinMode(ledPin, OUTPUT); // sets the pin 6 as an output for the fet drive
pinMode(stage1pin, OUTPUT); //sets pin as output for the stage leds
pinMode(stage2pin, OUTPUT);
pinMode(stage3pin, OUTPUT);
Serial.begin(9600); // for the detective work
}

void loop() // and this is where the story really starts

{
Serial.print("pulseVal =" );
Serial.print(pulseVal);
Serial.print(" read value ="); //show and tell time
Serial.print(val);
Serial.print(" time value =");
Serial.print(floaTime);
Serial.print(" weAreHereNow =" );
Serial.println (weAreHereNow);
delay(10); // use this to speed things up and down.... responsible for the timing number calculation
//===========show the current volts with slow up routine called count.==========

if (count==5)
{
if (weAreHereNow==0)
{
lcd.setCursor(0,1);
lcd.print("BulkChg");
lcd.setCursor (8,1);
lcd.print(bulkTime/860); // makes it about a minute update at 860.. ish
lcd.print(" min");
}

if (weAreHereNow==1)
{
lcd.setCursor(0,1);
lcd.print("Absorb ");
lcd.setCursor (8,1);
lcd.print(floaTime/860); // makes it about a minute update at 860.. ish
lcd.print(" min ");
}

if (weAreHereNow==2)
{
lcd.setCursor(0,1);
lcd.print("Float ");
lcd.setCursor (8,1);
lcd.print(fullTime/860); // makes it about a minute update at 860.. ish
lcd.print(" min ");
}

lcd.setCursor(0, 0);
lcd.print("Volts = "); // print the volts out
lcd.setCursor (8,0); // the if count is to slow the screen update to the value of if count=x
lcd.print (val/16.94);
count=0;
}

count=(count+1); // increment the counter for printing to stop wobble

//====================this section just for song and dance and twinkly lights

if (weAreHereNow==0)
{
digitalWrite (stage1pin,1); //digital pin will light up for the bulk charge bit
}
else
{
digitalWrite (stage1pin,0);
}

if (weAreHereNow==1) // this lights up digital to signal stage 2 the absorb cycle
{
digitalWrite (stage2pin,1); // this is all to light up leds to see where we are in the cycle
}
else
{
digitalWrite (stage2pin,0);
}


if (weAreHereNow==2)
{
digitalWrite (stage3pin,1); //this lights up stage 3.. the float cycle
}
else
{
digitalWrite (stage3pin,0); // remember if we drop below about 50v it will reset everything, the leds will show this too.
}

val = analogRead(analogPin); // read the input pin

if (val< bulkCharge)
{
pulseVal=pulseVal + increment; // was not up to bulkCharge, then increase pulse width incrementally
}

if (val>=bulkCharge && weAreHereNow==0) // now bulkCharge is here, change the weAreHereNow to 1 as a flag
{
weAreHereNow=1;
}

if (val>bulkCharge)
{
pulseVal=pulseVal-increment;
}

if ( pulseVal>=255)
{
pulseVal=255;
}
if ( pulseVal<=0)
{
pulseVal=0;
}

analogWrite (ledPin,pulseVal);
if (weAreHereNow==0) //if weAreHereNow is one , then count each cycle from now on until it no longer equals 1
{
bulkTime=bulkTime+1;

}
if (weAreHereNow==1) //if weAreHereNow is one , then count each cycle from now on until it no longer equals 1
{
floaTime=floaTime+1;
bulkCharge=absorbCharge;
}

if (weAreHereNow==2) //if weAreHereNow is two , then count each cycle from now on
{
fullTime=fullTime+1;
bulkCharge=absorbCharge;
}

if (floaTime>=timedOut) // once we reach timedOut, we have finished our absorb sequence, change status flag weAreHereNow to 2, and change the voltage now to float value
{
weAreHereNow=2;
bulkCharge = floatVolts;
}

if (val<startAllOverAgain) // panic routine when voltage drops back to 48 volts or so.
{
weAreHereNow=0;
bulkCharge=absorbCharge;
floaTime=0;
}
}
//that all folks

oztules:
And a pic of it in operation this morning..... it got up to 59v before the hot water came on, and the sun faded a bit... so back at 54v, but the things seems to both work, and monitor the times and stages.



forgot to calibrate it... so .2v discrepancy.... later...

.......oztules

frackers:

--- Quote from: oztules on July 16, 2017, 08:08:47 am ---So using one of my normal pwm boards, I interfaced the totem pole output to the mosfet, attached to the  huge heat sink of the inverter..... and quietly stood back to pick up the pieces. A quick back of the envelope said I^2R would be only about  8 watts losses..... but that would be before switching losses ... what would it really be.
................oztules

--- End quote ---

Still no idea what a "normal PWM board" is...

oztules:

Sorry Frackers

Thats the analog version of it... the normal use for that blue circuit board. It is a 4 comparator, and does the same thing, but no where near as interesting, as it does not do the three stage bit..... which is not a real problem, but nicer.
. Used with 60 cell panels, works very effectively for well over the hundred amp range when mixed with 8 hy4008 fets.

Here is the normal pwm board that is in a few of my creations



.......oztules

lighthunter:
Very good work Oztules! Your work is outstanding. I dont know how you do it. I'm fairly good at repairing things that someone else has built but getting a fet to switch at khz and up speeds without heat to destruction is a tremendous accomplishment in my world.

Another point of value is your  programming style,  ive heard many complaints of aurduino programs because most folks dont explain what each line of code does.

I totally agree with your observations of 60cell and mppt. I have a 10 panel array made of severly compromised quality (eva bubbles etc) they are thr 40v type so 2 in series, i tried a cheaper mppt unit for $100 ipanda or similar. Darn thing works real well, cant complain, thougb the settings are difficult to maneuver but in full sun i measure more amp flow to batteries by direct connecting array to battery and loosing the 20v. I may try a pitch at a buck converter myself when the sweetcorn is put up, I dont see how i could do any worse than that efficiency wise. I wonder how many mppt believers actually run the numbers to see if their mppt is gaining them the power they say?  Of the GTI units ive checked they seem to be much better or perfect in that regard.

Thank you for your time & trouble to help us out!

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version