on the fly config

More
12 Jul 2011 14:23 - 12 Jul 2011 14:24 #11457 by btvpimill
Replied by btvpimill on topic Re:on the fly config
This is a stepper setup.

Just to note, eszyman and I are both working on the same machine configuration. That is to say he has one as do I. Unfortunatly we do not live near each other, so we are trying to learn this stuff at the same time through our own trial and errors.

That said, I assume #5421 holds the position of Y? If so, is it possible to just set #(V_address) = #5421? then the same for the Z/W?

That way we wouldn't have to worry where we slave/unslave the axis. That way we could slave the Z/W, jog to position, then unslave them and the W would know where it is.

Eszyman has a thread going to have a functioning 2 axis jog button, so far some progress has been made based on tips in that thread, but still not working as desired.
Last edit: 12 Jul 2011 14:24 by btvpimill.

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

More
12 Jul 2011 15:03 #11460 by andypugh
Replied by andypugh on topic Re:on the fly config
btvpimill wrote:

This is a stepper setup

That probably makes it easier, there is no PID controller trying to fight you.

I assume #5421 holds the position of Y? Yes, #5240 to #5249 hold XYZABCUVW.

If so, is it possible to just set #(V_address) = #5421? then the same for the Z/W?[/quote[
You can, but it will be immediately over-written with the current "internal" position of the V axis from the motion controller.

There might well be a way to directly write axis positions to the motion controller that I simply don't know about.

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

More
12 Jul 2011 15:08 #11461 by btvpimill
Replied by btvpimill on topic Re:on the fly config
OK, thanks Andy

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

More
12 Jul 2011 16:05 #11465 by andypugh
Replied by andypugh on topic Re:on the fly config
I am thinking that a modified version of gantrykins might be the solution.

But I would need to try it out to see if it behaves as expected.

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

More
12 Jul 2011 19:00 #11468 by btvpimill
Replied by btvpimill on topic Re:on the fly config
Well we will try anything you throw at us if that helps any.

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

More
27 Jul 2011 00:37 #11896 by andypugh
Replied by andypugh on topic Re:on the fly config
This is something that came up on the mailing list, so doesn't do exactly what you want. It demonstrates the theory, though, and it should be easy to alter the swapkins.c file to suit your purposes.

It consists of a sample config (though it only goes as far as a set of stepgens, there are no output pins configured) and a kinematics file called "swapkins" written by Visteurs and then fiddled with a bit.

Unzip the attached file into your configs directory.

You need to install the kinematics module, so navigate to the place where you extracted the files, and then
sudo comp --install swapkins.c
You will be asked for your password. You will get three warning messages, ignore them.

You should now be able to start the sample config in the normal way. Then you need to home the joints one by one (I am not sure why the homing sequence is inactive, or why the spot never appears by joint 4.)

Then switch to world mode by pressing $

You can now jog X in the normal way, and watch the input to stepgen 0 change in the pyvcp panel on the right.
select the "swap" checkbutton, and then jogging or moving X controls the 4 stepgen. Deselect the button and you have control of stepgen 0 again, and the x-display returns to the previous value.

You quite often get a small twitch from the axes on the change, and a following error. I think this is some sort of timing problem with the changeover in the kinematics file, and that the solution is to be a bit cleverer during the first call to the kins after a mode change. However, moving to zero before swapping is another solution.

File Attachment:

File Name: stepper_xyza.zip
File Size:7 KB
Attachments:

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

More
28 Jul 2011 00:41 #11936 by btvpimill
Replied by btvpimill on topic Re:on the fly config
Thanks Andy, Right now I am in the middle of playing with getting the driver to work as discussed in another thread, and dealing with overall wire mangement. So this part of the project has taken a bit of a hold.

Rest assured your efforts are not for not, I am starting to get a glimpse of the power of the 'kins and agree this may be the direction to go. So I will come back to this and give it a go.

Again thanks for your help and support

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

More
28 Jul 2013 04:23 #37106 by btvpimill
Replied by btvpimill on topic on the fly config
Leave it to me to drag up old threads, but I am finally back to wanting this to work better than we have now. I have looked at the swapkins file, and I think I understand how to change it to suit our needs.

I am sure I have no idea how to compile it but I found some threads showing me that also. If anyone has any better ideas for what I need, please post it here

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

More
28 Jul 2013 05:38 #37109 by btvpimill
Replied by btvpimill on topic on the fly config
I see Andy told me how to install the file - Thanks Andy :)
Here is what I think I need to do to modify the swapkins file:
int kinematicsForward(const double *joints,
                     EmcPose * pos,
                     const KINEMATICS_FORWARD_FLAGS * fflags,
                     KINEMATICS_INVERSE_FLAGS * iflags)
{
   static int old_change = 0;
   pos->tran.x = joints[0];
   if(*haldata->change == 1) {    
   pos->tran.y = joints[1];
   pos->tran.y = joints[7];
   pos->tran.z = joints[2];
   pos->tran.z = joints[8];
   } 
   else 
   {
   pos->tran.y = joints[1];
   pos->tran.z = joints[2];
   pos->v = joints[7];
   pos->w = joints[8];
   }
   pos->tran.x = joints[0];
   pos->a = joints[3];
   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[1] = pos->tran.y;
   joints[1] = pos->tran.v;
   joints[2] = pos->tran.z;
   joints[2] = pos->tran.w;
   } 
   else 
   {
   joints[1] = pos->tran.y;
   joints[2] = pos->tran.z;
   joints[7] = pos->v;
   joints[8] = pos->w;
   }
   joints[0] = pos->tran.x;
   joints[3] = pos->a;
   joints[5] = pos->c;
   joints[6] = pos->u;
   

   return 0;
}
I can't try this for a few days, but want to see if it looks right. I only changed the stuff here, I laft the rest of the file as it were. The goal is to be able to set or clear a hal pin and have my V,W joints act as slaves to Y.Z.

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

More
28 Jul 2013 06:42 #37112 by andypugh
Replied by andypugh on topic on the fly config

   pos->tran.y = joints[1];
   pos->tran.y = joints[7];
   pos->tran.z = joints[2];
   pos->tran.z = joints[8];


That has to be wrong.

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

Time to create page: 0.370 seconds
Powered by Kunena Forum