rendered paste bodyIndex: src/emc/task/emccanon.cc
===================================================================
RCS file: /cvs/emc2/src/emc/task/emccanon.cc,v
retrieving revision 1.86
diff -u -r1.86 emccanon.cc
--- src/emc/task/emccanon.cc 11 Jun 2007 00:46:29 -0000 1.86
+++ src/emc/task/emccanon.cc 11 Jun 2007 01:46:46 -0000
@@ -655,6 +655,46 @@
see_segment(x, y, z, a, b, c);
}
+
+void RIGID_TAP(double x, double y, double z)
+{
+ double ini_maxvel, vel, acc;
+ EMC_TRAJ_RIGID_TAP rigidTapMsg;
+
+ // convert to mm units
+ x = FROM_PROG_LEN(x);
+ y = FROM_PROG_LEN(y);
+ z = FROM_PROG_LEN(z);
+
+ x += programOrigin.x;
+ y += programOrigin.y;
+ z += programOrigin.z;
+
+ x += currentXToolOffset;
+ z += currentZToolOffset;
+
+ rigidTapMsg.pos.tran.x = TO_EXT_LEN(x);
+ rigidTapMsg.pos.tran.y = TO_EXT_LEN(y);
+ rigidTapMsg.pos.tran.z = TO_EXT_LEN(z);
+
+ ini_maxvel = vel = getStraightVelocity(x, y, z, canonEndPoint.a, canonEndPoint.b, canonEndPoint.c);
+ if (vel > currentLinearFeedRate) {
+ vel = currentLinearFeedRate;
+ }
+ acc = getStraightAcceleration(x, y, z, canonEndPoint.a, canonEndPoint.b, canonEndPoint.c);
+
+ rigidTapMsg.vel = toExtVel(vel);
+ rigidTapMsg.ini_maxvel = toExtVel(ini_maxvel);
+ rigidTapMsg.acc = toExtAcc(acc);
+
+ flush_segments();
+
+ interp_list.append(rigidTapMsg);
+ canonUpdateEndPoint(canonEndPoint.x, canonEndPoint.y, canonEndPoint.z,
+ canonEndPoint.a, canonEndPoint.b, canonEndPoint.c);
+}
+
+
/*
STRAIGHT_PROBE is exactly the same as STRAIGHT_FEED, except that it
uses a probe message instead of a linear move message.
@@ -1124,12 +1164,12 @@
if(css_maximum) {
if(lengthUnits == CANON_UNITS_INCHES)
- css_numerator = 12 / (2 * M_PI) * spindleSpeed;
+ css_numerator = 12 / (2 * M_PI) * spindleSpeed * TO_EXT_LEN(25.4);
else
- css_numerator = 1000 / (2 * M_PI) * spindleSpeed;
+ css_numerator = 1000 / (2 * M_PI) * spindleSpeed * TO_EXT_LEN(1);
emc_spindle_on_msg.speed = css_maximum;
emc_spindle_on_msg.factor = css_numerator;
- emc_spindle_on_msg.xoffset = currentXToolOffset;
+ emc_spindle_on_msg.xoffset = TO_EXT_LEN(currentXToolOffset);
} else {
emc_spindle_on_msg.speed = spindleSpeed;
css_numerator = 0;
@@ -1152,7 +1192,7 @@
css_numerator = -1000 / (2 * M_PI) * spindleSpeed;
emc_spindle_on_msg.speed = css_maximum;
emc_spindle_on_msg.factor = css_numerator;
- emc_spindle_on_msg.xoffset = currentXToolOffset;
+ emc_spindle_on_msg.xoffset = TO_EXT_LEN(currentXToolOffset);
} else {
emc_spindle_on_msg.speed = -spindleSpeed;
css_numerator = 0;
@@ -1242,7 +1282,7 @@
EMC_SPINDLE_ON emc_spindle_on_msg;
emc_spindle_on_msg.speed = css_maximum;
emc_spindle_on_msg.factor = css_numerator;
- emc_spindle_on_msg.xoffset = currentXToolOffset;
+ emc_spindle_on_msg.xoffset = TO_EXT_LEN(currentXToolOffset);
interp_list.append(emc_spindle_on_msg);
}
interp_list.append(set_offset_msg);