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

5
tests/t0/.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
sim.var
sim.var.bak
tool.tbl
stdout
gcode-output

15
tests/t0/README Normal file
View File

@@ -0,0 +1,15 @@
nonrandom toolchanger:
T0 is special and means "no tool". T0 should not appear in the tool
table, if T0 is defined there is ignored.
random toolchanger:
T0 is a normal tool like any other, totally devoid of special meaning.
In practice T0 is usually(?) used to track an empty pocket in the
tool changer hardware.
Tool number -1 is used to indicate "unknown tool".

View File

@@ -0,0 +1 @@
../shared-checkresult

View File

@@ -0,0 +1,455 @@
sequence number 0.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 1.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 2.000000
X = 0.000000
Y = 0.000000
Z = -1.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 3.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 4.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 5.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = 0.000000
tlo_z = 0.000000
sequence number 6.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = 0.000000
tlo_z = 0.000000
sequence number 7.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 8.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 9.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = 0.000000
tlo_z = 0.000000
sequence number 10.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = 0.000000
tlo_z = 0.000000
sequence number 11.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 11.500000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 12.000000
X = 0.000000
Y = 0.000000
Z = 5.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 13.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 14.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 15.000000
X = 0.000000
Y = 0.000000
Z = -4.500000
toolno = 0.000000
tlo_z = 0.000000
sequence number 16.000000
X = 0.000000
Y = 0.000000
Z = -4.500000
toolno = 0.000000
tlo_z = 0.000000
sequence number 17.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 100.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 101.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 102.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 103.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 104.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 105.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 106.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 107.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 108.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 109.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 110.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 111.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = 2.000000
sequence number 112.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = 2.000000
sequence number 113.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 114.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 115.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 116.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 117.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 117.500000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 118.000000
X = 0.000000
Y = 0.000000
Z = 6.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 119.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 120.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 121.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 122.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 123.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 200.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 0.000000
tlo_z = 0.000000
sequence number 201.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 202.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 203.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 204.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 205.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 206.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 207.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 0.000000
tlo_z = 0.000000
sequence number 208.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 0.000000
tlo_z = 0.000000
sequence number 209.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 210.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 211.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 212.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 213.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 213.500000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 214.000000
X = 0.000000
Y = 0.000000
Z = 7.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 215.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 216.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 217.000000
X = 0.000000
Y = 0.000000
Z = -4.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 218.000000
X = 0.000000
Y = 0.000000
Z = -4.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 219.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000

106
tests/t0/nonrandom/sim.ini Normal file
View File

@@ -0,0 +1,106 @@
[EMC]
DEBUG = 0
VERSION = 1.1
#DEBUG = 0x7fffffff
[DISPLAY]
DISPLAY = linuxcncrsh
PROGRAM_PREFIX = ../subs
[TASK]
TASK = milltask
CYCLE_TIME = 0.001
[RS274NGC]
PARAMETER_FILE = sim.var
USER_M_PATH = ../subs
SUBROUTINE_PATH = ../subs
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 4.0
BASE_PERIOD = 0
SERVO_PERIOD = 1000000
[HAL]
HALFILE = LIB:core_sim.hal
[TRAJ]
AXES = 3
COORDINATES = X Y Z
HOME = 0 0 0
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 1.2
MAX_LINEAR_VELOCITY = 4
NO_FORCE_HOMING = 1
[EMCIO]
TOOL_TABLE = tool.tbl
TOOL_CHANGE_QUILL_UP = 1
RANDOM_TOOLCHANGER = 0
[AXIS_X]
HOME = 0.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[AXIS_Y]
HOME = 0.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[AXIS_Z]
HOME = 0.0
MIN_LIMIT = -4.0
MAX_LIMIT = 4.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[KINS]
KINEMATICS = trivkins
JOINTS = 3
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
FERROR = 0.050
MIN_FERROR = 0.010
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
FERROR = 0.050
MIN_FERROR = 0.010
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -4.0
MAX_LIMIT = 4.0
FERROR = 0.050
MIN_FERROR = 0.010

1
tests/t0/nonrandom/test.sh Symbolic link
View File

@@ -0,0 +1 @@
../shared-test.sh

View File

@@ -0,0 +1,50 @@
T1 P1 D0.125000 Z+1.000000 ;
t2 p2
t3 p3
t4 p4
t5 p7
t6 p6
T7 P7 D0.500000 Z+3.000000 ;
T8 P8
T9 P9
T10 P10
T11 P11
T12 P12
T13 P13
T14 P14
T15 P15
T16 P16
T17 P17
T18 P18
T19 P19
T20 P20
T21 P21
T22 P22
T23 P23
T24 P24
T25 P25
T26 P26
T27 P27
T28 P28
T29 P29
T30 P30
T31 P31
T32 P32
T33 P33
T34 P34
T35 P35
T36 P36
T37 P37
T38 P38
T39 P39
T40 P40
T41 P41
T42 P42
T43 P43
T44 P44
T45 P45
T46 P46
T47 P47
T48 P48
T49 P49
T50 P50 Z+2.000000 ;

View File

@@ -0,0 +1 @@
../shared-checkresult

View File

@@ -0,0 +1,455 @@
sequence number 0.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 1.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 2.000000
X = 0.000000
Y = 0.000000
Z = -1.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 3.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 4.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 5.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = -1.000000
tlo_z = 0.000000
sequence number 6.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = -1.000000
tlo_z = 0.000000
sequence number 7.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 8.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 9.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 10.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 11.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 11.500000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 12.000000
X = 0.000000
Y = 0.000000
Z = 5.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 13.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 14.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 15.000000
X = 0.000000
Y = 0.000000
Z = -4.500000
toolno = -1.000000
tlo_z = 0.000000
sequence number 16.000000
X = 0.000000
Y = 0.000000
Z = -4.500000
toolno = -1.000000
tlo_z = 0.000000
sequence number 17.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 100.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 101.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 102.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 103.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 104.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 105.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 106.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 107.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 108.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 109.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 110.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 111.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = 2.000000
sequence number 112.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = 2.000000
sequence number 113.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 114.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 115.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 116.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 117.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 117.500000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 118.000000
X = 0.000000
Y = 0.000000
Z = 6.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 119.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 120.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 121.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 122.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 123.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 200.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 201.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 202.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 203.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 204.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 205.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 206.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 207.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 0.000000
tlo_z = 0.000000
sequence number 208.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 0.000000
tlo_z = 0.000000
sequence number 209.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 210.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 211.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 212.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 213.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 213.500000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 214.000000
X = 0.000000
Y = 0.000000
Z = 7.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 215.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 216.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000
sequence number 217.000000
X = 0.000000
Y = 0.000000
Z = -4.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 218.000000
X = 0.000000
Y = 0.000000
Z = -4.400000
toolno = 0.000000
tlo_z = 0.000000
sequence number 219.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = 0.000000
tlo_z = 0.000000

View File

@@ -0,0 +1,106 @@
[EMC]
DEBUG = 0
VERSION = 1.1
#DEBUG = 0x7fffffff
[DISPLAY]
DISPLAY = linuxcncrsh
PROGRAM_PREFIX = ../subs
[TASK]
TASK = milltask
CYCLE_TIME = 0.001
[RS274NGC]
PARAMETER_FILE = sim.var
USER_M_PATH = ../subs
SUBROUTINE_PATH = ../subs
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 4.0
BASE_PERIOD = 0
SERVO_PERIOD = 1000000
[HAL]
HALFILE = LIB:core_sim.hal
[TRAJ]
AXES = 3
COORDINATES = X Y Z
HOME = 0 0 0
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 1.2
MAX_LINEAR_VELOCITY = 4
NO_FORCE_HOMING = 1
[EMCIO]
TOOL_TABLE = tool.tbl
TOOL_CHANGE_QUILL_UP = 1
RANDOM_TOOLCHANGER = 1
[AXIS_X]
HOME = 0.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[AXIS_Y]
HOME = 0.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[AXIS_Z]
HOME = 0.0
MIN_LIMIT = -4.0
MAX_LIMIT = 4.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[KINS]
KINEMATICS = trivkins
JOINTS = 3
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
FERROR = 0.050
MIN_FERROR = 0.010
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
FERROR = 0.050
MIN_FERROR = 0.010
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -4.0
MAX_LIMIT = 4.0
FERROR = 0.050
MIN_FERROR = 0.010

View File

@@ -0,0 +1 @@
../shared-test.sh

View File

@@ -0,0 +1,4 @@
T1 P1 D0.125000 Z+1.000000 ;
T7 P3 D0.500000 Z+3.000000 ;
T0 P2 ;
T50 P50 Z+2.000000 ;

View File

@@ -0,0 +1 @@
../shared-checkresult

View File

@@ -0,0 +1,455 @@
sequence number 0.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 1.000000
X = 0.000000
Y = 0.000000
Z = 0.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 2.000000
X = 0.000000
Y = 0.000000
Z = -1.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 3.000000
X = 0.000000
Y = 0.000000
Z = -1.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 4.000000
X = 0.000000
Y = 0.000000
Z = -1.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 5.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = -1.000000
tlo_z = 0.000000
sequence number 6.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = -1.000000
tlo_z = 0.000000
sequence number 7.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = -1.000000
tlo_z = 0.000000
sequence number 8.000000
X = 0.000000
Y = 0.000000
Z = -0.100000
toolno = -1.000000
tlo_z = 0.000000
sequence number 9.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 10.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 11.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 11.500000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 12.000000
X = 0.000000
Y = 0.000000
Z = 5.000000
toolno = -1.000000
tlo_z = 0.000000
sequence number 13.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 14.000000
X = 0.000000
Y = 0.000000
Z = 0.300000
toolno = -1.000000
tlo_z = 0.000000
sequence number 15.000000
X = 0.000000
Y = 0.000000
Z = -4.200000
toolno = -1.000000
tlo_z = 0.000000
sequence number 16.000000
X = 0.000000
Y = 0.000000
Z = -4.200000
toolno = -1.000000
tlo_z = 0.000000
sequence number 17.000000
X = 0.000000
Y = 0.000000
Z = -4.200000
toolno = -1.000000
tlo_z = 0.000000
sequence number 100.000000
X = 0.000000
Y = 0.000000
Z = -4.200000
toolno = 50.000000
tlo_z = 2.000000
sequence number 101.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 102.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = 2.000000
sequence number 103.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 104.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 105.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 106.000000
X = 0.000000
Y = 0.000000
Z = 1.100000
toolno = 50.000000
tlo_z = 2.000000
sequence number 107.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 108.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 109.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 110.000000
X = 0.000000
Y = 0.000000
Z = -1.300000
toolno = 50.000000
tlo_z = 2.000000
sequence number 111.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = 2.000000
sequence number 112.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = 2.000000
sequence number 113.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = 2.000000
sequence number 114.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 115.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 116.000000
X = 0.000000
Y = 0.000000
Z = 1.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 117.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 117.500000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 118.000000
X = 0.000000
Y = 0.000000
Z = 6.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 119.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 120.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 121.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 122.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 123.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 200.000000
X = 0.000000
Y = 0.000000
Z = -2.500000
toolno = 50.000000
tlo_z = -1.700000
sequence number 201.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 202.000000
X = 0.000000
Y = 0.000000
Z = 1.700000
toolno = 50.000000
tlo_z = -1.700000
sequence number 203.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 204.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 205.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 206.000000
X = 0.000000
Y = 0.000000
Z = 2.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 207.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 50.000000
tlo_z = -1.700000
sequence number 208.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 50.000000
tlo_z = -1.700000
sequence number 209.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 50.000000
tlo_z = -1.700000
sequence number 210.000000
X = 0.000000
Y = 0.000000
Z = -2.200000
toolno = 50.000000
tlo_z = -1.700000
sequence number 211.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 50.000000
tlo_z = -1.700000
sequence number 212.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 50.000000
tlo_z = -1.700000
sequence number 213.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 50.000000
tlo_z = -1.700000
sequence number 213.500000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 50.000000
tlo_z = -1.700000
sequence number 214.000000
X = 0.000000
Y = 0.000000
Z = 7.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 215.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 50.000000
tlo_z = -1.700000
sequence number 216.000000
X = 0.000000
Y = 0.000000
Z = 2.400000
toolno = 50.000000
tlo_z = -1.700000
sequence number 217.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 218.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = -1.700000
sequence number 219.000000
X = 0.000000
Y = 0.000000
Z = -2.000000
toolno = 50.000000
tlo_z = -1.700000

View File

@@ -0,0 +1,106 @@
[EMC]
DEBUG = 0
VERSION = 1.1
#DEBUG = 0x7fffffff
[DISPLAY]
DISPLAY = linuxcncrsh
PROGRAM_PREFIX = ../subs
[TASK]
TASK = milltask
CYCLE_TIME = 0.001
[RS274NGC]
PARAMETER_FILE = sim.var
USER_M_PATH = ../subs
SUBROUTINE_PATH = ../subs
[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 4.0
BASE_PERIOD = 0
SERVO_PERIOD = 1000000
[HAL]
HALFILE = LIB:core_sim.hal
[TRAJ]
AXES = 3
COORDINATES = X Y Z
HOME = 0 0 0
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 1.2
MAX_LINEAR_VELOCITY = 4
NO_FORCE_HOMING = 1
[EMCIO]
TOOL_TABLE = tool.tbl
TOOL_CHANGE_QUILL_UP = 1
RANDOM_TOOLCHANGER = 1
[AXIS_X]
HOME = 0.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[AXIS_Y]
HOME = 0.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[AXIS_Z]
HOME = 0.0
MIN_LIMIT = -4.0
MAX_LIMIT = 4.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
[KINS]
KINEMATICS = trivkins
JOINTS = 3
[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
FERROR = 0.050
MIN_FERROR = 0.010
[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -40.0
MAX_LIMIT = 40.0
FERROR = 0.050
MIN_FERROR = 0.010
[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 4
MAX_ACCELERATION = 100.0
BACKLASH = 0.000
INPUT_SCALE = 4000
OUTPUT_SCALE = 1.000
MIN_LIMIT = -4.0
MAX_LIMIT = 4.0
FERROR = 0.050
MIN_FERROR = 0.010

View File

@@ -0,0 +1 @@
../shared-test.sh

View File

@@ -0,0 +1,3 @@
T1 P1 D0.125000 Z+1.000000 ;
T7 P3 D0.500000 Z+3.000000 ;
T50 P50 Z+2.000000 ;

7
tests/t0/shared-checkresult Executable file
View File

@@ -0,0 +1,7 @@
#!/bin/bash
TEST_DIR=$(dirname "$1")
cd "$TEST_DIR" || { echo "E: Could not change directory to '$TEST_DIR'"; exit 1; }
sed 's/-0\.000000/0.000000/g' <gcode-output >gcode-output.filtered && mv gcode-output.filtered gcode-output
diff -u expected-gcode-output gcode-output

673
tests/t0/shared-test.sh Normal file
View File

@@ -0,0 +1,673 @@
#!/bin/bash
set -x
rm -f sim.var
# reset the tool table to a known starting configuration
rm -f tool.tbl
cp tool.tbl.original tool.tbl
rm -f gcode-output
if nc -z localhost 5007; then
echo "Process already listening on port 5007. Exiting"
exit 1
fi
linuxcnc -r sim.ini &
# let linuxcnc come up
TOGO=80
while [ $TOGO -gt 0 ]; do
echo trying to connect to linuxcncrsh TOGO=$TOGO
if nc -z localhost 5007; then
break
fi
sleep 0.25
TOGO=$((TOGO - 1))
done
if [ $TOGO -eq 0 ]; then
echo connection to linuxcncrsh timed out
exit 1
fi
(
function introspect() {
SEQUENCE_NUMBER=$1
echo 'set wait done'
echo "set mdi m100 P6 Q$SEQUENCE_NUMBER" # sequence number
echo 'set mdi m100 P0 Q#5420' # X
echo 'set mdi m100 P1 Q#5421' # Y
echo 'set mdi m100 P2 Q#5422' # Z
echo 'set mdi m100 P3 Q#5400' # toolno
echo 'set mdi m100 P4 Q#5403' # TLO z
echo 'set mdi m100 P5' # blank line
echo 'set wait done'
}
echo "hello EMC mt 1.0"
echo "set enable EMCTOO"
echo "set estop off"
echo "set machine on"
echo "set mode mdi"
#
# first, a bunch of testing with no tool in the spindle
#
# On nonrandom the spindle has T0, which is the nonrandom way to
# specify the special tool that means "no tool".
#
# On random the spindle has T-1, which is the random way to specify the
# special tool that means "no tool".
#
# Both random and nonrandom start this test with no tool in the
# spindle, but they encode this in different ways.
introspect 0
#
# g43
#
# Apply the TLO of the current tool. On both, the spindle has no tool,
# which has 0 TLO.
echo "set mdi g43"
introspect 1
# Apply the TLO of tool T1. On both, T1 is a valid tool, so we use its
# TLO.
echo "set mdi g43 h1"
introspect 2
# Apply the TLO of H0, this one is weird.
#
# On nonrandom, this requests the TLO of the tool in the spindle, which
# is currently T0, which is a special tool with TLO 0.
#
# On random, this requests the TLO of T0. If T0 is not in the tool
# table, this is an error and the active TLO remains unchanged (so it
# stays as the TLO of T1 that we just set above). If T0 is defined, we
# apply its TLO here.
echo "set mdi g43 h0"
introspect 3
#
# g10 l1
#
# Try to change TLO of the normal tool T7. This should work on both,
# but not change the active TLO.
echo "set mdi g10 l1 p7 z0.1"
introspect 4
# Apply the TLO of T7, which we just tried to set. This should work on
# both.
echo "set mdi g43 h7"
introspect 5
# Try to change TLO of the strange tool T0.
#
# This should fail in every config because you cannot change T0.
echo "set mdi g10 l1 p0 z0.2"
introspect 6
# Apply the TLO of the special H0.
#
# On nonrandom, this requests the TLO of the tool in the spindle, which
# is currently T0, which is a special tool with TLO 0.
#
# On random, this requests the TLO of T0. If T0 is not in the tool
# table, this is an error and the active TLO remains unchanged (so it
# stays as the TLO of T7 that we just set above). If T0 is defined, we
# apply its TLO here.
echo "set mdi g43 h0"
introspect 7
#
# g10 l10
#
# Try to change TLO of the normal tool T7. This should work on both.
echo "set mdi g10 l10 p7 z0.3"
introspect 8
# Apply the TLO of T7, which we just tried to set. This should work on
# both.
echo "set mdi g43 h7"
introspect 9
# Try to change TLO of the strange tool T0.
#
# This should fail on every config because you cannot change T0.
echo "set mdi g10 l10 p0 z0.4"
introspect 10
# Apply the TLO of the special H0.
#
# On nonrandom, this requests the TLO of the tool in the spindle, which
# is currently T0, which is a special tool with TLO 0.
#
# On random, this requests the TLO of T0. If T0 is not in the tool
# table, this is an error and the active TLO remains unchanged (so it
# stays as the TLO of T7 that we just set above). If T0 is defined, we
# apply its TLO here.
echo "set mdi g43 h0"
introspect 11
#
# g10 l11
#
# First offset the g59.3 coordinate system and make sure that worked,
# but then switch back to g54. This sets different g59.3 offsets in
# different configs, because they have different active Z TLOs at this
# point.
#
# Before this G10 L20, we are at the following Z locations:
# nonrandom: 0.0 (T0 TLO active)
# random without T0: 0.3 (T7 TLO active)
# random with T0: 0.0 (T0 TLO active)
#
# Then we set the G59.3 coordinate system offset such that the current
# Z location is 5, which gives us these G59.3 Z offsets:
# nonrandom: -5.0 + 0.0 TLO = -5.0
# random without T0: -5.0 + 0.3 TLO = -4.7
# random with T0: -5.0 + 0.0 TLO = -5.0
#
# All the configs will be at Z=5.0 after switching to G59.3.
echo "set mdi g10 l20 p9 z5"
introspect 11.5
echo "set mdi g59.3"
introspect 12
echo "set mdi g54"
introspect 13
# Try to change TLO of the normal tool T7. This should work on all
# configs.
#
# We should end up with the following Z coordinates:
# Nonrandom: -5.0 + 0.5 = -4.5
# Random without T0: -4.7 + 0.5 = -4.2
# Random with T0: -5.0 + 0.5 = -4.5
#
# But these offsets are not active until the G43 below.
echo "set mdi g10 l11 p7 z0.5"
introspect 14
# Apply the TLO of T7, which we just tried to set. This should
# work on all configs.
echo "set mdi g43 h7"
introspect 15
# Try to change TLO of the strange tool T0.
#
# This should fail on every config because you cannot change T0.
echo "set mdi g10 l11 p0 z0.6"
introspect 16
# Apply the TLO of the special H0.
#
# On nonrandom, this requests the TLO of the tool in the spindle, which
# is currently T0, which is a special tool with TLO 0.
#
# On random, this requests the TLO of T0. If T0 is not in the tool
# table, this is an error and the active TLO remains unchanged (so it
# stays as the TLO of T7 that we just set above). If T0 is defined, we
# apply its TLO here.
echo "set mdi g43 h0"
introspect 17
#
# That's all the testing we can do of the condition that there's
# nothing in the spindle. G41/G42 would be nice to test, but the
# numbered parameters we use for introspection aren't accessible to
# gcode while cutter comp is enabled. :-(
#
# So we move on! Put a valid tool in the spindle and test everything
# again!
#
# Switch to the valid tool T50 but don't apply its TLO yet.
# This should work on all configs.
echo "set mdi t50 m6"
introspect 100
#
# g43
#
# Apply the TLO of the current tool. On all configs, the spindle has
# T50. This should work on all configs.
echo "set mdi g43"
introspect 101
# change the TLO of the normal tool T7
# this should work on both, but not change the active TLO
echo "set mdi g10 l10 p7 z1.1"
introspect 102
# apply the TLO of the normal tool T7 (TLO of 0.5 set above)
# this should work on both
echo "set mdi g43 h7"
introspect 103
# try to change the TLO of T0
#
# On nonrandom this should fail because you can't change T0.
#
# On random without T0 this should fail because there is no T0.
#
# On random with T0 this should fail because you can't change T0.
echo "set mdi g10 l10 p0 z1.2"
introspect 104
# Apply the TLO of the special H0.
#
# On nonrandom, this requests the TLO of the tool in the spindle, which
# is currently T50.
#
# On random, this requests the TLO of T0. If T0 is not in the tool
# table, this is an error and the active TLO remains unchanged (so it
# stays as the TLO of T7 that we just set above). If T0 is defined, we
# apply its TLO here.
echo "set mdi g43 h0"
introspect 105
#
# g10 l1
#
# Try to change TLO of the normal tool T7. This should work on all
# configs, but not change the active TLO.
echo "set mdi g10 l1 p7 z1.3"
introspect 106
# Apply the TLO of T7, which we just tried to set. This should work on
# all configs.
echo "set mdi g43 h7"
introspect 107
# Try to change TLO of the strange tool T0.
#
# This should fail on nonrandom because you cannot change T0.
#
# It should fail on random without T0 because it has no T0.
#
# It should fail on random with T0 because you cannot change T0.
echo "set mdi g10 l1 p0 z1.4"
introspect 108
# Apply the TLO of the special H0.
#
# It should work on nonrandom and give us the TLO of the tool in the
# spindle, T50 (in this config, G43 H0 means "use current tool").
#
# It should fail on random without T0 and leave the TLO at the value
# from T7 above.
#
# It should work on random with T0 and give us the TLO of T0 (0.0).
echo "set mdi g43 h0"
introspect 109
#
# g10 l10
#
# Try to change TLO of the normal tool T7. This should work on all
# configs.
echo "set mdi g10 l10 p7 z1.5"
introspect 110
# Apply the TLO of T7, which we just tried to set. This should work on
# all configs.
echo "set mdi g43 h7"
introspect 111
# Try to change TLO of the strange tool T0.
#
# This should fail on nonrandom because you cannot change T0
#
# It should fail on random without T0 because it has no T0.
#
# It should fail on random with T0 because you cannot change T0
echo "set mdi g10 l10 p0 z1.6"
introspect 112
# Apply the TLO of the special H0.
#
# It should work on nonrandom and give us the TLO of the tool in the
# spindle, T50 (in this config, G43 H0 means "use current tool").
#
# It should fail on random without T0 and leave the TLO at the value
# from T7 above.
#
# It should work on random with T0 and give us the TLO of T0 (0.0).
echo "set mdi g43 h0"
introspect 113
# Try to change TLO of the currently loaded tool, T50.
# This should work on all configs but not change the active TLO
echo "set mdi g10 l10 p50 z1.7"
introspect 114
# Apply the TLO of the special H0.
#
# It should work on nonrandom and give us the TLO of the tool in the
# spindle, T50 (in this config, G43 H0 means "use current tool").
#
# It should fail on random without T0 and leave the TLO at the value
# from T7 above.
#
# It should work on random with T0 and give us the TLO of T0 (0.0).
echo "set mdi g43 h0"
introspect 115
# Apply the TLO of T7.
# This should work on all configs.
echo "set mdi g43 h7"
introspect 116
# Apply the TLO of the current tool
# This should work on all configs.
echo "set mdi g43"
introspect 117
#
# g10 l11
#
# First offset the G59.3 coordinate system and make sure that worked,
# but then switch back to G54. All configs are using the TLO of T50
# at this point, so they all set the same G59.3 coordinate system
# offset.
#
# Before this G10 L20, all configs are at Z=1.7 (T50 TLO active)
#
# Then we set the G59.3 coordinate system offset such that the current
# Z location is 6, which gives us a G59.3 Z offset of:
# -6.0 + 1.7 TLO = -4.3
#
# All the configs will be at Z = 6.0 after switching to G59.3.
echo "set mdi g10 l20 p9 z6"
introspect 117.5
echo "set mdi g59.3"
introspect 118
echo "set mdi g54"
introspect 119
# Try to change TLO of the normal tool T7. This should work on all
# configs.
echo "set mdi g10 l11 p7 z1.8"
introspect 120
# Apply the TLO of T7, which we just tried to set. This should
# work on all configs.
echo "set mdi g43 h7"
introspect 121
# Try to change TLO of the strange tool T0.
#
# This should fail on nonrandom because you cannot change T0.
#
# It should fail on random without T0 because it has no T0.
#
# This should fail on random with T0 because you cannot change T0.
echo "set mdi g10 l11 p0 z1.3"
introspect 122
# Apply the TLO of T0, which we just tried to set.
#
# It should work on nonrandom and give us a TLO of the tool in the
# spindle, T50.
#
# It should fail on random and leave the TLO at the value from T7
# above.
#
# It should work on random with T0 and give us the TLO of T0: 0.0
echo "set mdi g43 h0"
introspect 123
#
# Now load T0 into the spindle and retest everything again.
#
# Switch to the special tool T0 but don't apply its TLO yet.
#
# On nonrandom, this should unload the spindle.
#
# On random without T0 this should fail (there is no T0) and leave
# T50 in the spindle.
#
# On random with T0 this should work and put T0 in the spindle.
echo "set mdi t0 m6"
introspect 200
#
# g43
#
# Apply the TLO of the current tool.
#
# On nonrandom the spindle has the special tool T0, which has a 0 TLO.
#
# On random without T0 the spindle has T50, which has a TLO of -1.15,
# set above.
#
# On random with T0 the spindle has tool T0, which has a 0 TLO.
echo "set mdi g43"
introspect 201
# change the TLO of the normal tool T7
# this should work on all configs, but not change the active TLO
echo "set mdi g10 l10 p7 z2.0"
introspect 202
# apply the TLO of the normal tool T7 (TLO set above)
# this should work on all configs
echo "set mdi g43 h7"
introspect 203
# try to change the TLO of T0
#
# On nonrandom this should fail because you can't change T0.
#
# On random without T0 this should fail because there is no T0.
#
# On random with T0 this should fail because you can't change T0.
echo "set mdi g10 l10 p0 z2.1"
introspect 204
# try to apply the TLO of H0
#
# On nonrandom, this should apply the TLO of the current tool (special
# handling of G43 H0). The current tool is T0, which has 0 TLO.
#
# On random without T0 this should be an error (G43 H0 is nothing
# special, but there is no T0) and the active TLO should remain
# unchanged.
#
# On random with T0 this should apply the TLO of T0 (0.0).
echo "set mdi g43 h0"
introspect 205
#
# g10 l1
#
# Try to change TLO of the normal tool T7. This should work on all
# configs, but not change the active TLO.
echo "set mdi g10 l1 p7 z2.2"
introspect 206
# Apply the TLO of T7, which we just tried to set. This should work on
# all configs.
echo "set mdi g43 h7"
introspect 207
# Try to change TLO of the strange tool T0.
#
# This should fail on nonrandom because you cannot change T0.
#
# It should fail on random without T0 because it has no T0.
#
# This should fail on random with T0 because you cannot change T0.
echo "set mdi g10 l1 p0 z2.3"
introspect 208
# Apply the TLO of H0.
#
# It should work on nonrandom and give us the TLO of the tool in the
# spindle, T50.
#
# It should fail on random without T0 and leave the TLO at the value
# from T7 above.
#
# It should work on random with TLO and give us the TLO of T0.
echo "set mdi g43 h0"
introspect 209
#
# g10 l10
#
# Try to change TLO of the normal tool T7. This should work on all
# configs.
echo "set mdi g10 l10 p7 z2.4"
introspect 210
# Apply the TLO of T7, which we just tried to set. This should work on
# all configs.
echo "set mdi g43 h7"
introspect 211
# Try to change TLO of the strange tool T0.
#
# This should fail on nonrandom because you cannot change T0
#
# It should fail on random without T0 because it has no T0.
#
# It should fail on random with T0 because you cannot change T0
echo "set mdi g10 l10 p0 z2.5"
introspect 212
# Apply the TLO of the special H0.
#
# It should work on nonrandom and give us the TLO of the tool in the
# spindle, T0 (in this config, G43 H0 means "use current tool").
#
# It should fail on random without T0 and leave the TLO at the value
# from T7 above.
#
# It should work on random with T0 and give us the TLO of T0 (0.0).
echo "set mdi g43 h0"
introspect 213
#
# g10 l11
#
# First offset the G59.3 coordinate system and make sure that worked,
# but then switch back to G54. This sets different G59.3 offsets in
# different configs, because they have different active Z TLOs at
# this point.
#
# Before this G10 L20, we are at the following Z locations:
# nonrandom: 0.0 (T0 TLO active)
# random without T0: 2.4 (T7 TLO active)
# random with T0: 0.0 (T0 TLO active)
#
# Then we set the G59.3 coordinate system offset such that the current
# Z location is 7, which gives us these G59.3 Z offsets:
# nonrandom: -7.0 + 0.0 TLO = -7.0
# random without T0: -7.0 + 2.4 TLO = -4.6
# random with T0: -7.0 + 0.0 TLO = -7.0
#
# All the configs will be at Z=7.0 after switching to G59.3.
echo "set mdi g10 l20 p9 z7"
introspect 213.5
echo "set mdi g59.3"
introspect 214
echo "set mdi g54"
introspect 215
# Try to change TLO of the normal tool T7. This should work on all
# configs.
#
# We should end up with the following Z coordinates:
# Nonrandom: -7.0 + 2.6 = -4.4
# Random without T0: -4.6 + 2.6 = -2.0
# Random with T0: -7.0 + 2.6 = -4.4
#
# But these offsets are not active until the G43 below.
echo "set mdi g10 l11 p7 z2.6"
introspect 216
# Apply the TLO of T7, which we just tried to set. This should
# work on all configs.
echo "set mdi g43 h7"
introspect 217
# Try to change TLO of the strange tool T0.
#
# This should fail on nonrandom because you cannot change T0.
#
# It should fail on random without T0 because it has no T0.
#
# It should work on random with T0 because you cannot change T0.
echo "set mdi g10 l11 p0 z2.7"
introspect 218
# Apply the TLO of H0.
#
# It should work on nonrandom and give us a TLO of the tool in the
# spindle, T0
#
# It should fail on random without T0 and leave the TLO at the value
# from T7 above.
#
# It should work on random with T0 and give us a TLO of the tool in the
# spindle, T0
echo "set mdi g43 h0"
introspect 219
# give linuxcnc a second to finish
echo 'set wait done'
echo shutdown
) | nc localhost 5007
# wait for linuxcnc to finish
wait
exit 0

29
tests/t0/subs/M100 Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
#
# This script (M100) is called to log the current coordinates and the
# current tool number and Tool Length Offset information to a log file,
# for testing purposes
#
TEST_DIR=$(dirname INI_FILE_NAME)
OUT_FILE=$TEST_DIR/gcode-output
P=$1
Q=$2
#echo P is $P >> $OUT_FILE
#echo Q is $Q >> $OUT_FILE
case $P in
0.000000) echo "X = $Q" >> "$OUT_FILE" ;;
1.000000) echo "Y = $Q" >> "$OUT_FILE" ;;
2.000000) echo "Z = $Q" >> "$OUT_FILE" ;;
3.000000) echo "toolno = $Q" >> "$OUT_FILE" ;;
4.000000) echo "tlo_z = $Q" >> "$OUT_FILE" ;;
5.000000) echo "" >> "$OUT_FILE" ;;
6.000000) echo "sequence number $Q" >> "$OUT_FILE" ;;
*)
echo "unknown P=$P (Q=$Q)" >> "$OUT_FILE"
exit 1;;
esac