This part of the manual describes linuxcncMulti, a fork of LinuxCNC with several independent, parallel running NC channels (Siemens 840D / Fanuc multi-path style). Everything described in this part is an addition to LinuxCNC: a configuration without [EMCMOT]NUM_CHANNELS (or with NUM_CHANNELS = 1) behaves exactly like stock LinuxCNC, and channel 0 of a multi-channel machine is a complete stock LinuxCNC channel. Every feature that is new compared with LinuxCNC is marked with (new) in the tables below so that users of standard LinuxCNC see at a glance what the system adds.

What a channel is

A channel is a complete NC program execution unit with its own

  • G-code interpreter and task state machine (milltask -channel N, one process per channel),

  • trajectory planner in the real-time motion controller (one tpmod planner per channel inside the single motmod),

  • set of machine axes (joints) assigned in the INI file,

  • operating mode (manual, MDI, auto), machine on/off state, override, tool table / tool management, work offsets, parameter file,

  • NML command, status and error buffers (emcCommand_N, emcStatus_N, emcError_N), HAL pins (motion.N., axis.N.L., halui.N., iocontrol.N.) and GUI.

Channels run their programs at the same time on the same machine. They synchronize each other through wait marks evaluated in the real-time controller, exchange axes at run time (GET, GETD, RELEASE) and can start each other’s programs (INIT, START). The classic use is a turning centre with two spindles and several tool carriers, see the simulation configs/sim/multichannel/index_g200 (three channels: two turrets and a B-axis milling head, see [cha:mchmi]). The single-channel 5-axis machining centre configs/sim/multichannel/dmu60 (swivel rotary table, impeller machining with every path optimisation enabled) shows the planner side, see the path planner chapter.

Comparison with stock LinuxCNC

Topic LinuxCNC linuxcncMulti (new)

NC programs

one program at a time

one program per channel, running in parallel

Trajectory planners

one

one per channel; joints are assigned to channels in the INI ([CHANNEL_n]JOINTS)

Task / interpreter

one milltask

one milltask per channel, started by the linuxcnc script

NML buffers

emcCommand, emcStatus, emcError

the same names for channel 0 plus emcCommand_N …​ for channel N ([EMC]NML_FILE, configs/common/linuxcnc_mc.nml)

Axis names in G-code

X, Y, Z …​

machine axis names: an axis letter that exists in several channels becomes X1, X2 …​ and is written X2=12.5; letters that exist once keep the plain word

Synchronization

-

wait marks M90-M93, exact in the real-time controller

Axis exchange

-

GET(axis), GETD(axis), RELEASE(axis)

Program chaining

-

INIT(channel, program, N|S), START(channel)

Master spindle

one spindle for CSS / feed per revolution

SETMS(n) per channel, [CHANNEL_n]MASTER_SPINDLE

Machine on/off

machine-wide

channel 0 switches the machine, a channel >= 1 switches only its own joints (motion.N.enabled); the operator panel keys reach every channel through HAL

Tool management

tool table, optional database program

per channel; mctooldb adds sister tools, tool life (count/time), SETPIECE, TOOLSET, #<_tool[id]key>

Synchronized actions

-

Siemens-style ID=/IDS=/WHENEVER/WHEN/EVERY/DO evaluated every servo cycle: main-run variables, outputs, override, spindle, command axes, DELDTG, RDISABLE, overlaid offsets, polynomials, measuring

Kinematic transformations

switchkins, G12.1

per channel TRAORI, TRANSMIT, TRACYL, TRAFOOF selectable from the program, orientation vectors A3/B3/C3, TCS jog

Power-on program

RS274NGC_STARTUP_CODE

plus [CHANNEL_n]STARTUP_PROGRAM, a file run once at start (static synchronized actions)

GUI

AXIS, gmoccapy, …​ per machine

the same GUIs per channel ([CHANNEL_n]DISPLAY) or mchmi, an Operate-style multi-channel interface with 3D machine model, material removal, collision check and machine control panel

Python

linuxcnc.stat()

linuxcnc.stat(channel=N), command(channel=N), error_channel(channel=N) with the new status fields

Where to read on

  • [cha:multichannel-config] - INI keys, HAL pins, the launch script, machine axis names.

  • [cha:multichannel-gcode] - the G-code extensions: axis words, wait marks, axis exchange, program chaining, tool management statements, named parameters.

  • [cha:synchronized-actions] - synchronized actions.

  • [cha:kinematic-transformations] - TRAORI, TRANSMIT, TRACYL and the tool coordinate system.

  • [cha:mchmi] - the multi-channel operator interface and the machine control panel.

  • The design notes (in German) live in docs/multichannel/ of the source tree: architecture.md, synchronaktionen.md, transformationen.md.

Quick start

cd configs/sim/multichannel/index_g200
linuxcnc index_g200.ini

The linuxcnc script starts one task per channel, halui and halui.N, mctooldb per channel and mchmi. Switch the machine on with the EIN key of the control panel (it reaches every channel through HAL), reference with REF POINT / Alle, then start the shaft example from channel 0: welle_kanal1.ngc loads and starts the programs of the other two channels with INIT/START and waits for them with the marks.

Tests of every feature are under tests/multichannel/ and tests/ui-smoke/mchmi-*; they run in the CI and document the expected behaviour in detail.