Shadow length Implimentation

I am trying to implement shadow length calculation for solar tracking application.Here i have attached relevant formula.
question to convert length into degree format.
Initially i am converting conv_elevation : tracker_des_angle = 90-conv_elevation; in track mode, Since back tracking to be include How to calculate desire angle here.
tracker_des_angle will be in -90 degree to +90 degree i.e 7AM to 18PM

I don't believe in complex calculations for solar tracking.


Here my Tracker Desired angle calculated for single tracker. Since there array of tracker tracker has to be modified to get more output.

In my below code Angle is being decremented instead of increment, tracker desired and Angle are not matching

COde here

void  calc_back_track()
  static int D_min;
  static float  height=1200;
  static float  D_max;
  static int altiude;
  float phi_a = azimuth*M_PI/180;

  //  D_max=1500*D_min;

  // D_min= D_max*cos(180-phi_a);

  // tracker_desire=(atan(h/D_min)*(180/M_PI));

  //  D_min= D_max*cos(phi_a-180);
  D_min= D_max*cos(180-phi_a);
    tracker_desire = 90-conv_elevation;
    tracker_desire = -(90+conv_elevation);


void limitTrackerDesAngle(){
  tracker_desire = constrain(tracker_desire,-MAX_TRACK_ANGLE,MAX_TRACK_ANGLE);


Can someone help implement above algorithm Here how to calculate the shadow length

x- modules length=1200mm
?-modules angle varies with time of day. Initially i calculated for single tracker unit.
usually spacing between the tracker or panel is 3200 mm

How to calculate ?-solar radiation angle here.Once shadow length determined .

if backtrack_active
     if shadow length<=Lmin
            back_trackangle=?-solar radiation angle; it should be +45 degree and -45 degree format

NOAA_Solar_Calculations_day.xls (281 KB)

Dear all.

I am trying to implement the below algorithm. I have attached relevant calcualted Excel sheet here.

Initially i have single track panel .It will so i dint bother about the shadowing,
Now i have array of tracker like show in below link. When array being placed upper panel shadow panel on on lower panel which reduce the efficiency generation.So i wanted to implement to achieve the max efficiency,

SO let me how can relate my elevation angle with shadow length,
My ?-modules angle will changes with time of the day . shadow will be max in morning where my tracker position will be @ 45 degree even through calculated 75 since i am using linear actuator setup.
From 9:30 Pm start tracking +45 degree and stop tracking around(3:45 pm) -45 degree of actuator.
Question how to related shadow length with elevation angle.
How to get raid of shadow in morning and evening time here by adjusting panel potions to degree .

backtrack_angle.xls (279 KB)

If you want to avoid the shadow from one panel falling on adjacent panels then I think you would need to impose a constraint on the sun tracking that stopped it moving the panel into the region where the shadow would overlap. Obviously this region would depend on where the sun was. The trig to calculate that would be conceptually easy enough to work out but quite tedious to work through. I'm too lazy to do it for you. I didn't follow the links you posted - do they give you the formula to calculate the orientation at which overlap occurs from the sun position and panel size+spacing?