on the fly config

More
28 Jul 2013 06:53 #37113 by btvpimill
Replied by btvpimill on topic on the fly config
Wrong as in won't work? or wrong as in you don't think it will do what I want to do? Any idea what it should be? I am just guessing so far.

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

More
28 Jul 2013 07:29 #37117 by andypugh
Replied by andypugh on topic on the fly config

Wrong as in won't work? or wrong as in you don't think it will do what I want to do? Any idea what it should be? I am just guessing so far.


It will work, it might do what you want, but it is nonsense code to set a variable to a value twice in successive lines.

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

More
28 Jul 2013 07:35 #37118 by btvpimill
Replied by btvpimill on topic on the fly config
Andy you are correct, I was not thinking. I was reading the wrong direction, what I was doing in my mind was setting joint[1] and joint[7] to be the Y position. What I see I have actually done is set Y to be joint[1], then re assigned it to be joint[7]

I think I have mixed up my code for forward and reverse and who is doing what. I will re-post more senseable stuff after I eat. Thank you for pointing this out to me

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

More
28 Jul 2013 08:35 #37120 by btvpimill
Replied by btvpimill on topic on the fly config
Maybe this makes more sense (although I am not sure it does to me).
int kinematicsForward(const double *joints,
                     EmcPose * pos,
                     const KINEMATICS_FORWARD_FLAGS * fflags,
                     KINEMATICS_INVERSE_FLAGS * iflags)
{
   static int old_change = 0;
   
   if(*haldata->change == 1) {    
   pos->v = joints[1];
   pos->w = joints[2];
   } 
   else 
   {
   pos->v = joints[7];
   pos->w = joints[8];
   }
   pos->tran.x = joints[0];
   pos->tran.y = joints[1];
   pos->tran.z = joints[2];
   
   pos->a = joints[3];
   pos->b = joints[4];
   pos->c = joints[5];
   
   pos->u = joints[6];
   

   return 0;
}

int kinematicsInverse(const EmcPose * pos,
                     double *joints,
                     const KINEMATICS_INVERSE_FLAGS * iflags,
                     KINEMATICS_FORWARD_FLAGS * fflags)
{
   if(*haldata->change == 1) {  
   joints[7] = pos->tran.y;
   joints[8] = pos->tran.z;
   } 
   else 
   {
   joints[7] = pos->v;
   joints[8] = pos->w;
   }
   joints[0] = pos->tran.x;
   joints[1] = pos->tran.y;
   joints[2] = pos->tran.z;
   
   joints[3] = pos->a;
   joints[4] = pos->b;
   joints[5] = pos->c;
   
   joints[6] = pos->u;
   

   return 0;
}
The reverse section makes sense to me, but not the forward section. Seems like the forward section does not need to be conditional. After all if I am reading it right, position v,w should always come from joint[7],[8].
It seems like the reverse section is doing what I want where joint[7],[8] are controlled by either v,w or y,z. But maybe the forward part is to get the feedback module happy?

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

More
28 Jul 2013 08:47 #37121 by andypugh
Replied by andypugh on topic on the fly config

The reverse section makes sense to me, but not the forward section. Seems like the forward section does not need to be conditional. After all if I am reading it right, position v,w should always come from joint[7],[8].
It seems like the reverse section is doing what I want where joint[7],[8] are controlled by either v,w or y,z. But maybe the forward part is to get the feedback module happy?


The reverse kins is the important one. As you have noted, the forward kins is mainly for feedback (and maybe homing)

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

More
28 Jul 2013 08:51 #37122 by btvpimill
Replied by btvpimill on topic on the fly config
So do you agree the conditional part in forward is not needed? I will see is I can get this tested tomorrow somehow. This will be HUGE for us if this works :)

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

More
28 Jul 2013 08:53 #37123 by andypugh
Replied by andypugh on topic on the fly config
It's 3am here, I am not really in a position to consider your code in detail. I suggest you try it and see.
The following user(s) said Thank You: btvpimill

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

More
18 Sep 2015 20:45 #62748 by Todd Zuercher
Replied by Todd Zuercher on topic on the fly config
Were you ever able to get this to work?

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

More
18 Sep 2015 20:59 #62750 by btvpimill
Replied by btvpimill on topic on the fly config
We never got the kins to work as we wanted. But to be fair, we only tried for a very short time. I didn't have a working machine in front of me when we were trying and my tester was not really sure what was going on. I think it worked when we went one way, but then didn't change back.

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

More
18 Sep 2015 21:35 - 18 Sep 2015 21:38 #62753 by Todd Zuercher
Replied by Todd Zuercher on topic on the fly config
I've been able to do something like this using only the stock trivkins.

I set up two custom M-codes that will slave and unslave 2 axis. I'm using it on a router that has 2 spindles on a Z and W axis to carve identical items.

To use it I move both axis to a safe matching position, (such as G0 Z1.0 W1.0) then issue my slaving command M122. The slaving command crosses the W feedback and position commands with the Z via a couple of mux2s and an offset. After that the W moves the same as Z for all Z commands (any W commands are ignored). When finished with your slaving work you then have to move both axis back to the original slaving point (G0 Z1 W1) then give the unslave command (M123). Then normal XYZW operation is resumed.

Here is a link to a thread where I've posted some example configurations.
linuxcnc.org/index.php/english/forum/38-...e-questions?start=20

My main reason for making this set-up is to take advantage of the new blending and read ahead features in the new trajectory planner in LinuxCNC 2.7. (It currently reverts to the old planner when using axis other than XYZ.) The new planner shortens run times on most of our carving files by 25-50%.
Last edit: 18 Sep 2015 21:38 by Todd Zuercher.
The following user(s) said Thank You: BigJohnT

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

Time to create page: 0.190 seconds
Powered by Kunena Forum