The moveoff HAL component is a HAL-only method for implementing offsets. See the manpage ($ man moveoff) for the IMPORTANT limitations and warnings.

Компонент перемещения используется для смещения позиций сочленений с использованием пользовательских соединений HAL. Реализация функции смещения во время паузы программы поддерживается соответствующими соединениями для входных контактов. Поддерживаются девять сочленений.

Значения смещения оси (offset-in-M) непрерывно применяются (с учетом ограничений на значение, скорость и ускорение) к выходным контактам (offset-current-M, pos-plusoffset-M, fb-minusoffset-M), когда оба входных контакта включения (apply-offsets и move-enable) имеют значение TRUE. Два разрешающих входа соединены внутренне как логическое "И". Становится активным контакт предупреждения и выдается сообщение, если контакт apply-offsets становится неактивным во время применения смещений. Контакт предупреждения остается TRUE до тех пор, пока смещения не будут удалены или не будет активен контакт apply-offsets.

Typically, the move-enable pin is connected to external controls and the apply-offsets pin is connected to halui.program.is-paused (for offsets only while paused) or set to TRUE (for continuously applied offsets).

Applied offsets are automatically returned to zero (respecting limits) when either of the enabling inputs is deactivated. The zero value tolerance is specified by the epsilon input pin value.

Путевые точки записываются, когда разрешен компонент перемещения. Путевые точки управляются с помощью контактов waypoint-sample-secs и waypoint-threshold. Когда контакт backtrack-enable в TRUE, auto-return путь следует по записанным путевым точкам. Когда память, доступная для путевых точек, исчерпана, смещения фиксируются и контакт waypoint-limit становится активным. Это ограничение применяется независимо от состояния контакта backtrack-enable. Разрешающий контакт должен быть неактивен, чтобы обеспечить возврат в исходное положение (положение без смещения).

Возврат через путевые точки приводит к «замедлению» скорости движения, поскольку перемещения выполняются от точки к точке с соблюдением настроек скорости и ускорения. Контактами ограничения скорости и ускорения можно управлять динамически, чтобы постоянно контролировать смещения.

When backtrack-enable is FALSE, the auto-return move is NOT coordinated, each axis returns to zero at its own rate. If a controlled path is wanted in this condition, each axis should be manually returned to zero before deasserting an enabling pin.

Контакты waypoint-sample-secs, waypoint-threshold и epsilon оцениваются только тогда, когда компонент простаивает.

The offsets-applied output pin is provided to indicate the current state to a GUI so that program resumption can be managed. If the offset(s) are non-zero when the apply-offsets pin is deasserted (for example when resuming a program when offsetting during a pause), offsets are returned to zero (respecting limits) and an Error message is issued.

Caution
Если смещения включены и применяются, а станок по какой-либо причине выключен, любая «внешняя» логика HAL, которая управляет разрешающими контактами и offset-in-M входами, отвечает за их состояние, когда станок впоследствии снова включается.

This HAL-only means of offsetting is typically not known to LinuxCNC nor available in GUI preview displays. No protection is provided for offset moves that exceed soft limits managed by LinuxCNC. Since soft limits are not honored, an offset move may encounter hard limits (or CRASH if there are no limit switches). Use of the offset-min-M and offset-max-M inputs to limit travel is recommended. Triggering a hard limit will turn off the machine — see Caution above.

The offset-in-M values may be set with INI file settings, controlled by a GUI, or managed by other HAL components and connections. Fixed values may be appropriate in simple cases where the direction and amount of offset is well-defined but a control method is required to deactivate an enabling pin in order to return offsets to zero. GUIs may provide means for users to set, increment, decrement, and accumulate offset values for each axis and may set offset-in-M values to zero before deasserting an enabling pin.

The default values for accel, vel, min, max, epsilon, waypoint-sample-secs, and waypoint-threshold may not be suitable for any particular application. This HAL component is unaware of limits enforced elsewhere by LinuxCNC. Users should test usage in a simulator application and understand all hazards before use on hardware.

Sim configurations that demonstrate the component and a GUI (moveoff_gui) are located in:

  • configs/sim/axis/moveoff (axis-ui)

  • configs/sim/touchy/ngcgui (touchy-ui)

1. Modifying an existing configuration

A system-provided HAL file (LIB:hookup_moveoff.tcl) can be used to adapt an existing configuration to use the moveoff component. Additional INI file settings support the use of a simple GUI (moveoff_gui) for controlling offsets.

When the system HAL file (LIB:hookup_moveoff.tcl) is properly specified in a configuration INI file, it will:

  1. Disconnect the original joint.N.motor-pos-cmd and joint.N.motor-pos-fb pin connections

  2. Load (loadrt) the moveoff component (using the name mv) with a personality set to accommodate all axes identified in the INI file

  3. Add (addf) the moveoff component functions in the required sequence

  4. Повторно соедините контакты Joint.N.motor-pos-cmd и Joint.N.motor-pos-fb, чтобы использовать компонент перемещения

  5. Set the moveoff component operating parameters and limits for each axis in accordance with additional INI file settings

Note: The moveoff_gui application supports configurations that use known kinematics modules with KINEMATICS_TYPE=KINEMATICS_IDENTITY. Supported modules include: trivkins. With identity kins, moveoff_gui assigns each axis name specified with the command line parameter -axes axisnames to the corresponding joint.

Modify an existing configuration as follows:

Убедитесь, что существует запись в INI-файле для [HAL]HALUI и создайте новую запись [HAL]HALFILE для LIB:hookup_moveoff.tcl. Запись для LIB:hookup_moveoff.tcl должна следовать за всеми записями HALFILE= для файлов HAL, которые соединяют контакты для Joint.N.motor-pos-cmd, Joint.N.motor-pos-fb и любых компонентов, подключенных к этим контактам (например, компоненты ПИД и энкодер в сервосистеме).

[HAL]
HALUI   = halui
HALFILE = existing_configuration_halfile_1
...
HALFILE = existing_configuration_halfile_n
HALFILE = LIB:hookup_moveoff.tcl

Add INI file entries for the per-axis settings for each axis in use (if an entry is not defined, the corresponding entry from the [AXIS_n] section will be used, if no entry is found, then the moveoff component default will be used).

Note
Using component defaults or [AXIS_n] section values for per-axis offset settings is NOT recommended.
[MOVEOFF_n]
MAX_LIMIT =
MIN_LIMIT =
MAX_VELOCITY =
MAX_ACCELERATION =

Add INI file entries for moveoff component settings (omit to use moveoff defaults):

[MOVEOFF]
EPSILON =
WAYPOINT_SAMPLE_SECS =
WAYPOINT_THRESHOLD =

The moveoff_gui is used to make additional required connections and provide a popup GUI to:

  1. Provide a control togglebutton to Enable/Disable offsets

  2. Provide a control togglebutton to Enable/Disable backtracking

  3. Provide control pushbuttons to Increment/Decrement/Zero each axis offset

  4. Display each axis offset current value

  5. Display current offset status (disabled, active, removing, etc)

The provided control buttons are optional depending upon the state of the moveoff component move-enable pin. Both a display and controls for enabling offsetting are provided if the pin mv.move-enable is NOT connected when the moveoff_gui is started. For this case, the moveoff_gui manages the moveoff component move-enable pin (named mv.move-enable) as well as the offsets (mv.move-offset-in-M) and the backtracking enable (mv.backtrack-enable)

Если контакт mv.move-enable подключен при запуске moveoff_gui, то moveoff_gui выдаст экран, но НЕ элементы управления. Этот режим поддерживает конфигурации, в которых используется маховичок медленной подачи или другие методы управления входами смещения и разрешающими контактами (mv.offset-in-M, mv.move-enable, mv.backtrack-enable).

moveoff_gui создает необходимые соединения для контактов компонента перемещения: mv.power_on и mv.apply-offsets. Вывод mv.power_on подключается к выводу с поддержкой motion.motion (при необходимости автоматически создается новый сигнал). mv.apply-offsets подключается к halui.program.is-paused или имеет значение 1 в зависимости от параметра командной строки -mode [ onpause | always ]. При необходимости автоматически создается новый сигнал.

To use the moveoff_gui, add an entry in the INI file [APPLICATIONS] section as follows:

[APPLICATIONS]
# Note: a delay (specified in seconds) may be required if connections
# are made using postgui HAL files ([HAL]POSTGUI_HALFILE=)
DELAY = 0
APP = moveoff_gui option1 option2 ...

When the HAL file LIB:hookup_moveoff.tcl is used to load and connect the moveoff component, the mv.move-enable pin will not be connected and local controls provided by the moveoff_gui will be used. This is the simplest method to test or demonstrate the moveoff component when modifying an existing INI configuration.

Чтобы включить внешние элементы управления при использовании отображения moveoff_gui для значений смещения и состояния, файлы HAL, следующие за LIB:hookup_moveoff.tcl, должны установить дополнительные соединения. Например, в поставляемых демонстрационных конфигурациях (configs/sim/axis/moveoff/*.ini) используется простой системный файл HAL (с именем LIB:moveoff_external.hal) чтобы подключать контакты mv.move-enable, mv.offset-in-M. и mv.bactrack-enable к сигналам:

[HAL]
HALUI = halui
...
HALFILE = LIB:hookup_moveoff.tcl
HALFILE = LIB:moveoff_external.hal

The connections made by LIB:moveoff_external.hal (for a three axis configuration) are:

net external_enable mv.move-enable

net external_offset_0 mv.offset-in-0
net external_offset_1 mv.offset-in-1
net external_offset_2 mv.offset-in-2

net external_backtrack_en mv.backtrack-enable

These signals (external_enable, external_offset_M, external_backtrack_en) may be managed by subsequent HALFILES (including POSTGUI_HALFILEs) to provide customized control of the component while using the moveoff_gui display for current offset values and offset status.

The moveoff_gui is configured with command line options. For details on the operation of moveoff_gui, see the man page:

$ man moveoff_gui

For a brief listing of command line options for moveoff_gui, use the command line help option:

$ moveoff_gui --help

Usage:
moveoff_gui [Options]

Options:
    [--help | -? | -- -h ]  (This text)

    [-mode [onpause | always]]  (default: onpause)
                                  (onpause: show gui when program paused)
                                  (always:  show gui always)

    [-axes axisnames]       (default: xyz (no spaces))
                              (letters from set of: x y z a b c u v w)
                              (example: -axes z)
                              (example: -axes xz)
                              (example: -axes xyz)
    [-inc incrementvalue]   (default: 0.001 0.01 0.10 1.0 )
                              (specify one per -inc (up to 4) )
                              (example: -inc 0.001 -inc 0.01 -inc 0.1 )
    [-size integer]         (default: 14)
                              (Overall gui popup size is based on font size)
    [-loc center|+x+y]      (default: center)
                              (example: -loc +10+200)
    [-autoresume]           (default: notused)
                              (resume program when move-enable deasserted)
    [-delay delay_secs]     (default: 5 (resume delay))

Options for special cases:
    [-noentry]              (default: notused)
                             (don't create entry widgets)
    [-no_resume_inhibit]    (default: notused)
                             (do not use a resume-inhibit-pin)
    [-no_pause_requirement] (default: notused)
                             (no check for halui.program.is-paused)
    [-no_cancel_autoresume] (default: notused)
                             (useful for retraact offsets with simple)
                             (external control)
    [-no_display]           (default: notused)
                             (Use when both external controls and displays)
                             (are in use (see Note))

Note: If the moveoff move-enable pin (mv.move-enable) is connected when
      moveoff_gui is started, external controls are required and only
      displays are provided.