LinuxCNC Documentation

Оновлення LinuxCNC до нового минорного релізу (тобто до нової версії в тій самій стабільній серії, наприклад, з 2.9.7 до 2.9.8) відбувається автоматично, якщо ваш ПК підключено до Інтернету. Ви побачите запит на оновлення після минорного релізу разом з іншими оновленнями програмного забезпечення. Якщо у вас немає підключення до Інтернету на вашому ПК, див. Оновлення без мережі.

1. Оновіться до нової версії

У цьому розділі описано, як оновити LinuxCNC з версії 2.8.x до версії 2.9.y. Припускається, що у вас є встановлена версія 2.8, яку ви хочете оновити.

Щоб оновити LinuxCNC з версії, старшої за 2.8, спочатку необхідно оновити стару версію до 2.8, а потім виконати ці інструкції для оновлення до нової версії.

Якщо у вас немає старої версії LinuxCNC для оновлення, тоді краще зробити чисту інсталяцію нової версії, як описано в розділі Отримання LinuxCNC.

Крім того, якщо ви використовуєте Ubuntu Precise, Debian Wheezy або Debian Buster, варто розглянути можливість створення резервної копії каталогу "linuxcnc" на знімному носії та виконання чистої інсталяції новішої ОС та версії LinuxCNC, оскільки ці випуски були EOL у 2017, 2018 та 2022 роках відповідно. Якщо ви використовуєте Ubuntu Lucid, вам доведеться зробити це, оскільки Lucid більше не підтримується LinuxCNC (він був EOL у 2013 році).

Щоб оновити основні версії, наприклад 2.8 до 2.9, коли у вас є мережеве підключення на комп’ютері, вам потрібно вимкнути старі джерела linuxcnc.org apt у файлі /etc/apt/sources.list і додати нове джерело linuxcnc.org apt для 2.9, а потім оновити LinuxCNC.

Деталі залежатимуть від платформи, на якій ви працюєте. Відкрийте terminal, а потім введіть lsb_release -ic, щоб знайти цю інформацію:

lsb_release -ic
Дистриб'ютор ID: Debian
Кодове ім'я:       Trixie

Ви повинні використовувати Debian Bullseye, Bookworm або Trixie, або Ubuntu 20.04 "Focal Fossa" або новішу версію. LinuxCNC 2.9.y не працюватиме на старіших дистрибутивах.

Вам також потрібно буде перевірити, яке ядро реального часу використовується:

uname -r
6.1.0-10-rt-amd64

Якщо ви бачите (як вище) -rt- в імені ядра, то ви використовуєте ядро preempt-rt і повинні встановити версію LinuxCNC «uspace». Ви також повинні встановити uspace для конфігурацій «sim» на ядрах, що не працюють в режимі реального часу.

Якщо ви бачите «-rtai-» в назві ядра, то ви використовуєте RTAI realtime. Дивіться нижче, яку версію LinuxCNC потрібно встановити. Пакет RTAI доступний для Bookworm і Buster, але наразі недоступний для Bullseye.

1.1. Конфігурація Apt Sources

  • Відкрийте вікно «Джерела програмного забезпечення». Процес цього дещо відрізняється на трьох підтримуваних платформах:

    • Debian:

      • Натисніть «Меню програм», потім «Система», а потім «Менеджер пакетів Synaptic».

      • У Synaptic натисніть меню «Налаштування», потім натисніть «Репозиторії», щоб відкрити вікно «Джерела програмного забезпечення».

    • Точність Ubuntu:

      • Натисніть на значок «Головна панель Dash» у верхньому лівому куті.

      • У полі «Пошук» введіть «програмне забезпечення», а потім натисніть на значок «Центр програмного забезпечення Ubuntu».

      • У вікні Центру програмного забезпечення Ubuntu натисніть меню «Редагувати», потім натисніть «Джерела програмного забезпечення…​», щоб відкрити вікно «Джерела програмного забезпечення».

    • Ubuntu Lucid:

      • Натисніть меню «Система», потім «Адміністрування», а потім «Менеджер пакетів Synaptic».

      • У Synaptic натисніть меню «Налаштування», потім натисніть «Репозиторії», щоб відкрити вікно «Джерела програмного забезпечення».

  • У вікні «Джерела програмного забезпечення» виберіть вкладку «Інше програмне забезпечення».

  • Видаліть або зніміть позначки з усіх старих записів linuxcnc.org (залиште всі рядки, що не стосуються linuxcnc.org, як є).

  • Натисніть кнопку «Додати» та додайте новий рядок apt. Рядок дещо відрізнятиметься на різних платформах:

Table 1. Табличний огляд варіантів операційної системи та відповідної конфігурації репозиторію. Конфігурацію можна виконати в графічному інтерфейсі диспетчера пакетів або у файлі /etc/apt/sources.list.
ОС / Версія реального часу Репозиторій

Debian Bullseye - випередження

deb https://linuxcnc.org bullseye base 2.9-uspace

Debian Bookworm - випередити

deb https://linuxcnc.org bookworm base 2.9-uspace

Debian Bookworm - RTAI

deb https://linuxcnc.org bookworm base 2.9-rt

Debian Trixie - витіснення

deb https://linuxcnc.org trixie база 2.9-міліметровий простір

Debian Trixie - RTAI

deb https://linuxcnc.org trixie база 2.9-rt

Налаштування придатних джерел
Figure 1. Рисунок зі скріншотом конфігурації репозиторію менеджера пакетів synaptic.
  • Натисніть кнопку «Додати джерело», а потім «Закрити» у вікні «Джерела програмного забезпечення». Якщо з’явиться вікно з повідомленням про те, що інформація про доступне програмне забезпечення застаріла, натисніть кнопку «Перезавантажити».

1.2. Оновлення до нової версії

Тепер ваш комп’ютер знає, де взяти нову версію програмного забезпечення, далі нам потрібно її встановити.

Процес знову ж таки відрізняється залежно від вашої платформи.

1.2.1. Debian Bullseye, Bookworm та Trixie

Debian використовує менеджер пакетів Synaptic.

  • Відкрийте Synaptic, використовуючи інструкції з розділу Налаштування джерел apt вище.

  • Натисніть кнопку «Перезавантажити».

  • Використайте функцію пошуку для пошуку linuxcnc.

  • Пакет називається "linuxcnc" для ядер RTAI та "linuxcnc-uspace" для preempt-rt.

  • Поставте галочку, щоб позначити нові пакети linuxcnc та linuxcnc-doc-* для оновлення. Менеджер пакетів може вибрати ряд додаткових пакетів для встановлення, щоб задовольнити залежності, які має новий пакет linuxcnc.

  • Натисніть кнопку «Застосувати» та дозвольте комп’ютеру встановити новий пакет. Старий пакет linuxcnc буде автоматично оновлено до нового.

1.3. Ubuntu

  • Натисніть на значок «Головна панель Dash» у верхньому лівому куті.

  • У полі «Пошук» введіть «оновлення», а потім натисніть на значок «Менеджер оновлень».

  • Натисніть кнопку «Перевірити», щоб отримати список доступних пакетів.

  • Натисніть кнопку «Встановити оновлення», щоб встановити нові версії всіх пакетів.

2. Оновлення без мережі

Щоб оновити систему без мережевого підключення, потрібно завантажити .deb-файл, а потім встановити його за допомогою dpkg. Deb-файли можна знайти за адресою https://linuxcnc.org/dists/.

Вам потрібно перейти за посиланням вище, щоб знайти правильний deb-файл для вашої інсталяції. Відкрийте terminal та введіть lsb_release -ic, щоб знайти назву випуску вашої ОС.

> lsb_release -ic
Дистриб'ютор ID: Debian
Кодове ім'я:       trixie

Виберіть ОС зі списку, а потім виберіть потрібну основну версію, наприклад, 2.9-rt для RTAI або 2.9-uspace для preempt-rt.

Далі виберіть тип вашого комп’ютера: binary-amd64 для 64-бітного ПК або binary-arm64 (64-біт) для Raspberry Pi.

Далі виберіть потрібну версію знизу списку, наприклад, «linuxcnc-uspace_2.9.8_amd64.deb» (виберіть найновішу за датою). Завантажте deb-файл і скопіюйте його до свого домашнього каталогу. Ви можете перейменувати файл на щось коротше за допомогою файлового менеджера, наприклад, «linuxcnc_2.9.8.deb», потім відкрийте термінал і встановіть його за допомогою менеджера пакетів за допомогою цієї команди:

sudo dpkg -i linuxcnc_2.9.8.deb

3. Оновлення файлів конфігурації для версії 2.9

3.1. Суворіша обробка підключаємих інтерпретаторів

Якщо ви просто запускаєте звичайний G-код і не знаєте, що таке підключаємий інтерпретатор, то цей розділ вас не стосується.

Рідко використовуваною функцією LinuxCNC є підтримка підключаємих інтерпретаторів, якими керує недокументований INI-файл [TASK]INTERPRETER.

Версії LinuxCNC до версії 2.9.0 обробляли неправильне налаштування [TASK]INTERPRETER, автоматично повертаючись до використання інтерпретатора G-коду за замовчуванням.

Починаючи з версії 2.9.0, неправильне значення [TASK]INTERPRETER призведе до відмови LinuxCNC запускатися. Виправте цю ситуацію, видаливши налаштування [TASK]INTERPRETER з вашого INI-файлу, щоб LinuxCNC використовував інтерпретатор G-коду за замовчуванням.

3.2. Кантерп

Якщо ви просто запускаєте звичайний G-код і не використовуєте підключаємий інтерпретатор canterp, то цей розділ вас не стосується.

У надзвичайно малоймовірному випадку, якщо ви використовуєте canterp, майте на увазі, що модуль переміщено з /usr/lib/libcanterp.so до /usr/lib/linuxcnc/canterp.so, і налаштування [TASK]INTERPRETER відповідно потрібно змінити з libcanterp.so на canterp.so.

3.3. Обмеження шпинделя в INI

Тепер можна додавати налаштування до розділу [SPINDLE] INI-файлу.

MAX_FORWARD_VELOCITY = 20000 Максимальна швидкість шпинделя (в об/хв)

MIN_FORWARD_VELOCITY = 3000 Мінімальна швидкість шпинделя (в об/хв)

MAX_REVERSE_VELOCITY = 20000 Якщо цей параметр пропустити, він матиме значення MAX_FORWARD_VELOCITY за замовчуванням.

MIN_REVERSE_VELOCITY = 3000` Цей параметр еквівалентний MIN_FORWARD_VELOCITY, але для зворотного обертання шпинделя. Якщо його пропустити, за замовчуванням використовуватиметься MIN_FORWARD_VELOCITY.

INCREMENT = 200 Встановлює розмір кроку для команд збільшення/зменшення швидкості шпинделя. Це значення може бути різним для кожного шпинделя. Цей параметр діє з AXIS та Touchy, але зверніть увагу, що деякі екрани керування можуть обробляти речі по-різному.

HOME_SEARCH_VELOCITY = 100 - Прийнято, але наразі нічого не робить

HOME_SEQUENCE = 0 - Прийнято, але наразі нічого не робить

4. Оновлення файлів конфігурації для версії 2.10.y

Touchy: записи Touchy MACRO тепер слід розміщувати в розділі [MACROS] INI-файлу, а не в розділі [TOUCHY]. Це частина процесу уніфікації налаштувань INI між графічними інтерфейсами.

The mesa_modbus framework (modcompile and the mesa_modbus.c.tmpl driver template) has been removed. Configurations using it must migrate to the hm2_modbus driver with mesambccc-compiled MBCCB files, see hm2_modbus(9) and mesambccc(1). The 2.9 release retains the framework, so its documentation remains available in the 2.9 docs.

5. Preview renderer now requires OpenGL 3.3 core

The G-code preview shared by AXIS, the GTK screens (Gremlin / gmoccapy / gscreen / GladeVCP hal_gremlin / QtPlasmaC), and QtVCP was rewritten to use a single modern OpenGL 3.3 core-profile renderer (shaders, VBOs, an offscreen framebuffer for click selection, a glyph-atlas for overlay text). The legacy fixed-function path (display lists, immediate mode, GL_SELECT picking, glBitmap text, line stipple, GL_LIGHTING) has been removed. There is no runtime switch and no in-process fallback.

Hardware requirement. OpenGL 3.3 core is needed. On the supported platform (Linux with Mesa) this is available on Intel Sandy Bridge (2011) and newer, AMD r600 and newer, and nouveau. Machines without a capable GPU can use Mesa’s software renderer (llvmpipe), which handles the line-dominated preview acceptably:

LIBGL_ALWAYS_SOFTWARE=1 linuxcnc myconfig.ini

If a core context cannot be created the GUI exits at start-up with a diagnostic naming the OpenGL 3.3 requirement and suggesting LIBGL_ALWAYS_SOFTWARE=1, rather than starting with a blank or corrupt preview.

Warning
BREAKING: out-of-tree screens that inject raw legacy OpenGL

Custom screens that subclass the in-tree preview classes and override a drawing internal to emit raw fixed-function OpenGL (immediate mode, display lists, glBitmap, etc.) will fail against a core context. Compatibility is preserved only at the calling surface: the public methods and attributes of rs274.glcanon.GlCanonDraw / glnav.GlNavBase used by the in-tree GUIs keep their names, signatures, and behaviour (realize, redraw, redraw_perspective, redraw_ortho, select, set_highlight_line, set_canon, posstrs, the stale_dlist(...) cache-invalidation entry points, and the get_*/is_* callback contract). Move any custom drawing onto those supported entry points, or draw with your own modern-OpenGL code.

The immediate-mode drawing helpers of the old renderer (linuxcnc.draw_lines, linuxcnc.line9, linuxcnc.draw_dwells, linuxcnc.positionlogger.call()) are retired. They keep their names, signatures and argument checking so that out-of-tree callers still import and run, but they draw nothing and raise a DeprecationWarning on first use. The in-tree GUIs bake geometry to VBOs and upload the backplot from positionlogger.points().

5.1. Notes for integrators and driver authors

  • AXIS / Togl. The vendored Togl widget (src/emc/usr_intf/axis/extensions/togl.c) gained a boolean -coreprofile option (default false). When true it creates the context with glXChooseFBConfig + glXGetVisualFromFBConfig
    glXCreateContextAttribsARB (OpenGL 3.3 core), raising a descriptive Tcl error on failure. AXIS always enables it. The default (false) path is unchanged, so vismach and any out-of-tree Togl users keep their legacy contexts.

  • Gremlin (GTK). GTK3 only hands out core contexts through GtkGLArea, so the gremlin widget still builds its context by hand via GLX, now requesting 3.3 core with glXCreateContextAttribsARB. PyOpenGL cannot resolve that extension entry point (it comes back as a null function), so gremlin loads libGL directly with ctypes and creates and binds the context (choose-fbconfig / make-current / swap) through that one handle to avoid mixing context pointers.

  • Line width in core profiles. A forward-compatible core context (Qt requests one) rejects glLineWidth(> 1) with GL_INVALID_VALUE even though GL_ALIASED_LINE_WIDTH_RANGE reports a larger maximum. The renderer probes the accepted width once and caches it, so thick lines (the selection highlight, dwell markers) degrade to 1 px on such drivers instead of raising; a non-forward-compatible core context (AXIS’s Togl, Gremlin’s GLX) keeps the wider lines. Thick lines via quad expansion are a possible future improvement.

  • vismach is unaffected: it keeps its legacy Togl context and immediate-mode drawing; only its camera consumes the (now GL-free) explicit matrices from glnav.

5.2. The program is built in C++ during the parse

gcode.parse no longer drives the preview through per-move Python callbacks. For a canon that subclasses gcode.RendererCanon - rs274.glcanon.GLCanon is one, so every in-tree preview is - the whole program is built in C++ (GCodeRenderer, src/emc/rs274ngc/gcode_renderer.{hh,cc}): the g92/rotation/g5x transform, arc segmentation, rigid taps, (AXIS,hide) suppression, the vertices per drawn plane, the extents, the path lengths and the dwell and tool-change records. The finished program is handed over once, at the end of the parse, as a gcode.PreviewGeometry through the canon’s adopt_geometry(). A parse reads two more things off such a canon: program_geometry (the GEOMETRY strings and the rotation offsets) and arcdivision, which defaults to 64 and is read once at parse start. Every parse starts from a zero transform with nothing drawn; where the machine stands arrives as the caller’s initcode (a G53 G0 per axis), which the leading-traverse drop repositions on rather than draws. A RendererCanon subclass without a callable adopt_geometry is a TypeError from gcode.parse, not a silent fall back to callbacks.

The per-event canon protocol is unchanged for every other canon: rs274.interpret.PrintCanon, the interpreter tests and out-of-tree users of gcode.parse still receive straight_feed, arc_feed, next_line and the rest exactly as before, and rs274.interpret.Translated / ArcsToSegmentsMixin remain for them. The gcode module itself was rewritten on pybind11; its functions keep their names and signatures. One behaviour change: gcode.linecode() snapshots the running parse, and raises ValueError when no parse is in progress.

Warning
BREAKING: out-of-tree canons that subclass rs274.glcanon.GLCanon

On a rendered parse the interpreter forwards only next_line (on the handful of lines that still forward, not once per line), comment, message, change_tool, check_abort, the get_* queries and parameter_file. Consequently:

  • Overrides of the per-move methods are never called. straight_traverse, straight_feed, straight_probe, arc_feed, straight_arcsegments, rigid_tap, dwell, user_defined_function, set_g5x_offset, set_g92_offset, set_xy_rotation, tool_offset, set_plane, select_plane, set_feed_rate and set_spindle_rate no longer exist on GLCanon, and a subclass that defines them is not called back. Read the finished program from canon.program_geometry instead.

  • next_line is not a per-line tick. A progress bar overrides renderer_progress(lineno), which fires on the parser’s 100 ms tick and before each forwarded callback. AXIS and QtVCP show (AXIS,notify) / (PREVIEW,notify) messages by checking once more after load_preview returns, since no next_line follows the comment.

  • Parse-state attributes are gone. lo, first_move, xo..wo, suppress, in_arc, plane, feedrate, g5x_index, g5x_offset_*, g92_offset_*, rotation_xy, rotation_sin, rotation_cos and rotate_and_translate(). GLCanon no longer mixes in Translated or ArcsToSegmentsMixin; the renderer keeps its own copy of the offsets, the rotation, the plane and the feed rate and forwards none of them. Nothing in the tree reads them - the DROs read the status channel.

  • The per-move lists are gone. traverse, feed, arcfeed, moves, move_cats and preview_zero_rxy raise AttributeError on read, naming the replacement: the program record’s positions()/lines/kinds, g0_length/g1_length/run_time() and extents_zero_rxy.

  • tool_list and dwells fill at the end of the parse (in adopt_geometry) rather than growing during it. dwells keeps its column order and raw machine coordinates.

  • Still honoured: arcdivision (set from [DISPLAY]ARCDIVISION), the comment vocabulary (stop, notify, the foam Z levels; hide/show are counted in C++ from the same text), and change_tool, which the interpreter still needs for a G43 after an M6.

5.3. How the preview is put together

The drawing itself lives in lib/python/rs274/glcanon_scene.py, in four tiers. Nothing here changes what the preview looks like; it is where to start reading if you need to fix or extend one part of it.

  • Parts. One class per drawing concern - grid, program geometry, extents, bounding box, offsets, small origin, axes, machine-limits box, tool, live backplot, DRO overlay, the user_plot() hook. A part draws that one thing and nothing else. Adding a preview element means adding a part and placing it in the scene’s order, not editing an existing part.

  • The scene. PreviewScene holds the parts in draw order and runs them. Visibility is decided by the scene, not the part: it evaluates each part’s visible(ctx) and simply does not call a part whose gate is false, so draw() may assume it is visible and must not open with an if not shown: return. Gates that couple parts belong to the scene too - the extents-versus-bounding-box either/or, and the translucent compositing program_alpha wraps the program in.

  • Primitives. Services several parts share - a line array, a wireframe box, Hershey vector text, the tool-cone mesh - reached as ctx.prim. Letters are a primitive that axes, extents and offsets all use, not a sibling of "axes".

  • Passes. The preview is three sets of depth/blend state, not an arbitrary order: world geometry, translucent geometry drawn over it at equal depth, and the screen-space overlay. Each part declares its pass_; the scene sets the state when the pass changes. A part that needs something else for its own drawing (the tool’s constant-alpha blend) restores it afterwards.

Transforms go through a scoped model-view stack: with ctx.mv.push(): restores the previous transform on exit, including when an exception unwinds through it, so a part cannot leak a transform onto a later one. Offsets, small origin and axes share one such scope (RelativeCoordGroup), because the axes are drawn in the offset frame the offsets progressively build.

Parts read a FrameContext - an explicit, enumerated list of machine, view and renderer state, built once per frame by GlCanonDraw - rather than the widget itself. That is what lets them be tested without a window: build a context by hand, call part.draw(ctx), and assert on the vertices it emitted.

Click-to-select is not a part - it draws nothing to the screen. Picker renders the same program geometry into an offscreen framebuffer with line numbers encoded as colour and resolves the nearest hit; GlCanonDraw.select(x, y) delegates to it. It shares one ProgramGeometry with the drawing part, so the pickable geometry and the drawn geometry cannot drift apart.

Setting GLCANON_DEBUG=1, the preview’s one verbosity switch, raises the rs274 logger to DEBUG, checks glGetError after each pass, logs which parts the scene drew and which it skipped whenever that split changes, and reports depth/blend state a part left behind.

6. Нові компоненти HAL

6.1. Не в реальному часі

mdro mqtt-видавник pi500_vfd pmx485-тест qtplasmac-cfg2prefs qtplasmac-матеріали qtplasmac-plasmac2qt qtplasmac-налаштування sim-факел svd-ps_vfd

6.2. У режимі реального часу

anglejog div2 enum filter_kalman flipflop homecomp limit_axis mesa_uart millturn scaled_s32_sums tof ton

7. Нові водії

Було представлено фреймворк для керування пристроями ModBus за допомогою послідовних портів на багатьох платах Mesa. http://linuxcnc.org/docs/2.9/html/drivers/mesa_modbus.html

Новий драйвер GPIO для будь-якого GPIO, який підтримується бібліотекою gpiod, тепер включено: http://linuxcnc.org/docs/2.9/html/drivers/hal_gpio.html