CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2014
    Posts
    3

    RUNNING LINEAR ACTUATOR without feed back

    Dear all,

    I am trying to do single axis solar tracker with linear actuator /rtc/ UNO. I have already done with feedback sensor. Now Here i am trying to without feedback.
    Linear actuator specification: 24v , 3.2mm/sec as speed , 600mm stoke.

    Desired angle calculation: tracking start from 7am to 18PM, 11hours
    Assumed degree: 7AM as -45 deg , 12.30 as 0 degree and 18 pm as 45 degree.
    static float slope= 0.00227272727273;
    static float intercept=- 102.272727273;
    TS=(3600*hour)+(60*minute);
    Desire_Degree=(TS*slope)+intercept;

    Problem part : calculating actual angle/ calculation for Ton time and convert in to +/-45 degree format.
    rate=distance/ time
    Ton=600mm/660minute = 10/11 mm each minute
    time * 3.2mm/sec = 10mm / 11
    time= (25 / 88) sec/minute;
    if i wanna run for 2 sec ->(2*88/25)= 7.04 i.e actuator must on for 7 minute;
    angle= ((3 * position) / 20) - 45 and
    or
    position =((angle + 45) * 20) / 3
    since position = 3.2 * time
    angle =((96 * time) / 200) - 45.
    How can i put time here.
    can someone help me coding for calculating Ton time and solve above equation. below i posted my code . I need it has to be modified little bit. i need to implement ton time actuator here.

  2. #2
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: RUNNING LINEAR ACTUATOR without feed back

    Problem part : calculating actual angle/ calculation for Ton time and convert in to +/-45 degree format.
    rate=distance/ time
    Ton=600mm/660minute = 10/11 mm each minute
    time * 3.2mm/sec = 10mm / 11
    time= (25 / 88) sec/minute;
    if i wanna run for 2 sec ->(2*88/25)= 7.04 i.e actuator must on for 7 minute;
    I didnt double check your calculations but you switched actuator time and solar time .....

    if Actuator run for 2 sec ->(2*88/25)= 7.04 i.e actuator moves 7 minutes (solar time);
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  3. #3
    Join Date
    Jan 2014
    Posts
    3

    Re: RUNNING LINEAR ACTUATOR without feed back

    Quote Originally Posted by GremlinSA View Post
    I didnt double check your calculations but you switched actuator time and solar time .....

    if Actuator run for 2 sec ->(2*88/25)= 7.04 i.e actuator moves 7 minutes (solar time);

    Here i am assuming length as constant(Which is Wrong).I wanna keep actual degree variable such that if it cross Desire degree direction get reverse if actual degree is less it try to move forward. If Desire and actual degree are equal stop. Let me know changes made in below code.

    Name:  actual degree.jpg
Views: 939
Size:  81.0 KB

    Code:
    
    #include"glob.h"
    #include"rtc.h"
    #include"config.h"
    #include"actuator.h"
    
    signed int Desire_Degree;
    unsigned int TS;
    static float slope= 0.00227272727273;
    static float intercept=- 102.272727273;
    static int length;
    signed int Actual_Degree;
    
    double Actual_postion;
    static float ACT_SPEED=3.2;
    
    
    static int Lmin=0;
    static int Lmax=600;
    static int Smin=-45;
    static int Smax=45;
    static float Slope_length;
    
    signed int Intr_length;
    
    void setup()
    {
      // h=7;
     // m=30;
      rtcSetup();
      setupActuator();
    Serial.begin(9600);  
    }
    static int time_interval;
    
    void loop()
    {
      getRTCDateTime();
      //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 =(0.0151466666667*TS - 381.504);
     Actual_Degree=((3 *length) / 20) - 45;
     Actual_postion=((Actual_Degree + 45) * 20) / 3;
      moveActuator();
     if((Desire_Degree-Actual_Degree)>1)
     {
         Move_Forward();
         if((Actual_postion-length)==0);
         Move_Stop();
     }else
     {
       
       Move_Reverse();
     }
      
    /*  Slope_length=(Smax - Smin) / (Lmax-Lmin);
      Intr_length=Smin - ( Lmin * Slope_length);*/
    // Actual_Degree=((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;
    }
    }
    
    void setupActuator(){
     // pin setting  for Motor Driver
    }
    
    
    
    
    void moveActuator(){
      
    
      switch(DIR){
      case FWD:
        Move_Forward();
        break;
      case REV:
        Move_Reverse();
        break;
      case STOP:
        Move_Stop();
        break;
      }
    }
    
    void Move_Forward()
    {
      // pin setting  for forward
    
    }
    
    
    void Move_Reverse()
    {
     // pin setting  for reverse
    
    
    }
    
    void Move_Stop()
    
    {
      //pin setting for stop
    
    }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured