Knee mill table height; external offset or something else?

More
02 Nov 2023 07:17 #284302 by m0602232
Hi everybody!

I have an old Bridgeport Interact CNC retrofitted to Linuxcnc. Since quill traverse is only 127mm I would want to include linear encoder measuring table height. Table height is adjusted manually.

I did set it up using external offset and it seems to be working but what concerns me is the manual:
"When teleop jogging with external offsets enabled and non-zero values applied, encountering a soft
limit will stop motion in the offending axis without a deacceleration interval. Similarly, during
coordinated motion with external offsets enabled, reaching a soft limit will stop motion with no deac-
celeration phase. For this case, it does not matter if the offsets are zero."

Is there any other way to include table height encoder? It's basically only needed after tool changes when using long drillbits etc.

Any ideas will be appreciated, thanks!

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

More
02 Nov 2023 11:39 #284315 by andypugh
You could just add the two encoders together before passing the result to the position feedback, but that would lead to problems with homing and joint limits.

The best answer is probably to use a custom kinematics module where Z is the sum of the two joint positions, but then the joints can home independently and have separate travel limits.

I am guessing that this is a manually-opearted knee?

Take a look at the very old trivkins before it learned about tandem axes, a kinematics module can be pretty simple:
github.com/LinuxCNC/linuxcnc/blob/2.7/sr...inematics/trivkins.c
Basically two functions, one to convert joint to axis, and one to convert axis to joint.

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

More
02 Nov 2023 11:40 #284316 by andypugh
You could just add the two encoders together before passing the result to the position feedback, but that would lead to problems with homing and joint limits.

The best answer is probably to use a custom kinematics module where Z is the sum of the two joint positions, but then the joints can home independently and have separate travel limits.

I am guessing that this is a manually-opearted knee?

Take a look at the very old trivkins before it learned about tandem axes, a kinematics module can be pretty simple:
github.com/LinuxCNC/linuxcnc/blob/2.7/sr...inematics/trivkins.c
Basically two functions, one to convert joint to axis, and one to convert axis to joint.

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

More
02 Nov 2023 11:53 #284318 by m0602232
I thought about adding the encoders together but as far as I see it would be impossible to use because of joint limits being incorrect as you also stated.

Manually operated knee yes, originally there is no encoder but it is really inconvenient to use as is.

I will take a look at the link and will be back with even more questions i'm afraid :D , thank you!

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

More
04 Nov 2023 13:26 #284526 by m0602232
So I managed to link both encoders to Z-axis with custom kinematics module or at least the dro value changes correspondingly. The axis does not move when the table encoder is moved, it can be linked in HAL (sum2 joint.8.motor-pos-fb => joint.2.motor-pos-cmd) but then following error calculations go wrong.

Is there something else I can try? I dont completely understand how the kinematics module should be affecting joint outputs so there might be something wrong also.

File Attachment:

File Name: customkins.c
File Size:2 KB
Attachments:

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

More
22 Nov 2023 07:25 #286212 by m0602232
Progress, I think.

Kinematics module now connects two joints to an axis but there is some sort of issue. Forgot to take screenshot of halscope but when the knee is moved, velocity command of joint2 is full of extremely sharp spikes which causes pid to oscillate. In other words acceleration and max.speed limits are ignored. How should trajectory planner be involved in this kind of case? Could there be a way to smoothen the table encoder input before kinematics module? Any other ideas?
Thanks in advance.

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

More
22 Nov 2023 20:12 - 22 Nov 2023 20:42 #286268 by Aciera
Are you still using the same kinematic you posted above?
 
Last edit: 22 Nov 2023 20:42 by Aciera.

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

More
23 Nov 2023 15:26 #286330 by m0602232
Not the same, something like:

static double pos3 = 0;
int kinematicsForward(const double joints,
EmcPose pos,
const KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)

{

pos->tran.x = joints[0];
pos->tran.y = joints[1];
pos->tran.z = joints[2] + joints[3];
pos3 = joints[3];
pos->a = joints[3];
pos->b = 0;
pos->c = 0;
pos->u = 0;
pos->v = 0;
pos->w = 0;

return 0;
}

int kinematicsInverse(const EmcPose * pos,
double joints,
const KINEMATICS_INVERSE_FLAGS iflags,
KINEMATICS_FORWARD_FLAGS * fflags)

{

joints[0] = pos->tran.x;
joints[1] = pos->tran.y;
joints[2] = pos->tran.z - pos3;
joints[3] = pos->a;
joints[4] = pos->b;
joints[5] = pos->c;
joints[6] = pos->u;
joints[7] = pos->v;
joints[8] = pos->w;

return 0;

}

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

More
23 Nov 2023 15:44 #286334 by Aciera
Not sure but what is the purpose of the variable 'pos3'?

I would have tried something like this:

int kinematicsForward(const double joints,
EmcPose pos,
const KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)

{

pos->tran.x = joints[0];
pos->tran.y = joints[1];
pos->tran.z = joints[2] + joints[3];
pos->a = joints[3];
pos->b = 0;
pos->c = 0;
pos->u = 0;
pos->v = 0;
pos->w = 0;

return 0;
}

int kinematicsInverse(const EmcPose * pos,
double joints,
const KINEMATICS_INVERSE_FLAGS iflags,
KINEMATICS_FORWARD_FLAGS * fflags)

{

joints[0] = pos->tran.x;
joints[1] = pos->tran.y;
joints[2] = pos->tran.z - pos->a;
joints[3] = pos->a;
joints[4] = pos->b;
joints[5] = pos->c;
joints[6] = pos->u;
joints[7] = pos->v;
joints[8] = pos->w;

return 0;

}

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

More
23 Nov 2023 17:46 #286349 by tightmopedman9
This is something I've wanted to do on my knee mill as well. Finding the correct table height to run a program using both jobber twist drills and short end mills can be a pain. If you do decide to run such programs in one program it leads to a loss in rigidity from doing some cutting with the quill almost fully extended.

How I was thinking of accomplishing this is by changing the tool length offset when the height of the knee changes. What would be nice is a prompt after a tool change that requests a knee height adjustment to target minimum quill length extension. I was thinking you could do this with a Python script that processes an ngc. The script would look at the minimum Z height for a given tool, then replace the M6 with an O code routine. The O code routine would prompt the user 'Adjust Knee Height X Length, Press Resume After Adjustment' then check the new knee position and if within range, issue a G10 L10 (set tool table) for the entire tool table.

This solution would be a bit clunky, as you'd have to run the script on every file you post to the machine, unless you can integrate this feature into your post processor. Also, adjusting the entire tool table can be slow - I have 12 in mine, and rewriting all of them from a script takes ~20 seconds (from memory). It would probably be quicker to do a G10 L2 (set coordinate system) instead, but the problem with this (I think) is that your tool length offsets would be invalid after exiting an ngc.

Can you provide details and/or pictures on how you mounted your linear encoder and wired it to your controller?

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

Time to create page: 0.111 seconds
Powered by Kunena Forum