on the fly config
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.
Please Log in or Create an account to join the conversation.
That probably makes it easier, there is no PID controller trying to fight you.This is a stepper setup
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.
Please Log in or Create an account to join the conversation.
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.
Please Log in or Create an account to join the conversation.
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 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.
Please Log in or Create an account to join the conversation.
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.
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.
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;
}
Please Log in or Create an account to join the conversation.
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.