完善五轴 RTCP 仿真与验证资料

This commit is contained in:
2026-07-01 21:49:58 -04:00
parent ac4e855b2b
commit d0d58998ac
159 changed files with 6771594 additions and 339 deletions

View File

@@ -0,0 +1,75 @@
o<change> sub
;(debug, in change tool_in_spindle=#<tool_in_spindle> current_pocket=#<current_pocket>)
;(debug, selected_tool=#<selected_tool> selected_pocket=#<selected_pocket>)
;otherwise after the M6 this information is gone!
#<tool> = #<selected_tool>
#<pocket> = #<selected_pocket>
; we must execute this only in the milltask interpreter
; or preview will break, so test for '#<_task>' which is 1 for
; the milltask interpreter and 0 in the UI's
O100 if [#<_task> EQ 0]
(debug, Task ist Null)
O100 return [999]
O100 endif
;first go up
G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]
; then move to change position
G53 G0 X[#<_ini[CHANGE_POSITION]X>] Y[#<_ini[CHANGE_POSITION]Y>]
; cancel tool offset
G49
; using the code being remapped here means 'use builtin behaviour'
M6
O200 if [#<_hal[gmoccapy.toolmeasurement]> EQ 0]
O200 return [3] ; indicate no tool measurement
O200 endif
G53 G0 X[#<_ini[TOOLSENSOR]X>] Y[#<_ini[TOOLSENSOR]Y>]
G53 G0 Z[#<_ini[TOOLSENSOR]Z>]
O300 if [#<_hal[gmoccapy.searchvel]> LE 0]
O300 return [-1] ; indicate searchvel <= 0
O300 endif
O400 if [#<_hal[gmoccapy.probevel]> LE 0]
O400 return [-2] ; indicate probevel <= 0
O400 endif
F #<_hal[gmoccapy.searchvel]>
G91
G38.2 Z #<_ini[TOOLSENSOR]MAXPROBE>
G0 Z2
; This is commented out only for sim.
;F #<_hal[gmoccapy.probevel]>
;G38.2 Z-4
O500 if [#5070 EQ 0]
G90
O500 return [-3] ; indicate probe contact failure to epilog
O500 endif
G90
G53 G0 Z[#<_ini[CHANGE_POSITION]Z>]
#<touch_result> = #5063
#<probeheight> = #<_hal[gmoccapy.probeheight]>
#<blockheight> = #<_hal[gmoccapy.blockheight]>
;(DEBUG, #<touch_result> #<probeheight> #<blockheight>)
G10 L1 P#<tool> Z[#<touch_result> - #<_hal[gmoccapy.probeheight]> + #<_hal[gmoccapy.blockheight]>]
G43
;G10 L1 P#<tool> Z#<touch_result>
;G10 L2 P0 Z[#<workpieceheight> + #<probeheight> + #<touch_result>]
; signal success be returning a value > 0:
o<change> endsub [1]

View File

@@ -0,0 +1,21 @@
o<change_g43> sub
;(debug, in change tool_in_spindle=#<tool_in_spindle> current_pocket=#<current_pocket>)
;(debug, selected_tool=#<selected_tool> selected_pocket=#<selected_pocket>)
; we must execute this only in the milltask interpreter
; or preview will break, so test for '#<_task>' which is 1 for
; the milltask interpreter and 0 in the UI's
O100 if [#<_task> EQ 0]
(debug, Task ist Null)
O100 return [999]
O100 endif
; using the code being remapped here means 'use builtin behaviour'
M6
; set tool offset
G43
; signal success be returning a value > 0:
o<change_g43> endsub [1]
M2

View File

@@ -0,0 +1,26 @@
; Testfile go to position
; will jog the machine to a given position
; the image path must be relative from your config dir or absolute, "~" is allowed
(IMAGE, ./macros/images/goto_x_y_z.png)
O<go_to_position> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<go_to_position> endsub
M2

View File

@@ -0,0 +1,25 @@
; Testfile "hello world"
; will just give messages
O<halo_world> sub
G17
G21
G54
G61
G40
G49
G80
G90
G0 X10
(MSG, Hallo Welt)
(MSG, hello world)
G0X-10
O<halo_world> endsub
M2

View File

@@ -0,0 +1,27 @@
; Testfile I am Lost
; will jog to machine zero and set all axis to zero
; the image path must be relative from your config dir or absolute, "~" is allowed
(IMAGE, ./macros/images/i_am_lost.png)
O<i_am_lost> sub
G17
G21
G54
G61
G40
G49
G80
G90
(MSG, Will now move to machine zero)
G53 G0 X0 Y0 Z0
(MSG, will now set all axis to zero)
G10 L20 P0 X0 Y0 Z0
(MSG, all done)
O<i_am_lost> endsub
M2

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

View File

@@ -0,0 +1,22 @@
; Testfile "increment"
; will move the machine in relative coordinates
O<increment> sub
G17
G21
G54
G61
G40
G49
G80
G90
G91 G0 X#1 Y#2
G90
(DEBUG, X was [#1] and Y was [#2])
O<increment> endsub
M2

View File

@@ -0,0 +1,29 @@
; Testfile "Jog around"
; will just jog a little bit around
O<jog_around> sub
G17
G21
G54
G61
G40
G49
G80
G90
G91 G0 X 25
Y-25
Z-25
Y25
X-25
Z25
F250
G2 I 25
(MSG, It is done!)
O<jog_around> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_0> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_0> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_1> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_1> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_10> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_10> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_11> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_11> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_12> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_12> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_13> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_13> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_14> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_14> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_15> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_15> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_2> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_2> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_3> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_3> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_4> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_4> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_5> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_5> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_6> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_6> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_7> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_7> endsub
M2

View File

@@ -0,0 +1,27 @@
; Testfile go to position
; will jog the machine to a position to give
; the image path must be relative from your config dir or absolute, "~" is allowed
(IMAGE, ./macros/images/macro_8.png)
O<macro_8> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_8> endsub
M2

View File

@@ -0,0 +1,24 @@
; Testfile go to position
; will jog the machine to a position to give
O<macro_9> sub
G17
G21
G54
G61
G40
G49
G80
G90
;#1 = <X-Pos>
;#2 = <Y-Pos>
;#3 = <Z-Pos>
(DEBUG, Will now move machine to X = #1 , Y = #2 , Z = #3)
G0 X #1 Y #2 Z #3
O<macro_9> endsub
M2

View File

@@ -0,0 +1,44 @@
This is a small instruction to include macros in gmoccapy.
In your INI File you need to introduce a section called [MACROS]
and for every macro you'll need to include a one-liner like so:
MACRO = jog_around
or
MACRO = increment xinc yinc
where xinc and yinc are placeholders
During execution of the macro, you will be asked to enter the values.
You are allowed to introduce 9 macros!
If you enter more macros, only the first 9 will appear with button in gmoccapy.
In the [RS274NGC] section you may want to give a path to your macros like so:
[RS274NGC]
SUBROUTINE_PATH = nc_files/subroutines
or you place your macros in the nc_files folder.
Each macro must have it's own file in one of the mentioned folders and they are normal subroutines, so the must begin with:
O<jog_around> sub
and end with
O<jog_around> endsub
M2
The name of the file must be jog_around.ngc.
And an macro must contain at least one movement of one axis.
macro name in INI file have to be the same as the file name and the sub must have also the same name (case sensitive!)!
BE CAREFUL:
At this development step, the macros can only be interrupted by pressing the machine off button or the emergency exit button! I will check how to make this more secure!
Hope this does help.
Norbert

View File

@@ -0,0 +1,9 @@
%
o<on_abort> sub
G90
G40
G49
o<on_abort> endsub
%

View File

@@ -0,0 +1,20 @@
o<settool_g43> sub
;(debug, tool=#<tool> pocket=#<pocket>)
; we must execute this only in the milltask interpreter
; or preview will break, so test for '#<_task>' which is 1 for
; the milltask interpreter and 0 in the UI's
O100 if [#<_task> EQ 0]
(debug, Task ist Null)
O100 return [999]
O100 endif
; using the code being remapped here means 'use builtin behaviour'
m61 q#<tool>
; set tool offset
G43
; signal success be returning a value > 0:
o<settool_g43> endsub [1]
M2

View File

@@ -0,0 +1,12 @@
Table Rotary/Tilting (trt) Sim configs
xyzac-trt
xyzbc-trt
Example ngc files:
examples/boat-xyzac.ngc (!!! TOUCHOFF table Z to -13.25 !!!)
examples/boat-xyzbc.ngc (!!! TOUCHOFF table Z to - 8.30 !!!)
Example ngc files (ngcgui compatible subroutines):
examples/test-xyzac.ngc
examples/test-xyzbc.ngc

View File

@@ -0,0 +1,47 @@
o<test-xyzac> sub
(test-xyzac-kins with offsets and tool change)
( 5 AXIS XYZAC MILLING )
#<a_angle> = #1 (=20)
#<c_angle> = #2 (=30)
#<xy_max> = #3 (=30)
#<z_max> = #4 (=10)
#<feedrate> = #5 (=200)
#<tool1> = #6 (=1 1st Tool)
#<tool2> = #7 (=2 2nd Tool)
#<speed1> = #8 (=500)
#<speed2> = #9 (=600)
; 'square with 2 rounded corners'
#<x_max> = #<xy_max>
#<y_max> = #<xy_max>
#<g3_j> = #<xy_max>
N40 G00 G17 G40 G90 G94 Z10
(first tool - no z-offset)
T#<tool1> M6
S#<speed1> M3
G00 A#<a_angle> C#<c_angle>
G43 H#<tool1> Z0
G01 X#<x_max> F#<feedrate>
G01 Y#<y_max>
G01 X0
G03 X-#<x_max> Y0 I0 J-#<g3_j>
G00 Z#<z_max>
G00 X0
M5
(next tool- with z-offset)
T#<tool2> M6
S#<speed2> M3
G00 A#<a_angle> C#<c_angle>
G43 H#<tool2> Z0
G01 X-#<x_max> F#<feedrate>
G01 Y-#<y_max>
G01 X0
G03 X#<x_max> Y0 I0 J#<g3_j>
G0 Z#<z_max>
G0 X0 Y0
M5
A0 C0
o<test-xyzac> endsub

View File

@@ -0,0 +1,47 @@
o<test-xyzbc> sub
(test-xyzbc-trt-kins with offsets and tool change)
( 5 AXIS XYZBC MILLING )
#<b_angle> = #1 (=20)
#<c_angle> = #2 (=30)
#<xy_max> = #3 (=30)
#<z_max> = #4 (=10)
#<feedrate> = #5 (=200)
#<tool1> = #6 (=1 1st Tool)
#<tool2> = #7 (=2 2nd Tool)
#<speed1> = #8 (=500)
#<speed2> = #9 (=600)
;'square with 2 rounded corners'
#<x_max> = #<xy_max>
#<y_max> = #<xy_max>
#<g3_j> = #<xy_max>
G00 G17 G40 G90 G94 Z10
(first tool - no z-offset)
T#<tool1> M6
S#<speed1> M3
G00 B#<b_angle> C#<c_angle>
G43 H#<tool1> Z0
G01 X#<x_max> F#<feedrate>
G01 Y#<y_max>
G01 X0
G03 X-#<x_max> Y0 I0 J-#<g3_j>
G00 Z#<z_max>
G00 X0
M5
(next tool- with z-offset)
T#<tool2> M6
S#<speed2> M3
G00 B#<b_angle> C#<c_angle>
G43 H#<tool2> Z0
G01 X-#<x_max> F#<feedrate>
G01 Y-#<y_max>
G01 X0
G03 X#<x_max> Y0 I0 J#<g3_j>
G0 Z#<z_max>
G0 X0 Y0
M5
B0 C0
o<test-xyzbc> endsub

View File

@@ -0,0 +1,22 @@
###################################################################
# moccapy_postgui.hal file from Norbert Schechner #
###################################################################
loadrt abs names=abs_spindle_feedback
addf abs_spindle_feedback servo-thread
net spindle-speed-limited => abs_spindle_feedback.in
net spindle-abs abs_spindle_feedback.out => gmoccapy.spindle_feedback_bar
net spindle-at-speed gmoccapy.spindle_at_speed_led
# the unlink pin commands are only used, because they are connected
# in core_sim.hal and we use this file to simulate
unlinkp iocontrol.0.tool-change
unlinkp iocontrol.0.tool-changed
net tool-change gmoccapy.toolchange-change <= iocontrol.0.tool-change
net tool-changed gmoccapy.toolchange-changed => iocontrol.0.tool-changed
net tool-prep-number gmoccapy.toolchange-number <= iocontrol.0.tool-prep-number
net tool-offset gmoccapy.tooloffset-z

View File

@@ -0,0 +1,97 @@
[DEFAULT]
spindle_start_rpm = 300
scale_jog_vel = 21.0
scale_spindle_override = 1
scale_feed_override = 1
scale_rapid_override = 1
hide_turtle_jog_button = False
turtle_jog_factor = 10
dro_size = 28
open_file =
screen1 = window
x_pos = 40
y_pos = 30
width = 979
height = 750
gtk_theme = Follow System Theme
audio_alert = /usr/share/sounds/freedesktop/stereo/dialog-warning.oga
audio_error = /usr/share/sounds/freedesktop/stereo/dialog-error.oga
grid_size = 1.0
view = p
mouse_btn_mode = 4
hide_cursor = False
system_name_tool = Working Offset
system_name_g5x = G5x
system_name_rot = Rot
system_name_g92 = G92
system_name_g54 = G54
system_name_g55 = G55
system_name_g56 = G56
system_name_g57 = G57
system_name_g58 = G58
system_name_g59 = G59
system_name_g59.1 = G59.1
system_name_g59.2 = G59.2
system_name_g59.3 = G59.3
jump_to_dir = /home/gmoccapy
show_keyboard_on_offset = False
show_keyboard_on_tooledit = False
show_keyboard_on_edit = False
show_keyboard_on_mdi = False
show_keyboard_on_file_selection = False
spindle_bar_min = 0.0
spindle_bar_max = 6000.0
x_pos_popup = 45.0
y_pos_popup = 55
width_popup = 250.0
max_messages = 10
message_font = sans 10
use_frames = True
show_dro_btn = False
use_auto_units = True
blockdel = False
opstop = False
enable_dro = False
show_offsets = False
show_dtg = False
view_tool_path = True
view_dimension = True
gremlin_view = rbt_view_p
run_from_line = no_run
unlock_way = no
unlock_code = 123
show_preview_on_offset = False
use_keyboard_shortcuts = True
abs_color = #0000FF
rel_color = #000000
dtg_color = #FFFF00
homed_color = #00FF00
unhomed_color = #FF0000
dro_digits = 3
toggle_readout = True
reload_tool = True
tool_in_spindle = 0
blockheight = 0.0
use_toolmeasurement = False
kbd_height = 250
kbd_width = 880
kbd_set_height = False
kbd_set_width = False
info_tab_page = 0
jog_btn_size = 48
jog_box_width = 360
toolpage_use_calc = True
offsetpage_use_calc = True
gcodeview_font = monospace 10
hide_titlebar = False
icon_theme = classic
gcode_theme = classic
audio_enabled = True
hide_tooltips = False
system_name_g28 = G28
system_name_g30 = G30
iconview_sortorder = 0
iconview_sortbydate = 1
iconview_folderfirst = 0
sort_by_date = False

View File

@@ -0,0 +1,156 @@
[EMC]
VERSION = 1.1
MACHINE = sim-xyzac-trt
DEBUG = 0
[DISPLAY]
OPEN_FILE = ./examples/impeller-7bl-xyzac.ngc
JOG_AXES = XYZC
DISPLAY = gmoccapy
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2
PROGRAM_PREFIX = ../../../nc_files
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 1
TKPKG = Ngcgui 1.0
NGCGUI_FONT = Helvetica -12 normal
NGCGUI_SUBFILE = test-xyzac.ngc
[RS274NGC]
PARAMETER_FILE = xyzac.var
SUBROUTINE_PATH = ./examples:../../macros
REMAP=M6 modalgroup=6 prolog=change_prolog ngc=change_g43 epilog=change_epilog
REMAP=M61 modalgroup=6 prolog=settool_prolog ngc=settool_g43 epilog=settool_epilog
# the Python plugins serves interpreter and task
[PYTHON]
PATH_PREPEND = ../../python
TOPLEVEL = ../../python/toplevel.py
LOG_LEVEL = 0
[HAL]
HALUI = halui
HALFILE = LIB:basic_sim.tcl -no_use_hal_manualtoolchange
# vismach xyzac-trt-gui items
HALCMD = loadusr -W xyzac-trt-gui
HALCMD = net :table-x joint.0.pos-fb xyzac-trt-gui.table-x
HALCMD = net :saddle-y joint.1.pos-fb xyzac-trt-gui.saddle-y
HALCMD = net :spindle-z joint.2.pos-fb xyzac-trt-gui.spindle-z
HALCMD = net :tilt-a joint.3.pos-fb xyzac-trt-gui.tilt-a
HALCMD = net :rotate-c joint.4.pos-fb xyzac-trt-gui.rotate-c
HALCMD = net :tool-offset motion.tooloffset.z
HALCMD = net :tool-offset xyzac-trt-kins.tool-offset xyzac-trt-gui.tool-offset
HALCMD = net :y-offset xyzac-trt-kins.y-offset xyzac-trt-gui.y-offset
HALCMD = net :z-offset xyzac-trt-kins.z-offset xyzac-trt-gui.z-offset
HALCMD = sets :y-offset 20
HALCMD = sets :z-offset 10
POSTGUI_HALFILE = postgui.hal
[KINS]
KINEMATICS = xyzac-trt-kins
JOINTS = 5
[TRAJ]
COORDINATES = XYZAC
LINEAR_UNITS = mm
ANGULAR_UNITS = deg
DEFAULT_LINEAR_VELOCITY = 20
MAX_LINEAR_VELOCITY = 35
MAX_LINEAR_ACCELERATION = 400
DEFAULT_LINEAR_ACCELERATION = 300
[EMCMOT]
EMCMOT = motmod
SERVO_PERIOD = 1000000
COMM_TIMEOUT = 1
[TASK]
TASK = milltask
CYCLE_TIME = 0.010
[EMCIO]
TOOL_TABLE = xyzac-trt.tbl
[AXIS_X]
MIN_LIMIT = -200
MAX_LIMIT = 200
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
[JOINT_0]
TYPE = LINEAR
HOME = 0
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
MIN_LIMIT = -200
MAX_LIMIT = 200
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0
[AXIS_Y]
MIN_LIMIT = -100
MAX_LIMIT = 100
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
[JOINT_1]
TYPE = LINEAR
HOME = 0
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
MIN_LIMIT = -100
MAX_LIMIT = 100
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0
[AXIS_Z]
MIN_LIMIT = -120
MAX_LIMIT = 120
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
[JOINT_2]
TYPE = LINEAR
HOME = 0
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
MIN_LIMIT = -120
MAX_LIMIT = 120
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0
[AXIS_A]
MIN_LIMIT = -100
MAX_LIMIT = 50
MAX_VELOCITY = 30
MAX_ACCELERATION = 300
[JOINT_3]
TYPE = ANGULAR
HOME = 0
MAX_VELOCITY = 30
MAX_ACCELERATION = 300
MIN_LIMIT = -100
MAX_LIMIT = 50
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0
[AXIS_C]
MIN_LIMIT = -36000
MAX_LIMIT = 36000
MAX_VELOCITY = 30
MAX_ACCELERATION = 300
[JOINT_4]
TYPE = ANGULAR
HOME = 0
MAX_VELOCITY = 30
MAX_ACCELERATION = 300
MIN_LIMIT = -36000
MAX_LIMIT = 36000
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0

View File

@@ -0,0 +1,10 @@
T1 P1 Z0 D6 ;end mill
T2 P2 Z15 D8 ;end mill
T3 P3 Z0 D4.2 ;#7 tap drill
T4 P4 Z0 D10
T5 P5 Z30 D10
T6 P6 Z30 D10
T7 P7 Z30 D10
T8 P8 Z30 D10
T9 P9 Z30 D10
T10 P10 D0.5

View File

@@ -0,0 +1,202 @@
# Fri Jun 26 05:57:43 EDT 2026
#
# This file: ./xyzac-trt_cmds.hal
# Created by: /home/meswork/cnc_wams/linuxcnc/lib/hallib/basic_sim.tcl
# With options: -no_use_hal_manualtoolchange
# From inifile: /home/meswork/cnc_wams/linuxcnc/configs/sim/gmoccapy/non_trivial_kinematics/table-rotary-tilting/xyzac-trt.ini
# Halfiles: {LIB:basic_sim.tcl -no_use_hal_manualtoolchange}
#
# This file contains the hal commands produced by basic_sim.tcl
# (and any hal commands executed prior to its execution).
# ------------------------------------------------------------------
# To use ./xyzac-trt_cmds.hal in the original inifile (or a copy of it),
# edit to change:
# [HAL]
# HALFILE = LIB:basic_sim.tcl parameters
# to:
# [HAL]
# HALFILE = ./xyzac-trt_cmds.hal
#
# Notes:
# 1) Inifile Variables substitutions specified in the inifile
# and interpreted by halcmd are automatically substituted
# in the created halfile (./xyzac-trt_cmds.hal).
# 2) Input pins connected to a signal with no writer are
# not included in the setp listings herein so must be added
# manually
#
# components
#preloaded module: loadrt tpmod
#preloaded module: loadrt homemod
loadrt xyzac-trt-kins
loadrt motmod base_period_nsec=0 servo_period_nsec=1000000 num_joints=5
#loadrt __servo-thread (not loaded by loadrt, no args saved)
loadrt pid names=J0_pid,J1_pid,J2_pid,J3_pid,J4_pid
loadrt mux2 names=J0_mux,J1_mux,J2_mux,J3_mux,J4_mux
loadrt ddt names=J0_vel,J0_accel,J1_vel,J1_accel,J2_vel,J2_accel,J3_vel,J3_accel,J4_vel,J4_accel
loadrt sim_home_switch names=J0_switch,J1_switch,J2_switch,J3_switch,J4_switch
loadrt sim_spindle names=sim_spindle
loadrt limit2 names=limit_speed
loadrt lowpass names=spindle_mass
loadrt near names=near_speed
loadrt scale names=rpm_rps
# pin aliases
# param aliases
# signals
# nets
net J0:acc J0_accel.out
net J0:enable joint.0.amp-enable-out => J0_pid.enable
net J0:homesw J0_switch.home-sw => joint.0.home-sw-in
net J0:on-pos J0_pid.output => J0_mux.in1
net J0:pos-cmd joint.0.motor-pos-cmd => J0_pid.command
net J0:pos-fb J0_mux.out => J0_mux.in0 J0_switch.cur-pos J0_vel.in joint.0.motor-pos-fb
net J0:vel J0_vel.out => J0_accel.in
net J1:acc J1_accel.out
net J1:enable joint.1.amp-enable-out => J1_pid.enable
net J1:homesw J1_switch.home-sw => joint.1.home-sw-in
net J1:on-pos J1_pid.output => J1_mux.in1
net J1:pos-cmd joint.1.motor-pos-cmd => J1_pid.command
net J1:pos-fb J1_mux.out => J1_mux.in0 J1_switch.cur-pos J1_vel.in joint.1.motor-pos-fb
net J1:vel J1_vel.out => J1_accel.in
net J2:acc J2_accel.out
net J2:enable joint.2.amp-enable-out => J2_pid.enable
net J2:homesw J2_switch.home-sw => joint.2.home-sw-in
net J2:on-pos J2_pid.output => J2_mux.in1
net J2:pos-cmd joint.2.motor-pos-cmd => J2_pid.command
net J2:pos-fb J2_mux.out => J2_mux.in0 J2_switch.cur-pos J2_vel.in joint.2.motor-pos-fb
net J2:vel J2_vel.out => J2_accel.in
net J3:acc J3_accel.out
net J3:enable joint.3.amp-enable-out => J3_pid.enable
net J3:homesw J3_switch.home-sw => joint.3.home-sw-in
net J3:on-pos J3_pid.output => J3_mux.in1
net J3:pos-cmd joint.3.motor-pos-cmd => J3_pid.command
net J3:pos-fb J3_mux.out => J3_mux.in0 J3_switch.cur-pos J3_vel.in joint.3.motor-pos-fb
net J3:vel J3_vel.out => J3_accel.in
net J4:acc J4_accel.out
net J4:enable joint.4.amp-enable-out => J4_pid.enable
net J4:homesw J4_switch.home-sw => joint.4.home-sw-in
net J4:on-pos J4_pid.output => J4_mux.in1
net J4:pos-cmd joint.4.motor-pos-cmd => J4_pid.command
net J4:pos-fb J4_mux.out => J4_mux.in0 J4_switch.cur-pos J4_vel.in joint.4.motor-pos-fb
net J4:vel J4_vel.out => J4_accel.in
net estop:loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
net sample:enable motion.motion-enabled => J0_mux.sel J1_mux.sel J2_mux.sel J3_mux.sel J4_mux.sel
net spindle-at-speed near_speed.out => spindle.0.at-speed
net spindle-index-enable sim_spindle.index-enable <=> spindle.0.index-enable
net spindle-orient spindle.0.orient => spindle.0.is-oriented
net spindle-pos sim_spindle.position-fb => spindle.0.revs
net spindle-rpm-filtered spindle_mass.out => near_speed.in2 rpm_rps.in
net spindle-rps-filtered rpm_rps.out => spindle.0.speed-in
net spindle-speed-cmd spindle.0.speed-out => limit_speed.in near_speed.in1
net spindle-speed-limited limit_speed.out => sim_spindle.velocity-cmd spindle_mass.in
net tool:change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
net tool:prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
# parameter values
setp J0_accel.tmax 0
setp J0_mux.tmax 0
setp J0_pid.do-pid-calcs.tmax 0
setp J0_switch.tmax 0
setp J0_vel.tmax 0
setp J1_accel.tmax 0
setp J1_mux.tmax 0
setp J1_pid.do-pid-calcs.tmax 0
setp J1_switch.tmax 0
setp J1_vel.tmax 0
setp J2_accel.tmax 0
setp J2_mux.tmax 0
setp J2_pid.do-pid-calcs.tmax 0
setp J2_switch.tmax 0
setp J2_vel.tmax 0
setp J3_accel.tmax 0
setp J3_mux.tmax 0
setp J3_pid.do-pid-calcs.tmax 0
setp J3_switch.tmax 0
setp J3_vel.tmax 0
setp J4_accel.tmax 0
setp J4_mux.tmax 0
setp J4_pid.do-pid-calcs.tmax 0
setp J4_switch.tmax 0
setp J4_vel.tmax 0
setp limit_speed.tmax 0
setp motion-command-handler.tmax 0
setp motion-controller.tmax 0
setp near_speed.difference 10
setp near_speed.scale 1.1
setp near_speed.tmax 0
setp rpm_rps.tmax 0
setp servo-thread.tmax 0
setp sim_spindle.scale 0.01666667
setp sim_spindle.tmax 0
setp spindle_mass.gain 0.07
setp spindle_mass.tmax 0
# realtime thread/function links
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf J0_pid.do-pid-calcs servo-thread
addf J1_pid.do-pid-calcs servo-thread
addf J2_pid.do-pid-calcs servo-thread
addf J3_pid.do-pid-calcs servo-thread
addf J4_pid.do-pid-calcs servo-thread
addf J0_mux servo-thread
addf J1_mux servo-thread
addf J2_mux servo-thread
addf J3_mux servo-thread
addf J4_mux servo-thread
addf J0_vel servo-thread
addf J0_accel servo-thread
addf J1_vel servo-thread
addf J1_accel servo-thread
addf J2_vel servo-thread
addf J2_accel servo-thread
addf J3_vel servo-thread
addf J3_accel servo-thread
addf J4_vel servo-thread
addf J4_accel servo-thread
addf J0_switch servo-thread
addf J1_switch servo-thread
addf J2_switch servo-thread
addf J3_switch servo-thread
addf J4_switch servo-thread
addf limit_speed servo-thread
addf spindle_mass servo-thread
addf rpm_rps servo-thread
addf near_speed servo-thread
addf sim_spindle servo-thread
# setp commands for unconnected input pins
setp J0_pid.FF0 1.0
setp J0_pid.Pgain 0
setp J0_pid.Dgain 0
setp J0_pid.Igain 0
setp J0_pid.FF1 0
setp J0_pid.FF2 0
setp J1_pid.FF0 1.0
setp J1_pid.Pgain 0
setp J1_pid.Dgain 0
setp J1_pid.Igain 0
setp J1_pid.FF1 0
setp J1_pid.FF2 0
setp J2_pid.FF0 1.0
setp J2_pid.Pgain 0
setp J2_pid.Dgain 0
setp J2_pid.Igain 0
setp J2_pid.FF1 0
setp J2_pid.FF2 0
setp J3_pid.FF0 1.0
setp J3_pid.Pgain 0
setp J3_pid.Dgain 0
setp J3_pid.Igain 0
setp J3_pid.FF1 0
setp J3_pid.FF2 0
setp J4_pid.FF0 1.0
setp J4_pid.Pgain 0
setp J4_pid.Dgain 0
setp J4_pid.Igain 0
setp J4_pid.FF1 0
setp J4_pid.FF2 0
setp sim_spindle.scale 0.01666667
setp limit_speed.maxv 5000.0
setp spindle_mass.gain .07
setp near_speed.scale 1.1
setp near_speed.difference 10

View File

@@ -0,0 +1,119 @@
5161 0.000000
5162 0.000000
5163 0.000000
5164 0.000000
5165 0.000000
5166 0.000000
5167 0.000000
5168 0.000000
5169 0.000000
5181 0.000000
5182 0.000000
5183 0.000000
5184 0.000000
5185 0.000000
5186 0.000000
5187 0.000000
5188 0.000000
5189 0.000000
5210 0.000000
5211 0.000000
5212 0.000000
5213 0.000000
5214 0.000000
5215 0.000000
5216 0.000000
5217 0.000000
5218 0.000000
5219 0.000000
5220 1.000000
5221 0.000000
5222 0.000000
5223 0.000000
5224 0.000000
5225 0.000000
5226 0.000000
5227 0.000000
5228 0.000000
5229 0.000000
5230 0.000000
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
5247 0.000000
5248 0.000000
5249 0.000000
5250 0.000000
5261 0.000000
5262 0.000000
5263 0.000000
5264 0.000000
5265 0.000000
5266 0.000000
5267 0.000000
5268 0.000000
5269 0.000000
5270 0.000000
5281 0.000000
5282 0.000000
5283 0.000000
5284 0.000000
5285 0.000000
5286 0.000000
5287 0.000000
5288 0.000000
5289 0.000000
5290 0.000000
5301 0.000000
5302 0.000000
5303 0.000000
5304 0.000000
5305 0.000000
5306 0.000000
5307 0.000000
5308 0.000000
5309 0.000000
5310 0.000000
5321 0.000000
5322 0.000000
5323 0.000000
5324 0.000000
5325 0.000000
5326 0.000000
5327 0.000000
5328 0.000000
5329 0.000000
5330 0.000000
5341 0.000000
5342 0.000000
5343 0.000000
5344 0.000000
5345 0.000000
5346 0.000000
5347 0.000000
5348 0.000000
5349 0.000000
5350 0.000000
5361 0.000000
5362 0.000000
5363 0.000000
5364 0.000000
5365 0.000000
5366 0.000000
5367 0.000000
5368 0.000000
5369 0.000000
5370 0.000000
5381 0.000000
5382 0.000000
5383 0.000000
5384 0.000000
5385 0.000000
5386 0.000000
5387 0.000000
5388 0.000000
5389 0.000000
5390 0.000000

View File

@@ -0,0 +1,119 @@
5161 0.000000
5162 0.000000
5163 0.000000
5164 0.000000
5165 0.000000
5166 0.000000
5167 0.000000
5168 0.000000
5169 0.000000
5181 0.000000
5182 0.000000
5183 0.000000
5184 0.000000
5185 0.000000
5186 0.000000
5187 0.000000
5188 0.000000
5189 0.000000
5210 0.000000
5211 0.000000
5212 0.000000
5213 0.000000
5214 0.000000
5215 0.000000
5216 0.000000
5217 0.000000
5218 0.000000
5219 0.000000
5220 1.000000
5221 0.000000
5222 0.000000
5223 0.000000
5224 0.000000
5225 0.000000
5226 0.000000
5227 0.000000
5228 0.000000
5229 0.000000
5230 0.000000
5241 0.000000
5242 0.000000
5243 0.000000
5244 0.000000
5245 0.000000
5246 0.000000
5247 0.000000
5248 0.000000
5249 0.000000
5250 0.000000
5261 0.000000
5262 0.000000
5263 0.000000
5264 0.000000
5265 0.000000
5266 0.000000
5267 0.000000
5268 0.000000
5269 0.000000
5270 0.000000
5281 0.000000
5282 0.000000
5283 0.000000
5284 0.000000
5285 0.000000
5286 0.000000
5287 0.000000
5288 0.000000
5289 0.000000
5290 0.000000
5301 0.000000
5302 0.000000
5303 0.000000
5304 0.000000
5305 0.000000
5306 0.000000
5307 0.000000
5308 0.000000
5309 0.000000
5310 0.000000
5321 0.000000
5322 0.000000
5323 0.000000
5324 0.000000
5325 0.000000
5326 0.000000
5327 0.000000
5328 0.000000
5329 0.000000
5330 0.000000
5341 0.000000
5342 0.000000
5343 0.000000
5344 0.000000
5345 0.000000
5346 0.000000
5347 0.000000
5348 0.000000
5349 0.000000
5350 0.000000
5361 0.000000
5362 0.000000
5363 0.000000
5364 0.000000
5365 0.000000
5366 0.000000
5367 0.000000
5368 0.000000
5369 0.000000
5370 0.000000
5381 0.000000
5382 0.000000
5383 0.000000
5384 0.000000
5385 0.000000
5386 0.000000
5387 0.000000
5388 0.000000
5389 0.000000
5390 0.000000