diff --git a/src/emc/motion/control.c b/src/emc/motion/control.c index 9c10369b51f..0b62691c942 100644 --- a/src/emc/motion/control.c +++ b/src/emc/motion/control.c @@ -1194,7 +1194,19 @@ static void set_operating_mode(void) /* check entering free space mode */ if (!emcmotInternal->coordinating && GET_MOTION_COORD_FLAG()) { - if (GET_MOTION_INPOS_FLAG()) { + /* in position is the planner's; the joints follow it through + the cubics and come to rest a few cycles later. Taking + pos_cmd before that leaves them short of the end. A moving + external offset never rests, so it does not hold this up. */ + int at_rest = 1; + for (joint_num = 0; joint_num < NO_OF_KINS_JOINTS; joint_num++) { + CUBIC_STRUCT *cu = &joints[joint_num].cubic; + if (cu->x0 != cu->x3 || cu->x1 != cu->x3 || cu->x2 != cu->x3) { + at_rest = 0; + } + } + if (GET_MOTION_INPOS_FLAG() + && (at_rest || hal_get_bool(emcmot_hal_data->eoffset_active))) { for (joint_num = 0; joint_num < ALL_JOINTS; joint_num++) { /* point to joint data */ joint = &joints[joint_num]; diff --git a/src/emc/usr_intf/gscreen/gscreen.py b/src/emc/usr_intf/gscreen/gscreen.py index 3388bdb7ab6..593f1b1700d 100755 --- a/src/emc/usr_intf/gscreen/gscreen.py +++ b/src/emc/usr_intf/gscreen/gscreen.py @@ -636,7 +636,7 @@ def __init__(self): units=self.inifile.find("AXIS_X","UNITS") if units==None: self.add_alarm_entry(_("No UNITS entry found in [TRAJ] or [AXIS_X] of INI file")) - units = inifile.maplinearunits(units, fallback=1.0) + units = self.inifile.maplinearunits(units, fallback=1.0) if 1.0 == units: self.machine_units_mm=1 conversion=axis_kinds.unit_factors(self.inifile, 1.0/25.4)