code for dual axis solar tracker with arduino

lamineoriska:
I want to use the algorithms to track the sun not with the sensors (LDR) and i need to make commands to the stepper motors with the results of azimuth and altitude angles from the program i mention it above at the link

So you're just working on the pointing aspect and not on the whole structure and movement of larger arrays?

When you get this done, can you make an array of small flat mirrors reflect sunlight onto one spot?

GoForSmoke:
So you're just working on the pointing aspect and not on the whole structure and movement of larger arrays?

When you get this done, can you make an array of small flat mirrors reflect sunlight onto one spot?

yes the tracker structure can be modified to use it for PV panels or thermal panels because the method of tracker is the same, even you can use it for track a satellite

Unless you put the small cell on a frame suitable for whole panels out in weather, you won't learn much good that will apply to larger structures with your toy and you might even learn some bad lessons. Scale has problems all its own, the whole increases by cubes while the load-bearing cross sections increase by squares.

lamineoriska:
I already purchase the steppers motors and i should work with it
but the steppers will not work all the day long
they will work for couple times to drive the panel and face the sun about once/30 min

You stated you will be driving with a dalingtn array. no signal means no power to hold the motor in place. no wasted power.
also, if you move past the point of the calculated point, the Earth's rotation will narrow that constantly until the Sun is behind. meaning you want to overshoot by about 15 minutes and then wait 15 minutes past the point. that way, you stay within your sweet spot.
as a note, you will have to use a RTC for this, since you are calculating position, you are at the mercy of the positional accuracy of the unit.
another note, if you have a hard stop for the home, and drive hard into it, with the intention of missing steps, you have a zero point for the next day. a lot of devices will have the panels rotate to face the ground overnight. keeps the dew off and the panels are parallel with wind.
you could even drive them to a latch with a solenoid to lock them in place for the overnight. reduces stress from a storm.

dave-in-nj:
You stated you will be driving with a dalingtn array. no signal means no power to hold the motor in place. no wasted power.
also, if you move past the point of the calculated point, the Earth's rotation will narrow that constantly until the Sun is behind. meaning you want to overshoot by about 15 minutes and then wait 15 minutes past the point. that way, you stay within your sweet spot.
as a note, you will have to use a RTC for this, since you are calculating position, you are at the mercy of the positional accuracy of the unit.
another note, if you have a hard stop for the home, and drive hard into it, with the intention of missing steps, you have a zero point for the next day. a lot of devices will have the panels rotate to face the ground overnight. keeps the dew off and the panels are parallel with wind.
you could even drive them to a latch with a solenoid to lock them in place for the overnight. reduces stress from a storm.

i'm going to use a small tracker for presentation only with a cell less than 15x15mm

lamineoriska:
It's not to big just a cell 10*10mm

You are confusing us.

I said in Reply #2
"If the purpose is to keep a solar panel facing the sun stepper motors are a bad idea as they use too much energy."

and in Reply #3 you said
"what you suggest fop replacing the stepper motors ?"

from which I presumed you were talking about a big solar panel used to produce electric power. Now you tell us it is only a tiny cell 1cm square.

For a small cell that size the simplest way to move it would be with servos.

...R

Robin2:
You are confusing us.

I said in Reply #2
"If the purpose is to keep a solar panel facing the sun stepper motors are a bad idea as they use too much energy."

and in Reply #3 you said
"what you suggest fop replacing the stepper motors ?"

from which I presumed you were talking about a big solar panel used to produce electric power. Now you tell us it is only a tiny cell 1cm square.

For a small cell that size the simplest way to move it would be with servos.

...R

I have to make it with stepper motors cause i don't have servos right now

JohnLincoln:
Is there a gearbox between the stepper motor and the solar panel?
If so what is the gear ratio?

How many steps does your stepper motor take per revolution?

We need this information to be able to calculate how many steps of the motor correspond to one degree of rotation of the array.

yes I use is a gearbox the teeth on the drive gear (on the motor) is 25 teeth and the driven gear teeth is 90 that's mean the gearbox ratio is 3.6
and the stepper motor has 1.8 deg/step

1.8 degrees if more than fine enough to point that cell and get over 99% of what perfect aim would give.

clearly the best approach is to use what you have.

if you calculate the panel motion and it works, you have it right. cannot get any simpler.

dave-in-nj:
clearly the best approach is to use what you have.

if you calculate the panel motion and it works, you have it right. cannot get any simpler.

the only problem that i'm new in the arduino's world of programing and i don't know how to make a sketch to drive the stepper motors that's the problem i need the arduino's sketch that can drive the steppers motors to track the sun with algorithms

Robin2:
from which I presumed you were talking about a big solar panel used to produce electric power. Now you tell us it is only a tiny cell 1cm square.

...R

he said that technically, size is irrelevant. any mechanical thing can be scaled up or down.
steppers are by far the best selection for calculated tracking.
an industrial servo with positional feedback would be a second choice and only when your panels are in the multiples of square meters in size. cost does not matter and power requires multiple HP motors.
a hobby servo does not offer the ability to scale up, simply because the cost of high power hobby servos hit into the hundreds of dollars when you are only approaching the power of a common stepper.
also, steppers offer multiple revolutions so can be used with gears and threaded rods that are so common in large heliostats and telescopes, the devices that are in the same category ie: application, as a solar tracker.

dave-in-nj:
he said that technically, size is irrelevant.

Perhaps, but I was trying to be practical. Stepper motors do NOT make sense for a solar array that is intended to produce power because they would probably use all of the power that is produced, or perhaps more.

I don't think it makes sense to view the positioning algorithm as an end in itself. It is just a small part of a project that has some specific purpose and it should be designed to serve that purpose.

...R

I HATE this forum.

wrote a sketch to help and it got trashed because soimeone else posted white I was typing.

someone should write a sketch to swing baseball bats and beat everyone involved in choosing this forum formats.
disgusted, just disgusted.

Got trashed? Usually there is just a new window that opens to let you know another message was posted; you are still allowed to post yours as-is.
I think the only time it gets lost now is when the topic is moved to another forum while you are posting.

CrossRoads:
Got trashed? Usually there is just a new window that opens to let you know another message was posted; you are still allowed to post yours as-is.
I think the only time it gets lost now is when the topic is moved to another forum while you are posting.

It has happened to me on numerous occasions.

if you are writing while someone else posts, you post will not be accepted.

yes, you get an error and if you catch it, you can re-post.
alas, my 10 year old kicks me off the computer now and again and I hit post, then close the window.

it is a setting in the forum set-up to force overlapping posts to be bumped into a error.

it may be the quick reply box. think I'll try the standard reply for awhile.

I think what irks me most is that the forum is designed and run by programmers.

check every hour if the azimuth and maybe elevation are still within limits of 1%, if not move the steppermotors with the stepper.lib to the new posuition, and switch off after reaching the goal.


lamineoriska,

to use the darlington, you must use a uni-polar.
you must put power to the center of the coil.
the darlington pulls the coil to ground.

the timing is from one coil to the next.

coil1a = 5;
coil2a = 7
coil1b = 6;
coil2b = 8;

=====================

if (count>0){
count++
coil2a(high)
delay(2)
count++
coil1a(low)
delay(2)
count++
coil1b(high)
delay(2)
count++
coil2a(low)
delay(2)
count++
coil2b(high)
delay(2)
count++
coil1a(high)
delay(2)
count++
coil2b(low)
delay(2)
count++

if(count>416){
count=0;
timer=milli();
}

if(count=0){
if(millis()-timer>15 minutes){
count=1
}
}

this will not work as listed, i ius just to show the idea of timing
416 half step every 15 minutes gets you close.

better to use a real time clock.
.

dave-in-nj:
if you are writing while someone else posts, you post will not be accepted.

yes, you get an error and if you catch it, you can re-post.

So? You read the new post(s) and decide if you want to edit your post or not post at all.
That's a feature. It is not a Bug.

alas, my 10 year old kicks me off the computer now and again and I hit post, then close the window.

So HATE the forum then?

There are a lot of problems with the new forum software which is also true of the old forum software but when you blame it for your own misuse you have no leg to stand on.

And BTW, code should go in code tags. It's now the on far left of the symbols row with B next.

GoForSmoke:
So? You read the new post(s) and decide if you want to edit your post or not post at all.
That's a feature. It is not a Bug.

So HATE the forum then?

There are a lot of problems with the new forum software which is also true of the old forum software but when you blame it for your own misuse you have no leg to stand on.

And BTW, code should go in code tags. It's now the on far left of the symbols row with B next.

a feature is something that makes a thing better.
it is hard for me to believe that anyone sees that someone else posted, then goes to read that other post. then chooses to delete their post. I am sure it can happen. but since this 'feature' seems to be that this list has, and is, to me, the way I use this forum, very annoying. I choose to call it a bug. or really a poor choice of settings by whomever ran down the list and selected one thing over another.
it teaches me that either I do not try to post long posts, or I write them on some other program and then copy them over. again, in my mind, neither reflects the use as a 'feature'
I do apologize to the OP for this brief hijacking of his thread.