mchmi is the operator interface of linuxcncMulti, modelled on SINUMERIK
Operate: one window shows all channels of the machine side by side, with
the usual areas (Maschine, WZ-Liste, NPV, Programm, Programm-Manager,
Diagnose) in the left bar and softkeys at the bottom and on the right. It
is started with [DISPLAY]DISPLAY = mchmi; a stock GUI per channel
([CHANNEL_n]DISPLAY = axis) is the alternative. Details and all keys:
man page mchmi(1).
Window technology
The panel is a Qt window (qtpy with PyQt6, the 3D column a
QOpenGLWidget; packages python3-pyqt6, python3-qtpy, python3-opengl,
python3-numpy). It is laid out for a 15.6 inch panel at 1280x720 and
scales with the window height (1920x1080 is 1.5 times);
[DISPLAY]MCHMI_HEIGHT (or the environment variable MCHMI_HEIGHT)
forces a design height. Keys: F1 to F8 are the bottom softkeys, Shift+F1
to F8 the right ones, Esc closes an overlay. In the 3D views the left
mouse button pans, the middle button (or Shift+left) rotates, the right
button and the wheel zoom, a double click on a collision marker jumps to
the program line. The logic (channels, softkey automaton, HAL keys,
Programmvorlauf, run_lines) is the window-free module mchmi_core, the
window mchmi_qt (one module per area: app, program, jog, panel, tools,
offsets, diag, vis), the cycles and sketches mchmi_cycles.
Language (new)
The texts of the panel are German in the sources and translated with
gettext catalogs (domain mchmi, share/locale/<lang>/LC_MESSAGES/mchmi.mo,
sources src/po/mchmi/<lang>.po): English, Spanish, Italian, French,
Slovak, Slovenian and Czech. The language comes from [DISPLAY]LANG of
the INI (en, es, it, fr, sk, sl, cs; de or unset keeps the
German texts), else from the environment (MCHMI_LANG, LANGUAGE,
LC_ALL, LC_MESSAGES, LANG). The Enterprise tools use the catalog
mcenterprise of the overlay in the same way. New texts are extracted
and merged into the catalogs with scripts/mchmi-po.py src/po/mchmi
<python files>; a JSON table of translations is applied with
scripts/mchmi-po.py src/po/mchmi --apply tr_<lang>.json.
The icons of the area bar on the left are drawn glyphs; a picture
lib/python/mchmi_qt/panel_png/area_<area>.png (machine, tools, offsets,
program, manager, diag) replaces the glyph of an area;
scripts/mchmi-area-icons.py strip.png cuts such pictures from a
vertical strip.
Window
-
A column per channel: header (name, state, mode), status line with the wait reason (mark, axis exchange, program end), position table with the machine axis names and the frame label (MKS/WKS, "TCS", the active transformation), a middle window switched by the right softkeys (G functions, M functions, base block, times, program levels, T,F,S, synchronized actions, main-run variables), and the program text with the block in execution (the motion under way while the planner holds segments, otherwise the block the task executes: a dwell, a tool call, the wait of a loop); after Reset and after the program end the program pointer is back at the first block, as on the SINUMERIK.
-
With
[DISPLAY]MACHINE_MODEL(a vismach model module driven by the joint positions, with the tools of the tool files in their turret stations) and[WORKPIECE_n](blank diameter and length, chuck face, spindle direction, C joint, slide joint, chuck output), a third column shows the machine in 3D above and the workpieces below: a material removal simulation per spindle (turning, drilling, milling with the head), chucks on digital outputs hand the part from the main to the counter spindle. A model may follow HAL pins besides the joints: a module-levelHAL_PINS = {"mag_angle": "fp4-hwsim.mag-angle", …}names them, mchmi reads them every cycle and passes the values tobuild()under their keys likejoint0(a magazine disc, a swivel arm or a slide driven by the PLC rather than by NC axes, see the FP4 example). The model is rebuilt when the tool in a spindle changes and when a tool moves between a station, a gripper (the keys"9998/2"… of the magazine dict) and the spindle ("9998/1"). -
The operating mode is chosen with the M key at the top right: AUTO, MDA, JOG, REF POINT on the right softkeys, the areas on the bottom ones. JOG offers the forms T,S,M, Nullpunkt Werkstück (G10 L20), Werkzeug messen (against the workpiece or the fixed point
[CHANNEL_n]TOOL_SENSOR_<axis>, G10 L1), Position and Planfräsen; REF has one key per axis (green when homed) and Alle. -
Programs: program manager (NC, local and USB drives; the workpieces with their version control, see below), editor with syntax highlighting (incl.
X2=, the channel statements and synchronized actions), cycles and multichannel statements as forms, block search and Programmvorlauf (restart at a line: the interpreter state up to that line is established by MDI, then run-from-line). -
Programm prüfen: the collision check runs the programs of all channels on a common time axis with the semantics of the wait marks, cuts the blanks along the feed moves and checks the holders of different channels against each other and against the machine; a jog guard narrows the jog limits of the selected channel (
command.set_axis_limits). -
Diagnose: alarm list of all channels (
SETALalarms with number and text), messages, log, version; the softkeys HAL Show, HAL Scope and HAL Meter start the HAL tools of LinuxCNC beside mchmi, mcplc the HAL programming (mcplc, Enterprise edition) with this configuration: its project next to the INI (<ini name>.hpj) when there is one, else the import of the INI. The page Kreisformtest is the circularity test (see below), the page Antriebsoptimierung the Auto Servo Tuning ([cha:ast]).
Extensions of the panel (new)
mchmi is a platform: modules named mchmi_ext_<name> on the Python path
register what they add - an area of the left bar with its key in the M
menu, a page of the diagnosis area, a loader of machine models by file
extension - and the panel does not depend on them. The Community
edition of linuxcncMulti ships none; the Enterprise edition brings
mchmi_ext_mcwatch (the process monitoring area), mchmi_ext_ast (the
Auto Servo Tuning page) and mchmi_ext_mcbuilder ([DISPLAY]
MACHINE_MODEL = .mcm). Without them the areas and pages are simply
absent and a .mcm model is refused with a message; the circularity
test, the user screens and everything else of the panel stay. An
extension that fails to import is reported as a message, the panel
comes up without it. MCHMI_EXTENSIONS=none in the environment starts
the panel without extensions, a comma-separated list limits them (the
tests use that).
Reporting a fault or a wish: Melden (new)
The page Melden of the diagnosis area sends a fault, a feature wish or
a question to the operator’s support service with everything the
analysis needs. The operator picks the kind, writes what happened, what
was expected and how it repeats, and sees the contents of the bundle
before it is made, each one to be left out: a screenshot of the panel,
the HAL snapshot (every pin, signal and parameter, halcmd show all),
the signal trace of the last ten seconds (the joints' commanded and
actual positions and following errors, machine on, estop, the
channels' program and mode states - a ring the panel fills all the
time), the alarm log, the channel states with their program lines, the
configuration (INI, HAL, tool, screen, model and program files, without
the licence and the operator’s private settings) and the logs of
LinuxCNC and the kernel. Erstellen asks for a second press, writes the
bundle (a zip with a manifest) under meldungen/ below
[DISPLAY]PROGRAM_PREFIX and, when the INI names the service
([SUPPORT] URL, optionally CUSTOMER), sends it there with the
licence as the credential; the answer is a ticket number. Without a
service, or without a network, the bundle stays local and can be sent
later from the Tickets list or carried on a stick.
Tickets lists the reports with their ticket and state and fetches the
answers (Antworten holen, also every two minutes while the list is
open): the analysis and, for a configuration fault, a proposed change
as a diff of the configuration files. Fix anwenden (a second press
confirms) backs the touched files up as <name>.bak-<stamp> and
applies the diff with patch; a diff that reaches outside the
configuration directory is refused. LinuxCNC is restarted afterwards.
The service and its analysis are the operator’s (mcsupport, see
docs/multichannel/editionen.md); every automatic answer is released by
the operator before the customer sees it.
The licence of the Enterprise edition (new)
The Enterprise extensions and programs (mcplc, mcbuilder, mcwatch,
mcast-measure) ask for an option key: a licence file with the customer,
the machine id, the packages, the issue date and the subscription end,
signed by the operator (Ed25519, mclicense-gen(1)). The control
checks the signature against the embedded public keys and the machine
id against its own: it comes from the Mesa card where there is one (an
Ethernet card’s MAC through mesaflash), else from the mainboard, else
from the first network interface, and reads like M-3F9A-12C0-77B1-04E2
(the prefix names the source). Without a valid licence an Enterprise
area or page shows "Enterprise-Option nicht freigeschaltet" with the
reason and the machine id to send with the order, a .mcm model is
refused, and the programs stop with the same message. The functions
never expire: when the subscription ends, updates and support end, the
licensed functions keep running; the page *Version of the diagnosis
area shows the edition, the licence and the subscription, and warns 30
days before its end. The same page carries the update channel of the
subscription: Updates prüfen asks the operator’s package repository
(mcupdate(1), [UPDATE] of the INI, the licence’s update token as the
credential) and lists the packages with a newer version, Update
installieren installs them - only while the machine is off, LinuxCNC is
restarted afterwards. The file lives at /etc/linuxcnc/license.json,
at [EMC]LICENSE_FILE of the INI or at ~/linuxcnc/license.json.
This is the GPL: the licence is an option key as on a SINUMERIK, a
convenience and a contract, not a copy protection.
The circularity test (Kreisformtest)
The page Kreisformtest of the diagnosis area drives a full circle in
the chosen plane (XY, XZ or YZ) with the chosen radius and feed around
the point the selected channel stands on - clockwise (G2), then
counter-clockwise (G3), incrementally, so that no work offset matters -
and records the position feedback of the two joints every servo cycle
(the sampler of mcplc’s traces). The key Kreis fahren asks for a
second press; the space around the point must be free. The result is
shown like a ballbar diagnosis: the polar plot of the radial deviation
from the nominal circle, magnified by the chosen Vergrößerung (µm per
division, five divisions in and out, chosen automatically after a
measurement), run 1 in magenta and run 2 in green, with Sollbahn the
deviation of the commanded path (the planner’s own error); and the
figures per run and for both: circularity (Kreisformabweichung), mean
radius against the nominal one, centre offset, backlash (Umkehrspiel,
the step of the deviation at the reversal of each axis), reversal
spikes (Quadrantenübergang), the 45° and 0° ellipse terms, and for both
runs together the squareness (Rechtwinkligkeit, µm/m, from the 45°
ellipse common to both directions), the servo mismatch (Schleppfehler,
ms, from the ellipse that turns with the direction) and the scale
difference of the two axes. Speichern writes the samples (CSV), the
figures (JSON) and the plot (PNG) to kreisformtest/ below
PROGRAM_PREFIX. The feedback is the encoder of each joint: with
encoders on the motors a backlash of the mechanics stays invisible, the
servo errors do not; a ballbar remains the instrument for the geometry.
The machine control panel
The softkey Steuertafel opens the simulated operator panel, laid out
like the SINUMERIK machine control panel with the pictures of its keys
(the PNG files in mchmi_qt/panel_png/, the whole key with frame and
caption; a key without a picture is drawn in the same style): the
emergency stop with four round keys below it (the
channels), the block JOG / REPOS / REF.POINT, MDA / TEACH IN / [VAR],
AUTO / INC 1 / INC 10, SINGLE BLOCK / INC 100 / INC 1000, RESET / CYCLE
STOP / CYCLE START, the block of machine keys (AUS / EIN with the lock
symbols, spindle left / right, coolant, REF ALLE, program check, spindle
stop, collision guard; TEST STOP, hand wheel, tool change and settings
are placeholders), the axis keys of the selected channel (the unlabelled
keys of the real panel) with TCS and WCS/MCS below them and "-", RAPID,
"+" (jog while the key is held, with RAPID at rapid speed, with an
increment by that distance), the spindle and feed override dials with
SPINDLE STOP / START and FEED STOP / START, and the column ALARM CANCEL,
GROUP CHANNEL, HELP with the key switch (positions 0 to 3). A lit key
(mode, increment, spindle direction, machine on, WCS, feed and spindle
running, CYCLE STOP while paused) shows a green frame and symbol like the
LEDs of the real panel, CYCLE STOP a red one; the lit variant of a
picture is derived from the picture when there is no file <name>_on.png
for it. The axis keys jog the axes of the selected channel in
its own TELEOP state (the panel switches to it if needed, e.g. after
REF), so the active transformation and the TCS frame apply; only while
REF is selected do they jog the joints.
The machine keys and the feed pot are HAL pins of the component mchmi
(mchmi.machine-on, mchmi.machine-off, mchmi.estop-activate,
mchmi.estop-reset: a pulse per key press; mchmi.feed-override in
percent). mchmi runs [HAL]POSTGUI_HALFILE once the pins exist; a pin
that is netted carries its key alone, so HAL decides which channels a key
reaches (see [cha:multichannel-config]). An unconnected pin leaves the
key to the selected channel.
Program text
The program window of every channel (the listing in AUTO with the
running, start and collision lines, the MDA program typed into it) and
the editor of the program area highlight the NC text alike: comments,
G and M codes, axis words, tool / feed / spindle words, o-words and
# parameters of RS274, and the SINUMERIK elements - the statements
(WAITM, INIT, MVTOOL, POSM, MSG, REPOSA …), the keywords
of the declarations and control structures (DEF, IF / ELSE /
ENDIF, WHILE, LOOP, FOR, REPEAT, GOTOF …), labels, the
system variables ($A_IN[n], $TC_MPP6[m,p], $P_PROG_EVENT) and the
R parameters.
Tool management
The area WZ-Liste edits the tool files of mctooldb(1) (one per
channel that has one; a channel that only runs the tool changer has no
tool file and no page here): magazine strip, table, details (geometry,
sister tools, tool life with set point / actual / pre-warning,
disabled), new / sister / lock / life / delete. The 3D model shows every
tool of a carrier in its station by type.
With magazines and buffer places configured ([TOOLMAG_k],
[TOOLBUFFER_k], [TOOLLOAD_k], see the configuration chapter) the
strip shows, after the places of the magazine, the buffer places
(spindle, grippers, loaders) and the load points with the tools on
them, and the column Platz names the place (1/12, Spindel 1,
Greifer 2, - for a tool without a place). The softkey Plätze »
opens Umsetzen (the selected tool to a magazine and place; place 0
searches a free one, the owner place first), Beladen (a tool without
a place onto one), Entladen (the tool leaves its place, it stays in
the file) and Magazin positionieren (POSM as an MDI command in the
channel that owns the magazine axis). A move the places do not allow
(place taken, reserved for a tool in the buffer, locked) is refused
with a message; so is a magazine place typed into the details of a
tool (a new one included) that another tool holds or that is reserved
for a tool in the buffer - the entry is not taken over. The 3D model of a machine may draw the tools on the
buffer places (the DMU 60 shows them in the grippers of its arm).
The machine area gets a further bottom page when the selected channel
has asynchronous subprograms ([CHANNEL_n]ASUP_k): one softkey ASUP k
per program, which starts it like the HAL edge does (served while the
channel is idle).
Tool geometry and holders
The material removal and the collision check use the tool as a solid of
revolution about its axis: the cutting part from the type and the
Schneidendaten (mill flat, ball ball nose, bull with the corner
radius corner, cone engraving or chamfer cutter with the point angle
angle and the tip diameter tipdiam, drill with its point angle;
the cutting length flute, default 2.5 diameters), and the non-cutting
body: the shank above the flutes (shank), the holder and the spindle
nose. The body removes nothing; where it meets material, the table or a
fixture it is a collision (live in the 3D column, and in advance in the
dry run of Programm prüfen).
The 3D page: tool path, comparison, export
The third softkey page of the machine area works on the 3D column:
Werkzeugpfad shows the loaded program of the selected channel as lines
(rapids red and dashed, feed moves in a colour per tool number; on a
table kinematics the path lives in the workpiece frame and turns with
the part), pressed again it hides it. Soll-Ist-Vergleich colours the
simulated part by its deviation from the finished part: an STL in the
workpiece frame ([WORKPIECE_n]TARGET, or chosen in the dialog), the
tolerance (green within ±, COMPARE_TOL) and the end of the scale
(COMPARE_MAX: stock runs from yellow to red, a gouge from cyan over
blue to magenta); the part line reports the largest stock, the largest
gouge and the share of the surface within the tolerance, and the
comparison stays on for the next blank. Teil als STL writes the
simulated part (the dexel surface with bore and end faces) as a binary
STL in the workpiece frame, e.g. as the finished part of a following
comparison or for a CAD check. The key … ausblenden (named after
the channel of the second column) hides that column - an auxiliary
channel such as a tool changer that needs no watching: the first column
and the 3D view share its space; pressed again it shows the column, the
choice is kept in mchmi_settings.json next to the INI.
Dry run (Programm prüfen on a table kinematics)
On a table kinematics ([WORKPIECE_n]FRAME = TCP) Programm prüfen runs
the program as a dry run in the workpiece frame: a fresh blank from the
program’s WORKPIECE statement (else the INI blank) is cut by the cutting
part of every tool along the sampled path (TCP, the tool axis from B and
C), the shank, the holder and the spindle nose are checked against the
material, the tool against the fixtures of the machine model (FIXTURES
in the workpiece frame: the table surface, clamps, boxes, rings) and a
rapid against the cut part.
The run steps along in the background while the panel stays usable; the
3D views follow it: the machine shows the tool of the run at every
position, the workpiece window the blank being cut. At the first
collision the run halts: both partners turn red, the tool light red
and the workpiece or the fixture it hits dark red, the line is marked in
the program window and named in the message line. Cycle Start
continues the run to the next collision, Cycle Stop or Reset ends
it. When the run is through, the collision list opens (line, kind,
position; Zur Zeile marks the line), the markers stay in the 3D view
and the tool path of the run is shown. Machine models provide
pose_to_joints(x, y, z, b, c, tool_len) for the animation (the DMU 60
model does; without it only the blank and the markers are shown) and
build(joints, tools, active, highlight) to draw the tool of the
highlighted channel in the collision colour.
Other machines (no TCP frame) use the sampled check in the machine
frame (holders and obstacles of the model), which runs at once.
Workpieces and version control
The NC drive of the program manager holds, next to the part programs,
the folder Werkstücke ([DISPLAY]WORKPIECE_DIR, default
werkstuecke below PROGRAM_PREFIX). Every subfolder of it is a
workpiece with its programs; Neues Werkstück (second softkey page)
creates one. The third softkey page is the version control of the
selected workpiece, built on git (the git command must be installed):
-
Versionsverwaltung creates the repository in the workpiece folder (after a confirmation). From then on the page splits in two columns: the file tree on the left, on the right the history of the workpiece above (version, date, author, description; the first line is the working copy when it holds changes not checked in yet) and below it the files changed by the selected version. A file expands to the lines of its difference (added lines green, removed lines red).
-
Einchecken stores all changes of the workpiece as a new version with a description. When a program of a versioned workpiece is saved in the editor (Speichern, Anwahl, Schließen, Maschine or another area), the panel asks whether to check the change in.
-
Remote verknüpfen links the repository with a remote address (a git server or a bare repository on a network share); Senden / Holen fetches the remote’s versions (fast-forward) and sends the local ones. Credentials are not asked for interactively: use an address with the credentials embedded, SSH keys or a credential helper.
-
Verlauf aktualisieren (the same key once the version control exists) rereads the history, Aktualisieren on the second page the file tree.
The repository is the folder’s .git directory; the folder itself can
also be used with git from the command line.
Process monitoring
The area Prozessüberwachung shows the process monitoring (mcwatch,
Enterprise edition) of the selected channel: the running process
with its live loads, reference and worn curves, limits and zones in a
chart, the processes of the program in a table, and the switches - the
monitoring as a whole, per tool and per process - together with
learning, the curve roles, the envelope tolerance and the alarm
acknowledgement. It needs the daemon (loadusr -W mcwatch); without it
the area shows no data.
User screens (Bedienbilder)
Machine-specific operating pages - the hand functions of a tool
changer, a magazine, a gearbox spindle, a loader - are described in a
JSON file named by [DISPLAY]USER_SCREENS (relative to the INI), in the
manner of SINUMERIK "Run MyScreens", and appear as the area
Bedienbilder (left bar, or the M key). mchmi itself knows nothing of
the machine: every key is a HAL pin mchmi.u.<pin> the config nets to
its PLC in the POSTGUI_HALFILE, every interlock and state is a HAL pin
the page reads.
{"title": "Bedienbilder",
"pages": [
{"name": "WECHSLER", "title": "Werkzeugwechsler - Handfunktionen",
"softkeys": [{"type": "key", "label": "Störung\nquittieren", "pin": "arm-reset"},
{"type": "key", "label": "Testmodus", "pin": "arm-force", "mode": "level",
"confirm": true, "danger": true}],
"groups": [
{"title": "Zustand", "items": [
{"type": "value", "label": "Zustand", "pin": "fp4-arm.state",
"texts": {"0": "bereit", "3": "Störung"}, "alarm": ["3"]},
{"type": "lamp", "label": "Hydraulikdruck", "pin": "fp4-arm.pressure-in"}]},
{"title": "Schwenkarm", "items": [
{"type": "key", "label": "Arm\nvor", "pin": "arm-front",
"allow": "fp4-arm.allow-arm-front", "on": "fp4-arm.arm-pos", "on_value": 2},
{"type": "input", "label": "Zielplatz", "pin": "mag-goto", "kind": "s32",
"min": 1, "max": 20, "default": 1}]}]}]}
key-
A push key on the page (or, under
softkeys, on the right softkey bar, up to 7).modeedge(the default) pulses the pin for 150 ms,leveltoggles it and keeps it,holdholds it while the key is pressed.allownames a HAL pin that enables the key - the PLC’s interlock, a disabled key is grey -ona pin whose value (on_value, default 1) lights the key green;confirmasks for a second press within 4 s ("Sicher?"),dangermarks a key like a test mode. lamp-
A bit of the machine, green when on (
invertturns it round). value-
A number or state of the machine, shown through
texts({value: text}), else withformat(printf, default%g) andunit; the values inalarmare shown red. input-
A number the operator sets with - and + keys (
kinds32orfloat,min,max,step,default), written to the pin at once.
The pages are the bottom softkeys. The keys of several pages may share a pin. The definition is checked at start; a mistake is reported in the alarm line and the area is left out. The FP4 example ([cha:fp4]) has the pages WECHSLER, MAGAZIN and SPINDEL; its HAL ORs the keys with the commands of the changer program and switches the place numbers between the program and the page with a mux.
INI keys of mchmi
[DISPLAY]DISPLAY = mchmi, MACHINE_MODEL, USER_SCREENS, PROGRAM_PREFIX,
WORKPIECE_DIR, INCREMENTS, DEFAULT_*VELOCITY, DEFAULT_SPINDLE_SPEED,
POSITION_OFFSET, POSITION_FEEDBACK, CYCLE_TIME;
[WORKPIECE_n] NAME DIAMETER LENGTH CHUCK_Z DIRECTION C_JOINT CHUCK_DOUT
SLIDE_JOINT SLIDE_SIGN FRAME AXIS B_JOINT GRIP NTH DZ MODEL DX TARGET
COMPARE_TOL COMPARE_MAX; [CHANNEL_n] NAME
MASTER_SPINDLE TOOL_DB TOOL_STATIONS TOOL_SENSOR<axis> RESTART_ORDER.
[WORKPIECE_n]FRAME = TCP is for a table kinematics (xyzbc-trt-kins and
the like): the positions are the tool tip in the workpiece frame, the
tool axis follows B_JOINT and C_JOINT, the part turns and tilts with
the table in the 3D view. AXIS = Z stands the part on the table (world
y of the model); GRIP (mm below the chuck face drawn as clamped stock,
default 20), NTH (rays per turn, default 72) and DZ (slice, default
0.5 mm) set the resolution. MODEL = HEIGHT keeps the blank as a height
map instead of the radial dexel (grid DX, default 1 mm): the right
model for a part machined from above on a table, swept blades included,
where a ray from the axis would cross a channel and then the next blade
(the impeller of the DMU 60); undercuts are not kept in either model.
The blank of the INI is the one at start; a
WORKPIECE statement of the running program replaces it (see the
G-code chapter), "Rohteile neu" restores it. Example:
configs/sim/multichannel/dmu60 (a 5-axis machining centre with a
swivel rotary table, the impeller programs define their blank as a
cylinder or from an STL file).