Author Topic: Using old grid tie inverters to charge batteries  (Read 977 times)

0 Members and 1 Guest are viewing this topic.

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #15 on: July 24, 2017, 09:14:23 PM »
34,35,36 is a pot nominally 2k... 1 k would probably be better for definition, may need the 15k changed to 16k to compensate... Just another reason I don't do circuits ... it would only be seconds before the pcb did not match the schematic... even slightly.

if you place a pot on the diagram you will find that the pins 34 and 190 are the wiper pins, it won;lt fit any other way ( not an equilateral triangle.. but isosceles) 
Battery neg to pin 50 is a zener... I use 18v but any where over 14 would do I guess.... I have hundreds of 18v 1watt. Sets the reg voltage
pin 50-51 is a 10k resistor

Opto is A3120 8 pin device. 2 amps output or thereabouts... too big probably, but have lots of these too.

"where does the forward bias for the FET(s) come from?".. the 180r drives the top of the totem poles in the a3120
So in the 48v controller, the b+ is common with both potentials, the bat and the solar.

When using the GTI version, the GTI uses the battery as a isolated supply, so still the fet G+ is still supplied by the 180r form b+ supply

I'll increase the string size so they show up... my bad.

I never draw a circuit, as I have no idea what I am doing until it's done.... fairly simple.
 I think best on the pcb GUI of PFW.exe no idea why... just do.

.......oztules
Flinders Island...... Australia

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #16 on: July 24, 2017, 09:46:47 PM »
ila_rendered
Flinders Island...... Australia

Offline frackers

  • Full Member
  • ***
  • Posts: 225
  • Karma: +9/-0
  • If it moves - computerise it!
Re: Using old grid tie inverters to charge batteries
« Reply #17 on: July 24, 2017, 10:53:48 PM »
Hmm - I like the spec of the opto device - having the driver in it helps a lot!! So presumably the source of the MOSFETs is commoned to battery -ve.

Think I might go for a cheap 12v switch mode isolated supply for the array side of the opto driven from the LF inverter. Everything goes off then when the inverter shuts down ;) Change out of $7 for 5 of them isn't going to break the bank!!

Certainly exactly what I wanted to do (rather than the bang-bang approach with 5kw at a time).

Checked out out my spare GTI and I see is has 2 470uF 350v caps in series on the solar inputs so the 500Hz PWM from an Arduino should be fine with that although I will probably put a 16uF motor start cap across it as no idea what the ESR of the input caps is - wouldn't want to hammer them with the rippple!
Robin Down Under (or are you Up Over!)

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #18 on: July 25, 2017, 12:44:53 AM »
For the GTI version, yes, the source is common to the Battery neg and the array neg ( 300v or more).
 
For the  battery array  ( 60v)  the battery plus and the array plus are shared, and the mosfet source is the array neg , and the fet drain is the battery neg .......will do a circuit to that effect... probably another posting talking about how to build both versions. start to finish. This was the experimental post on the subject I guess.... more a can we do it thread.... and yes we can is the verdict.

.........oztules.

Flinders Island...... Australia

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #19 on: July 25, 2017, 06:23:18 AM »
ok programming is complete for now here it is in all its gore.
This is the first time I have seen anything like this on the net... so I have tried to make it as complete as possible
There is some interest in the AC coupled version of this which I will do soon.

========================================================================================
/*program to use for driving a 3 stage charging device via pwm.
  The program will use the floatVolts,bulkCharge and absorbCharge values to control the set points.
 
  pin3analog will be the voltage sense from a 0-5v input from a voltage divider for measuring the
  voltage from the battery. Standard 1602 LCD is assumed.
 
  Stay in bulk until 59v, then run absorb for a few hpours, and then float at 57 for the rest of the day.
 
  The time is in the long timedOut constant. If the battery voltage drops to less than startAllOverAgain ( nominal 860 for about 50volts ) then it reverts to bulk
  charge again, ready for the next day etc.
 
  Voltage read is the " lcd.print (val/16.99);" line, the 16.99 can be changed to calibrate the voltage to match the real world.
  output is from pin6. It can drive a opto or totem pole driver for the fet.
  Also is simple 5 stage averaging
  ........oztules
  */



 
 
  // 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);//define lcd pins 12,ll control 10-7 data
 
 
 
  int R1=0;
  int R2=0;                      // these R ints are simply for reading multiple times for averaging       
  int R3=0;                      // this shows a fear of arrays and for routines
  int R4=0;
  int R5=0;
  int realValue=0;
  int inputPin=3;
 
 
  long fullTime=0;              // timer for float stage #2
  long bulkTime=0;              //timer for stage 1 bulk
  int ledPin = 6;               // fet gate connected to this pin via totem or similar driver digital pin 6
  int stage1pin =2;
  int stage2pin =3;             // led pin outputs for visual display from distance
  int stage3pin =4;
  int analogPin = 3;            // divided voltage from battery or transformer if thats your go;
  int val = 0;                  // value of voltage query
  int count=0;                  // count for display timing.... stop screen jitter
  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 = 970;         // compared to the figure of the bulk and absorb...
  int bulkCharge = 1004;        // figured that 1000  would do as the set point for absorb voltage
  int absorbCharge =1004;       // voltage equivalent for the absorb voltage.... same as bulk.... funny about that.
  int startAllOverAgain = 850;  // probably in the 49v range
  long timedOut = 54000;        // time delay for absorb and step rate will change this...54000=2hrs.. sort of...
  int increment = 10;           // how much to change each pulse width for voltage control definition
  int weAreHereNow=0;           // initialize the start stage as zero

  void setup()                  //  this is where the story starts...
  {
  lcd.begin(16, 2);
  pinMode(ledPin, OUTPUT);      // sets the pin 6 as an output for the fet drive
  pinMode(stage1pin, OUTPUT);
  pinMode(stage2pin, OUTPUT);   // set led pins as outputs
  pinMode(stage3pin, OUTPUT);
  Serial.begin(9600);
  }
  void loop()                       // and this is where the story really starts
  {
  Serial.print("pulseVal =" );      // This display on the laptop tells us a bit about what it sees so as to calibrate                   
  Serial.print(pulseVal);           // what the pulse value will mean to other parameters
  Serial.print("  real value =");   //show and tell time is another word for this routine
  Serial.print(realValue);          // shows the averaged value
  Serial.print("  val value =");    //show and tell time is another word for this routine
  Serial.print(val);                // shows the averaged value
  //example of line ....pulseVal =240  read value =413 bulktime value =0 absorb time value =0 float time value =0   weAreHereNow  =0
  // pulseVal=pwm pulse output
  // read value is the actual value the nano sees on pin 3... so we can equate all things to this, ie voltage.. then calculate puse width etc
  // the rest are values of current timers in use at the time.


       
  Serial.print(" bulktime value =");     
  Serial.print(bulkTime);
  Serial.print(" absorb time value =");   //three timers   
  Serial.print(floaTime);
  Serial.print(" float time value =");     
  Serial.print(fullTime);
 
 
 
  Serial.print("   weAreHereNow  =" );    // stage number currently displaying
  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==10)            // every 10 counts, we will display only to keep screen stable
  {
 
  if (val<startAllOverAgain )
  {
    lcd.setCursor(0,1);
    lcd.print("Pre-bulk volts");
  }
   
   
  if (weAreHereNow==0 && val>startAllOverAgain)        // if stage 1 then we do this routine
  {
  lcd.setCursor(0,1);
  lcd.print("Bulk  = ");
  lcd.setCursor (8,1);
  lcd.print(bulkTime/450); // makes it about a minute update at 450.. ish
  lcd.print(" min");
  }
 
  if (weAreHereNow==1)      // if stage 2 then we do this screen routine
 
  {
  lcd.setCursor(0,1);
  lcd.print("Absorb ");
  lcd.setCursor (8,1);
  lcd.print(floaTime/450); // makes it about a minute update at 450.. ish
  lcd.print(" min ");
 
  }
 
  if (weAreHereNow==2)
  {
  lcd.setCursor(0,1);
  lcd.print("Float ");
  lcd.setCursor (8,1);
  lcd.print(fullTime/450); // makes it about a minute update at 450.. 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.99);// voltage correction.... change the number
  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 8 will light up for the bulk charge bit
  }
  else
  {
    digitalWrite (stage1pin,0);
  }
 
  if (weAreHereNow==1)                   // this lights up digital pin 9 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 pin 10
  }
  else
  {
  digitalWrite (stage3pin,0);            //  remember if we drop below about 48v it will reset everything, the leds will show this too.
  }
 //======================================================= =========================================
  R1= analogRead(inputPin);            // we go and read the input pin 5 times in rapid succession
  R2= analogRead(inputPin);
  R3= analogRead(inputPin);           // poor mans averaging routine. probably as fast or more than normal ones.
  R4= analogRead(inputPin);           // having read the same pin 5 times, we can go and average the result... my sort of simple averaging.
  R5= analogRead(inputPin);
 
  realValue=(R1+R2+R3+R4+R5)/5;      // we do the average here
 
 
  val = realValue;         //  it all hinges on this value. 5 readings averaged
 
    if (val>=bulkCharge && weAreHereNow==0)   // if we achieve 59v (bulk chg) AND we were in stage zero then change weAreHereNow to 1 as a flag ie absorb
  {                   
      weAreHereNow=1;                   //   weAreHereNow=1 is absorb status                       
  }

  //=============bulk routine==============


  if ( weAreHereNow==0)              // if in stage 1 then check voltage against bulk charge constant ... can be set in definitions
  {
   bulkTime=bulkTime+1;
  if (val< bulkCharge)
  {
  pulseVal=pulseVal + increment;  // was not up to bulkCharge, then increase pulse width incrementally
  }


  if (val>bulkCharge)
  {
    pulseVal=pulseVal-increment;   // if over the preset bulk voltage ... then back the pwm off a bit
  }
 
 if ( pulseVal>=255)
  {
    pulseVal=255;               // if pulse width calculation exceeds 255 then just make it 255
  }
   if ( pulseVal<=0)
  {
    pulseVal=0;                 //if pulse width calculation is below zero, then make it zero instead
  }

  }

  //==========absorb routine==============
 
  if ( weAreHereNow==1)                // if we are in absorb then do this
  {
   
  {
    floaTime=floaTime+1;               // check if time elapsed in absorb is up or not (timedOut constant)
  }
 
  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;
  }
 
  if (val< absorbCharge)
   {
   pulseVal=pulseVal + increment;  // was not up to bulkCharge, then increase pulse width incrementally
   }


  if (val>absorbCharge)
  {
    pulseVal=pulseVal-increment;
  }
 
 if ( pulseVal>=255)
  {
    pulseVal=255;                // seen all this before
  }
   if ( pulseVal<=0)
  {
    pulseVal=0;
  }
  }
  //=========float routine=======
 
 
  if ( weAreHereNow==2)        // are we in float charge stage
  {
 
  fullTime=fullTime+1;       // increment float timer
 
 
  if (val< floatVolts)
  {
  pulseVal=pulseVal + increment;  // was not up to bulkCharge, then increase pulse width incrementally
  }


  if (val>floatVolts)
  {
    pulseVal=pulseVal-increment;    // keeping charge in the float band....floatVolts is the constant we use
  }
 
 if ( pulseVal>=255)
  {
    pulseVal=255;
  }
   if ( pulseVal<=0)
  {
    pulseVal=0;
  }

  }
  //==============================write the pulse to the fet======================
  analogWrite (ledPin,pulseVal); // actually write the data to the fet via pin 6 ...     

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


For the sake of completedness, this is the circuit board that it refers to and works with.

jumper added for GTI use compared to the last one

 ila_rendered

click to increase size


.............oztules

Flinders Island...... Australia

Offline Pete

  • Full Member
  • ***
  • Posts: 93
  • Karma: +10/-0
  • Golden Valley Tasmania
Re: Using old grid tie inverters to charge batteries
« Reply #20 on: July 25, 2017, 05:32:45 PM »
Hi Oz, I am a keep it simple type myself, just wondering if your PWM board would work just driving a couple of Mosfets as a regulator.
I have three regulators in parallel at the moment because they are much cheaper in low current versions than high current.
I was thinking that rather than run a GTinverter to charge my batteries I may be able to use the program you wrote to run an arduino based 12 volt regulator.
Or is there an easier way.
I guess your battery charger setup works good in that you don't need large cables from the panels to the batteries, and you have lots of GTI's sitting about wanting to be used. Like you said , you enjoy making problems so that you can sort them out.
I am just looking for a simple, easy to make, cheap, regulator.
Thanks for the articles, I really enjoy reading of the exploits on Flinders
Pete

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #21 on: July 25, 2017, 07:48:30 PM »
yes.... I actually use the lm339 version for 12v regulators on electric fence solar installations... they will be gradually changed to the arduino I think.

I will have to do another article to explain the wiring/hooking up of all of this I guess.

My main charger is one of the 339 boards driving 6-8 hy4008 fets at up to 100-150 amps or so @ 60v.... very cheap alternative.
I will chop the 339 parts off and replace with the arduino too.


.........oztules
Flinders Island...... Australia

Offline Madness

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Using old grid tie inverters to charge batteries
« Reply #22 on: August 05, 2017, 05:45:32 PM »
I see some discussion here regarding PCB software, I use design spark which is free and has no size limitations. It allows doing a PCB with or without any circuit. I have never tried sending files off to be made I just print straight to paper and use toner transfer, it also prints to PDF.

I have made my own version of Oztules controller here, I have used serial LCD and included the provision to control 2 SSR's to turn on loads at preset levels such as turn on the hot water system just below the float and absorb voltages and temperature compensation.

This design has not been tested yet, the Arduino code is not completed yet but I will post it when done.

ila_rendered

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #23 on: August 06, 2017, 05:58:55 PM »
We are supposed to have a 104n across pins 5 and 8 on the opto. I have not done that on mine earlier, but thats what the data sheet demands.... I am thinking at less than 500hz, it makes no difference, as I have not seen any problems with that one....solder on the back for me I think.

You will need to ground the source side of the output for GTI use...but NOT for lvdc use... just so you know.

You must have at least 15v on the opto or it will default to uvlo.... so your supply voltages to the LCD has me confused, looks like the 15/18v not sure what zenner you have there, I use 18v now........ and the 5v goes to the LCD... is that how serial works, or am I stuffing it up somehow.... whats the LCD do with 18v?

I have changed the 180 to 100r driving the nano to help support the led display as well.
The other 180 is now 470 from memory....


oztules
Flinders Island...... Australia

Offline Madness

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Using old grid tie inverters to charge batteries
« Reply #24 on: August 07, 2017, 04:24:24 AM »
Hi Oz,

Thanks for picking up my stuffup, the connection to the LCD should have been ground. I will have to do a bit of surgery on the one I have etched.


ila_rendered* GTI Controller 1.1.pdf (7.4 kB - downloaded 12 times.)

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #25 on: August 07, 2017, 07:50:32 AM »
All well that ends well.... nice that we saved the LCD from an untimely demise.

I have not successfully done the  serial LCD yet.... but nor have I bothered to try.
I have downloaded the library, but it just corrupted the already running parallel ones on compile... so I dumped it until I do a design with another LCD arrangement.  I will do one soon.

The boards from China were $5 for 10... I cant do  a single board much less than that... so my bathtub days are over I sense.

You will find it is a very useful circuit to play with, as it does everything you want very easily.... begrudgingly thinking these little nano's should have been used a  long time ago...curses.

I'm still learning on Kicad...... beginning to think that should I meet the bloke who designed the interface.................... well, he. may as well used reverse polish notation instead.... that caught on really well for HP back in the day..... who dreams up this stuff. They must have thought long and hard to make an interface worse than the ones Protel made back in 1985. It is powerful, but definitely not intuitive.... some is just plain dumb.. you cannot even pan... sheer genius.... and if they garrote the bloke who did the idiot "must have a page legend taking up half the A4 page.......no matter what on all printed matter... I won't interfere.

They must have spent thousands of hours on this, and they trip up on the simplest things. They have done other things brilliantly.... I don't get it.

I will look at the sparks one. If it has the correct gerber generators and drill  files... I may have to learn that as well.





.............oztules
Flinders Island...... Australia

Offline Madness

  • Newbie
  • *
  • Posts: 10
  • Karma: +0/-0
Re: Using old grid tie inverters to charge batteries
« Reply #26 on: August 07, 2017, 04:13:59 PM »
At $2.44 for a serial LCD I would not have lost any sleep over it, although I might have swore at myself a bit for the stupid mistake.

Designspark has video tutorials if you get stuck, it was a bit of learning curve but now I can do most of what I want with ease. If you try it there is this component library loader  http://www.samacsys.com that has a online search engine for components, once you find what you want you click on the icon and go back to designspark and the component is there ready to drop in. Works with a few other programs also. A little tip is once you have a component the right physical size you can copy it and go to it's properties and edit the value, ie different value resistors.

$5 for 10 PCB's is tempting, how long before they arrive in your letter box? I am only doing one off's though, taken me a while to perfect that and I am not sure I would have the patience for a slow boat from China.

Discovering Arduino's opens so many doors, adding things like turning on loads as required is so flexible.

To get the serial LCD working you need to delete the original LCD library, must be a better way but I have not found one yet.

Offline oztules

  • Moderator
  • Hero Member
  • *****
  • Posts: 1093
  • Karma: +90/-5
  • Village idiot
Re: Using old grid tie inverters to charge batteries
« Reply #27 on: August 07, 2017, 05:33:36 PM »
China post is generally 5-10days,
DHL@30bucks a go... plus remote 30 dollars is 2-3days...... not that desperate.

Total cost will be 13usd for 10 boards inc shipping to the island with china post.If I had a few more designs, they ship them concurrently, and then it gets really cheap.

I mostly have a few weeks where i can do other things to get a beautiful standard board.... never mind 10 of them.

I'm getting good with Kicad now, downloaded sparks, but it is native windows.... will run under wine... but I have had enough of windows stuff.... so Kicad will work and work well........... (, even if I have to jam bamboo under the fingernails to stay focused ). With CERN helping in development, it won't go away soon.

Want to hear how it goes for you.

I need more panels, so will probably import from QLD..... don't know whats in the water up there, but itis central to cheap solar panels.

At least I only paid $1.87each  for my last lot of LCD's..... but that does not quite make up for your cheap panels....


..........oztules
Flinders Island...... Australia

Offline frackers

  • Full Member
  • ***
  • Posts: 225
  • Karma: +9/-0
  • If it moves - computerise it!
Re: Using old grid tie inverters to charge batteries
« Reply #28 on: August 10, 2017, 07:19:25 AM »
Was looking for some means to isolate the supply for the MOSFET gates and I came across these at my favourite online source https://www.aliexpress.com/item/5-pcs-12V400mA-4-5W-Isolated-Switch-Power-Supply-Module-AC-DC-Buck-Step-Down-Module/32757538151.html. They arrived today and they are TINY. Piggy backing a 6k8 0805 SMD resistor across a 2k4 (R6) will push the output up to 16volts for the gate drive ;)

Just for a laugh, I fired one up on the bench PSU and at 40v in it was producing a stable 12v out. I've not tested the current capability yet at this low an input volts (getting late!!) but I was going to use them off the inverter AC output anyway.

In the same post, some LM5008 buck bias regulators arrived which can handle up to 100v input (and hence safe on a fully charged 48v system)  to provide for the 3.3v on the controller. Looks like I might be able to use one of these isolated modules and avoid earth loops etc when it comes to measuring and just change the 2k4 for a 27k to move from 12v down to 3.3v directly or use 9k1 and fit an AMS1117 linear regulator (the PCB is laid out for one already) to drop from 5v down to 3.3v

Might actually get some more stuff done as I haven't touched the inverter project for a while!
Robin Down Under (or are you Up Over!)

Offline frackers

  • Full Member
  • ***
  • Posts: 225
  • Karma: +9/-0
  • If it moves - computerise it!
Re: Using old grid tie inverters to charge batteries
« Reply #29 on: August 13, 2017, 10:30:35 PM »
Just for a laugh, I fired one up on the bench PSU and at 40v in it was producing a stable 12v out. I've not tested the current capability yet at this low an input volts (getting late!!) but I was going to use them off the inverter AC output anyway.
Well, I've tested it with a small fan that draws 80mA and the voltage is rock steady ONCE IT'S STABLISED. Connecting and disconnecting the load cause the voltage regulation to go walkabout!.

Think I'll get a few more so I have spares to break!!

Robin Down Under (or are you Up Over!)