Discussion in "Software" started by    ajit    Jan 4, 2014.
Sat Jan 04 2014, 04:32 pm
I am trying to write code for tracking application.I have Designed with feedback sensor which is working fine. I am trying to run same thing without feedback.
component used: RTC,linear actuator, arduino board. motor Driver

Linear actuator: 24v Dc,3A,3.2mm/sec speed , resolution 1.89 pulse /mm.
application: single axis tracker
tracker start time:7Am , tracker stop time:18 pm
Desired degree assumed: 7Am as -45 deg , 0 degree around 12:30 and 45 degree around 18pM

Desire degree equation:
TS=(3600*hour)+(60*SEC);
Desire_Degree=(TS*slope)+intercept;
static float slope= 0.00227272727273;
static float intercept=- 102.272727273;

Problem in calculating actual position: since we don't have feedback we don't know actuator position
for that i am considering:
step1:
we know above statement tracker has to run for 11 hour,660min,39600 sec
resolution=1.89 pulse /mm
for 600mm movement=600*1.89 pulses=1134
39600/1134=34.92sec
i.e means for every 34.92 sec it gives 1 pulse. /* here i don't how mm it will move, and convet it to actual angle*/

step2:

We know 600mm has to be traveled 660min i.e(10/11)mm/min
time=distance/speed=(10/11*3.2)=0.284 sec per min
if i wanna move for every 2 sec =2/0.284=7.04 minutes ie means it moves for every 7 min
angle= ((3 * position) / 20) - 45
or
position =((angle + 45) * 20) / 3
we know position = 3.2 * time;
angle =((96 * time) / 200) - 45;
how to calculate ton time of actuator??
is there any way we can do coding simple.?
let me know changes made in below code to calculate Actual Position of actuator

```

double Desire_Degree;
unsigned int TS;
static float slope= 0.00227272727273;
static float intercept=- 102.272727273;
static int length;
double Actual_Degree;
static int h;
static int m;
double Actual_postion;
static float ACT_SPEED=3.2;

void setup()
{
h=7;
m=30;

Serial.begin(9600);
}
static int time_interval;

void loop()
{
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=(TS*3.2);
length =(0.0151466666667*TS - 381.504);
Actual_Degree=((3 *length) / 20) - 45;

Actual_postion=((Actual_Degree + 45) * 20) / 3;

// actual_deg=((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;
}
}

```

In above code i consider all parameter as constant . So code may no work

[ Edited Sat Jan 04 2014, 04:33 pm ]
Mon Jan 06 2014, 01:24 am
What is " resolution 1.89 pulse /mm." ?
Without some sort of feedback you can't do it.
Which Linear actuator are you using ?.

[ Edited Mon Jan 06 2014, 01:50 am ]
Mon Jan 06 2014, 09:40 am

What is " resolution 1.89 pulse /mm." ?
Without some sort of feedback you can't do it.
Which Linear actuator are you using ?.

ExperimenterUK

I am using PJM 350 model.why i cant do it without feedback. I don't need give me exact length. during calculation.
The idea is simple, but i could not able to put in c code
to determine actual angle you can say
initial length =0, final length=0;
problem calculate delta_time;
delta length=(speed* delta_time);
final length/ degree= converted form of +/-45 degree
initial length=final length
Tue Jan 07 2014, 02:22 am

problem calculate delta_time;
delta length=(speed* delta_time);
final length/ degree= converted form of +/-45 degree
initial length=final length

ajit.nayak87

The problem is "speed."
It will vary with load, wear on the actuator and voltage.
Also there is start up acceleration to consider.
You can probably get acceptable results by a type of trial and error.
e.g.
Set up the full solar tracker.
Move from one stop to the other using 1 second pulses, 1 second apart.
Count the pulses.
Now space out the pulses to fill 12 hours.

Note the number of pulses needed each day and adjust the spacing.

Tue Jan 07 2014, 10:01 am

problem calculate delta_time;
delta length=(speed* delta_time);
final length/ degree= converted form of +/-45 degree
initial length=final length

ajit.nayak87

The problem is "speed."
It will vary with load, wear on the actuator and voltage.
Also there is start up acceleration to consider.
You can probably get acceptable results by a type of trial and error.
e.g.
Set up the full solar tracker.
Move from one stop to the other using 1 second pulses, 1 second apart.
Count the pulses.
Now space out the pulses to fill 12 hours.

Note the number of pulses needed each day and adjust the spacing.

ExperimenterUK

Can you put it in code
Wed Jan 08 2014, 03:11 am

Can you put it in code

ajit.nayak87

This code is much simpler that the code you already posted.
Pseudo code goes something like...

Run motor backwards until it hits the start of travel switch
while(1)
{
Run motor forward for one second.
Stop motor for one second.
increment count
if at end of travel ,exit loop
}
//save count as StepCount

for daily use..
count =StepCount
while(count)
{
Run motor forward one for one second.
Stop motor for 5 minutes //12 hours/StepCount

if at end of travel
{ //less steps are needed so adjust StepCount and gap
exit while loop
}
decrement count
}

//If not at end of travel, more steps are needed so adjust StepCount and gap

[ Edited Wed Jan 08 2014, 07:02 am ]

### Recent

xzvCar
Thu Sep 12 2024, 08:00 pm
Sazrpho
Thu Sep 12 2024, 01:27 pm
Malvebria
Thu Sep 12 2024, 01:24 pm
Sazrpig
Thu Sep 12 2024, 01:23 pm
ScottPease
Thu Sep 12 2024, 10:22 am
FeDerHaine
Thu Sep 12 2024, 10:08 am
Mulacrodesia
Thu Sep 12 2024, 12:42 am
Ubrat_qwmr
Wed Sep 11 2024, 04:50 am