Author Topic: manual solar tracker Design  (Read 2200 times)

ajit.nayak87

  • New Member
  • *
  • Posts: 6
    • View Profile
manual solar tracker Design
« on: January 02, 2014, 05:44:53 AM »
Dear all,

I am trying to Solar tracking Without any feedback. I am using RTC , arduino UNO board and Linear actuator.
Linear actuator:24v , 600mm stroke, 3.2mm/sec speed .
Desired angle Calculation :
TS=(3600*h)+(60*m);
Desire_Degree=(TS*slope)+intercept; slope = 0.00227272727273;Intercept :- 102.272727273;
Now problem finding actual angle:
as i told 600mm stroke has to divide in 660 min ie 11 hour. mm/min=(10/11)
How can i calculate actual angle Depend on actuator speed and time:
In below code i am finding angle Which is constant can't varied










Code: [Select]

double Desire_Degree;
unsigned int TS;
static float slope= 0.00227272727273;
static float intercept=- 102.272727273;
static int length;
double Actual_Degree;
static int h;
static int m;
double Actual_postion;
static float ACT_SPEED=3.2;


void setup()
{
   h=7;
  m=30;
 
 
Serial.begin(9600); 
}
static int time_interval;

void loop()
{
  calc_min();
  //Desire degree calculation
  if(h<23)
  {
  TS=(3600*h)+(60*m);
  Desire_Degree=(TS*slope)+intercept;
 
  //Actual anngle calculation
  time_interval=(10)/(11*ACT_SPEED)*(25/88);
 // length=(TS*3.2);
  length =(0.0151466666667*TS - 381.504);
  Actual_Degree=((3 *length) / 20) - 45;
 
  Actual_postion=((Actual_Degree + 45) * 20) / 3;
 
 
 
 // actual_deg=((3*length)/200)-45;
  Serial.print("HH-MM: ");
  Serial.print(h);Serial.print(":");Serial.println(m);
  Serial.print("Desired Degree:");
 Serial.println(Desire_Degree);
 Serial.print("Actual Degree:");
 Serial.println(Actual_Degree);
 Serial.print("length:");
 Serial.println(length);
 Serial.print("Actual pos:");
 Serial.println(Actual_postion);
Serial.println(".................................");
 
  } 
  delay(1000);
}

void calc_min()
{

if(m<60)
{
   m=m+5;
}else if(m==60)
{
  m=0;h=h+1;
}
}


Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 651
    • View Profile
Re: manual solar tracker Design
« Reply #1 on: January 03, 2014, 08:21:54 PM »
Hi ajit,

I'm not sure that I completely understand the question.
I'm curious where you found this line. I've never seen it anywhere before.
Desire_Degree=(TS*slope)+intercept; slope = 0.00227272727273;Intercept :- 102.272727273;

I'm assuming that this is a single axis sun tracker?

It sounds like the "Desire_Degree" is related to the position of the sun, correct?

It also sounds like you are trying to change the position of the machine by turning the motors on for a short period of time to move it to the new angle.
For that you would need to know how much longer or shorter the linear actuator must become. What I do is a calculate the length of the actuator at the machine's current angle, then I calculate the length of the actuator at the new angle and subtract one from the other.
This tells me how far the linear actuator must move.
If for example it must move 10mm and the motors move it at a rate of 5mm per second, then the linear actuator must be turned on for 2 seconds.
I'm not sure how accurate this method would be since I've never tried it, but I guess it would be good enough for sun tracking.

Also, I use the Law of Cosines to calculate how long the actuator must be. http://en.wikipedia.org/wiki/Law_of_cosines

Again I'm not sure if I understood the question, but hopefully I was able to help some.

Gabriel





ajit.nayak87

  • New Member
  • *
  • Posts: 6
    • View Profile
Re: manual solar tracker Design
« Reply #2 on: January 03, 2014, 10:00:52 PM »
Hi ajit,

I'm not sure that I completely understand the question.
I'm curious where you found this line. I've never seen it anywhere before.
Desire_Degree=(TS*slope)+intercept; slope = 0.00227272727273;Intercept :- 102.272727273;

I'm assuming that this is a single axis sun tracker?

It sounds like the "Desire_Degree" is related to the position of the sun, correct?

It also sounds like you are trying to change the position of the machine by turning the motors on for a short period of time to move it to the new angle.
For that you would need to know how much longer or shorter the linear actuator must become. What I do is a calculate the length of the actuator at the machine's current angle, then I calculate the length of the actuator at the new angle and subtract one from the other.
This tells me how far the linear actuator must move.
If for example it must move 10mm and the motors move it at a rate of 5mm per second, then the linear actuator must be turned on for 2 seconds.
I'm not sure how accurate this method would be since I've never tried it, but I guess it would be good enough for sun tracking.

Also, I use the Law of Cosines to calculate how long the actuator must be. http://en.wikipedia.org/wiki/Law_of_cosines

Again I'm not sure if I understood the question, but hopefully I was able to help some.

Gabriel







Yes i am trying to do single axis tracker here. Desired angle assumed -45 @ 7Am,0 @12 pm and 45 degree @ 18 Pm . Yes Desire Degree related to position of sun. I wanted actual angle variable w.r..t  time.my actuator stroke is 600mm and speed is 3.2mm/sec.
speed =distance/time= 600/3.2 time taken 187.5 Sec to cover 600mm. Now 187.5 second has to be divided within 660minutes i.e running actuator from 7AM to 18PM. so i need formula that convert position in to angle. Where  time is variable.

As you told:
If for example it must move 10mm and the motors move it at a rate of 5mm per second, then the linear actuator must be turned on for 2 seconds.

how can i calculate actuator tun on time.assume that actuator is 0mm  and move to 10mm. Actuator on=(difference of distance)/actuator speed; and Here how i can convert it to -45 deg to 45 deg  range???. how to put in in code????

after 18pm i wanted to say desired degree must me 0 degree and actuator length to 300 mm . how can actuator on time to move it to 300mm and stop
 




Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 651
    • View Profile
Re: manual solar tracker Design
« Reply #3 on: January 06, 2014, 08:06:50 PM »


This code will calculate the length of the actuator based on an angle input. I don't know enough about your machineto be able to tell you what to input, but you may be able to figure it out by reading the documentation on this page. http://www.cerebralmeltdown.com/arduino-sun-tracking-heliostat-program-documentation/
The areas where it explains Setting #4, #5, #11, #12, Setting #6 and #13, and Setting #7 and #14 are what you would be interested in.
Code: [Select]
//This code calculates the length of the linear actuator.
float leadscrewLength(float b,float c,float AcuteObtuse,float angle, float AngleAtZero){
  float output;
  if (AcuteObtuse == 1){angle = AngleAtZero - angle;}
  if (AcuteObtuse == 2){angle = AngleAtZero + angle;}
  output = sqrt(b * b + c * c - 2 * b * c * cos((angle) * pi / 180));
  return output;
}

"how can i calculate actuator tun on time.assume that actuator is 0mm  and move to 10mm."
It sounds like you already answered this question yourself with this "Actuator on=(difference of distance)/actuator speed;"

A lot of what you are doing is just going to take some trial and error on your part. Since I don't have the machine in front of me it is difficult for me to give advice.

I think you could probably make this a lot simpler than it is by ignoring the angles completely and just programming the motor to turn on every say five minutes for a set amount of time in the morning. At the end of the day, you would program the machine to move in the opposite direction until it resets on a limit switch and the stop and wait for morning again. Trying to precisely move DC motors by turning them off and on for a set period of time won't likely be very accurate no matter how you do it, so why not just do it the easier way?

That's just my idea anyway.

ajit.nayak87

  • New Member
  • *
  • Posts: 6
    • View Profile
Re: manual solar tracker Design
« Reply #4 on: January 06, 2014, 09:13:31 PM »
Ok. let go with your procedure.If i say move actuator for every 5 min . How can i know its new position moved.Since it dont have any feed back. If i have feedback i could control it.


ajit.nayak87

  • New Member
  • *
  • Posts: 6
    • View Profile
Re: manual solar tracker Design
« Reply #5 on: January 06, 2014, 09:25:15 PM »
Assume that above thing not worked. Can you suggest me the Feedback option controlled by MCU for steps

Like linear actuator with
1-> hall sensor
2->potentiometer
3->encoder
4-> reed switch

Which option is better and why??
How hall sensor works here in above case.

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 651
    • View Profile
Re: manual solar tracker Design
« Reply #6 on: January 07, 2014, 06:55:52 AM »
"Ok. let go with your procedure.If i say move actuator for every 5 min . How can i know its new position moved.Since it don't have any feed back. If i have feedback i could control it."
I don't know exactly, I've never tried. It's just going to take a bit of experimentation. Once you have it up and running, try turning the motors on for say five seconds and measure the number of degrees that it moves. The sun moves 15 degrees per hour, so if the machine moves 1 degree in five seconds, you just need to make sure that the machine is on long enough every hour to add up to 15 degrees.

It won't be exact, but it should be good enough.

I've never tried any of the other methods either, but I imagine they all should work fine. I doubt that one would be any better than the others.

Fair warning, I will by no means write this program for you, nor do I think anyone else will. When I first started my own sun tracking program, I had no clue what I was doing, but I suffered through it and actually became a decent programmer at the end of it all.
That and I have my own projects that I want to work on. ;)


ajit.nayak87

  • New Member
  • *
  • Posts: 6
    • View Profile
Re: manual solar tracker Design
« Reply #7 on: January 07, 2014, 10:05:17 PM »
Thanks for reply.For single axis tracker  with feedback sensor we can do easily . Since i am trying to do without feedback facing some issue for programming.

IF i use linear actuator with feedback according to which will be better option and why?
1-> hall sensor
2->potentiometer
3->encoder
4-> reed switch
Quote
It won't be exact, but it should be good enough.

I've never tried any of the other methods either, but I imagine they all should work fine. I doubt that one would be any better than the others.

Fair warning, I will by no means write this program for you, nor do I think anyone else will. When I first started my own sun tracking program, I had no clue what I was doing, but I suffered through it and actually became a decent programmer at the end of it all.
That and I have my own projects that I want to work on