Import LinuxCNC source tree

This commit is contained in:
Wang Dequan
2026-08-20 06:17:39 +08:00
commit 2c814634c3
9429 changed files with 10556013 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
Vigilant Products
www.vigproducts.com

View File

@@ -0,0 +1,244 @@
# EMC controller parameters for generic controller. Make these what you need
# for your system.
# General note: Comments can either be preceded with a # or ; - either is
# acceptable, although # is in keeping with most linux config files.
# Settings with a + at the front of the comment are likely needed to get
# changed by the user.
# Settings with a - at the front are highly unneeded to be changed
###############################################################################
# General section
###############################################################################
[EMC]
#- Version of this INI file
VERSION = 1.1
#+ Name of machine, for use with display, etc.
MACHINE = LinuxCNC-HAL-VTI
#+ Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
DEBUG = 0
# DEBUG = 0x00000007
# DEBUG = 0x7FFFFFFF
###############################################################################
# Sections for display options
###############################################################################
[DISPLAY]
#+ Name of display program, e.g., axis
# DISPLAY = axis
DISPLAY = tklinuxcnc
# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME = 0.200
#- Path to help file
HELP_FILE = tklinuxcnc.txt
#- Initial display setting for position, RELATIVE or MACHINE
POSITION_OFFSET = RELATIVE
#- Initial display setting for position, COMMANDED or ACTUAL
POSITION_FEEDBACK = ACTUAL
#+ Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE = 1.2
#- Prefix to be used
PROGRAM_PREFIX = ../../nc_files/
#- Introductory graphic
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
###############################################################################
# Task controller section
###############################################################################
[FILTER]
#No Content
[RS274NGC]
#- File containing interpreter variables
PARAMETER_FILE = vti.var
###############################################################################
# Motion control section
###############################################################################
[EMCMOT]
#- Name of the motion controller to use (only one exists for nontrivkins)
EMCMOT = motmod
#- Timeout for comm to emcmot, in seconds
COMM_TIMEOUT = 1.0
#- Servo task period, in nanosecs
SERVO_PERIOD = 1000000
###############################################################################
# Hardware Abstraction Layer section
###############################################################################
[TASK]
# Name of task controller program, e.g., milltask
TASK = milltask
#- Cycle time, in seconds, that task controller will sleep between polls
CYCLE_TIME = 0.010
###############################################################################
# Part program interpreter section
###############################################################################
[HAL]
# The run script first uses halcmd to execute any HALFILE
# files, and then to execute any individual HALCMD commands.
#
# list of hal config files to run through halcmd
#+ files are executed in the order in which they appear
HALFILE = core_servo.hal
HALFILE = vti_motion.hal
HALFILE = vti_io.hal
#- list of halcmd commands to execute
# commands are executed in the order in which they appear
#HALCMD = save neta
###############################################################################
# Trajectory planner section
###############################################################################
[HALUI]
#No Content
[TRAJ]
#+ machine specific settings
# COORDINATES = X Y Z R P W
COORDINATES = X Y Z
HOME = 0 0 0
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 2.000
MAX_LINEAR_VELOCITY = 30.48
DEFAULT_LINEAR_ACCELERATION = 300.0
MAX_LINEAR_ACCELERATION = 500.0
###############################################################################
# Axes sections
###############################################################################
#+ First axis
# each setting is commented for axis_0
[EMCIO]
#- tool table file
TOOL_TABLE = vti.tbl
[KINS]
KINEMATICS = trivkins
JOINTS = 3
[AXIS_X]
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0
MAX_VELOCITY = 30.48
MAX_ACCELERATION = 500.0
[JOINT_0]
# type of axis, LINEAR vs. ROTARY
TYPE = LINEAR
# home position
HOME = 0.000
# maximum velocity
MAX_VELOCITY = 30.48
# maximum acceleration
MAX_ACCELERATION = 500.0
# mechanical backlash measured
BACKLASH = 0.000
# time to update the axis
# number of encoder ticks / unit
INPUT_SCALE = 800
# dac gain for output
OUTPUT_SCALE = 1.000
# dac bias for output
OUTPUT_OFFSET = 0.000
# minimum travel limit (from position 0)
MIN_LIMIT = -1000.0
# maximum travel limit (from position 0)
MAX_LIMIT = 1000.0
# following error at max speed
FERROR = 1.270
# following error when halted
MIN_FERROR = 0.254
# read HAL_Introduction.pdf for an insight about Homing
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
# PID tuning params
MAX_OUTPUT = 1.0
DEADBAND = 0.000381
P = 100.0
I = 0.000
D = 0.000
FF0 = 0.000
FF1 = 0.000
FF2 = 0.0
BIAS = 0.000
#+ Second axis
[AXIS_Y]
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0
MAX_VELOCITY = 30.48
MAX_ACCELERATION = 500.0
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 30.48
MAX_ACCELERATION = 500.0
BACKLASH = 0.000
INPUT_SCALE = 200
OUTPUT_SCALE = 1.000
OUTPUT_OFFSET = 0.000
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0
FERROR = 1.270
MIN_FERROR = 0.254
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
# PID tuning params
MAX_OUTPUT = 1.0
DEADBAND = 0.000381
P = 100.0
I = 0.000
D = 0.000
FF0 = 0.000
FF1 = 0.000
FF2 = 0.0
BIAS = 0.000
#+ Third axis
[AXIS_Z]
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0
MAX_VELOCITY = 30.48
MAX_ACCELERATION = 500.0
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 30.48
MAX_ACCELERATION = 500.0
BACKLASH = 0.000
INPUT_SCALE = 200
OUTPUT_SCALE = 1.000
OUTPUT_OFFSET = 0.000
MIN_LIMIT = -1000.0
MAX_LIMIT = 1000.0
FERROR = 1.270
MIN_FERROR = 0.254
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
# PID tuning params
MAX_OUTPUT = 1.0
DEADBAND = 0.000381
P = 100.0
I = 0.000
D = 0.000
FF0 = 0.000
FF1 = 0.000
FF2 = 0.0
BIAS = 0.000
###############################################################################
# section for main IO controller parameters
###############################################################################

View File

@@ -0,0 +1,4 @@
T1 P1 D0.125000 Z+0.511000 ;1/8 end mill
T2 P2 D0.062500 Z+0.100000 ;1/16 end mill
T3 P3 D0.201000 Z+1.273000 ;#7 tap drill
T99999 P99999 Z+0.100000 ;big tool number

View File

@@ -0,0 +1,30 @@
This configuration step is intended for servo machines running the Vigilant Technologies PCI-ENCDAC 4 channel card.
Check www.Vigilanttech.com for additional details.
You can have either a standard pinout (LinuxCNC style) or you could make a new one which would suit your own custom cabling.
Right now the ini file is for metric setup, but an inch specific one could be easily added.
Detailed description:
* nml files
-- it uses a default nml file (found in configs/common/linuxcnc.nml), but copied over here during the first make
* hal files
-- it uses a default servo hal file (found in configs/common/core_servo.hal), but copied over here during the first make
-- vti_motion.hal - this is the main hal file for the VTI, it loads the vti driver and sets up motion specific links, it is fairly well commented, so it should be easy to read / modify.
-- vti_io.hal - this is the second hal file for the VTI, it configures IO specific links (like the pin number where the X limit switch is, or where the spindle start pin is connected), it is fairly well commented, so it should be easy to read / modify. This servo setup is mostly for serious machines, so the ESTOP should really be planned / implemented properly (that means use an external ESTOP chain, and let LinuxCNC know about it, and let LinuxCNC interrupt the external chain too). Read more about this in the wiki at http://wiki.linuxcnc.org/
* additional files
-- vti.tbl - this is the tool table file, and it holds definitions for the tools used, along with tool sizes for compensation (tool length & tool diameter)
-- vti.var - the variables file. This file is used by the interpreter to save internal variables when LinuxCNC shuts down, and rereads them on the next startup.
Further specific information can be found in the LinuxCNC wiki:
http://wiki.linuxcnc.org/

View File

@@ -0,0 +1,125 @@
# HAL config file for Vigilant Technologies Inc. VTI PCA board
#
# install driver (only needed if vti_motion.hal doesn't get run)
#loadrt hal_vti
# add I/O to servo thread so they will be evaluated
# every servo period
# read inputs first
addf vti.di-read servo-thread 1
# write outputs last
addf vti.do-write servo-thread -1
#uncomment following line if ADC's are needed (for example spindle-tach feedback)
#addf vti.0.read-adcs servo-thread 1
#
# Connect motion controller I/Os
#
# connect limit/home switch outputs to motion controller
#newsig Xminlim bit
#newsig Xmaxlim bit
#newsig Xhome bit
#linksp Xminlim <= vti.in-02
#linksp Xminlim => joint.0.neg-lim-sw-in
#linksp Xmaxlim <= vti.in-01
#linksp Xmaxlim => joint.0.pos-lim-sw-in
#linksp Xhome <= vti.in-00
#linksp Xhome => joint.0.home-sw-in
#newsig Yminlim bit
#newsig Ymaxlim bit
#newsig Yhome bit
#linksp Yminlim <= vti.in-06
#linksp Yminlim => joint.1.neg-lim-sw-in
#linksp Ymaxlim <= vti.in-05
#linksp Ymaxlim => joint.1.pos-lim-sw-in
#linksp Yhome <= vti.in-04
#linksp Yhome => joint.1.home-sw-in
#newsig Zminlim bit
#newsig Zmaxlim bit
#newsig Zhome bit
#linksp Zminlim <= vti.in-10
#linksp Zminlim => joint.2.neg-lim-sw-in
#linksp Zmaxlim <= vti.in-09
#linksp Zmaxlim => joint.2.pos-lim-sw-in
#linksp Zhome <= vti.in-08
#linksp Zhome => joint.2.home-sw-in
#continue in the same manner for further axes (A,B,C)
# connect amp faults to motion controller
#newsig Xfault bit
#newsig Yfault bit
#newsig Zfault bit
#linksp Xfault <= vti.in-03
#linksp Xfault => joint.0.amp-fault-in
#linksp Yfault <= vti.in-07
#linksp Yfault => joint.1.amp-fault-in
#linksp Zfault <= vti.in-11
#linksp Zfault => joint.2.amp-fault-in
# connect index pulses to motion controller
# do these when index pulsing is figured out
#newsig Xindex bit
#newsig Yindex bit
#newsig Zindex bit
#linksp Xindex <= vti.0.enc-index
#linksp Xindex => joint.0.index-enable
#linksp Yindex <= vti.1.enc-index
#linksp Yindex => joint.1.index-enable
#linksp Zindex <= vti.2.enc-index
#linksp Zindex => joint.2.index-enable
# connect amp enables to motion controller
#linksp Xenable => vti.out-00
#linksp Yenable => vti.out-01
#linksp Zenable => vti.out-02
# connect watchdog reset to motion controller
# needs watchdo
#newsig WatchdogRst bit
#linksp WatchdogRst <= vti.watchdog-reset
#linksp WatchdogRst => motion.watchdog-reset-out
#
# Connect I/O controller I/Os
#
# connect e-stop write/sense to I/O controller
# these connections assume an external ESTOP circuitry will be used
# if it's not used, comment the next lines and uncomment the loopback
#newsig EstopSense bit
#newsig EstopWrite bit
#linksp EstopSense <= vti.in-12
#linksp EstopSense => iocontrol.0.emc-enable-in
#linksp EstopWrite <= vti.out-07
#linksp EstopWrite => iocontrol.0.user-enable-out
# ESTOP loopback, only use this for a simple machine without external ESTOP
# you really SHOULDN'T use a servo machine without proper ESTOP
#net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
# connect spindle fwd/rev to I/O controller
#newsig SpindleFwd bit
#newsig SpindleRev bit
#linksp SpindleFwd <= vti.out-06
#linksp SpindleFwd => spindle.0.forward
#linksp SpindleRev <= vti.out-05
#linksp SpindleRev => spindle.0.reverse
# connect spindle brake to I/O controller
#newsig SpindleBrakeOn bit
#linksp SpindleBrakeOn <= vti.out-10
#linksp SpindleBrakeOn => spindle.0.brake
# connect mist/flood coolant to I/O controller
#newsig MistOn bit
#newsig FloodOn bit
#linksp MistOn <= vti.out-11
#linksp MistOn => iocontrol.0.coolant-mist
#linksp FloodOn <= vti.out-12
#linksp FloodOn => iocontrol.0.coolant-flood

View File

@@ -0,0 +1,37 @@
# HAL config file for Vigilant Technologoes VTI PCI board
#
# install driver, this should autodetect the board
# if that doesn't work, try using base=0xABC, where ABC matches your setup
# loadrt hal_stg base=0x200
loadrt hal_vti num_chan=4 dio="IOIO"
# add functions to servo thread so they will be evaluated
# every servo period
# read inputs first
addf vti.capture-position servo-thread 1
# write outputs last
addf vti.write-dacs servo-thread -1
# connect position feedback signals to encoders
net Xpos-fb <= vti.0.position
net Ypos-fb <= vti.1.position
net Zpos-fb <= vti.2.position
# get feedback scaling from ini file
setp vti.0.position-scale [JOINT_0]INPUT_SCALE
setp vti.1.position-scale [JOINT_1]INPUT_SCALE
setp vti.2.position-scale [JOINT_2]INPUT_SCALE
# connect PID output signals to DACs
net Xoutput => vti.0.dac-value
net Youtput => vti.1.dac-value
net Zoutput => vti.2.dac-value
# set output scaling from ini file
setp vti.0.dac-gain [JOINT_0]OUTPUT_SCALE
setp vti.1.dac-gain [JOINT_1]OUTPUT_SCALE
setp vti.2.dac-gain [JOINT_2]OUTPUT_SCALE
# set output offset to zero
setp vti.0.dac-offset [JOINT_0]OUTPUT_OFFSET
setp vti.1.dac-offset [JOINT_1]OUTPUT_OFFSET
setp vti.2.dac-offset [JOINT_2]OUTPUT_OFFSET