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,7 @@
This configuration step is intended for Sherline stepper lathes.
SherlineLathe_inch.in
inch units
SherlineLathe_mm.in
metric units

View File

@@ -0,0 +1,206 @@
# 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-STEP-IN
#+ 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]
DISPLAY = axis
# DISPLAY = tklinuxcnc
# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME = 0.200
LATHE = 1
#- 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 = stepper.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
#+ Base task period, in nanosecs - this is the fastest thread in the machine
BASE_PERIOD = 50000
#- Servo task period, in nanosecs - will be rounded to an int multiple of BASE_PERIOD
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_stepper.hal
#HALFILE = xylotex_pinout.hal
HALFILE = standard_pinout.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 A B C
COORDINATES = X Z
HOME = 0 0 0
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 0.18
MAX_LINEAR_VELOCITY = .36
DEFAULT_LINEAR_ACCELERATION = 2.0
MAX_LINEAR_ACCELERATION = 2.0
###############################################################################
# Axes sections
###############################################################################
#+ First axis
[EMCIO]
#- tool table file
TOOL_TABLE = stepper.tbl
[KINS]
KINEMATICS = trivkins
JOINTS = 3
[AXIS_X]
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_VELOCITY = .36
MAX_ACCELERATION = 2
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = .36
# NOTE: the step generator module applies its own limits to
# acceleration and velocity. We have discovered that it needs
# to have a little "headroom" over the accel by the trajectory
# planner, otherwise it can fall slightly behind during accel
# and later overshoot as it catches up. In the long term we
# hope to come up with a clean fix for this problem. In the
# meantime, please set STEPGEN_MAXACCEL below to a few percent
# higher than the regular acceleration limit MAX_ACCELERATION
MAX_ACCELERATION = 2
STEPGEN_MAXACCEL = 2.2
BACKLASH = 0.000
SCALE = -16000
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
FERROR = 01.00
MIN_FERROR = 0.5
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
#+ Second axis
[AXIS_Y]
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_VELOCITY = .36
MAX_ACCELERATION = 2.0
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = .36
MAX_ACCELERATION = 2.0
STEPGEN_MAXACCEL = 2.20
BACKLASH = 0.000
SCALE = -16000
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
FERROR = 1
MIN_FERROR = .5
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
#+ Third axis
[AXIS_Z]
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_VELOCITY = .36
MAX_ACCELERATION = 2
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = .36
MAX_ACCELERATION = 2
STEPGEN_MAXACCEL = 2.20
BACKLASH = 0.000
SCALE = -16000
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
FERROR = 01.00
MIN_FERROR = 0.010
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
###############################################################################
# section for main IO controller parameters
###############################################################################

View File

@@ -0,0 +1,206 @@
# 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-STEP-MM
#+ 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]
DISPLAY = axis
# DISPLAY = tklinuxcnc
# Cycle time, in seconds, that display will sleep between polls
CYCLE_TIME = 0.200
LATHE = 1
#- 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 = stepper.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
#+ Base task period, in nanosecs - this is the fastest thread in the machine
BASE_PERIOD = 50000
#- Servo task period, in nanosecs - will be rounded to an int multiple of BASE_PERIOD
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_stepper.hal
#HALFILE = xylotex_pinout.hal
HALFILE = standard_pinout.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 A B C
COORDINATES = X Z
HOME = 0 0 0
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 4.6
MAX_LINEAR_VELOCITY = 8
DEFAULT_LINEAR_ACCELERATION = 50
MAX_LINEAR_ACCELERATION = 50
###############################################################################
# Axes sections
###############################################################################
#+ First axis
[EMCIO]
#- tool table file
TOOL_TABLE = stepper.tbl
[KINS]
KINEMATICS = trivkins
JOINTS = 3
[AXIS_X]
MIN_LIMIT = -400
MAX_LIMIT = 400.0
MAX_VELOCITY = 8
MAX_ACCELERATION = 50
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 8
# NOTE: the step generator module applies its own limits to
# acceleration and velocity. We have discovered that it needs
# to have a little "headroom" over the accel by the trajectory
# planner, otherwise it can fall slightly behind during accel
# and later overshoot as it catches up. In the long term we
# hope to come up with a clean fix for this problem. In the
# meantime, please set STEPGEN_MAXACCEL below to a few percent
# higher than the regular acceleration limit MAX_ACCELERATION
MAX_ACCELERATION = 50
STEPGEN_MAXACCEL = 60
BACKLASH = 0.000
SCALE = -800
MIN_LIMIT = -400
MAX_LIMIT = 400.0
FERROR = 26
MIN_FERROR = 0.26
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
#+ Second axis
[AXIS_Y]
MIN_LIMIT = -300.0
MAX_LIMIT = 300.0
MAX_VELOCITY = 8
MAX_ACCELERATION = 50
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 8
MAX_ACCELERATION = 50
STEPGEN_MAXACCEL = 60
BACKLASH = 0.000
SCALE = -800
MIN_LIMIT = -300.0
MAX_LIMIT = 300.0
FERROR = 26
MIN_FERROR = 0.26
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
#+ Third axis
[AXIS_Z]
MIN_LIMIT = -400.0
MAX_LIMIT = 400.0
MAX_VELOCITY = 8
MAX_ACCELERATION = 50
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 8
MAX_ACCELERATION = 50
STEPGEN_MAXACCEL = 60
BACKLASH = 0.000
SCALE = -800
MIN_LIMIT = -400.0
MAX_LIMIT = 400.0
FERROR = 26
MIN_FERROR = 0.26
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = NO
###############################################################################
# section for main IO controller parameters
###############################################################################

View File

@@ -0,0 +1,77 @@
# standard pinout config file for 3-axis steppers
# using a parport for I/O
#
# first load the parport driver
loadrt hal_parport cfg="0x0378"
#
# next connect the parport functions to threads
# read inputs first
addf parport.0.read base-thread 1
# write outputs last
addf parport.0.write base-thread -1
#
# finally connect physical pins to the signals
net Xstep => parport.0.pin-03-out
net Xdir => parport.0.pin-02-out
net Ystep => parport.0.pin-05-out
net Ydir => parport.0.pin-04-out
net Zstep => parport.0.pin-07-out
net Zdir => parport.0.pin-06-out
# create a signal for the estop loopback
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
# create signals for tool loading loopback
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
# connect "spindle on" motion controller pin to a physical pin
net spindle-on spindle.0.on => parport.0.pin-09-out
###
### You might use something like this to enable chopper drives when machine ON
### the Xen signal is defined in core_stepper.hal
###
# net Xen => parport.0.pin-01-out
###
### If you want active low for this pin, invert it like this:
###
# setp parport.0.pin-01-out-invert 1
###
### A sample home switch on the X axis (axis 0). make a signal,
### link the incoming parport pin to the signal, then link the signal
### to EMC's axis 0 home switch input pin
###
# net Xhome parport.0.pin-10-in => joint.0.home-sw-in
###
### Shared home switches all on one parallel port pin?
### that's ok, hook the same signal to all the axes, but be sure to
### set HOME_IS_SHARED and HOME_SEQUENCE in the ini file. See the
### user manual!
###
# net homeswitches <= parport.0.pin-10-in
# net homeswitches => joint.0.home-sw-in
# net homeswitches => joint.1.home-sw-in
# net homeswitches => joint.2.home-sw-in
###
### Sample separate limit switches on the X axis (axis 0)
###
# net X-neg-limit parport.0.pin-11-in => joint.0.neg-lim-sw-in
# net X-pos-limit parport.0.pin-12-in => joint.0.pos-lim-sw-in
###
### Just like the shared home switches example, you can wire together
### limit switches. Beware if you hit one, EMC will stop but can't tell
### you which switch/axis has faulted. Use caution when recovering from this.
###
# net Xlimits parport.0.pin-13-in => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in

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