Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
e2547c4
tests: record what the task planner does with every command
rene-dev Nov 10, 2026
910b3b4
task: hand emcTaskPlan() the new command
rene-dev Nov 10, 2026
f3d8ff0
task: one list of immediate commands for the planner tables
rene-dev Nov 10, 2026
83cfb05
task: export halui's status pins that motion and iocontrol lack
rene-dev Nov 10, 2026
7cca152
task: halui's command pins, as task-internal commands
rene-dev Nov 10, 2026
dc8c0ba
task: the halui pins whose iocontrol counterpart differs
rene-dev Nov 10, 2026
932da0b
nml: remove seven commands nothing in the tree sends
rene-dev Nov 16, 2026
bd2ce46
task: remove the MDI input queue nothing appends to, and what is left…
rene-dev Nov 16, 2026
c9bb969
task: the message pointers of emcTaskIssueCommand() are locals
rene-dev Nov 16, 2026
8349532
task: one table for what a queued command waits for, before and after
rene-dev Nov 16, 2026
9d90fa0
task: the planner is one switch instead of seven nested ones
rene-dev Nov 16, 2026
75bc00a
motion: remove EMCMOT_JOG_ABS, which nothing sends any more
rene-dev Nov 16, 2026
225fc36
tests: task-planner is skipped without test_task_probe
rene-dev Nov 16, 2026
45d132a
jog while paused, and return to the paused position on resume
rene-dev Nov 17, 2026
9151410
task: the task mode follows what runs and cannot be set
rene-dev Oct 16, 2026
30f52cd
user interfaces: no wait after a mode change
rene-dev Oct 16, 2026
1351204
remove EMC_TASK_SET_MODE and halui's mode request pins
rene-dev Oct 16, 2026
1e73131
task: DONE only once a run has ended and motion is back
rene-dev Oct 16, 2026
c9f8e95
gscreen: fix startup crash, use self.inifile for maplinearunits
rene-dev Oct 18, 2026
57308dd
GStat, qtvcp, gladevcp: jog and spindle while paused
rene-dev Oct 18, 2026
e2033c1
gmoccapy: jog while paused
rene-dev Oct 18, 2026
55958b2
touchy, gscreen: jog while paused
rene-dev Oct 18, 2026
bf9eb0d
qtvcp screens: keyboard jog while paused
rene-dev Oct 18, 2026
2e9ecd7
tests: task-planner, stale-motion-status and jog-while-paused without…
rene-dev Nov 13, 2026
7913b1e
motion: wait for the joints to come to rest before entering joint mode
rene-dev Nov 16, 2026
48d6c55
task: forget the coolant saved at a pause when the run ends
rene-dev Nov 17, 2026
845e396
tests: remove the task planner table and its probe
rene-dev Nov 17, 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
1 change: 0 additions & 1 deletion configs/sim/axis/gladevcp/probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ def ensure_mode(self,m, *p):
if self.s.task_mode == m or self.s.task_mode in p: return True
if self.running(do_poll=False): return False
self.c.mode(m)
self.c.wait_complete()
return True

def active_codes(self):
Expand Down
4 changes: 0 additions & 4 deletions configs/sim/axis/halui_pyvcp/pyvcp.hal
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ net flood-off pyvcp.flood.off halui.flood.off
net mist-is-on pyvcp.mist.is-on halui.mist.is-on
net flood-is-on pyvcp.flood.is-on halui.flood.is-on

net mode-manual pyvcp.mode.manual halui.mode.manual
net mode-auto pyvcp.mode.auto halui.mode.auto
net mode-mdi pyvcp.mode.mdi halui.mode.mdi

net spindle-start pyvcp.spindle.on halui.spindle.0.start
net spindle-stop pyvcp.spindle.off halui.spindle.0.stop
net spindle-forward pyvcp.spindle.forward halui.spindle.0.forward
Expand Down
24 changes: 9 additions & 15 deletions configs/sim/axis/halui_pyvcp/vcp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,9 @@
<labelframe text="Mode">
<hbox>
<vbox>
<button>
<halpin>"mode.manual"</halpin>
<text>"Man"</text>
<justify>"center"</justify>
</button>
<label>
<text>"Man"</text>
</label>
<led>
<halpin>"mode.is-manual"</halpin>
<size>20</size>
Expand All @@ -68,11 +66,9 @@
</led>
</vbox>
<vbox>
<button>
<halpin>"mode.auto"</halpin>
<text>"Auto"</text>
<justify>"center"</justify>
</button>
<label>
<text>"Auto"</text>
</label>
<led>
<halpin>"mode.is-auto"</halpin>
<size>20</size>
Expand All @@ -81,11 +77,9 @@
</led>
</vbox>
<vbox>
<button>
<halpin>"mode.mdi"</halpin>
<text>"MDI"</text>
<justify>"center"</justify>
</button>
<label>
<text>"MDI"</text>
</label>
<led>
<halpin>"mode.is-mdi"</halpin>
<size>20</size>
Expand Down
1 change: 0 additions & 1 deletion configs/sim/gmoccapy/lathe_configs/lathehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ def cycle_pin(self, pin, data = None):
if c is not None:
self.cmd.abort()
self.cmd.mode(linuxcnc.MODE_MDI)
self.cmd.wait_complete()
c.emit('clicked')
print(c.get_name(), "clicked")

Expand Down
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 @@ -188,7 +188,6 @@ def cycle_pin(self, pin, data = None):
if c.name.partition('.')[2] == 'action':
self.cmd.abort()
self.cmd.mode(linuxcnc.MODE_MANUAL)
self.cmd.wait_complete()
c.emit('clicked')

def gash(self, obj, data = None):
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
8 changes: 0 additions & 8 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 Expand Up @@ -121,7 +114,6 @@ EMC_MOTION_STAT_TYPE
EMC_TASK_INIT_TYPE
EMC_TASK_HALT_TYPE
EMC_TASK_ABORT_TYPE
EMC_TASK_SET_MODE_TYPE
EMC_TASK_SET_STATE_TYPE
EMC_TASK_PLAN_OPEN_TYPE
EMC_TASK_PLAN_RUN_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
30 changes: 23 additions & 7 deletions docs/src/config/python-interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,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 Expand Up @@ -364,6 +378,11 @@ see <<python:reading-ini-values,ReadingINI file values>> for an example.

*task_mode*:: '(returns integer)' -
current task mode. One of `MODE_MDI`, `MODE_AUTO`, `MODE_MANUAL`.
`MODE_AUTO` while a program runs (including paused) and `MODE_MDI`
while MDI commands run. While task is idle it is the mode this process
last asked for with `mode()`, `MODE_MANUAL` until then: task's own mode
reports what runs and cannot be set, so each user interface keeps its
own page.

*task_paused*:: '(returns integer)' -
task paused flag.
Expand Down Expand Up @@ -595,8 +614,6 @@ def ok_for_mdi():
return not s.estop and s.enabled and (s.homed.count(1) == s.joints) and (s.interp_state == linuxcnc.INTERP_IDLE)

if ok_for_mdi():
c.mode(linuxcnc.MODE_MDI)
c.wait_complete() # wait until mode switch executed (or default timeout of 5s occurs!)
c.mdi("G0 X10 Y20 Z30")
----

Expand Down Expand Up @@ -643,10 +660,6 @@ c.mdi("G0 X10 Y20 Z30")
c.mist(linuxcnc.MIST_ON)
c.mist(linuxcnc.MIST_OFF)

c.mode(linuxcnc.MODE_MDI)
c.mode(linuxcnc.MODE_AUTO)
c.mode(linuxcnc.MODE_MANUAL)

c.override_limits()

c.program_open("foo.ngc")
Expand Down Expand Up @@ -735,7 +748,10 @@ c.tool_offset(toolno, z_offset, x_offset, diameter, frontangle, backangle, orie
MIST_OFF

`mode(int)`::
set mode (MODE_MDI, MODE_MANUAL, MODE_AUTO).
set the mode this process shows (MODE_MDI, MODE_MANUAL, MODE_AUTO), see
`task_mode`. Nothing is sent to task: it starts an MDI run on `mdi()`
and a program run on `auto(AUTO_RUN)` or `auto(AUTO_STEP)` when it is
idle, and jogs and homes whenever it is idle, whatever mode was set.

`override_limits()`::
set the override axis limits flag.
Expand Down
71 changes: 71 additions & 0 deletions docs/src/getting-started/updating-linuxcnc.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,77 @@ LinuxCNC. Use *iocontrol.0.tool-prep-number* (the tool number) or
*iocontrol.0.tool-prep-pocket* (its pocket) instead. A HAL file that
still connects the pin fails to load.

=== The task mode cannot be set

Manual, MDI and Auto are no longer modes a user interface switches
between. Task accepts what fits what it is doing:

* while idle: jogs, homing, an MDI command (which starts MDI) and a
program run or step (which starts the program);
* while MDI runs: more MDI commands, which queue, pause and abort;
* while a program runs: pause, step and abort, as before.

Immediate commands such as overrides, spindle and coolant are accepted
as before. Several user interfaces can therefore show different pages at
the same time without taking the machine away from each other.

* Task's mode, and `halui.mode.is-manual`, `.is-mdi`, `.is-auto`, report
what runs: Auto while a program runs or is paused, MDI while MDI
commands run, Manual otherwise. They change on their own when a run
starts and ends.
* The Python `mode()` command, Tcl `emc_mode` and linuxcncrsh `set mode`
no longer reach task. They set the mode that user interface (Python or
Tcl process, linuxcncrsh connection) shows, which `task_mode`,
`emc_mode` and `get mode` report while task is idle. User interfaces
that switch pages on the mode keep working, each with its own page.
* The `halui.mode.manual`, `.mdi` and `.auto` pins are gone. Remove the
nets that connect them from HAL files: a program start button only
needs `halui.program.run`. The `.is-manual`, `.is-mdi` and `.is-auto`
pins stay.
* Switching to Manual used to abort a running MDI command. It no longer
does: use abort.
* Task puts motion into coordinated mode when a run starts and back into
joint or world mode when it ends, so wheel (MPG) jogs work whenever
nothing runs. A jog in progress, including a wheel jog, holds off MDI
and program starts, which are refused with an error.
* A run started in Manual mode used to be ignored. It now runs the
program. A run or step with no program open is refused.
* While MDI runs, jogs and switching between joint and world mode are
refused; they used to be passed to motion.
=== 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
Loading