Recent Posts

Pages: 1 [2] 3 4 ... 10
11
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by oztules 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

12
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by oztules 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.

13
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by frackers 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!
14
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by oztules on July 24, 2017, 09:46:47 PM »
ila_rendered
15
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by oztules 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
16
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by frackers on July 24, 2017, 06:34:19 PM »
OK - a few questions sans schematic.

What is pins 34, 35, 36?
Pins 189, 190, 191 is labelled 5k - if its a pot, which is the wiper?
From Battery to pin 50 of the tip35 is what?
from Pin 50 to 51 is what?
What type of opto (pinouts?)
The opto output goes to the source and drain of the series FET(s), where does the forward bias for the FET(s) come from?

I fully understand the 'straight to PCB' idea - my weather station update http://www.anotherpower.com/board/index.php/topic,1268.msg13750/topicseen.html does exactly that and worked well until I decided to change the DHT22 for a BME280 sensor where I couldn't remember what was connected to what!! I eventually traced it out and modified the PCB but I'm going to have to actually draw a schematic just to help my ailing brain cells if I decide on another change.

I've even started to learn kicad ;) (too many restrictions with the free version of Eagle)



17
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by welshman on July 24, 2017, 05:54:45 PM »
very interesting info. nice controller, some thought must have went into that.
18
Oztules / Re: Using old grid tie inverters to charge batteries
« Last post by oztules on July 24, 2017, 06:28:25 AM »
Sorry DJ...

 but I don't have schematics..... I see it in my head, and just draw the board in protel for windows. I don't burn up lots of  time with circuits, ( not that I can read anyway, as I scribble rather than draw if I do any part of the circuit on paper.)

They are obviously wonderful things, and I appreciate other people doing circuits... but I just don't do them on these simple projects, and not even on serious projects  ( years ago).
If I had them, you would be welcome to them.

You are very welcome to reverse engineer them, and publish them for others if you so desire, but I just don't do them I'm afraid...

It does cause me great angst... as all the newer PCB programs are rubbish if you want to free hand like I do, they require a circuit to profile the actual parts... and try as I might, I just give up as it is too hard for me to do schematics in them... the programs are written by aliens.

 Protel I know backwards (PFW.exe), and allows freehand board design... very quick to get your thoughts on a board, but the newer protel is both stupid expensive, and impossible to use as easily as the old junk I like.

So I do projects for me, and share them with others that may want to copy or improve. The board pattern is the best way to get into it quickly, and get the results I get.

On another forum, another chap did do the reverse engineering, of the egs002 and 8010 projects.....and proceeded to make a beautiful inverter board system... which blew up every time when he loaded it up, and cost him many fets, big IGBT blocks and egs002 boards... so layout is important sometimes too in certain projects.. probably better to copy what works until your familiar with it.

So the board pattern is much more important than the circuit..... reverse engineer it if it helps you to understand it though.

He still has not got it going..... last seen going off on a tangent worrying about the series inductor, and blaming that for the failures..... I have found the coil to be insignificant  to that problem.... at high power, the layout counts.

The last program I think that needs to be done is  now finished.
Will do another day with it to get comfortable it is bullet proof.

It averages out the readings to stop spurious pin voltages. I did not do the array system of round robbin averaging...too advanced for me, so I did a simple version that probably works as fast cycle time wise. It averages 5 readings before committing to the read value.... real programmers are advised not to look.

If there is anything you wish to know about this or other projects I have done... ask.



......oztules
19
If you see these caps on Ebay etc.. DO NOT BUY THEM


Purchased 10 of these caps. Supposed to be 10,000uF at 125v but the tester told the true story.
Sent an abusive email along with pictures of my tests and they finally refunded me the full cost.


Then purchased 4 of these which were on spec..



Would definitely recommend testing all your components as Oztules said..

Building a test rig with a 150w 12v globe to test the RDS on resistance of the Mosfets.

Those test results to come later..



Cheers.






20
Solar (heating or electric) / Re: Solar News
« Last post by DJ on July 24, 2017, 02:43:28 AM »
I think someone has not factored in the immense scale of their national rail system..

Quote
Although the train will still be pulled by a diesel-powered locomotive, a set of 16 solar panels atop each coach will replace the diesel generators that typically power these appliances. The railways estimate that a train with six solar-powered coaches could save around 21,000 litres of diesel every year, worth around Rs12 lakh.

As interpret the statement made there, they are refering to a saving of 21,000L PER TRAIN not per the whole network.
I give them more credit than to be working on a saving of only 21K L for the whole railway network.
 Maybe some places might be that greenwashed but I doubt the Indians are.
 
Going on a train of 6 Carriages  with 16 Panels of say 300W ea, 8 hours of sunlight which would be way optimistic given they all can't be facining the ideal direction let alone if any are at a particular time.   I cannot see the energy return of 21K l of Diesel.  If each individual train does not add up, you can have 10000 trains and it still won't work out.

Quote
Aren't the rooftops of Indian trains usually full sunlight blocking people?

I think you have a VERY valid point.  The vids I have seen where people tend to get on the roofs of the trains are the Diesels. I have seen vids of people getting BBQ'ed on top of electrics but they tend to appear to be less .  The other thing is if the panels are going to be smashed with people climbing on them or even stolen.  I imagine something like a solar panel could be a very desired item in the poor parts for either personal home use of sale for extra income.
I'm also lent to wonder about the possible reduction of output through the buildup of diesel soot on the panels although that maybe countered by the everyday rains in Monsoon season which isn't exactly great for solar output either.
Perhaps they would be a lot better off putting the panels on top of the railway stations where the panels could be set up for a lot better efficiency and make the saving through less power consumption or back feeding into the grid. 

Seems to me to be yet another of the endless feel good greenwashed but completely over hyped and poorly thought out ideas.

Pages: 1 [2] 3 4 ... 10