Skip to content

Commit a46e735

Browse files
committed
motion: fix for trivkins duplicate coordinate jogs
tldr: no *joint* jog if negative home_sequence Problem Statement: ------------------ Using the trivkins kinematics module with duplicated coordinates is useful for a gantry using two motors to move a single axis because it allows synchronization of the final homing move for the joints involved. However, use of duplicated coordinate letters creates problems that are dependent on the kinematics type (as defined by the trivkins module kinstype= parameter) and gui conventions: 1) Using kinstype=1 (KINEMATICS_IDENTITY the default) creates numerous problems with the axis gui because it always hides the distinctions of joints and axes for IDENTITY kinematics. Restrictions include: a) An axis with duplicated coordinate letters cannot be homed individually (Home-all must be used) b) Prior to homing, jogging a duplicated coordinate will move only one of the joints used for the duplicated coordinate letter. 2) Using kinstype=B (KINEMATICS_BOTH) clearly distinguishes joints and axes and clarifies the need to HOME the machine before operating in world coordinates for conventional cartesian jogging and execution of mdi commands and gcode programs. But -- unwary operators may jog one of the joints used for a duplicated coordinate letter excessively and rack the machine prior to homing. Solution: --------- a) For any kinematics type, disable joint jogging for a joint when it uses a negative [JOINT_n]HOME_SEQUENCE to synchronize the final homing moves on related joints. b) For KINEMATICS_BOTH, a request to jog a joint with a negative HOME_SEQUENCE causes motion to report an error. b) For KINEMATICS_IDENTITY, a request to jog a joint with a negative HOME_SEQUENCE causes motion to reports an error and suggests the requirement to Home the machine With this change, gantry users can be encouraged to use KINEMATICS_BOTH since the problem of racking is eliminated with the use of negative HOME_SEQUENCE on synchronized joints.
1 parent 3a4dde2 commit a46e735

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

docs/src/config/ini-homing.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,11 @@ with a synchronized final move*. If the HOME_SEQUENCE value is
191191
zero or positive, a command to home the joint will home only the
192192
specified joint.
193193

194+
Joint mode jogging of joints having a negative HOME_SEQUENCE is
195+
disallowed. In common gantry applications, such jogging can lead
196+
to misalignment (racking). Note that conventional jogging in
197+
world coordinates is always available once a machine is homed.
198+
194199
Examples for a 3 joint system
195200

196201
Two sequences (0,1), no synchronization

docs/src/getting-started/updating-linuxcnc.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,4 +1074,11 @@ Support connection of 'halui.mode.is-teleop' to 'pendant_util.amux-enable' via
10741074
the signal 'pendant:amux-enable'. This change allows homing and joint mode
10751075
jogging to occur at normal (not reduced) acceleration settings.
10761076

1077+
=== Negative [JOINT_n]HOME_SEQUENCE
1078+
1079+
Joints using a negative HOME_SEQUENCE are not allowed to jog in joint
1080+
mode in order to prevent misalignment (racking) in common gantry
1081+
configurations. As always, machines with any kinematics type must be
1082+
homed prior to enabling conventional world mode jogging.
1083+
10771084
// vim: set syntax=asciidoc:

src/emc/motion/command.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,25 @@ void emcmotCommandHandler(void *arg, long period)
480480

481481
if (joint_num >= 0 && joint_num < emcmotConfig->numJoints) {
482482
joint = &joints[joint_num];
483+
if ( ( emcmotCommand->command == EMCMOT_JOG_CONT
484+
|| emcmotCommand->command == EMCMOT_JOG_INCR
485+
|| emcmotCommand->command == EMCMOT_JOG_ABS
486+
)
487+
&& !(GET_MOTION_TELEOP_FLAG())
488+
&& (joint->home_sequence < 0)
489+
) {
490+
if (emcmotConfig->kinType == KINEMATICS_IDENTITY) {
491+
rtapi_print_msg(RTAPI_MSG_ERR,
492+
"Homing is REQUIRED to jog requested coordinate\n"
493+
"because joint (%d) in home_sequence is negative (%d)\n"
494+
,joint_num,joint->home_sequence);
495+
} else {
496+
rtapi_print_msg(RTAPI_MSG_ERR,
497+
"Cannot jog joint %d because home_sequence is negative (%d)\n"
498+
,joint_num,joint->home_sequence);
499+
}
500+
return;
501+
}
483502
}
484503
if (axis_num >= 0 && axis_num < EMCMOT_MAX_AXIS) {
485504
axis = &axes[axis_num];

src/emc/motion/control.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,8 @@ static void handle_jjogwheels(void)
862862
/* if joint is not active, skip it */
863863
continue;
864864
}
865+
866+
865867
/* get counts from jogwheel */
866868
new_jjog_counts = *(joint_data->jjog_counts);
867869
delta = new_jjog_counts - joint->old_jjog_counts;
@@ -907,6 +909,19 @@ static void handle_jjogwheels(void)
907909
reportError("Can't wheel jog locking joint_num=%d",joint_num);
908910
continue;
909911
}
912+
if (joint->home_sequence < 0) {
913+
if (emcmotConfig->kinType == KINEMATICS_IDENTITY) {
914+
rtapi_print_msg(RTAPI_MSG_ERR,
915+
"Homing is REQUIRED to wheel jog requested coordinate\n"
916+
"because joint (%d) in home_sequence is negative (%d)\n"
917+
,joint_num,joint->home_sequence);
918+
} else {
919+
rtapi_print_msg(RTAPI_MSG_ERR,
920+
"Cannot wheel jog joint %d because home_sequence is negative (%d)\n"
921+
,joint_num,joint->home_sequence);
922+
}
923+
continue;
924+
}
910925
/* calculate distance to jog */
911926
distance = delta * *(joint_data->jjog_scale);
912927
/* check for joint already on hard limit */

0 commit comments

Comments
 (0)