modify rotatekins for inclined planes

More
28 Oct 2014 19:17 - 28 Oct 2014 19:18 #52493 by alan_3301
I am looking for a solution in linuxcnc to machine inclined planes with only XY moves, so that the Z axis is changed to follow the angle of the plane.
I am thinking of using a manually indexed B axis, to machine some angled planes on a part.
Right now I use a tapered ballnose bit and a small stepover, while it works, it takes forever.
If I could rotate my spindle in B axis, and program XY moves for the surface, it would be much quicker.

I would like to modify rotatekins so that it rotates the XY plane around the Y axis by B axis degrees.

I do not know trig, so would appreciate it if someone could check my work.
I basically put X and Y kinematics back to normal, and changed Z to match how Y was in rotatekins.
Am I way off, or is it this simple?
int kinematicsForward(const double *joints,
EmcPose * pos,
const KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)
{
double b_rad = -joints[4]*M_PI/180;
pos->tran.x = joints[0];
pos->tran.y = joints[1];
pos->tran.z = joints[2] * sin(b_rad) + joints[1] * cos(b_rad);
pos->a = joints[3];
pos->b = joints[4];
pos->c = joints[5];
pos->u = joints[6];
pos->v = joints[7];
pos->w = joints[8];
return 0;
}
int kinematicsInverse(const EmcPose * pos,
double *joints,
const KINEMATICS_INVERSE_FLAGS * iflags,
KINEMATICS_FORWARD_FLAGS * fflags)
{
double b_rad = pos->b*M_PI/180;
joints[0] = pos->tran.x;
joints[1] = pos->tran.x;
joints[2] = pos->tran.z * sin(b_rad) + pos->tran.y * cos(b_rad);
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;
}
Last edit: 28 Oct 2014 19:18 by alan_3301.

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

Time to create page: 0.059 seconds
Powered by Kunena Forum