task: disallow task mode change if jogging
Realtime mpg (wheel) jogging is not controlled through task, so task must detect jogging status provided by motion to disallow a task mode change Ref: https://forum.linuxcnc.org/24-hal-components/45991-jogwheel-start-of-any-gcode-motion-causes-following-error#243898
This commit is contained in:
parent
35c8b4817d
commit
87f66feaf4
7 changed files with 38 additions and 1 deletions
|
|
@ -302,6 +302,27 @@ void emcmotController(void *arg, long period)
|
|||
prototypes"
|
||||
*/
|
||||
|
||||
bool axis_jog_is_active(void)
|
||||
{
|
||||
int n;
|
||||
for (n = 0; n < EMCMOT_MAX_AXIS; n++) {
|
||||
if ( (&axes[n])->kb_ajog_active || (&axes[n])->wheel_ajog_active) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool joint_jog_is_active(void)
|
||||
{
|
||||
int n;
|
||||
for (n = 0; n < EMCMOT_MAX_JOINTS; n++) {
|
||||
if ( (&joints[n])->kb_jjog_active || (&joints[n])->wheel_jjog_active) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
static void process_inputs(void)
|
||||
{
|
||||
int joint_num, spindle_num;
|
||||
|
|
@ -2166,6 +2187,8 @@ static void update_status(void)
|
|||
/* check to see if we should pause in order to implement
|
||||
single emcmotDebug->stepping */
|
||||
|
||||
emcmotStatus->jogging_active = axis_jog_is_active()
|
||||
|| joint_jog_is_active();
|
||||
if (emcmotDebug->stepping && emcmotDebug->idForStep != emcmotStatus->id) {
|
||||
tpPause(&emcmotDebug->coord_tp);
|
||||
emcmotDebug->stepping = 0;
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ to another.
|
|||
#include "kinematics.h"
|
||||
#include "simple_tp.h"
|
||||
#include "rtapi_limits.h"
|
||||
#include "rtapi_bool.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
|
||||
|
|
@ -738,7 +739,7 @@ Suggestion: Split this in to an Error and a Status flag register..
|
|||
unsigned char tail; /* flag count for mutex detect */
|
||||
int external_offsets_applied;
|
||||
EmcPose eoffset_pose;
|
||||
|
||||
bool jogging_active;
|
||||
} emcmot_status_t;
|
||||
|
||||
/*********************************
|
||||
|
|
|
|||
|
|
@ -1222,6 +1222,7 @@ class EMC_MOTION_STAT:public EMC_MOTION_STAT_MSG {
|
|||
int on_soft_limit;
|
||||
int external_offsets_applied;
|
||||
EmcPose eoffset_pose;
|
||||
bool jogging_active;
|
||||
};
|
||||
|
||||
// declarations for EMC_TASK classes
|
||||
|
|
|
|||
|
|
@ -231,6 +231,11 @@ int emcTaskSetMode(int mode)
|
|||
{
|
||||
int retval = 0;
|
||||
|
||||
if (jogging_is_active()) {
|
||||
emcOperatorError(0, "Ignoring task mode change while jogging");
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (mode) {
|
||||
case EMC_TASK_MODE_MANUAL:
|
||||
// go to manual mode
|
||||
|
|
|
|||
|
|
@ -154,6 +154,10 @@ int all_homed(void) {
|
|||
return 1;
|
||||
}
|
||||
|
||||
bool jogging_is_active(void) {
|
||||
return emcStatus->motion.jogging_active;
|
||||
}
|
||||
|
||||
void emctask_quit(int sig)
|
||||
{
|
||||
// set main's done flag
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ extern int emcRunHalFiles(const char *filename);
|
|||
|
||||
// Returns 0 if all joints are homed, 1 if any joints are un-homed.
|
||||
int all_homed(void);
|
||||
bool jogging_is_active(void);
|
||||
|
||||
int emcTaskInit();
|
||||
int emcTaskHalt();
|
||||
|
|
|
|||
|
|
@ -1968,6 +1968,8 @@ int emcMotionUpdate(EMC_MOTION_STAT * stat)
|
|||
stat->analog_output[aio] = emcmotStatus.analog_output[aio];
|
||||
}
|
||||
|
||||
stat->jogging_active = emcmotStatus.jogging_active;
|
||||
|
||||
// set the status flag
|
||||
error = 0;
|
||||
exec = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue