Discussion in "Software" started by    ajit    Jan 4, 2014.
Sat Jan 04 2014, 11:02 AM
#1
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, 11:03 AM ]
Sun Jan 05 2014, 07:54 PM
#2
What is " resolution 1.89 pulse /mm." ?
Without some sort of feedback you can't do it.
Which Linear actuator are you using ?.



[ Edited Sun Jan 05 2014, 08:20 PM ]
Mon Jan 06 2014, 04:10 AM
#3


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
Mon Jan 06 2014, 08:52 PM
#4


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, 04:31 AM
#5



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
Tue Jan 07 2014, 09:41 PM
#6


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, 01:32 AM ]

Get Social

Information

Powered by e107 Forum System

Conversation

Thu Jun 11 2020, 06:27 AM
anudee
sir could please send the code for I2C and wifi interfacing with 8051
scena
Tue May 19 2020, 10:29 PM
Does anyone have microcontroller programming software for STC15F104W (core 8051, 4 k, 128 byte, 6 I/O pin, UART ... DIL8), that works?
Sat May 02 2020, 07:38 PM
Tamu Gurung
Hi I am looking for a assembly language program for a digital decimal counter. Time counts max limit of 2 mins starting from 2.00 mins and ending at 0.00. time is to be displayed on 4 7-segment LED displays. Edsim51 simulator to be used. Thanks
Wed Mar 25 2020, 01:39 PM
Tajammul
Sir kindly send the code file i2c for 8051
ExperimenterUK
Fri Mar 13 2020, 10:36 PM
@ Rohitnani,ABEBE..which project ?
Fri Mar 13 2020, 12:55 PM
ABEBE
how can get hadwere of this project
Rohitnani
Sat Mar 07 2020, 05:11 PM
Sir, Could you please send me the zip file input password....
Wed Feb 26 2020, 04:58 PM
Peter Parker
Is it possible to send multiple messages using only 1 GSM module?
Sat Feb 01 2020, 10:12 AM
Pearl Olin
Hello,
Wed Jan 22 2020, 06:16 PM
MINU CHAUDHARY
I m getting errors while simulation process during interfacing socket output and lcd... Can i get the report of ur project which is same as us.

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 40, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123
Forum Activity
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 11:07 PM
PS: I am a new learner thats why my question may s...
Mirza123 Avatar
Posted By Mirza123
Wed Jul 01 2020, 02:05 PM
Thanks for the assistance. I have read the data sh...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jul 01 2020, 10:12 AM
See section 15 (Ports) of the data sheet. ...
wimac Avatar
Posted By wimac
Tue Jun 30 2020, 10:05 AM
How did you know that it is not 8051. Mirza123It i...
Mirza123 Avatar
Posted By Mirza123
Tue Jun 30 2020, 08:39 AM
It seems ports on the AT89LP2052 is not like on th...
ExperimenterUK Avatar
Posted By ExperimenterUK
Tue Jun 30 2020, 08:34 AM
It seems ports on the AT89LP2052 are not like on t...
Mirza123 Avatar
Posted By Mirza123
Thu Jun 25 2020, 04:07 PM
Hello!i am trying to use AT89LP2052 ( AT89LP2052 h...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jun 17 2020, 09:42 PM
It is about capacitor? i should put it between Vcc...
cerouno Avatar
Posted By cerouno
Wed Jun 17 2020, 10:37 AM
Take another look at the power supply to the LCD.A...
ExperimenterUK Avatar
Posted By ExperimenterUK
Wed Jun 17 2020, 02:01 AM
Take another look at the power supply to the LCD.A...