Author Topic: Control for heating with solar off grid no batteries  (Read 26446 times)

0 Members and 1 Guest are viewing this topic.

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #27 on: August 09, 2016, 05:31:41 AM »
I will pickup a pot  for the board.  Is plugging into the three ground pins  and joining them to the neutral on the bottom side of the power plug what you mean or should the ground pins be soldered also?

Not quite sure of the wording for declaring the pot? The blinking is fast but it will be sorted out.

Taking this as educational not of being mean.

Thanks

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #28 on: August 09, 2016, 07:59:19 AM »
I see that you have compiled it and are getting serial data out. That's 80% of the effort.
That version I sent you was saved more than a year ago.  I chose it because it didn't have
a lot of extraneous stuff in it. Obviously later versions were corrected. Now we are adding
most of it back in.  All variables have to be declared at the beginning.  int indicates it
is a standard integer and you assign an initial value to it. Integers an be up to + or -
32K. Remember that that when the variable will be multiplied.  The format is as follows.

int pot       = 0;           // raw A/D pot voltage

The semi colon (;) indicates the end of every statement.  Math follows the MiDAS rule in an
equation.Multiplication is done first, then division, adding and last subtracting unless
parentheses are used. Look in the case of calculating PW percentage.  (you should add this)

    Serial.print("    ");                        // create space between last data
    Serial.print(PWM3 * 100 / 255);     // print percentage output value
    Serial.println("% power");              // identify variable and do line feed
   
This will give values between 0-100.  If the following was done.

  ((PWM3/255) * 100) The only two answers would be 0 and 100. 

That is integer math, a calculator wouldn't care.  Note the println at the end. That creates
a carriage return at the end.  You are old enough to remember a typewriter.  If you don't
remove the ln from the previous print statement, the % printing will be on a separate line.
The ("    ") creates a space.  Otherwise the two numbers would run together.

I also changed the code to the following.

    Serial.print("voltage is ");              // identify variable
    Serial.print((float)panel / 10);        // print actual panel voltage
                                                     // float formats to two decimal places

(float) changes the printing format to two decimal places, so what is displayed is 124.30 
instead of 1243.  The math is still integer so it is faster. This can also be done to setpoint.

I take the simplistic form of code to display on this site.  I add spaces for readability and
don't use shortcuts like ++ to increment up.  This helps it look more like English and not so
intimidating.  If you keep this format it will be easier to understand when it is looked at a
year later.

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #29 on: August 09, 2016, 09:49:52 AM »
Back to hardware.  No need to solder the grounds.  It is just good to have multiple sources
of contact in case one gets pulled out by accident.  Also gold isn't being used as much and
humidity over time can cause corrosion on tin contacts.

The tracking circuit is quite simple.  It is six diodes in series. That number will give a
reasonable voltage change.  The diodes can be potted in epoxy or some heat shrink tubing.
For heat shrink, I apply some hot melt glue the length of the diode string and let it cool
before inserting into the shrink.  Then it all melts together when heated and forms an
environmental seal. I understand the reluctance to attach anything to the panel itself.
Just placing it in the junction box as close to the panel as possible will work. There will
be a thermal delay but should work well.  If there is a long wire run, just putting the
diodes on a black aluminum plate at the house should work. It should face the same direction
as the panels.

The diodes closely match the thermal properties of the panel, as temperature goes down the
voltage goes up.  The voltage power point of the panels is usually rated at 25C. I blame
Jimmy Carter that I can't think in terms of C. It has to be a pretty cold day for the panels
to be that temperature at mid day.  For most of us the power point voltage will be lower.
The power point voltage is still a good number to work with.

The diode string is powered from the +5V of the board through a 1.2K resistor. This gives
the diodes a couple of ma of forward bias.  Any general purpose silicon diode can be used.
I have used 1N4148 and 1N4002 types  The forward voltage will be about 3.6 volts. A voltage
divider across this diode string will allow us to dial in the setpoint for the panels. The
voltage divider should be at least 200K total, including the pot, to keep the loading minimal.
The Wiper signal is filtered by a .1uF capacitor or larger which provides a low impedance
for the A/D converter input A1.  A 20K pot will give about a 5% adjustment from midpoint.
With a linear pot, the midpoint resistance to each end will be half.  Volume control pots
will not be equal resistance to both ends.  They can still be used but the adjustment will
be touchy. With the adjustment pot set midway, a second pot can be used to find the
resistance value or just have on hand a lot of resistors.  The ideal power point will be
when the maximum average voltage is found on the heater.  That resistor capacitor method
was explained earlier.  If the PWM goes up to 255 or 100%, the panels have more power
than the heaters can take.


Bruce S

  • Global Moderator
  • Super Hero Member Plus
  • *****
  • Posts: 4584
  • Country: us
  • USA
Re: Control for heating with solar off grid no batteries
« Reply #30 on: August 09, 2016, 10:21:34 AM »
OperaHouse;
I keep following these posts. The amount of knowledge you put out is phenomenal.
I do have to 2nd your point about making it readable.
I have from my Basic and ABasic days; made notes to what I did and why.
To this very week they still come in handy.

Keep it up!! and THANK YOU!!

Bruce S
PS>>> I was going to make mention of not connecting all the ground points together, but I see you have addressed that already.
Cheers
 
A kind word often goes unsaid BUT never goes unheard

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #31 on: August 09, 2016, 12:59:10 PM »
There is so much that you can do with these, I don't know why there are not articles here
all the time. You don't have to get into complicated code, only yes/no decisions. At $6 it
isn't a big risk. 

I have a pump that is scheduled to go on 10 times a day for a certain period. When it reaches
that time it looks to see if the battery is fully charged.  If it is, the pump turns on.

Two batteries run my system.  One is the house battery, the other runs the refrigerator. House
battery disconnects at night, it reconnects when the refrigerator battery fully charges. That
battery connects and disconnects many times a day.  Just a few lines of code.  The mechanical
relay operates with PWM, high current to pull in and reduces to one quarter power shortly
after.  A big energy savings with larger relays.  I still like relays for durability.

Wrote this battery slump test.  We all have some load that is pretty uniform in current draw.
This routine records the lowest voltage.  It can set an alarm when things look strange. The
lowest voltage is recorded about one second after turn on. My fridge draws 120A at startup,
a nice battery test. That voltage is put on the battery with a sticker.  You can see which
battery is getting old or when there is a connection loose. Five data points are stored over
a few seconds besides the lowest voltage.  A nice window into what is happening.

They also make a nifty controller for small systems or a dump controller for water heating
operating externally of an existing controller.

It all sounds more exciting than it really is.  Most of the time I feel really embarrassed
when I see how little of the program memory was used.  If you can get past just loading in
a sample program like BLINK, you have it made. $6 seems like a small investment for this
much potential. Most of the programs start with a simple boilerplate routines organized in
a sketch. I copy that starter sketch. A/D read and averaging, input and output lines, screen
display, relay PWM, LED blink, defined variables and loop counter are all there.  I hate to
type and it is easy to forget the format for functions.  Copy and paste saves me all that
work. Click as many as you need and just change the variable names. Delete the stuff not
wanted.

Bruce S

  • Global Moderator
  • Super Hero Member Plus
  • *****
  • Posts: 4584
  • Country: us
  • USA
Re: Control for heating with solar off grid no batteries
« Reply #32 on: August 09, 2016, 03:08:28 PM »
FIRST : To the OP! Apologies if this drifts too far.
BUT!! OH is making very good points and it is important even for old people like me to be reminded to not let the big picture get in the way of getting started.

OperaHouse;
The point I just made is very to the point. It was back in one of your other pgm sessions that I realized I was making it too hard. Was trying to thing of finding programs that were looking costly, then putting the whole idea on hold because of that.
ALL most of it took was looking / reading / remembering

Looking at your codes, looking at DamonHD's codes

RE-Reading up on simple basic commands

Remembering just how easy it was using the simple stuff like if/then statements.

I messaged your earlier  statement into a a simple air pump timer to run for my hydro-ponics setup.
TADA , now I have a cute hand-me-down HF panel that is used to charge a small bank of recycled 18650s and one of the cheapo USB charge controllers.
Now I have some kick-N peppers and cherry tomatoes that I don't have to fight 95F weather to keep hydrated.
ALL because someone reminded me of how easy this stuff can be.
Again THANK YOU!!


PS>> DamonHD's coding skills are still decades beyond me :-/

   
 
A kind word often goes unsaid BUT never goes unheard

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #33 on: August 10, 2016, 12:32:59 PM »
I think ontfarmer has done quite well so far, but he hasn't been exactly a Chatty Cathy. I have saud before that just loading in the software and getting one of the supplied sample programs loaded into a UNO is about 80% of the work.  A lot of people are following this and wondering just how you even start.  His perspective is quite different from mine and his experiences would be quite interesting to others.

I understand the cosmic angst of facing something new. I just bought my wife a new car two months ago.  Got her just what she wanted.  She had to move it in the driveway and it took fifteen minutes to figure out how to get the windshield wipers to work.  Well the manual is 700 pages!  She still won't drive it, says leave the truck for me. She wouldn't drive the truck either till I was in the hospital and she had to.  Now she thinks it is hers.  I just got a new phone and can just barely use it.  I still have not updated the version of the Arduino software downloaded years ago.  It does everything I want now.  Who knows what can of worms I could get into.  We all have fears.  So, your experiences would be very interesting to people.  Document every step of your project here.  Help someone else get started.  I appreciate this takes time.

Got more updates but will hold off for a while.

DamonHD

  • Global Moderator
  • SuperHero Member
  • *****
  • Posts: 3648
  • Country: gb
    • Earth Notes
Re: Control for heating with solar off grid no batteries
« Reply #34 on: August 10, 2016, 01:23:24 PM »
I just like the way you're turning him into a programmer without it being any more fuss than learning how to use a new tool on the workbench!  B^>

I am terrified by ALL of this stuff, even though I'm apparently quite good at some of it, like novelty and change, and am not especially risk-averse.  Pick your battles, I say!

Rgds

Damon

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #35 on: August 11, 2016, 07:53:59 AM »
I'll talk about some other aspects of the uno hardware. The A/D converters use the power
supply +5V for a reference.  Supply voltages can vary from 4.95 to 5.25V.  Any numbers I
give you for the A/D converter are general and can vary a bit.  When you plug in a laptop
with the USB cable, the laptop may supply the voltage even though the uno is powered by
another source. USB power is often higher because it has to deal with cable losses. I found
this out the hard way when I wrote my refrigerator program. I calibrated my diode temperature
sensor with laptop power. When I got to the camp and it ran off the internal regulator,
the temps were several degrees off.  I solved this with future development projects by
having a dedicated USB cable that has the 5V line cut. I use back to back diodes where I
made the cut. This insures there is always some power connected, but differences of supply
voltage differences of up to 0.6V are ignored.

The A/D converter inputs like to see an input impedance of about 10K.  They have a fairly
high input impedance, but have a charge coupled aspect to them.  A capacitor at the input
of .1uF or higher insures a stable reading.  It also absorbs noise spikes and radio
interference that might be present.  There is another interesting thing you might experience,
ghosting.  Those pins are awfully close together and if viewed at an angle it is easy to
place that pin connector at the next adjacent pin.  When you have a moment you should try
this.  Add another A/D input and assign it to the next pin not used and leave it floating.
Read it out in the serial section. That number will be about 70% of the prior pins voltage.
I've seen it many times on message boards,  Help...I'm not reading the voltage I should have.
That happens often with input A0.  It is the first A/D converter and your mind thinks A1.
In computers zero is a number.

Inputs and outputs must be declared in the program.  pinMode does this by identifying the pin
number and whether it is an INPUT or an OUTPUT.  Just to confuse you further, those are the
pin numbers on the board connectors not the pins of the IC.  Since you won't be building your
own boards that shouldn't be a problem.

pinMode(13, OUTPUT);       // sets the digital LED pin 13 as output, onboard LED

It is very easy to forget to include this when adding a new output to the program.  The compiler
will not flag this as a problem.  Two things will happen.  First, the output will only turn
on for a very short time. Short enough that you may not notice any thing has happened. The
output will not latch to the on state as it normally does and it will go to a floating state.
If you are driving a FET without a gate pull down resistor, the will turn on for quite a while until
the capacitance of the gate discharges.  That can leave you pulling your hair out trying to
figure out why things randomly turn off. Thinking they should have made the compiler smarter?
This is actually a feature that many programmers use.  Here is a simple test you can try.
Comment out // the line that identifies pin 13 as an output. You can just make out the LED
flashing if the room isn't too bright.

void setup()
{
 Serial.begin(9600);        // setup serial port speed
 // pinMode(13, OUTPUT);       // sets the digital LED pin 13 as output, onboard LED
 pinMode(10, OUTPUT);       // digital pulse for timing loop OPTIONAL
 pinMode(3, OUTPUT);        // sets the digital pin 3 as PWM output to drive FET
}

This is the kind of stuff to have in a boilerplate sketch.  You will always be using some
output. Pin 13 is always used for the onboard LED.  You could name every pin and the compiler
wouldn't care if you didn't use them in the program. The same with the serial port, you don't
have to use it.  And it keeps the designated structure of the program.  It is easy to forget
to start and end with the brackets.  void setup()  What's that about? I do not know where they
get these names. They could have used norknid. It just has to be there and having a boilerplate
sketch will do that.  Then you can concentrate on the actual logic code.

This is simply a tool. Downloading the compiler is free.  Edit up one of the sample programs
like Blink or AnalogReadSerial and click on VERIFY. That will compile and check for errors.
Putting the code of the Blink program into AnalogReadSerial would be a good exercise and the
start of a boilerplate sketch.  No need to buy any hardware.  Boilerplates make programming
faster and easier.

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #36 on: August 12, 2016, 07:25:39 AM »
I think I told you about ghosting of the A/D converter. I've been playing around with this
program on a breadboard and I can see a tiny bit of ghosting when I am trying to get the
program to increment a count very slowly. This is because impedance's are higher than ideal
at the input of the A/D converter. I suggest you move the pot input from A1 to A3. This
will reduce this interaction between the two. In practical operation this wouldn't mean much. 
I just found it a little annoying when adjusting the pot is so touchy anyway. If you were trying
to do something more precision, grounding the analog pins to either side would help.

Time for more features. I've added a calculated power reading. In doing so I violated my
rule for beginners, to keep everything "out of the box" as possible. Using an unsigned integer
skirts on the border. Integer math allows positive and negative numbers up to 32K. Multiply
something and exceeding 32K produces a negative number. A pretty definite indicator this limit
has been exceeded.  With an unsigned integer, that can go up to 64K. Exceed that and the number
gets much smaller than expected. Unsigned here is pretty handy when dividing by a large number
like 255. The bigger the numerator the better when dividing.  Just be aware of the trouble
you can get into when types of integers are mixed in a program.  Like pasting a section of
code from another program. Going long can get you into a bigger can of worms.  At some point
you should try it. If at all possible keep multipliers to the power of two. This is what
declaring a unsigned integer looks like. Not that scary.

unsigned int power32    = 0;  // output power X 32, a nice binary number
unsigned int maxpower  = 0;  // potential power of heater

You will need to know the resistance of the heating element and enter that in the program. I
chose 9.3 ohms. Heaters will all have a stated wattage and voltage. For example

             2000W / 240V = 8.3 ohms 

This gets multiplied by 10 in the program to make it a nice integer number. That is because
the panel voltage in the program is ten times the actual value.  It all comes out in the wash.


    // CALCULATE POWER OF HEATER
    // panel integer is actually 10 times the voltage
    // this must be reduced first to stay within processor limit
    // of 64K for the unsigned variables maxpower & power32
    // resistance is multiplied by 10 to make a two digit number
    // This is the same as another division by 10 of panel
    //     maxpower = E * E/R
    //     power = maxpower * PWM%
    // except we multiply the PWM3 count by 32 to get a larger number
    // before dividing.  Larger powers and wattages may require different
    // numbers to stay within 64K limit of processor. The numbers are a
    // little choppy due to integer math. This is a pseudo reflection of power.
   
    maxpower = (panel/10) * (panel/93);
   
    power32 = maxpower * (PWM3 * 32 / 255);

Note the parentheses.  If all the multiplications were done first, the number would be too large.

Then we print the number out to the screen.  That number is 32 times the true value.  For
convenience it is divided in the print statement.  For lower wattage heaters that number
could be higher and vice versa.  Testing by forcing values to either limits will insure
you haven't made a mistake. For this variable an integer is suitable.
   
    Serial.print("    ");                     // create space between last data
    Serial.print(power32 / 32);         // print output power reduced by 32
    Serial.println("W");                   // identify variable and do line feed

When using this data to find the panel power point, first tune for the highest wattage.
Then fine tune for the highest % or PWM3 number. Wattage can take some big jumps.
   
   
« Last Edit: August 12, 2016, 07:35:50 AM by OperaHouse »

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #37 on: August 14, 2016, 11:25:28 AM »
My plan for heating water with solar panels is to help heat the house. I put up 12 panels 
 3720 watt.  Storage is going to be 2 furnace oil tanks. The water will be circulated through the furnace.
The heating elements  are 120 volt 1000 and 1500 watt, not sure which one will be best in
the winter?
The controller for the heater element is arduino UNO that will be done by PWM.  OperaHouse  has been very kind helping me with all the details, wiring, programing,
 Etc,  Etc.
Here is the panel.


OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #38 on: August 14, 2016, 02:41:54 PM »
This is the box I put my drivers in.  Oddly enough this box was from a commercial water heater.  The only thing in it are the FET drives for my two water tanks.  The uno was about 30 feet away in the house.  Having it up to 100 feet away is a nice feature of this system using opto isolators. Mounting this on the side of the house was prior to my building the power shack, a 4 X 6 foot enclosure for all the solar electronics, batteries and water tanks.  Note the plastic cover to protect it from rain.  When I moved it into the shack there was a frog inside that was electrocuted.  You might want to try the system I used here.  Each heating element has its own FET driver.  Start with the 1000W heater, when that goes to 100% duty cycle start the second heater.  Just a slight variation of the program.  Instead of counting up to 255, the count goes up to 510.  The first 255 is one heater and the next 255 is the second heater.  I see pumps to control too.  You will have fun with this.

The display is a Turnigy power meter.  Unfortunately these only monitor up to 60V.  That works fine for my 36V  array.  I cut a trace modified it to work on 12V.  I don't trust their regulator at 60V. The LED show 12V power on and the other two are for the heaters.
« Last Edit: August 14, 2016, 03:10:08 PM by OperaHouse »

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #39 on: August 14, 2016, 04:37:12 PM »
The pump for circulating hot water to the furnace will be powered with hydro from the grid.

I was installing two different size heating elements  1000 and  1500 watt  because of not
knowing how much the panels will provide in the worst of the winter. The plan is to power  only one element at a time 1000 watt first, when the days get longer if there is enough power the wires can be changed to  the 1500 watt.  That way the elements are there and
just change the wires.  Six panels will be used to power the element.  There will be two of these systems.
« Last Edit: August 15, 2016, 01:05:23 PM by Bruce S »

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #40 on: August 15, 2016, 09:12:58 AM »
I had to go back to the other thread to figure out what you had in panels.  Somehow I
had the feeling you had less power and this was three strings of 24V panels. This doesn't
make a substantial change, but there are practical aspects like wire.  Three sets of #12
cable is cheaper than four.  That means instead of a buss voltage of about 110V, it has
to be raised to 150V.  I assume those 1,000 and 1,500W heating elements were 120V. A 4,500W
240V element will produce about 1,200W at your operating voltage.  The scale that appears on
heating elements is due to boiling on the surface and that deposits minerals. Operate the
heater with a lower heat density and those deposits will never form.  So I'm in favor of
using elements at a lower voltage than rated.

I don't know your long term goals but it seems you have a lot of tank capacity. I can heat
30 gallons of water up to 140F with 900W of panels. For certain reasons that is not optimized
but it gives a ballpark number to work with.  At home I collected data on heat loss at night
with a 30gallon water heater. It came to about 3KWH a day.  This tank was not well insulated
even though I had an external fiberglass blanket to it. Heat loss isn't a bad thing if it is
the heating season and the tanks are in your living room.  A 275 gallon oil tank has a lot of
surface area.  It would seem more practical just to do heating with a wall or space heater
during the day.  With the uno you can do zone heating.  With 150V buss a 120V heating element
can be used.  Just limit the PWM to about 200.  The world is your oyster with a UNO. Regardless
I think you will be needing a couple more FETs.


ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #41 on: August 16, 2016, 11:27:03 AM »
Space heater is something to consider for heat. Would be a lot less work.  With the hot water  going through the furnace would look after  the rooms that get heated and may get
some a night ?

My wind turbine powers baseboard heaters for zone heating.  I will give that some thought.




« Last Edit: August 17, 2016, 06:58:49 AM by Bruce S »

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #42 on: August 16, 2016, 02:03:47 PM »
See, there is always more to the story. I didn't mention it, but was more concerned about the shading on the panels in the picture. It would be good to confine that to one string.  I'm finally off to camp after delaying it 2 1/2 months.  Long trip,probably wont hear from me till Sunday. 

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #43 on: August 24, 2016, 04:29:47 PM »
 Have not heard anything.  Just checking how the trip was to the camp ?

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #44 on: August 24, 2016, 05:49:29 PM »
It was a typical trip.  Just outside Corning NY, about 200 miles from camp, I looked in the rear view mirror and saw smoke.  Leaf spring on trailer snapped and tire was burning a hole in plastic storage container.  Just missed the battery by an inch.  Contemplated just taking what I could and abandoning the rest.  Buying another $200 trailer just for the spring was another option.  Jacked trailer up and and removed the spring pieces.  Found three small pieces of wood along the road.  Duck taped them together and put them under axle.  One inch forward or back on that side would chew up tire on frame.  Nothing held the block of wood in place. Took ratchet strap off load and wrapped it around axle to front and back of frame to keep it in place.  The wood was basically held in place by weight.  If block fell out it would destroy the tire. My wife said the usual...Is this safe.   Made it to camp in spite of very bumpy roads.  Out on Cape Cod for a couple of days with relatives.  Everything fired up at the camp normally and no leaks this year.

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #45 on: August 27, 2016, 10:32:11 AM »
What have you done lately.  You should have burned up something by now.

How important is tracking the power point?  At my camp I don't do it.  I'm only there for
one season so the temperatures are pretty consistant.  My water heaters do not present
enough load in full sun so voltages on them go over the poWer point anyway for one hour or more a day. Early mornings don't provide a lot of power anyway and all that goes to charging the
battery so the refrigerator can come back to temperature.. Running a temperature sense line out to the panel may not be cost effective or practical.  Even a sun absorbsion plat at the house can have issues. If you want to keep it simple, adjusting the power point manually would be good enough. Lack of tracking hasn't affected me in a tangible way and other priorities have kept me busy. But, going from summer to winter is a big change in the power point and if you do have a year round system it should be somewhat automatic. I had a panel at home to do some development work last spring. I didn't get far with that. Now that is at the camp and part of the water heater array. Some simple routine for power point tracking will show up later.  At least one IC manufacturer uses this panel temperature method and claims this is a tracking chip.

The key point of this system is the gigantic difference it makes between a direct connection
to a simple resistive load.  Solar panels hate a fixed resistance load.  Once sun intensity
drops just a little, the voltage drops a lot.  Power is voltage squared divided by resistance.
That magnifies the problem and from the charts the voltage drops very quickly. With this system
the voltage isn't allowed to drop.  The load adjusts to maintain the voltage.  At early sun and
late afternoon the results are dramatic.  And of course clouds can happen at any time.

I have to rethink my system with the new medical load.  I need to parallel the house and the fridge battery at night and then disconnect them in the morning as the fridge comes on line.  The house battery is located in the house about 40 feet from the power shed battery.  The wire resistance of that long run prevents that battery from getting a high current charge.  I sense that it doesent get back up to a full charge potential.

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #46 on: August 27, 2016, 06:03:36 PM »
I have been working installed a wire to the panels for the tracker, got part of the tracker put together.  added the information you gave me to the sketch.  Picked up 240 volt elements to try.  Is the resistance for the heater just added?  maybe you can give me a example.  Unsigned interger  didn't understand but that doesn't matter as long as it works.

Hooked up the three 1000 watt 240 volt baseboard heaters they where producing heat at
140 some volt.  The two FET got the heat sink quite warm. A bit like your wife in the new
car a bit confused not wanting to wreck something.  Waiting on digital  metre.  Putting elements in tank then will power them and see how that goes.

[quote author=OperaHouse With this system the voltage isn't allowed to drop.  The load adjusts to maintain the voltage. 
I will check to see if this works on mine? Have not changed the PWM to 200 yet.
Should I  ask about new medical load?  Hope things at fine.

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #47 on: August 30, 2016, 10:33:25 AM »
No need to change the PWM limit to 200 if the elements are 240V.

A binary 16 bit number is 64K maximum.  The standard integer math is signed. The highest bit is used for negative or positive indicator so the maximum number is +32K or -32K.  If you know that your numbers will never be negative, that bit 16 can be used for a number up to 64K.  That doubles the possible number size.

I know this is coming out in drips an dabbles.  In integer math, the remainder is always dropped. This will consistently give you lower numbers in your calculations.  If 26 is divided by 10, the answer is 2.  If half the divider of 10 is added to the number before division, the number will round up. 26 + 5) / 10 = 3.  So, remainders of 4 or less get rounded down and 5 and over get rounded up.  In the example I used some ruff justice and added 6 since the second number is divided by 93 and the adder for that division should be higher.

    // Ineter division always drops the remainder so numbers are consistently
    // low. This routine corrects that consistant low number.  Both divisions
    // are basically divisions by 10.
   
    panelrndup = panel + 6;                    // add 6 so division rounds up
                                                            // remainders 4 and over and rounds
                                                            // down remainders below 4
                                               
    maxpower = (panelrndup/10) * (panelrndup/93);

Why don't you draw exactly what you have for an output circuit.
   

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #48 on: September 01, 2016, 12:04:00 PM »
Three 1000W 240V heaters in parallel will not be enough load to drop the voltage.  That is likely about 900W total.

I optimized some of my own software because the numbers were when I had fewer panels.  I ran out of power two nights even though the additional load is only 9AH.  Turns out the second battery is not up to snuff.  If I remember to parallel the two batteries everything works.  Fall is coming and still concerned about the days being short and cloudy.  Yesterday was overcast all day and only got a lukewarm shower.  There are generally two days at the end of the season when I have to fire up the generator just to keep the fridge going.  Might need to run an extension cord to the neighbor.

This is the power shed and software development center. Your proto board is on the table above the water heaters.  I swore I would keep this one place nice and clean.

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #49 on: September 03, 2016, 11:56:58 AM »
When the three 1000 watt baseboard heaters  where plugged in the voltage dropped 20 volts.
When I entered the last info to the sketch it said that " panelrudup " was not declared.

You have a lot in that power room, doesn't look that bad to me. Putting some things together right now, then  I will draw the output circuit.

Busy on the farm again, will get back to this in a few days.

Thanks

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #50 on: September 04, 2016, 11:24:37 AM »
You didn't declare  panelrudup as an interger at the start of the program with the other variables.  And you can call it what you want but it is RNDUP not RU.  You may have two spellings if it was declared.

OperaHouse

  • Hero Member
  • *****
  • Posts: 1075
  • Country: us
Re: Control for heating with solar off grid no batteries
« Reply #51 on: September 08, 2016, 11:16:57 AM »
While we are waiting, here are some routines that may be useful in other projects.  The SERIAL MONITOR in tools is very useful in debugging a program.  Not only can you get data from the micro, but you can send it back.  The first code is a simple loop counter so the screen just doesn't become a blur of data.  it counts program loops and resets at 10 or any other number.  This only works in the last routine.

The next code allows me to reset program variables without having to wait.  The inhibit is used in the refrigerator section of code.  It prevents a hot start just after the refrigerator has turned off.  inhibit starts at 5 for minutes and counts down to zero.  If you change some code, you hate to wait 5 minutes to see if it works.  This manually resets it immediately to zero so new code can be tested without waiting.  Handy for a lot of applications.

The last allows you to use a pot to vary a setpoint to see if it is optimal before setting it in stone.  The A/D reads 0 to1023.  to make a finer adjustment just divide that number by 2 or 4.  Then subtract half of the maximum value.  That will give you a +- range.  Add that to the fixed number under test.  Then just display the numbers so they can be entered manually in the program.  I have a pot with pins on the leads.  Just connect to GND, analog input , and power +5 or 3V3 for smaller numbers if the +5 pin is already used.  AI3 is my variable used for analog pin #3.  The actual read is elsewhere in the program.


update = update + 1;                                               // loop counter
if (update == 10) update = 0;                                  // reset every 10


 if (Serial.available() > 0) kbd = Serial.read();             // look for and get keyboard 
                                                                                //character to change diagnostic screen 
                                                                                // kbd is the character returned
                                                                                //from keyboard


  //     RESET VARIABLES COMMAND FOR TEST
    if (kbd == 'R' || kbd == 'r')                                   // if R or r reset variables
  {     
    SLUMP = 15000;
    DLV   = 0;
    DLV2  = 0;
    DLV3  = 0;   
    DLV4  = 0;   
    DLV4  = 0; 
    SLUMPCT = 0;
    inhibit = 0;
  }


 if (kbd == 'p' || kbd == 'P' || (keyboard == 'P' && update == 1))           
                                                                             // if P or p  POT debug screen
                                                                             // update slows down data display
  {
    keyboard = 'P';                                                   // retain keyboard value otherwise
                                                                             //it will be lost
    Serial.print(" ");                                                 // space before start of data
   
    Serial.print(AI3);                                               // raw A/D value from pin #3
    Serial.print(" AI5    ");
   
    POT = AI3 / 4 - 127;                                           // divided value gives +- 127 also
                                                                             // gives deadband
   
    Serial.print(POT);                                                // display POT value
    Serial.print(" POT");
    Serial.print('\t');                                                 // send tab for spacing
   
    SET12 = POT + 1500;                                         // add adjustment             
   
    Serial.print(SET12);                                            // adjusted standard value
    Serial.print(" SET12    ");
   
    Serial.print("   15000    ");                                   // normal value
   
    Serial.print(PWM9drv);                                         // adjusted standard value
    Serial.print(" 12V drive    ");
   
    Serial.print(panel12);                                            // panel voltage
    Serial.print(" 12V panel");
    Serial.print('\t');                                                    // tab to next column     

    // NOTE: printlin is used this time instead of print.   println adds a new line character
    //automatically after the data string so the next set of data is on a new line.  The
    // Auto Scroll box in the SERIAL MONITOR tool can be unchecked to freeze the screen.
    Serial.println ('P');
  }




« Last Edit: September 08, 2016, 11:34:52 AM by OperaHouse »

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #52 on: September 10, 2016, 05:44:56 PM »
 Made up a bracket to support the capacitors  and the rest of components.  Hooked up the
wires that's when the problems happened. When I came upstairs to check the uno the led
light was on but not blinking just stayed on, the TX light did not flash. 

When I put the wire in to drive the FETS, started at the uno  went 15' with 24 awg put the opto isolator there which is powered by the uno. That is where the 15 volt wall wart is to power the 30' of 24 awg to the FETS.  Tried uploading but no success  getting the code
below. The testing I done on the baseboard heaters with temporary wiring went well but not this.

Arduino: 1.6.9 (Windows 7), Board: "Arduino/Genuino Uno"

Sketch uses 5,928 bytes (18%) of program storage space. Maximum is 32,256 bytes.
Global variables use 284 bytes (13%) of dynamic memory, leaving 1,764 bytes for local variables. Maximum is 2,048 bytes.
           (  I erased from 1 > 9 )

avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x84
Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

ontfarmer

  • Full Member
  • ***
  • Posts: 124
  • Country: ca
Re: Control for heating with solar off grid no batteries
« Reply #53 on: September 11, 2016, 04:38:07 AM »
Should have added this.  Checking to try and find what was wrong the voltage was the same
on all three pins of the FET   150 volt. Wondering if that on the gate got back to the uno?
Thought it could not get past opto isolator?