scarakins axis follow problem in -x and -y zone

More
2 years 9 months ago - 2 years 9 months ago #289653 by bkt
Hi at all,

on Lcnc 2.9.1 and scarakins standard ....
not understand why but I observe these never test before now: when reach x-500 y+1 position trought x-500 y-1  position in world mode I have an estop event ... think because these row inside kins foward:
Code:
        *iflags = 0;            if (joint[1] < 90)                      *iflags = 1; than in Inverse: [code]    /* joint 1 angle needed to make arm length match sqrt(rsq) */     cc = (rsq - D2*D2 - D4*D4) / (2*D2*D4);     if(cc < -1) cc = -1;     if(cc > 1) cc = 1;     q1 = acos(cc);     if (*iflags)     q1 = -q1; but not understand why exactly seems x and c axis try to moove into undesired point (with estop obtain follow error on joint 0 and joint3 so X and C axis) ... these not happens in positive area +X and +Y or +X and -Y or -X and -Y ... only during moovement trought -Y to +Y if I'm on -X area ..... but is these logical?  a3 or C axis not change angle during these motion from -n to +n or inverse .... any suggestion is appreciate p.s.: axis limit for test is set to +6000mm and -6000 mm... but robot can reach only 900mm. joint limit is set to +720° and -720° so is not a limit problem ...
[/code]
Last edit: 2 years 9 months ago by bkt.

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago - 2 years 9 months ago #289891 by bkt
image missing /media/kunena/emoticons/silly.png  seems a simply solution can be follow:
Code:
static int scaraKinematicsInverse(const EmcPose * world,                                   double * joint,                                   const KINEMATICS_INVERSE_FLAGS * iflags,                                   KINEMATICS_FORWARD_FLAGS * fflags) {     double a3;     double q0, q1;     double xt, yt, xt1, yt1, rsq, cc;     double x, y, z, c;     x = world->tran.x;     y = world->tran.y;     z = world->tran.z;     c = world->c;     /* convert degrees to radians */     a3 = c * ( PM_PI / 180 );     /* center of end effector (correct for D6) */     xt = x - D6*cos(a3);     yt = y - D6*sin(a3);     xt1 = xt;     yt1 = yt;     /* horizontal distance (squared) from end effector centerline         to main column centerline */     rsq = xt*xt + yt*yt;     /* joint 1 angle needed to make arm length match sqrt(rsq) */     cc = (rsq - D2*D2 - D4*D4) / (2*D2*D4);     if(cc < -1) cc = -1;     if(cc > 1) cc = 1;     q1 = acos(cc);     if (*iflags)         q1 = -q1;     /* angle to end effector */     q0 = atan2(yt, xt);     /* end effector coords in inner arm coord system */     xt = D2 + D4*cos(q1);     yt = D4*sin(q1);     /* inner arm angle */     //q0 = q0 - atan2(yt, xt);     if((xt1<0) && (yt1>=0)){q0 = q0 - atan2(yt, xt) - 2*M_PI;}     else{q0 = q0 - atan2(yt, xt);}     /* q0 and q1 are still in radians. convert them to degrees */     q0 = q0 * (180 / PM_PI);     q1 = q1 * (180 / PM_PI);     joint[0] = q0;     joint[1] = q1;     joint[2] = D1 + D3 - D5 - z;     joint[3] = c - ( q0 + q1);     joint[4] = world->a;     joint[5] = world->b;     *fflags = 0;     return (0); } // scaraKinematicsInverse()

not tested on real machine for now ... only on openGL test windows.

regards
Last edit: 2 years 9 months ago by bkt.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago #291224 by bkt
sorry seems I deleted the previous my answer by posting this new possible solution for -x & -y scara working zone, when end-point passes trought Y=0 ....

Please Log in or Create an account to join the conversation.

More
2 years 9 months ago - 2 years 9 months ago #291462 by bkt
 because i use reverse geometry of scara joint the file must be modify in these way:

(see txt file) 

File Attachment:

File Name: scarakins-behind.txt
File Size:2.14 KB


tested on my 950mm machine ... not tested on other machinery.
Last edit: 2 years 9 months ago by bkt.
The following user(s) said Thank You: Aciera, DPFlex

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #308685 by DPFlex
Hello,
My system is:
- Debian Bookworm, LCNC 2.9.3
- Installed on Desktop PC with scripts: www.linuxcnc.org/linuxcnc-install.sh
I just revise SCARA dimensions:
Code:
#define DEFAULT_D1 490 #define DEFAULT_D2 340 #define DEFAULT_D3  50 #define DEFAULT_D4 250 #define DEFAULT_D5  50 #define DEFAULT_D6  50

My question is: after revising scarakins.c, how to let the installed LCNC know and run ?.
Thank you.

Please Log in or Create an account to join the conversation.

More
2 years 2 months ago #308709 by Aciera
You can try compiling the modified 'scarakins.c' using 'halcompile'
Code:
sudo halcompile --install <your_path>/scarakins.c

You will need the dev package for halcompile to be available.
Code:
sudo apt install linuxcnc-dev

If that does not compile then you will need to build LinuxCNC locally on your computer:
linuxcnc.org/docs/master/html/code/building-linuxcnc.html
The following user(s) said Thank You: DPFlex

Please Log in or Create an account to join the conversation.

Time to create page: 0.395 seconds
Powered by Kunena Forum