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,17 @@
<?xml version='1.0' encoding='UTF-8'?>
<pyvcp>
<labelframe text="Gripper">
<vbox>
<scale>
<halpin>"gripper"</halpin>
<resolution>1</resolution>
<orient>HORIZONTAL</orient>
<initval>0</initval>
<min_>-200</min_>
<max_>200</max_>
</scale>
</vbox>
</labelframe>
</pyvcp>

View File

@@ -0,0 +1,3 @@
net gripper <= pyvcp.gripper-f
net gripper => scorbot-er-3.joint7.motor-pos-cmd

View File

@@ -0,0 +1,71 @@
<?xml version='1.0' encoding='UTF-8'?>
<pyvcp>
<vbox>
<label><text>"These widgets indicate a HAL_BIT"</text></label>
<hbox>
<label><text>"LED:"</text></label>
<led>
<halpin>"led-sample"</halpin>
<size>20</size>
</led>
</hbox>
<label><text>"These widgets control a HAL_BIT"</text></label>
<vbox>
<hbox>
<label><text>"Button"</text></label>
<button>
<text>"Button:"</text>
<halpin>"button-sample"</halpin>
</button>
</hbox>
<hbox>
<label><text>"Checkbutton:"</text></label>
<checkbutton>
<halpin>"chbutton-sample"</halpin>
</checkbutton>
</hbox>
</vbox>
<label><text>"These widgets indicate a HAL_FLOAT"</text></label>
<vbox>
<hbox>
<label><text>"Bar:"</text></label>
<bar>
<halpin>"bar-sample"</halpin>
</bar>
</hbox>
<hbox>
<label><text>"Number:"</text></label>
<number>
<halpin>"number-sample"</halpin>
<format>"+004.4f"</format>
<font>('Helvetica',40)</font>
</number>
</hbox>
</vbox>
<label><text>"These widgets control a HAL_FLOAT"</text></label>
<vbox>
<hbox>
<label><text>"Scale:"</text></label>
<scale>
<orient>HORIZONTAL</orient>
<halpin>"scale-sample"</halpin>
</scale>
</hbox>
<hbox>
<label><text>"Spinbox:"</text></label>
<spinbox>
<font>('Helvetica',40)</font>
</spinbox>
</hbox>
</vbox>
<!-- this is a comment-->
</vbox>
</pyvcp>

View File

@@ -0,0 +1,113 @@
loadrt [KINS]KINEMATICS
#autoconverted scorbot-kins
# motion controller, get name and thread periods from ini file
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt differential
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf differential.0 servo-thread
loadusr -W scorbot-er-3
#
# E-Stop
#
net estop-loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
#
# Joint 0
#
net j0.cmd <= joint.0.motor-pos-cmd
net j0.cmd => scorbot-er-3.joint0.motor-pos-cmd
net j0.cmd => joint.0.motor-pos-fb
net j0.limit <= scorbot-er-3.joint0.limit-sw
net j0.limit => joint.0.home-sw-in
net j0.limit => joint.0.neg-lim-sw-in
net j0.limit => joint.0.pos-lim-sw-in
setp scorbot-er-3.joint0.scale [JOINT_0]SCALE
#
# Joint 1
#
net j1.cmd <= joint.1.motor-pos-cmd
net j1.cmd => scorbot-er-3.joint1.motor-pos-cmd
net j1.cmd => joint.1.motor-pos-fb
net j1.limit <= scorbot-er-3.joint1.limit-sw
net j1.limit => joint.1.home-sw-in
net j1.limit => joint.1.neg-lim-sw-in
net j1.limit => joint.1.pos-lim-sw-in
setp scorbot-er-3.joint1.scale [JOINT_1]SCALE
#
# Joint 2
#
net j2.cmd <= joint.2.motor-pos-cmd
net j2.cmd => scorbot-er-3.joint2.motor-pos-cmd
net j2.cmd => joint.2.motor-pos-fb
net j2.limit <= scorbot-er-3.joint2.limit-sw
net j2.limit => joint.2.home-sw-in
net j2.limit => joint.2.neg-lim-sw-in
net j2.limit => joint.2.pos-lim-sw-in
setp scorbot-er-3.joint2.scale [JOINT_2]SCALE
#
# Joint 3
# LinuxCNC commands "wrist pitch" on J3, this goes through the differential.
#
net wrist.pitch-cmd <= joint.3.motor-pos-cmd
net wrist.pitch-cmd => differential.0.pitch-cmd
net wrist.pitch-fb <= differential.0.pitch-fb
net wrist.pitch-fb => joint.3.motor-pos-fb
net j3.cmd <= differential.0.motor0-cmd
net j3.cmd => scorbot-er-3.joint3.motor-pos-cmd
net j3.cmd => differential.0.motor0-fb
net wrist-pitch.limit <= scorbot-er-3.joint3.limit-sw
net wrist-pitch.limit => joint.3.home-sw-in
setp scorbot-er-3.joint3.scale [JOINT_3]SCALE
#
# Joint 4
# LinuxCNC commands "wrist roll" on J4, this goes through the differential.
#
net wrist.roll-cmd <= joint.4.motor-pos-cmd
net wrist.roll-cmd => differential.0.roll-cmd
net wrist.roll-fb <= differential.0.roll-fb
net wrist.roll-fb => joint.4.motor-pos-fb
net j4.cmd <= differential.0.motor1-cmd
net j4.cmd => scorbot-er-3.joint4.motor-pos-cmd
net j4.cmd => differential.0.motor1-fb
net wrist-roll.limit <= scorbot-er-3.joint4.limit-sw
net wrist-roll.limit => joint.4.home-sw-in
setp scorbot-er-3.joint4.scale [JOINT_4]SCALE

View File

@@ -0,0 +1,370 @@
# This config file was created 2015-10-18 15:29:00.438682 by the update_ini script
# The original config files may be found in the /home/seb/linuxcnc-dev/configs/by_machine/scorbot-er-3/scorbot-er-3.old directory
[EMC]
# The version string for this INI file.
VERSION = 1.1
MACHINE = Scorbot-ER III
# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
#DEBUG = 0x7fffffff
DEBUG = 0
[DISPLAY]
DISPLAY = axis
CYCLE_TIME = 0.100
HELP_FILE = doc/help.txt
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
# Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE = 2.0
MAX_SPINDLE_OVERRIDE = 2.0
MAX_LINEAR_VELOCITY = 27
DEFAULT_LINEAR_VELOCITY = 27
MAX_ANGULAR_VELOCITY = 27
DEFAULT_ANGULAR_VELOCITY = 27
PROGRAM_PREFIX = ../../../nc_files/
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
EDITOR = gvim
TOOL_EDITOR = gvim
INCREMENTS = 10 mm, 1 mm, 0.10 mm, 0.01 mm
PYVCP = gripper.xml
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python3
[RS274NGC]
PARAMETER_FILE = sim.var
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
SERVO_PERIOD = 1000000
[TASK]
TASK = milltask
CYCLE_TIME = 0.001
[HAL]
HALFILE = scorbot-er-3.hal
#HALFILE = ../../common/shuttlexpress.hal
#HALFILE = shuttlexpress-customization.hal
POSTGUI_HALFILE = pyvcp.hal
HALUI = halui
[HALUI]
#No Content
[TRAJ]
AXES = 5
COORDINATES = X Y Z A B
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
#HOME = 0 0 0 0 0
# mm/second
DEFAULT_VELOCITY = 675
MAX_VELOCITY = 675
# mm/second/second
DEFAULT_ACCELERATION = 5000
MAX_ACCELERATION = 5000
POSITION_FILE = position.txt
#
# The Scorbot-ER III User's Manual (6th Edition) Appendix E states that
# motors 1-5 (joints 0-4) use optical encoders with 6 slots/revolution.
# Experimentally, the Scorbot motor control box reports 6 counts per
# revolution.
#
# The arm motors (joint 0, 1, & 2) have gearboxes with a ratio of 127.7:1.
# The wrist motors (joints 3 & 4) have gearboxes with a ratio of 65.5:1.
#
# 6 counts/motor-rev * 127.7 motor-revs/driveshaft-rev = 766.2 counts/driveshaft-rev
#
# 6 counts/motor-rev * 65.5 motor-revs/driveshaft-rev = 393 counts/driveshaft-rev
#
# Each motor then has a different transmission to actuate the joint, but
# they're all 1:1 after the gearbox on the motor.
#
[EMCIO]
#TOOL_TABLE = sim.tbl
#TOOL_CHANGE_POSITION = 0 0 0
#TOOL_CHANGE_QUILL_UP = 1
[KINS]
KINEMATICS = scorbot-kins
#This is a best-guess at the number of joints, it should be checked
JOINTS = 5
[AXIS_X]
HOME = 0.000
MIN_LIMIT = -1000
MAX_LIMIT = 1000
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
[JOINT_0]
TYPE = ANGULAR
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
# Motor 0 turns a 24 tooth gear that rolls around a 120 tooth gear.
# 766.2 counts/driveshaft-rev * 1 driveshaft-rev/24 teeth = 31.925 counts/tooth
# 31.925 counts/tooth * 120 teeth/joint-rev = 3831.0 counts/joint-rev
# 3831.0 counts/joint-rev * 1 joint-rev/360 degrees = 10.6417 counts/degree
SCALE = 10.6417
MIN_LIMIT = -1000
MAX_LIMIT = 1000
FERROR = 0.100
MIN_FERROR = 0.010
HOME = 0.000
HOME_OFFSET = -0.100
HOME_SEARCH_VEL = -7.500
HOME_LATCH_VEL = 2.000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
[AXIS_Y]
HOME = 130.000
MIN_LIMIT = -1000
MAX_LIMIT = 1000
MAX_VELOCITY = 500
MAX_ACCELERATION = 5000
[JOINT_1]
TYPE = ANGULAR
MAX_VELOCITY = 500
MAX_ACCELERATION = 5000
# Motor 1 turns an 18 tooth gear that rolls around a 72 tooth gear.
# 766.2 counts/driveshaft-rev * 1 driveshaft-rev/18 teeth = 42.567 counts/tooth
# 42.567 counts/tooth * 72 teeth/joint-rev = 3064.8 counts/joint-rev
# 3064.8 counts/joint-rev * 1 joint-rev/360 degrees = 8.513 counts/degree
SCALE = -8.513
MIN_LIMIT = -32
MAX_LIMIT = 127
FERROR = 0.100
MIN_FERROR = 0.010
HOME = 125.000
HOME_OFFSET = 127.900
HOME_SEARCH_VEL = 7.500
HOME_LATCH_VEL = -2.000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 2
[AXIS_Z]
HOME = 0.000
MIN_LIMIT = -1000
MAX_LIMIT = 1000
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
[JOINT_2]
TYPE = ANGULAR
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
# Motor 2 turns an 18 tooth gear that rolls around a 72 tooth gear.
# The 72 tooth gear turns a 19(?) tooth timing pulley connected to a 17 tooth timing pulley.
# 766.2 counts/driveshaft-rev * 1 driveshaft-rev/18 teeth = 42.567 counts/tooth
# 42.567 counts/tooth * 72 teeth/axle-rev = 3064.8 counts/axle-rev
# 3064.8 counts/axle-rev * 1 axle-rev/19 timing-teeth = 161.305 counts/timing-tooth
# 161.305 counts/timing-tooth * 17 timing-teeth/joint-rev = 2742.189 counts/joint-rev
# 2742.189 counts/joint-rev * 1 joint-rev/360 degrees = 7.617 counts/rev
SCALE = 7.6171929824561415
MIN_LIMIT = -1000
MAX_LIMIT = 1000
FERROR = 0.050
MIN_FERROR = 0.010
HOME = 0.000
HOME_OFFSET = -30.001
HOME_SEARCH_VEL = -7.500
HOME_LATCH_VEL = 2.000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 2
[AXIS_A]
HOME = 20.0
MIN_LIMIT = -1000
MAX_LIMIT = 1000
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
[JOINT_3]
TYPE = ANGULAR
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
# Motor 3 turns a 12 tooth timing gear (gear #1) connected by a timing belt
# to a 23 tooth timing gear (gear #2). Gear #2 is connected by another
# belt to another 23 tooth timing gear (gear #3). Gear #3 is connected by
# another timing belt to another 23 tooth timing gear (gear #4).
# Gear #4 is connected to a differential drive in the wrist.
# The drive gear (the part of the diff rigidly connected to the timing gear)
# has 32 teeth. The driven gear also has 32 teeth.
#
# FIXME: Since this motor moves the hand in two degrees of freedom, i'm not
# sure how to think about the units etc here.
#
# At the motor:
# 393 counts/driveshaft-rev * 1 driveshaft-rev/12 teeth = 32.75 counts/timing-tooth
# Then at the end of the timing belt drive:
# 32.75 counts/timing-tooth * 32 diff-teeth/23 timing-teeth = 45.56521739130435 counts/diff-tooth
# 45.56521739130435 counts/diff-tooth * 32 diff-teeth/360 degrees = 4.05024154589372 counts/degree
# FIXME: i'm not sure it's ok to convert diff-teeth to degrees that way since it's a differential
SCALE = 4.05024154589372
MIN_LIMIT = -1000
MAX_LIMIT = 1000
FERROR = 0.050
MIN_FERROR = 0.010
HOME = -30.0
HOME_OFFSET = -56.0
HOME_SEARCH_VEL = -7.500
HOME_LATCH_VEL = 2.000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1
[AXIS_B]
HOME = 4.0
MIN_LIMIT = -1000
MAX_LIMIT = 1000
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
[JOINT_4]
TYPE = ANGULAR
MAX_VELOCITY = 675
MAX_ACCELERATION = 5000
# Motor 4, same as motor 3
SCALE = 4.05024154589372
MIN_LIMIT = -1000
MAX_LIMIT = 1000
FERROR = 0.050
MIN_FERROR = 0.010
HOME = 4.0
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = -7.500
HOME_LATCH_VEL = 2.000
HOME_USE_INDEX = NO
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
#[AXIS_5]
#TYPE = ANGULAR
#MAX_VELOCITY = 100
#MAX_ACCELERATION = 500
# joint 5
#SCALE = 5
#MIN_LIMIT = -8.0
#MAX_LIMIT = 0.0001
#FERROR = 0.050
#MIN_FERROR = 0.010
#HOME = 0.000
#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
#[AXIS_6]
#TYPE = ANGULAR
#MAX_VELOCITY = 100
#MAX_ACCELERATION = 500
# joint 6
#SCALE = 5
#MIN_LIMIT = -8.0
#MAX_LIMIT = 0.0001
#FERROR = 0.050
#MIN_FERROR = 0.010
#HOME = 0.000
#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
#[AXIS_7]
#TYPE = ANGULAR
#MAX_VELOCITY = 100
#MAX_ACCELERATION = 500
# joint 7
#SCALE = 5
#MIN_LIMIT = -8.0
#MAX_LIMIT = 0.0001
#FERROR = 0.050
#MIN_FERROR = 0.010
#HOME = 0.000
#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

View File

@@ -0,0 +1,20 @@
# for each click of the jog-wheel there's 1000 simulated counts coming out
# of the ilowpass below, so these numbers are 1000x smaller than the jog
# increment size they encode
setp tristate-float.sxp-jog-increment-0.in 0.0005
setp tristate-float.sxp-jog-increment-1.in 0.001
setp tristate-float.sxp-jog-increment-2.in 0.005
setp tristate-float.sxp-jog-increment-3.in 0.010
# each of the 8 tristate floats has a constant jog speed on it
# speeds are specified as "fraction of machine max speed"
setp tristate-float.sxp0.in 0
setp tristate-float.sxp1.in 25
setp tristate-float.sxp2.in 50
setp tristate-float.sxp3.in 100
setp tristate-float.sxp4.in 200
setp tristate-float.sxp5.in 400
setp tristate-float.sxp6.in 810
setp tristate-float.sxp7.in 1620