Author Topic: heliostat  (Read 512 times)

mary pascaline

  • New Member
  • *
  • Posts: 2
    • View Profile
heliostat
« on: August 22, 2016, 08:44:56 AM »
Hello
My name is marie pascaline I am a student of master and I work on controlling a mini heliostat. I work with an open loop so without solar sensor collector. I need help with the program. I have already calculated the different solar coordinates and the coordinates of the heliostat.  In tne programs I've seen in the site  i think there is not calculation for the heliostat coordinates therefore it's not necessry to calculate it? Thank you!
« Last Edit: August 22, 2016, 09:44:28 AM by mary pascaline »


Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: heliostat
« Reply #1 on: August 23, 2016, 05:11:51 PM »
Hi Marie,

I'm not sure if I understand what you are asking, but I don't think the calculations are really posted anywhere on the site. They are in the program though, so you might be able to work them out from the programming syntax.

If you go to the "Functions" tab in the Arduino IDE and then find the "FindHeliostatAltAndAz" function, you will find where the calculations are for calculating the heliostat coordinates. It basically inputs the sun's altitude and azimuth and the desired target altitude and azimuth and outputs the altitude and azimuth direction for the heliostat.

Is that what you are looking for?


mary pascaline

  • New Member
  • *
  • Posts: 2
    • View Profile
Re: heliostat
« Reply #2 on: September 22, 2016, 02:26:19 AM »
sorry for the late reply yes that's what i wanted but i search in the arduino IDE i see nothing i can have the link please.

Gabriel

  • Administrator
  • Hero Member
  • *****
  • Posts: 650
    • View Profile
Re: heliostat
« Reply #3 on: September 23, 2016, 05:06:52 AM »
I'm not sure why it's not showing up. Sometimes you have to click the file in the folder directly. I guess I could have just posted the code in the first place though. :)

The code basically just turns the sun and target's altitude and azimuth into a vector, calculates the half way point between them, and then turns the resulting vector back into altitude and azimuth measurements.

Code: [Select]
//This code calculates the angles for the heliostat (returnaltaz = 1 will return alt, 2 returns az)
void FindHeliostatAltAndAz(float SunsAltitude, float SunsAzimuth, float targetalt, float targetaz, float &machinealt, float &machineaz){

  float x,y,z,z1,z2,x1,x2,y1,y2,hyp,dist;
 
  z1 = sin(to_rad(SunsAltitude));
  hyp = cos(to_rad(SunsAltitude));
  x1 = hyp*cos(to_rad(SunsAzimuth*-1));
  y1 = hyp*sin(to_rad(SunsAzimuth*-1));

  z2 = sin(to_rad(targetalt));
  hyp = cos(to_rad(targetalt));
  x2 = hyp*cos(to_rad(targetaz*-1));
  y2 = hyp*sin(to_rad(targetaz*-1)); 
 
  x=(x1-x2)/2+x2;
  y=(y1-y2)/2+y2;
  z=(z1-z2)/2+z2;
 
  dist=sqrt(x*x+y*y+z*z);
  if ((dist>-0.0001) && (dist <0.0001)){
  dist=0.0001;
  }

  machinealt=to_deg(asin(z/dist));
  machineaz=to_deg(atan2(y*-1,x));

}