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,10 @@
max5 5 axis XYZBC configs
max5triv.ini -- implemented with trivkins
max5kins.ini -- implemented with max5 kinematics
non-identity kinematics
automatic teleop after homing
max5_base.inc -- shared settings

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,159 @@
[MAX]
# distance from the end of the "reference tool" (tool-length - 0) to the
# center of the head tilt axis
B_PIVOT_LENGTH = 0
[DISPLAY]
DISPLAY = axis
CYCLE_TIME = 0.200
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2.0
PROGRAM_PREFIX = ../../nc_files/
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
EDITOR = gedit
[RS274NGC]
PARAMETER_FILE = max5triv.var
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
SERVO_PERIOD = 1000000
[TASK]
TASK = milltask
CYCLE_TIME = 0.010
[TRAJ]
COORDINATES = X Y Z B C
LINEAR_UNITS = mm
ANGULAR_UNITS = deg
DEFAULT_LINEAR_VELOCITY = 200.0
MAX_LINEAR_VELOCITY = 346.0
MAX_LINEAR_ACCELERATION = 800.0
DEFAULT_LINEAR_ACCELERATION = 800.0
[EMCIO]
TOOL_TABLE = max5.tbl
[AXIS_X]
MIN_LIMIT = -100
MAX_LIMIT = 200
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 100.0
[JOINT_0]
# this is the table
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 100.0
MIN_LIMIT = -100
MAX_LIMIT = 200
HOME_OFFSET = 101.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 5.0
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
[AXIS_Y]
MIN_LIMIT = -60
MAX_LIMIT = 60
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 100.0
[JOINT_1]
# this is the saddle
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 100.0
MIN_LIMIT = -60
MAX_LIMIT = 60
HOME_OFFSET = -61
HOME_SEARCH_VEL = -20
HOME_LATCH_VEL = -3
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
[AXIS_Z]
MIN_LIMIT = -149.0
MAX_LIMIT = 1.0
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 100.0
[JOINT_2]
# this is the head moving up and down the column
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 20.0
MAX_ACCELERATION = 100.0
MIN_LIMIT = -149.0
MAX_LIMIT = 1.0
HOME_OFFSET = 2.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 5.0
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
[AXIS_A]
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_VELOCITY = 45.0
MAX_ACCELERATION = 100.0
[JOINT_3]
TYPE = ANGULAR
HOME = 0.000
MAX_VELOCITY = 45.0
MAX_ACCELERATION = 100.0
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 0
[AXIS_B]
MIN_LIMIT = -90.0
MAX_LIMIT = 90.0
MAX_VELOCITY = 45.0
MAX_ACCELERATION = 225.0
[JOINT_4]
# this is the head tilting side to side
TYPE = ANGULAR
HOME = 0.000
MAX_VELOCITY = 45.0
MAX_ACCELERATION = 225.0
MIN_LIMIT = -90.0
MAX_LIMIT = 90.0
HOME_OFFSET = 91.0
HOME_SEARCH_VEL = 25.0
HOME_LATCH_VEL = 3.0
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
[AXIS_C]
MIN_LIMIT = -3600.0
MAX_LIMIT = 3600.0
MAX_VELOCITY = 45.0
MAX_ACCELERATION = 225.0
[JOINT_5]
# this is a rotary table sitting on the main table
TYPE = ANGULAR
HOME = 0.000
MAX_VELOCITY = 45.0
MAX_ACCELERATION = 225.0
MIN_LIMIT = -3600.0
MAX_LIMIT = 3600.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 20.0
HOME_LATCH_VEL = 3.0
HOME_IGNORE_LIMITS = NO
HOME_SEQUENCE = 1

View File

@@ -0,0 +1,112 @@
# HAL config file for vismach simulation of max5 - 9-axis version
# first load all the RT modules that will be needed
# kinematics
loadrt [KINS]KINEMATICS
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
# load five limit3 blocks to simulate the accel and vel limits of the motors
loadrt limit3 count=5
# load window comparators for home/limit switches
loadrt wcomp count=5
loadrt not count=5
# load the vismach model
loadusr -W max5gui
# set a visible tool
#setp max5gui.tool-length 35
setp max5gui.tool-radius 3
net tool-len motion.tooloffset.w max5gui.tool-length
# add motion controller functions to servo thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
# add other functions
addf limit3.0 servo-thread
addf limit3.1 servo-thread
addf limit3.2 servo-thread
addf limit3.3 servo-thread
addf limit3.4 servo-thread
addf wcomp.0 servo-thread
addf wcomp.1 servo-thread
addf wcomp.2 servo-thread
addf wcomp.3 servo-thread
addf wcomp.4 servo-thread
addf not.0 servo-thread
addf not.1 servo-thread
addf not.2 servo-thread
addf not.3 servo-thread
addf not.4 servo-thread
# create HAL signals for position commands from motion module
# send them to limit blocks so it will ferror if it exceeds a limit
net table-pos-cmd joint.0.motor-pos-cmd => limit3.0.in
net saddle-pos-cmd joint.1.motor-pos-cmd => limit3.1.in
net head-pos-cmd joint.2.motor-pos-cmd => limit3.2.in
net tilt-pos-cmd joint.4.motor-pos-cmd => limit3.3.in
net rotate-pos-cmd joint.5.motor-pos-cmd => limit3.4.in
# set the limit block parameters from the ini file
setp limit3.0.maxv [JOINT_0]MAX_VELOCITY
setp limit3.0.maxa [JOINT_0]MAX_ACCELERATION
setp limit3.1.maxv [JOINT_1]MAX_VELOCITY
setp limit3.1.maxa [JOINT_1]MAX_ACCELERATION
setp limit3.2.maxv [JOINT_2]MAX_VELOCITY
setp limit3.2.maxa [JOINT_2]MAX_ACCELERATION
setp limit3.3.maxv [JOINT_4]MAX_VELOCITY
setp limit3.3.maxa [JOINT_4]MAX_ACCELERATION
setp limit3.4.maxv [JOINT_5]MAX_VELOCITY
setp limit3.4.maxa [JOINT_5]MAX_ACCELERATION
# loop limited position commands back to motion module feedback
# also send them to the vismach model and to the "limit switches"
net table-pos-fb limit3.0.out => joint.0.motor-pos-fb max5gui.table wcomp.0.in
net saddle-pos-fb limit3.1.out => joint.1.motor-pos-fb max5gui.saddle wcomp.1.in
net head-pos-fb limit3.2.out => joint.2.motor-pos-fb max5gui.head wcomp.2.in
net tilt-pos-fb limit3.3.out => joint.4.motor-pos-fb max5gui.tilt wcomp.3.in
net rotate-pos-fb limit3.4.out => joint.5.motor-pos-fb max5gui.rotate wcomp.4.in
# route home/limit switch signals to EMC
net table-limits-ok wcomp.0.out => not.0.in
net table-limits-tripped not.0.out => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
net saddle-limits-ok wcomp.1.out => not.1.in
net saddle-limits-tripped not.1.out => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
net head-limits-ok wcomp.2.out => not.2.in
net head-limits-tripped not.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
net tilt-limits-ok wcomp.3.out => not.3.in
net tilt-limits-tripped not.3.out => joint.4.neg-lim-sw-in joint.4.pos-lim-sw-in joint.4.home-sw-in
net rotate-home-tripped wcomp.4.out => joint.5.home-sw-in
# set location of switches
# these positions are in vismach coords - they can be are offset from machine coords
# these hardware limits are set to allow 2mm more overall travel than the soft limits
setp wcomp.0.min -101
setp wcomp.0.max 101
setp wcomp.1.min -101
setp wcomp.1.max 21
setp wcomp.2.min -96
setp wcomp.2.max 57
setp wcomp.3.min -91
setp wcomp.3.max 91
setp wcomp.4.min 90
setp wcomp.4.max 100
# kins needs this value
setp maxkins.pivot-length [MAX]B_PIVOT_LENGTH
# 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
net spindle-fwd spindle.0.forward
net spindle-rev spindle.0.reverse
net spindle-speed spindle.0.speed-out
net flood iocontrol.0.coolant-flood
net mist iocontrol.0.coolant-mist
net Aloop joint.3.motor-pos-cmd joint.3.motor-pos-fb

View File

@@ -0,0 +1,14 @@
#INCLUDE max5_base.inc
[KINS]
KINEMATICS = maxkins
JOINTS = 6
[HAL]
HALFILE = max5kins.hal
HALUI = halui
[EMC]
VERSION = 1.1
MACHINE = MAX5 with kinematics Simulation
DEBUG = 0

View File

@@ -0,0 +1,109 @@
# HAL config file for vismach simulation of max5 - trivkins version
# first load all the RT modules that will be needed
# kinematics
loadrt [KINS]KINEMATICS
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
# load five limit3 blocks to simulate the accel and vel limits of the motors
loadrt limit3 count=5
# load window comparators for home/limit switches
loadrt wcomp count=5
loadrt not count=5
# load the vismach model
loadusr -W max5gui
# set a visible tool
setp max5gui.tool-radius 3
# get tool length from motion controller
net tool-len motion.tooloffset.z max5gui.tool-length
# add motion controller functions to servo thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
# add other functions
addf limit3.0 servo-thread
addf limit3.1 servo-thread
addf limit3.2 servo-thread
addf limit3.3 servo-thread
addf limit3.4 servo-thread
addf wcomp.0 servo-thread
addf wcomp.1 servo-thread
addf wcomp.2 servo-thread
addf wcomp.3 servo-thread
addf wcomp.4 servo-thread
addf not.0 servo-thread
addf not.1 servo-thread
addf not.2 servo-thread
addf not.3 servo-thread
addf not.4 servo-thread
# create HAL signals for position commands from motion module
# send them to limit blocks so it will ferror if it exceeds a limit
net table-pos-cmd joint.0.motor-pos-cmd => limit3.0.in
net saddle-pos-cmd joint.1.motor-pos-cmd => limit3.1.in
net head-pos-cmd joint.2.motor-pos-cmd => limit3.2.in
net tilt-pos-cmd joint.4.motor-pos-cmd => limit3.3.in
net rotate-pos-cmd joint.5.motor-pos-cmd => limit3.4.in
# set the limit block parameters from the ini file
setp limit3.0.maxv [JOINT_0]MAX_VELOCITY
setp limit3.0.maxa [JOINT_0]MAX_ACCELERATION
setp limit3.1.maxv [JOINT_1]MAX_VELOCITY
setp limit3.1.maxa [JOINT_1]MAX_ACCELERATION
setp limit3.2.maxv [JOINT_2]MAX_VELOCITY
setp limit3.2.maxa [JOINT_2]MAX_ACCELERATION
setp limit3.3.maxv [JOINT_4]MAX_VELOCITY
setp limit3.3.maxa [JOINT_4]MAX_ACCELERATION
setp limit3.4.maxv [JOINT_5]MAX_VELOCITY
setp limit3.4.maxa [JOINT_5]MAX_ACCELERATION
# loop limited position commands back to motion module feedback
# also send them to the vismach model and to the "limit switches"
net table-pos-fb limit3.0.out => joint.0.motor-pos-fb max5gui.table wcomp.0.in
net saddle-pos-fb limit3.1.out => joint.1.motor-pos-fb max5gui.saddle wcomp.1.in
net head-pos-fb limit3.2.out => joint.2.motor-pos-fb max5gui.head wcomp.2.in
net tilt-pos-fb limit3.3.out => joint.4.motor-pos-fb max5gui.tilt wcomp.3.in
net rotate-pos-fb limit3.4.out => joint.5.motor-pos-fb max5gui.rotate wcomp.4.in
# route home/limit switch signals to EMC
net table-limits-ok wcomp.0.out => not.0.in
net table-limits-tripped not.0.out => joint.0.neg-lim-sw-in joint.0.pos-lim-sw-in joint.0.home-sw-in
net saddle-limits-ok wcomp.1.out => not.1.in
net saddle-limits-tripped not.1.out => joint.1.neg-lim-sw-in joint.1.pos-lim-sw-in joint.1.home-sw-in
net head-limits-ok wcomp.2.out => not.2.in
net head-limits-tripped not.2.out => joint.2.neg-lim-sw-in joint.2.pos-lim-sw-in joint.2.home-sw-in
net tilt-limits-ok wcomp.3.out => not.3.in
net tilt-limits-tripped not.3.out => joint.4.neg-lim-sw-in joint.4.pos-lim-sw-in joint.4.home-sw-in
net rotate-home-tripped wcomp.4.out => joint.5.home-sw-in
# set location of switches
# these positions are in vismach coords - they can be are offset from machine coords
# these hardware limits are set to allow 2mm more overall travel than the soft limits
setp wcomp.0.min -101
setp wcomp.0.max 101
setp wcomp.1.min -101
setp wcomp.1.max 21
setp wcomp.2.min -96
setp wcomp.2.max 57
setp wcomp.3.min -91
setp wcomp.3.max 91
setp wcomp.4.min 90
setp wcomp.4.max 100
# 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
net spindle-fwd spindle.0.forward
net spindle-rev spindle.0.reverse
net spindle-speed spindle.0.speed-out
net flood iocontrol.0.coolant-flood
net mist iocontrol.0.coolant-mist
net Aloop joint.3.motor-pos-cmd joint.3.motor-pos-fb

View File

@@ -0,0 +1,14 @@
#INCLUDE max5_base.inc
[KINS]
KINEMATICS = trivkins coordinates=xyzabc
JOINTS = 6
[HAL]
HALFILE = max5triv.hal
HALUI = halui
[EMC]
VERSION = 1.1
MACHINE = MAX5-trivkins Simulation
DEBUG = 0