Files
2026-08-20 06:17:39 +08:00

201 lines
5.4 KiB
INI

# Simulated 3-axis mill demonstrating first-class MTConnect support.
#
# This is the standard sim/axis machine plus an [MTCONNECT] section and an
# [APPLICATIONS] entry that launches the MTConnect agent after the GUI starts.
# The core HAL files (core_sim.hal, ...) are found in the system HALLIB; only
# cooling.hal is local to the sibling sim/axis directory.
#
# Run: linuxcnc example.ini
# Then: curl http://localhost:5000/probe
[EMC]
VERSION = 1.1
MACHINE = LinuxCNC-MTConnect-Demo
DEBUG = 0
[DISPLAY]
DISPLAY = axis
CYCLE_TIME = 0.100
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
MAX_SPINDLE_OVERRIDE = 1.0
MAX_LINEAR_VELOCITY = 5
DEFAULT_LINEAR_VELOCITY = .25
DEFAULT_SPINDLE_SPEED = 200
PROGRAM_PREFIX = ../../../nc_files/
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
TOOL_EDITOR = tooledit
# MTConnect feature -----------------------------------------------------------
# A few lines enable the whole feature. The device model (/probe) is generated
# automatically from the sections below.
[MTCONNECT]
ENABLE = 1
DEVICE_NAME = mtconnect_demo
UUID = linuxcnc-demo-0001
HTTP_PORT = 5000
# HTTP_BIND: interface to serve on. Default 127.0.0.1 (loopback only); set to
# 0.0.0.0 to expose the agent on the LAN. (INI values take no inline comments.)
# HTTP_BIND = 127.0.0.1
# TRANSPORT: comma-separated list of http, mqtt, shdr (legacy "both" = http,mqtt)
TRANSPORT = http
SAMPLE_HZ = 10
# MQTT_BROKER = localhost
# MQTT_PORT = 1883
# MQTT_PREFIX = MTConnect
# Custom HAL pins as MTConnect data items. Each HAL_ITEM reads a HAL pin/signal
# (via hal.get_value) into a standard MTConnect SAMPLE data item. component=
# names the host (default: a generic Sensor; or spindle/controller/path/an axis).
# Only standard MTConnect SAMPLE types are accepted (e.g. LOAD, TEMPERATURE,
# PRESSURE, VOLTAGE, AMPERAGE, FREQUENCY, ANGLE, VELOCITY, TORQUE, ...).
# HAL_ITEM = pin=spindle.0.load, id=spindle_load, type=LOAD, units=PERCENT, component=spindle
# HAL_ITEM = pin=hm2_5i25.temp, id=board_temp, type=TEMPERATURE, units=CELSIUS
# Solid-model geometry. The /probe document references meshes with SolidModel
# elements and the agent serves them from /models/, so a standard MTConnect twin
# viewer (e.g. demo.mtconnect.org, TrakHound) can render the machine. LinuxCNC
# bundles no viewer. MODEL_AUTO generates simple placeholder box geometry for the
# base and each axis from the travel limits, so it works with no mesh files. To
# use real geometry instead, drop STL/OBJ/glTF files in models/ and set
# MODEL_BASE / MODEL_X / MODEL_Y / MODEL_Z. Meshes must be authored in
# millimetres (MTConnect's canonical unit; SolidModel carries no per-mesh unit).
MODEL_AUTO = 1
# Nesting order of the moving links.
MODEL_CHAIN = Y X Z
# Branched topology: the quill/tool (Z) hangs off the base, not the table.
MODEL_PARENT_Z = BASE
# Table/saddle physically move opposite the reported (tool-relative) coordinate.
MODEL_INVERT = X Y
[TASK]
TASK = milltask
CYCLE_TIME = 0.001
[RS274NGC]
PARAMETER_FILE = sim.var
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD = 0
SERVO_PERIOD = 1000000
[EMCIO]
TOOL_TABLE = ../sim.tbl
TOOL_CHANGE_POSITION = 0 0 0
TOOL_CHANGE_QUILL_UP = 1
[HAL]
HALFILE = core_sim.hal
HALFILE = sim_spindle_encoder.hal
HALFILE = axis_manualtoolchange.hal
HALFILE = simulated_home.hal
HALFILE = check_xyz_constraints.hal
HALFILE = ../cooling.hal
# Load the MTConnect agent as a userspace HAL component (see mtconnect.hal).
HALFILE = mtconnect.hal
HALUI = halui
[TRAJ]
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
MAX_LINEAR_VELOCITY = 4
DEFAULT_LINEAR_ACCELERATION = 100
MAX_LINEAR_ACCELERATION = 100
POSITION_FILE = position.txt
[KINS]
KINEMATICS = trivkins
JOINTS = 3
# Spindle 0 usable speed band (RPM) for a small VFD-driven knee mill. The agent
# maps the forward limits into /probe as both a spindle
# <Specification type="ROTARY_VELOCITY"> (Maximum/Minimum) under the Rotary "S"
# component and <Constraints> on the commanded-velocity DataItem.
[SPINDLE_0]
MIN_FORWARD_VELOCITY = 100
MAX_FORWARD_VELOCITY = 6000
# Reverse band + step size: not read by the agent, included for a realistic
# machine model (MAX_REVERSE defaults to MAX_FORWARD if omitted).
MAX_REVERSE_VELOCITY = 6000
INCREMENT = 100
[AXIS_X]
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
[AXIS_Y]
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
[AXIS_Z]
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
MIN_LIMIT = -8.0
MAX_LIMIT = 0.12
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 5
MAX_ACCELERATION = 50.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
FERROR = 0.050
MIN_FERROR = 0.010
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 5
MAX_ACCELERATION = 50.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
FERROR = 0.050
MIN_FERROR = 0.010
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 5
MAX_ACCELERATION = 50.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -8.0
MAX_LIMIT = 0.12
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET = 1.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 20.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0