RUNNING LINEAR ACTUATOR without feed back

Discussion in 'Programmer's Corner' started by ajitnayak, Jan 6, 2014.

  1. ajitnayak

    Thread Starter Member

    Feb 22, 2013
    36
    0
    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.

    Let me know changes to be made in below code.

    Code ( (Unknown Language)):
    1.  
    2.  
    3.  
    4.  
    Code ( (Unknown Language)):
    1.  
    2.  
    3. double Desire_Degree;
    4. unsigned int TS;
    5. static float slope= 0.00227272727273;
    6. static float intercept=- 102.272727273;
    7. static int length;
    8. double Actual_Degree;
    9. static int h;
    10. static int m;
    11. double Actual_postion;
    12. static float ACT_SPEED=3.2;
    13.  
    14.  
    15. void setup()
    16. {
    17.    h=7;
    18.   m=30;
    19.  
    20.  
    21. Serial.begin(9600);  
    22. }
    23. static int time_interval;
    24.  
    25. void loop()
    26. {
    27.   calc_min();
    28.   //Desire degree calculation
    29.   if(h<23)
    30.   {
    31.   TS=(3600*h)+(60*m);
    32.   Desire_Degree=(TS*slope)+intercept;
    33.  
    34.   //Actual anngle calculation
    35.   time_interval=(10)/(11*ACT_SPEED)*(25/88);
    36.  // length=(TS*3.2);
    37.   length =(0.0151466666667*TS - 381.504);
    38.   Actual_Degree=((3 *length) / 20) - 45;
    39.  
    40.   Actual_postion=((Actual_Degree + 45) * 20) / 3;
    41.  
    42.  
    43.  
    44.  // actual_deg=((3*length)/200)-45;
    45.   Serial.print("HH-MM: ");
    46.   Serial.print(h);Serial.print(":");Serial.println(m);
    47.   Serial.print("Desired Degree:");
    48.  Serial.println(Desire_Degree);
    49.  Serial.print("Actual Degree:");
    50.  Serial.println(Actual_Degree);
    51.  Serial.print("length:");
    52.  Serial.println(length);
    53.  Serial.print("Actual pos:");
    54.  Serial.println(Actual_postion);
    55. Serial.println(".................................");
    56.  
    57.   }  
    58.   delay(1000);
    59. }
    60.  
    61. void calc_min()
    62. {
    63.  
    64. if(m<60)
    65. {
    66.    m=m+5;
    67. }else if(m==60)
    68. {
    69.   m=0;h=h+1;
    70. }
    71. }
    72.  
    73.  
     
    Last edited: Jan 20, 2014
  2. sirch2

    Well-Known Member

    Jan 21, 2013
    1,008
    351
    I may be missing something but it seems you need 600mm over 11 hours giving 0.6/39600m/s = 1.515*10^-5m/s or 0.01515mm/s. So do you not just need to scale this into what ever the actuator is expecting for zero to full travel?

    In Arduino Loop is called repeatedly and you have a delay(1000) - i.e. 1 second so your loop will run approximately every second so you need to move the actuator 0.01515mm every loop run. Probably best to increase that to 1 minute delay and move 0.909mm. You will need to factor in things like the time taken to check the RTC etc.
     
  3. ajitnayak

    Thread Starter Member

    Feb 22, 2013
    36
    0

    Could you make change in change code. I think also assumed the length as constant here.I am just testing code with fake time.When i use RTC .it should work as expected. Desired angle has no problem.I think this part is wrong because i am considering length constant

    length =(0.0151466666667*TS - 381.504); Actual_Degree=((3 *length) / 20) - 45;
     
    Last edited: Jan 6, 2014
  4. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    Why would you do an open loop control system? You cannot claim it is tracking when there is no feedback.

    Over time, the drift in your system will make your equations and controller pretty much useless. If you have a closed loop implementation, why wouldn't you use it?
     
  5. ajitnayak

    Thread Starter Member

    Feb 22, 2013
    36
    0
    I already done closed loop system. They are working fine.This application is where people doesn't matter about angle.

    Since i am assuming 7Am as -45 degree ,0degree at12:30PM and 18pm as 45 degree.
    During start of each day i am doing init SO to avoid drift in the angle.
     
  6. ajitnayak

    Thread Starter Member

    Feb 22, 2013
    36
    0
    If it doesnot work @ all. Linear actuator with below configuration is better

    1) with potentiometer
    2) with encoder
    3) with hall sensor
    4)with limit switches

    So i need option that can be controlled using MCU
     
  7. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    ...and what happens when the earth tilts away from the sun? Your angle is off.

    So why make an open loop controller after you've made a closed loop one?

    Why don't you use the same method as before?
     
  8. ajitnayak

    Thread Starter Member

    Feb 22, 2013
    36
    0

    Why don't you use the same method as before?("Which method ur talking about");
    We can adjust angle in coding Desire angle earth tilts away from the sun?? It might be periods .
     
  9. tshuck

    Well-Known Member

    Oct 18, 2012
    3,531
    675
    You said you had a closed loop implementation. Use whatever sensing method you used then.
    Sounds like a lot more work for something that you already have a closed loop solution for that will work in all cases...:confused:
     
  10. ajitnayak

    Thread Starter Member

    Feb 22, 2013
    36
    0

    Reason i wanted to go with open loop system is it reduces Inclinometer cost that used in closed loop system.So I am trying to Design.If we use some actuator with linear encoder , we can determine position and also save driver cost.

    If i am using linear actuator ALONE IT SAVE ME THE ENCODER AND FEEDBACK COST.

    since accuracy is not much important . I thought we can do without any feedback
     
  11. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    You can get a 3-axis accelerometer module from Ebay for about $5, which will work perfectly as a two-axis analogue inclinometer.

    The only other costs are some weatherproofing of the tiny module and some wires to it.
     
Loading...