2011/7/26 Dave <[email protected]>:
>>
> I was thinking that moving both tables to the same position might be a
> problem, but now I am thinking that might be the simplest solution.
I do not see a problem here. Just one line in g-code like this:
G0 X10 U10
Put whatever coordinate is most convenient.
> If I did that change in the kinematics module, would both axes have to
> be in the same position to make an axis swap?
Yes, initial suggestion wants X and U to be equal.
To treat the different positions of X and U during the switching over,
I like Andy's suggestion about using limit3 component. I tried to come
up with a solution to implement it in kinematics calcs, but could not
overcome all the obstacles.
So this option requires You to bring X and U to the same position,
when switching them over.
Here is my "remix" of trivkins (if You want to change its name, simply
replace the name through the file):
/********************************************************************
* Description: trivkins.c
* Trivial kinematics for 3 axis Cartesian machine
* It is modified to allow switch joints between X and U
* axes with a dedicated HAL pin
*
* Derived from a work by Fred Proctor & Will Shackleford
*
* Author:
* License: GPL Version 2
* System: Linux
*
* Copyright (c) 2004 All rights reserved.
*
* Last change: 2011
********************************************************************/
#include "kinematics.h" /* these decls */
struct haldata_t {
hal_float_t *change;
} *haldata = 0;
#define change (*(haldata->change))
int kinematicsForward(const double *joints,
EmcPose * pos,
const KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)
{
if(change == 1) {
pos->tran.x = joints[6];
pos->u = joints[0];
} else {
pos->tran.x = joints[0];
pos->u = joints[6];
}
pos->tran.y = joints[1];
pos->tran.z = joints[2];
pos->a = joints[3];
pos->b = joints[4];
pos->c = joints[5];
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)
{
if(change == 1) {
joints[6] = pos->tran.x;
joints[0] = pos->u;
} else {
joints[0] = pos->tran.x;
joints[6] = pos->u;
}
joints[1] = pos->tran.y;
joints[2] = pos->tran.z;
joints[3] = pos->a;
joints[4] = pos->b;
joints[5] = pos->c;
joints[7] = pos->v;
joints[8] = pos->w;
return 0;
}
/* implemented for these kinematics as giving joints preference */
int kinematicsHome(EmcPose * world,
double *joint,
KINEMATICS_FORWARD_FLAGS * fflags,
KINEMATICS_INVERSE_FLAGS * iflags)
{
*fflags = 0;
*iflags = 0;
return kinematicsForward(joint, world, fflags, iflags);
}
KINEMATICS_TYPE kinematicsType()
{
return KINEMATICS_IDENTITY;
}
#include "rtapi.h" /* RTAPI realtime OS API */
#include "rtapi_app.h" /* RTAPI realtime module decls */
#include "hal.h"
EXPORT_SYMBOL(kinematicsType);
EXPORT_SYMBOL(kinematicsForward);
EXPORT_SYMBOL(kinematicsInverse);
MODULE_LICENSE("GPL");
static int comp_id;
int rtapi_app_main(void) {
int result;
comp_id = hal_init("trivkins");
if(comp_id < 0)
return comp_id;
haldata = hal_malloc(sizeof(struct haldata_t));
result = hal_pin_float_new("trivkins.change", HAL_IN,
&(haldata->change), comp_id);
if(result < 0) goto error;
hal_ready(comp_id);
return 0;
error:
hal_exit(comp_id);
return result;
}
void rtapi_app_exit(void) { hal_exit(comp_id); }
------------------------------------------------------------------------------
Magic Quadrant for Content-Aware Data Loss Prevention
Research study explores the data loss prevention market. Includes in-depth
analysis on the changes within the DLP market, and the criteria used to
evaluate the strengths and weaknesses of these DLP solutions.
http://www.accelacomm.com/jaw/sfnl/114/51385063/
_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users