RUNNING LINEAR ACTUATOR without feed back

Discussion in 'General Electronics Chat' started by ajitnayak87, Dec 30, 2013.

  1. ajitnayak87

    Thread Starter New Member

    Dec 30, 2013
    8
    0
    Dear all.

    Here i am trying to do simple algorithm.I wanna formula to calculate actual position in algorithm

    Desired angle calculation:
    desired angle=-0.00227272727273x + 102.272727273 where x= (3600*hour)+(minute*60)

    actual angle:actual actuator stroke is 600mm ,3.2mm/sec speed ,0.192mm/min. I wanted to run actuator from morning 7 AM to 18PM. approximately 11 hour/660 minutes,How can i convert this mm/min movement into 45 deg to -45 deg .

    7AM assume deg :45 , 0mm actuator initial length
    12:30 assume deg :0 , 300mm length
    18:00 assume deg -45,600mm actuator final length

    half code with desired angle.
    Code ( (Unknown Language)):
    1.  
    2.  
    3. static int hh;
    4. static int mm;
    5. static int ss;
    6. signed int  degree;
    7. unsigned int TS;
    8.  
    9. static float slope= 0.00227272727273;
    10. static float intercept=- 102.272727273;
    11.  
    12.  
    13. void setup()
    14. {
    15.   Serial.begin(9600);
    16.   hh=06;
    17.   mm=45;
    18.  
    19. }
    20.  
    21. void loop()
    22. {
    23.   calc_min();
    24. if(hh<24)
    25. {
    26.     Serial.print("HH-MM: ");
    27.     Serial.print(hh);Serial.print(":");Serial.println(mm);
    28.     TS=(3600*hh)+(60*mm);
    29.     Serial.print("TS:");
    30.     Serial.println(TS);
    31.     degree=(TS*slope)+intercept;
    32.     Serial.print("Desired Degree:");
    33.     Serial.println(degree);
    34.     Serial.println("..................");
    35. }
    36.   delay(1000);
    37.  
    38.  
    39. }
    40. void calc_min()
    41. {
    42.  
    43. if(mm<60)
    44. {
    45.    mm=mm+5;
    46. }else if(mm==60)
    47. {
    48.   mm=0;hh=hh+1;
    49. }
    50. }
    51.  
    52.  
    53.  
    54.  
     
Loading...