Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
0c78343
tests: record what the task planner does with every command
rene-dev Nov 10, 2026
f0f1fb9
task: hand emcTaskPlan() the new command
rene-dev Nov 10, 2026
6b8923c
task: one list of immediate commands for the planner tables
rene-dev Nov 10, 2026
435b2fd
nml: remove seven commands nothing in the tree sends
rene-dev Nov 16, 2026
bd7c03d
task: remove the MDI input queue nothing appends to, and what is left…
rene-dev Nov 16, 2026
07f2e47
task: the message pointers of emcTaskIssueCommand() are locals
rene-dev Nov 16, 2026
ddc4f35
task: one table for what a queued command waits for, before and after
rene-dev Nov 16, 2026
7bd99f0
task: the planner is one switch instead of seven nested ones
rene-dev Nov 16, 2026
5814349
motion: remove EMCMOT_JOG_ABS, which nothing sends any more
rene-dev Nov 16, 2026
2b89446
tests: remove the task planner table and its probe
rene-dev Nov 17, 2026
4b6a355
task: export halui's status pins that motion and iocontrol lack
rene-dev Nov 10, 2026
6fd0a7b
task: halui's command pins, as task-internal commands
rene-dev Nov 10, 2026
0f078b0
task: the halui pins whose iocontrol counterpart differs
rene-dev Nov 10, 2026
5468a83
tests: task-hal, one test for task's input and status pins
rene-dev Dec 5, 2026
7060e2b
docs: task's HAL pins
rene-dev Dec 5, 2026
7eb00c6
jog while paused, and return to the paused position on resume
rene-dev Nov 17, 2026
c9e1918
GStat, qtvcp, gladevcp: jog and spindle while paused
rene-dev Oct 18, 2026
8a37431
gmoccapy: jog while paused
rene-dev Oct 18, 2026
2a0cec0
touchy, gscreen: jog while paused
rene-dev Oct 18, 2026
22c9bd8
qtvcp screens: keyboard jog while paused
rene-dev Oct 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ def launch_log_dialog(self):
# keyboard jogging from key binding calls
# double the rate if fast is true
def kb_jog(self, state, joint, direction, fast = False, linear = True):
if not STATUS.is_man_mode() or not STATUS.machine_is_on():
if not STATUS.is_jog_ok():
return
if linear:
distance = STATUS.get_jog_increment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1428,8 +1428,9 @@ def touchoff_error(self, data):
self.add_status(data, CRITICAL)

def kb_jog(self, state, joint, direction, fast = False, linear = True):
ACTION.SET_MANUAL_MODE()
if not STATUS.is_man_mode() or not STATUS.machine_is_on():
if not STATUS.is_pause_jog_ok():
ACTION.SET_MANUAL_MODE()
if not STATUS.is_jog_ok():
self.add_status('Machine must be ON and in Manual mode to jog', CRITICAL)
return
if linear:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def processed_key_event__(self,receiver,event,is_pressed,key,code,shift,cntrl):
# keyboard jogging from key binding calls
# double the rate if fast is true
def kb_jog(self, state, joint, direction, fast = False, linear = True):
if not STATUS.is_man_mode() or not STATUS.machine_is_on():
if not STATUS.is_jog_ok():
return
if linear:
distance = STATUS.get_jog_increment()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1334,7 +1334,7 @@ def touchoff(self, selector):
self.add_status("Touchoff routine is already running", CRITICAL)

def kb_jog(self, state, joint, direction, fast = False, linear = True):
if not STATUS.is_man_mode() or not STATUS.machine_is_on():
if not STATUS.is_jog_ok():
self.add_status('Machine must be ON and in Manual mode to jog', CRITICAL)
return
if linear:
Expand Down
2 changes: 1 addition & 1 deletion configs/sim/woodpecker/woodpecker_/woodpecker_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ def touchoff(self, selector):
ACTION.CALL_MDI("G90")

def kb_jog(self, state, joint, direction, fast = False, linear = True):
if not STATUS.is_man_mode() or not STATUS.machine_is_on():
if not STATUS.is_jog_ok():
self.add_status('Machine must be ON and in Manual mode to jog')
return
if linear:
Expand Down
31 changes: 0 additions & 31 deletions docs/src/code/code-notes.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -638,37 +638,6 @@ planner accelerates at the joint accel limit at the beginning of the
move, and will decelerate at the joint accel limit to stop at the
target position.

=== JOG_ABS

The JOG_ABS command initiates an absolute jog on a single joint. An
absolute jog is a simple move to a specific location, in joint
coordinates. Normally absolute jogs stop when they reach the desired
location, however they also stop when they hit a limit, or on an ABORT
command.

==== Requirements

The command handler will silently reject the JOG_ABS command if
machine is not in free mode, or if any joint is in motion
(GET_MOTION_INPOS_FLAG() == FALSE), or if motion is not enabled. It
will also silently ignore the command if the joint is already at or
beyond its limit and the commanded jog would make it worse.

==== Results

The free mode trajectory planner for the joint identified by
emcmotCommand\->axis is activated, the target position is set to
emcmotCommand\->offset, and the velocity limit is set to
emcmotCommand\->vel. The free mode trajectory planner will generate a
smooth trapezoidal move from the present position to the target
position. The planner can correctly handle changes in the target
position that happen while the move is in progress. If multiple JOG_ABS
commands are issued in quick succession, each new command changes the
target position and the machine goes to the final commanded position.
The free mode planner accelerates at the joint accel limit at the
beginning of the move, and will decelerate at the joint accel limit to
stop at the target position.

=== SET_LINE

The SET_LINE command adds a straight line to the trajectory planner
Expand Down
7 changes: 0 additions & 7 deletions docs/src/code/nml-messages.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,8 @@ EMC_JOINT_SET_JOINT_TYPE
EMC_JOINT_SET_UNITS_TYPE
EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE
EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE
EMC_JOINT_SET_FERROR_TYPE
EMC_JOINT_SET_HOMING_PARAMS_TYPE
EMC_JOINT_SET_MIN_FERROR_TYPE
EMC_JOINT_SET_MAX_VELOCITY_TYPE
EMC_JOINT_INIT_TYPE
EMC_JOINT_HALT_TYPE
EMC_JOINT_ABORT_TYPE
EMC_JOINT_ENABLE_TYPE
EMC_JOINT_DISABLE_TYPE
Expand All @@ -56,7 +52,6 @@ EMC_AXIS_STAT_TYPE
----
EMC_JOG_CONT_TYPE
EMC_JOG_INCR_TYPE
EMC_JOG_ABS_TYPE
EMC_JOG_STOP_TYPE
----

Expand All @@ -68,8 +63,6 @@ EMC_TRAJ_SET_AXES_TYPE
EMC_TRAJ_SET_UNITS_TYPE
EMC_TRAJ_SET_CYCLE_TIME_TYPE
EMC_TRAJ_SET_MODE_TYPE
EMC_TRAJ_SET_VELOCITY_TYPE
EMC_TRAJ_SET_ACCELERATION_TYPE
EMC_TRAJ_SET_MAX_VELOCITY_TYPE
EMC_TRAJ_SET_MAX_ACCELERATION_TYPE
EMC_TRAJ_SET_SCALE_TYPE
Expand Down
3 changes: 3 additions & 0 deletions docs/src/config/ini-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,9 @@ Finally, no amount of tweaking will speed up a tool path with lots of small, tig
* `MAX_LINEAR_VELOCITY = 5.0` - (((MAX VELOCITY))) The maximum velocity for any axis or coordinated move, in 'machine units' per second.
The value shown equals 300 units per minute.
* `MAX_LINEAR_ACCELERATION = 20.0` - (((MAX ACCELERATION))) The maximum acceleration for any axis or coordinated axis move, in 'machine units' per second per second.
* `PAUSE_RETURN_LAST = Z` - (((PAUSE RETURN LAST))) The axes that return last when a paused program or MDI command resumes after jogs while paused.
The other axes return to the paused position first, together in a straight line, then these, so by default the tool comes down onto the point last.
Empty: all axes return in one straight line. The return runs at the axis velocity and acceleration limits.
* `PLANNER_TYPE = 0` - (((PLANNER TYPE))) Selects the trajectory planner type: 0 = trapezoidal (default), 1 = S-curve with jerk limiting.
S-curve planning is only active when `PLANNER_TYPE = 1` AND `MAX_LINEAR_JERK` is 1.0
or above; a smaller value falls back to trapezoidal, with an operator message.
Expand Down
14 changes: 14 additions & 0 deletions docs/src/config/python-interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,20 @@ see <<python:reading-ini-values,ReadingINI file values>> for an example.
*paused*:: '(returns boolean)' -
`motion paused` flag.

*pause_jog_ok*:: '(returns boolean)' -
a pause has stopped the motion of a program or MDI command: axes may
jog, see `pause_offset`.

*pause_offset*:: '(returns tuple of floats)' -
how far jogs while paused have moved each axis off the paused position.
Resume (or step) brings them back to zero first: the spindles and the
coolant as they were at the pause, the spindles at speed, the axes other
than `[TRAJ]PAUSE_RETURN_LAST` in a straight line, then those, then the
program goes on. An abort keeps the machine where it was jogged to.

*pause_returning*:: '(returns boolean)' -
resuming after a pause: spindles, back to the paused position, then on.

*single_stepping*:: '(returns boolean)' -
`motion single_stepping` flag.

Expand Down
34 changes: 34 additions & 0 deletions docs/src/getting-started/updating-linuxcnc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,40 @@ unsigned (uint) to signed (sint) because the actual value written is a signed
quantity. Otherwise, any negative values would become very large numbers. Any
configuration using it needs to update the HAL type.

=== Jogging while paused

Axes can now be jogged, by keyboard, halui, linuxcncrsh or a wheel, while
a program or MDI command is paused, including at M0 and M1, once the pause
has stopped the motion. Joints cannot. On resume (or step) LinuxCNC first:

. puts the spindles and the coolant back as they were at the pause, and
waits for the spindles to be at speed;
. returns the axes to the paused position: the axes other than
`[TRAJ]PAUSE_RETURN_LAST` (default `Z`) together in a straight line,
then those, at the axis limits;
. goes on with the program.

Pausing again during the return stops it; the axes can be jogged again
from there. An abort keeps the machine where it was jogged to. Reverse
run is refused while the axes are away from the paused position.

AXIS, gmoccapy, gscreen, touchy and the QtVCP screens (except QtPlasmaC,
which keeps its own cut recovery) enable their jog and spindle controls
while paused. Custom screens and handler files that allow jogs only in
manual mode should check the new GStat functions instead:

* `is_jog_ok()`: the machine is on and in manual mode, or a pause has
stopped the motion (`stat.pause_jog_ok`). Jogs while paused are axis
jogs in coordinated mode: do not call `teleop_enable()` first, task
refuses it while a program or MDI command runs.
* `is_spindle_ok()`: the machine is on and in manual mode, or the
interpreter is paused.
* the `pause-jog-ok-changed` signal, to enable and disable jog controls.

Code that saved the parameter file by switching modes (the QtVCP and
GladeVCP `UPDATE_VAR_FILE` action did) should use `task_plan_synch()`:
the interpreter writes the parameter file whenever it synchs.


== Preview renderer now requires OpenGL 3.3 core

Expand Down
20 changes: 20 additions & 0 deletions docs/src/gui/gstat.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,11 @@ It is expected to be in the machine's native units regardless of the current uni
*program-pause-changed* :: '(returns bool)' -
Sent when program is paused/unpaused.

*pause-jog-ok-changed* :: '(returns bool)' -
Sent when a pause of a program or MDI command has stopped the motion, so the
axes may jog, and again when that ends (resume, step or abort). +
See *is_jog_ok*.

*optional-stop-changed* :: '(returns bool)' -
Sent when optional stop is set/unset

Expand Down Expand Up @@ -669,6 +674,21 @@ returns string representing the internal selected axis letter.

*is_mdi_mode* :: '(None)' -

*is_pause_jog_ok* :: '(None)' -
returns True while a pause has stopped the motion of a program or MDI command:
the axes (not the joints) may jog. Resume or step brings them back to the
paused position first.

*is_jog_ok* :: '(None)' -
returns True when the machine is on and jogs are possible: in manual mode, and
for the axes while paused (see *is_pause_jog_ok*). Use this, not
*is_man_mode*, to enable jog controls and keyboard jogging.

*is_spindle_ok* :: '(None)' -
returns True when the machine is on and spindle commands are possible: in
manual mode and while the interpreter is paused. Resume puts the spindles back
as they were at the pause.

*is_auto_mode* :: '(None)' -

*is_on_and_idle* :: '(None)' -
Expand Down
2 changes: 1 addition & 1 deletion docs/src/gui/qtvcp.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -845,7 +845,7 @@ class HandlerClass:
# keyboard jogging from key binding calls
# double the rate if fast is true
def kb_jog(self, state, joint, direction, fast = False, linear = True):
if not STATUS.is_man_mode() or not STATUS.machine_is_on():
if not STATUS.is_jog_ok():
return
if linear:
distance = STATUS.get_jog_increment()
Expand Down
78 changes: 78 additions & 0 deletions docs/src/man/man1/milltask.1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,84 @@ soon as altered values are propagated to the motion module.
*ini.traj_arc_blend_ramp_freq*::
Allows adjustment of \[TRAJ]*ARC_BLEND_RAMP_FREQ*

=== Task pins (task.*)

*milltask* also creates the *task* component. Its pins carry the names
of the *halui*(1) pins they stand for, under `task.` instead of
`halui.`, and act the same way. Unlike the `ini.*` pins they exist
before the `[HAL]HALFILE` files run, so a configuration can net them
there.

The output pins are updated once per task cycle from task's own status:

*task.machine.units-per-mm* real out::
Machine units per mm.
*task.estop.is-activated* bool out::
The machine is in E-stop.
*task.mode.is-manual*, *task.mode.is-auto*, *task.mode.is-mdi* bool out::
The task mode.
*task.mode.is-joint* bool out::
Motion is in joint mode.
*task.program.is-idle*, *task.program.is-running*, *task.program.is-paused* bool out::
What the interpreter does.
*task.program.optional-stop.is-on*, *task.program.block-delete.is-on* bool out::
Optional stop and block delete.
*task.max-velocity.value*, *task.feed-override.value*, *task.rapid-override.value* real out::
The maximum velocity and the overrides.
*task.spindle.*__N__*.override.value* real out::
The spindle override of spindle _N_.
*task.joint.*__N__*.on-soft-min-limit*, *task.joint.*__N__*.on-soft-max-limit*, *task.joint.*__N__*.override-limits* bool out::
The soft limits of joint _N_, and whether its limits are overridden.
*task.axis.*__L__*.pos-feedback*, *task.axis.*__L__*.pos-relative* real out::
The Cartesian feedback position of axis _L_, and its position relative
to the current offsets (what a DRO shows).
*task.tool.number* uint out::
The tool in the spindle.
*task.tool.diameter* real out::
Its diameter.

The input pins act on a rising edge, like halui's, and send the same
command a user interface would. *task.spindle.*__N__*.increase* and
*.decrease* also act on the falling edge, which ends the change.

*task.machine.on*, *task.machine.off* bool in::
Turn the machine on or off.
*task.estop.reset* bool in::
Leave E-stop.
*task.estop.activate* bool in::
Request E-stop. See the note below.
*task.mode.teleop*, *task.mode.joint* bool in::
Switch motion to world or joint mode.
*task.mist.on*, *task.mist.off*, *task.flood.on*, *task.flood.off* bool in::
Coolant.
*task.program.run*, *task.program.pause*, *task.program.resume*, *task.program.step*, *task.program.stop* bool in::
Run, pause, resume, step or stop the open program.
*task.abort* bool in::
Abort.
*task.program.optional-stop.on*, *.off*, *task.program.block-delete.on*, *.off* bool in::
Optional stop and block delete.
*task.home-all* bool in::
Home all joints. Only there when `[JOINT_0]HOME_SEQUENCE` is set.
*task.joint.*__N__*.home*, *task.joint.*__N__*.unhome* bool in::
Home or unhome joint _N_.
*task.spindle.*__N__*.start*, *.stop*, *.forward*, *.reverse*, *.increase*, *.decrease*, *.brake-on*, *.brake-off* bool in::
Spindle _N_.

A command from an input pin has no serial number of its own. The status
keeps echoing the last command a user interface sent, and an input pin
command that task refuses does not make that one read as failed. The
status still shows what task is doing, though: a user interface that
waits for its last command to be done (*wait_complete()* in Python) also
waits while a program started from a pin runs. With halui, whose pins
send NML commands, that wait ended as soon as halui sent one.

IMPORTANT: *task.estop.activate*, like *halui.estop.activate*, is not a
safety input. It is an edge that task handles in its next cycle, after
any command already waiting, as it would a user interface's E-stop
button. It does not hold the machine in E-stop either. An E-stop chain
belongs on *iocontrol.0.emc-enable-in*, which is a level, and on the
hardware itself.

== NOTES

The *inihal* pins cannot be linked or set in a HAL file that is
Expand Down
9 changes: 1 addition & 8 deletions include/nml_intf/emc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,9 @@ struct PM_CARTESIAN;

#define EMC_JOINT_SET_MIN_POSITION_LIMIT_TYPE ((NMLTYPE) 107)
#define EMC_JOINT_SET_MAX_POSITION_LIMIT_TYPE ((NMLTYPE) 108)
#define EMC_JOINT_SET_FERROR_TYPE ((NMLTYPE) 111)
#define EMC_JOINT_SET_HOMING_PARAMS_TYPE ((NMLTYPE) 112)
#define EMC_JOINT_SET_MIN_FERROR_TYPE ((NMLTYPE) 115)
#define EMC_JOINT_HALT_TYPE ((NMLTYPE) 119)
#define EMC_JOINT_HOME_TYPE ((NMLTYPE) 123)
#define EMC_JOG_CONT_TYPE ((NMLTYPE) 124)
#define EMC_JOG_INCR_TYPE ((NMLTYPE) 125)
#define EMC_JOG_ABS_TYPE ((NMLTYPE) 126)
#define EMC_JOINT_OVERRIDE_LIMITS_TYPE ((NMLTYPE) 129)
#define EMC_JOINT_LOAD_COMP_TYPE ((NMLTYPE) 131)
#define EMC_JOINT_SET_BACKLASH_TYPE ((NMLTYPE) 134)
Expand All @@ -86,8 +81,6 @@ struct PM_CARTESIAN;
#define EMC_TRAJ_TERM_COND_BLEND 2

#define EMC_TRAJ_SET_MODE_TYPE ((NMLTYPE) 204)
#define EMC_TRAJ_SET_VELOCITY_TYPE ((NMLTYPE) 205)
#define EMC_TRAJ_SET_ACCELERATION_TYPE ((NMLTYPE) 206)
#define EMC_TRAJ_SET_MAX_VELOCITY_TYPE ((NMLTYPE) 207)
#define EMC_TRAJ_SET_SCALE_TYPE ((NMLTYPE) 209)
#define EMC_TRAJ_SET_RAPID_SCALE_TYPE ((NMLTYPE) 238)
Expand Down Expand Up @@ -329,7 +322,6 @@ extern int emcJointLoadComp(int joint, const char *file, int type);
extern int emcJogStop(int nr, int jjogmode);
extern int emcJogCont(int nr, double vel, int jjogmode);
extern int emcJogIncr(int nr, double incr, double vel, int jjogmode);
extern int emcJogAbs(int nr, double pos, double vel, int jjogmode);


extern int emcJointUpdate(EMC_JOINT_STAT stat[], int numJoints);
Expand Down Expand Up @@ -398,6 +390,7 @@ extern int emcTrajUpdate(EMC_TRAJ_STAT * stat);
extern int emcTrajSetJerk(double jerk);
extern int emcTrajSetMaxJerk(double jerk);
extern int emcTrajPlannerType(int type);
extern int emcTrajSetPauseReturnLast(unsigned axis_mask);
extern int emcTrajSetScurvePeakScale(double scale);
/* G64_R_PLANNER: [TRAJ]SMOOTH_PLANNER - planner a G64 R>0 request resolves to */
extern int emcTrajSetSmoothPlanner(int type);
Expand Down
Loading