Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
44a1d1d
G12.1, G13.1: select kinematics from G-code
grandixximo Aug 11, 2026
254a2d1
G12.1, G13.1: take the kinematics from motion on every synch
grandixximo Aug 11, 2026
fddf5df
motion: record the kinematics type only once the switch succeeds
grandixximo Aug 12, 2026
9e1453c
motion: deprecate selecting the kinematics type from HAL
grandixximo Aug 12, 2026
a420991
motion: name the kinematics selection for what it is
grandixximo Aug 12, 2026
b0b9950
configs: select kinematics with G12.1 in the switchkins comp sims
grandixximo Aug 12, 2026
c96f9b5
configs: select kinematics with G12.1 in the remaining switchkins sims
grandixximo Aug 12, 2026
d716cdc
docs: stop offering the deprecated pin as an equal way to switch
grandixximo Aug 12, 2026
5427c48
docs: lead with the deprecation notice for the switchkins pin
grandixximo Aug 12, 2026
824d0dd
docs: add a kinematics conventions chapter
grandixximo Aug 23, 2026
03eae8d
kinematics: add optional work frame and tool frame entry points
grandixximo Aug 23, 2026
dd04036
trtfuncs: supply the work and tool frames for xyzac and xyzbc
grandixximo Aug 23, 2026
bdb94f3
trivkins: supply the work and tool frames
grandixximo Aug 23, 2026
e57a085
xyzacb_trsrn, xyzbca_trsrn: supply the work and tool frames
grandixximo Aug 23, 2026
3098d6e
pumakins: supply the work and tool frames
grandixximo Aug 23, 2026
6871bdb
tests: cover the frame helpers
grandixximo Aug 23, 2026
cb6a652
kinematics: answer which joints point the tool somewhere
grandixximo Aug 24, 2026
2bf57f8
trsrn: set the kinematics pins up once, at load
grandixximo Aug 26, 2026
1cbc8ce
tests: check the shipped frame functions where they run
grandixximo Aug 26, 2026
7ae6452
kinematics: the tool frame is the joints' alone
grandixximo Sep 4, 2026
275210f
kinematics: let the caller hold joints in the tool frame inverse
grandixximo Sep 4, 2026
2386293
kinematics: take the tool frame inverse request as a program writes it
grandixximo Sep 4, 2026
797fdf7
xyzbc-trt-kins: apply the direction sign to the offsets in the inverse
grandixximo Sep 3, 2026
f913560
scarakins: set the elbow flag for a negative elbow angle
grandixximo Sep 3, 2026
c0fc16d
pumakins, three21kins: compare the branch flags modulo a whole turn
grandixximo Sep 3, 2026
b6f1856
userkins, millturn, matrixkins, xyzab_tdr_kins: set the kinematics pi…
grandixximo Sep 3, 2026
9417334
kinematics: add an optional Jacobian entry point
grandixximo Sep 3, 2026
7d429b2
trtfuncs, 5axiskins, maxkins: supply the Jacobian
grandixximo Sep 3, 2026
add1d10
corexykins, rotatekins, rosekins, matrixkins, millturn, userkins: sup…
grandixximo Sep 3, 2026
dab0317
xyzab_tdr_kins, xyzacb_trsrn, xyzbca_trsrn: supply the Jacobian
grandixximo Sep 3, 2026
19a1e7a
tripodkins, lineardeltakins, rotarydeltakins, genhexkins, pentakins: …
grandixximo Sep 3, 2026
8f10c54
scarakins, scorbot-kins: supply the Jacobian
grandixximo Sep 3, 2026
7b17c92
genserkins: supply the Jacobian from its geometric one
grandixximo Sep 3, 2026
e2e66a0
tests: check the Jacobian of every module where it runs
grandixximo Sep 3, 2026
3706a9a
switchkins: separate the dispatch from rtapi_app_main()
grandixximo Aug 11, 2026
f1e4158
switchkins: let halcompile components use the switchkins core
grandixximo Aug 11, 2026
531a6f1
switchkins: add an out-of-tree module template
grandixximo Aug 12, 2026
60c918e
kins: drop the kinematics.h include switchkins.h already provides
grandixximo Aug 12, 2026
f475a16
kins: include switchkins.h as an exported header
grandixximo Aug 12, 2026
5b51e06
switchkins: install the implementation as source for out-of-tree modules
grandixximo Aug 12, 2026
0256c79
canon: stop printing on every kinematics switch
grandixximo Aug 24, 2026
dd6e0fb
kinematics: evaluate a module outside RT by binding to its live pins
grandixximo Aug 10, 2026
bea5bce
twp: split the machine maths out of the tilted work plane remap
Sigma1912 Aug 23, 2026
cdc361a
twp: check the primary angle against the primary joint limits
grandixximo Aug 23, 2026
41afe43
twp: keep the arc functions inside their domain
grandixximo Aug 24, 2026
07d649a
kinematics: add the parameter block form of a module
grandixximo Sep 4, 2026
d626960
trtfuncs, xyzac-trt-kins, xyzbc-trt-kins, maxkins: move onto the para…
grandixximo Sep 4, 2026
e26375d
corexykins, rotatekins, rosekins, tripodkins, scorbot-kins, the delta…
grandixximo Sep 4, 2026
7e5fb3b
scarakins, pumakins, three21kins: move onto the parameter block
grandixximo Sep 4, 2026
68e9cda
millturn, xyzab_tdr_kins, xyzacb_trsrn, xyzbca_trsrn: move onto the p…
grandixximo Sep 4, 2026
47dedfd
genserkins, genhexkins, pentakins: move onto the parameter block
grandixximo Sep 4, 2026
4e2bfcc
switchkins: seed the gui forward from the last answer for a pure type
grandixximo Sep 4, 2026
1cd891c
kinematics_user: take the joints in as well as out, and bind modules …
grandixximo Sep 4, 2026
eadbac5
switchkinscomp: write the template on the parameter block
grandixximo Sep 4, 2026
c539195
docs: describe the parameter block form of a kinematics module
grandixximo Sep 4, 2026
491a708
tests: check that a module answers the same outside realtime
grandixximo Sep 4, 2026
7e7493b
kinematics: take the tool offset from motion, not from a net
grandixximo Sep 4, 2026
c264d2c
tests: put the nutating head kinematics next to the tilted work plane…
grandixximo Sep 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ share/desktop-directories/linuxcnc-cnc.directory
share/desktop-directories/linuxcnc-ref.directory
share/desktop-directories/linuxcnc-doc.directory
share/linuxcnc/mesa_modbus.c.tmpl
share/linuxcnc/switchkins.c
share/linuxcnc/switchkins_setup.c
share/linuxcnc/kins_util.c
share/linuxcnc/kins_single.c
src/modules.order
/configs/*/emc.nml
!/configs/common/emc.nml
Expand Down
1 change: 0 additions & 1 deletion configs/sim/axis/vismach/5axis/bridgemill/5axis.ini
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ CYCLE_TIME = 0.010
HALUI = halui
HALFILE = LIB:basic_sim.tcl
HALFILE = 5axisgui.hal
HALCMD = net :kinstype-select <= motion.analog-out-03 => motion.switchkins-type
POSTGUI_HALFILE = 5axis_postgui.hal

[HALUI]
Expand Down
17 changes: 3 additions & 14 deletions configs/sim/axis/vismach/5axis/bridgemill/remap_subs/428remap.ngc
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M428 by remap: select kinstype=0 genhexkins
o<428remap>sub
#<kinstype> = 0
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G13.1 ; back to kinstype 0, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M428: Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M428: Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<428remap>endsub
17 changes: 3 additions & 14 deletions configs/sim/axis/vismach/5axis/bridgemill/remap_subs/429remap.ngc
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M429 by remap: select kinstype==1 Identity kinematics
o<429remap>sub
#<kinstype> = 1
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G12.1 P#<kinstype> ; select kinstype, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M429:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M429:Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<429remap>endsub
17 changes: 3 additions & 14 deletions configs/sim/axis/vismach/5axis/bridgemill/remap_subs/430remap.ngc
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M430 by remap: select kinstype==2 userk kins
o<430remap>sub
#<kinstype> = 2
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M30:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G12.1 P#<kinstype> ; select kinstype, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M430:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M430:Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<430remap>endsub
3 changes: 0 additions & 3 deletions configs/sim/axis/vismach/5axis/table-dual-rotary/README
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ For proper tool-path preview RELOAD THE CGODE after startup and after changing o
***********************************************
Note: IMPORTANT ini file requirements:

[HAL]
HALCMD = net :kinstype-select <= motion.analog-out-0N => motion.switchkins-type

[RS274NGC]
SUBROUTINE_PATH = ./remap_subs
REMAP = M428 modalgroup=10 ngc=428remap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M428 by remap: kinstype==1 (xyzac,xyzbc) (note: sparm=identityfirst)
;M428 by remap: kinstype==1 (xyzab-tdr kinematics)
o<428remap>sub
#<kinstype> = 1 ; xyzac,xyzbc
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
#<kinstype> = 1 ; xyzab-tdr

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G12.1 P#<kinstype> ; select kinstype, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M428: Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M428: Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<428remap>endsub
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M429 by remap: kinstype==0 Identity kinematics
o<429remap>sub
#<kinstype> = 0
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G13.1 ; back to kinstype 0, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M429:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M429: Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<429remap>endsub
10 changes: 4 additions & 6 deletions configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ SUBROUTINE_PATH = ./remap_subs

[KINS]
#NOTE:
# switchkins-type == 0 is identity kins
# switchkins-type == 1 is xyzab-tdr-kins
# kinstype 0 is identity kins
# kinstype 1 is xyzab-tdr-kins

KINEMATICS = xyzab_tdr_kins
JOINTS = 5
Expand All @@ -36,8 +36,6 @@ KINEMATICS = xyzab_tdr_kins
HALFILE = LIB:basic_sim.tcl
POSTGUI_HALFILE = xyzab-tdr-postgui.hal

# net for control of motion.switchkins-type
HALCMD = net :kinstype-select <= motion.analog-out-03 => motion.switchkins-type

# Values '(x,z)-offsets' for geometric offset of the rotary-assembly and the
# values '(x,y,z)-rot-point' that describe the position of the
Expand Down Expand Up @@ -76,8 +74,8 @@ HALCMD = sets :x-offset -20
HALCMD = sets :z-offset -10

[HALUI]
# M429:identity kins (motion.switchkins-type==0 startupDEFAULT)
# M428:xyzab-tdr kins (motion.switchkins-type==1)
# M429:identity kins (kinstype 0, startupDEFAULT)
# M428:xyzab-tdr kins (kinstype 1)
MDI_COMMAND = M429
MDI_COMMAND = M428

Expand Down
3 changes: 0 additions & 3 deletions configs/sim/axis/vismach/5axis/table-rotary-tilting/README
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@ Demonstrations:
***********************************************
Note: IMPORTANT ini file requirements:

[HAL]
HALCMD = net :kinstype-select <= motion.analog-out-0N => motion.switchkins-type

[RS274NGC]
SUBROUTINE_PATH = ./remap_subs
REMAP = M428 modalgroup=10 ngc=428remap
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M428 by remap: kinstype==1 (xyzac,xyzbc) (note: sparm=identityfirst)
o<428remap>sub
#<kinstype> = 1 ; xyzac,xyzbc
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G12.1 P#<kinstype> ; select kinstype, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M428: Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M428: Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<428remap>endsub
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M429 by remap: kinstype==0 Identity kinematics
o<429remap>sub
#<kinstype> = 0
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G13.1 ; back to kinstype 0, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M429:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M429:Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<429remap>endsub
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
;M430 by remap: kinstype==2 userk kins
o<430remap>sub
#<kinstype> = 2
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N

o1 if [exists [#<_hal[motion.switchkins-type]>]]
o1 else
(debug,M430:Missing [RS274NGC]HAL_PIN_VARS=1)
(debug,STOP)
M2
o1 endif

M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
M66 E0 L0 ; force synch
G12.1 P#<kinstype> ; select kinstype, syncs interp and motion

o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
(debug,M430:Wrong motion.switchkins-type)
(debug,or missing hal net to analog-out-0x)
o2 if [[#<_task> EQ 1] AND [#<_kins_type> NE #<kinstype>]]
(debug,M430:Wrong kinematics type)
(debug,STOP)
M2
o2 else
o2 endif

o<430remap>endsub
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pin+motion.analog-out-03
pin+motion.switchkins-type
pin+motion.kins-type

pin+joint.0.pos-cmd
pin+joint.1.pos-cmd
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ SUBROUTINE_PATH = ./remap_subs

[KINS]
#NOTE: for backwrds compatibility !!!!!!!!!!!!!!!!!!!
# default switchkins-type == 0 is xyzac-trt-kins
# here switchkins-type == 0 is identity kins
# default kinstype 0 is xyzac-trt-kins
# here kinstype 0 is identity kins
KINEMATICS = xyzac-trt-kins sparm=identityfirst
JOINTS = 5

Expand All @@ -48,8 +48,6 @@ KINEMATICS = xyzac-trt-kins sparm=identityfirst
HALFILE = LIB:basic_sim.tcl
POSTGUI_HALFILE = switchkins_postgui.hal

# net for control of motion.switchkins-type
HALCMD = net :kinstype-select <= motion.analog-out-03 => motion.switchkins-type

# vismach xyzac-trt-gui items
HALCMD = loadusr -W ./xyzac-trt-gui.py
Expand All @@ -73,9 +71,9 @@ HALCMD = setp xyzac-trt-kins.conventional-directions 0

[HALUI]
# NOTE: kinstype==0 is identity kins because sparm=identityfirst
# M429:identity kins (motion.switchkins-type==0 startupDEFAULT)
# M428:xyzac kins (motion.switchkins-type==1)
# M430:userk kins (motion.switchkins-type==2)
# M429:identity kins (kinstype 0, startupDEFAULT)
# M428:xyzac kins (kinstype 1)
# M430:userk kins (kinstype 2)
MDI_COMMAND = M429
MDI_COMMAND = M428
MDI_COMMAND = M430
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ Uses remapped user m codes for kins switch:
M428: XYZAC (TCP)
M430: userk Kinematics

A hal net is required to connect the
analog out pin N, Example (for N=3):

net :kinstype-select <= motion.analog-out-03
net :kinstype-select => motion.switchkins-type
The kinematics type is selected with
G12.1 and G13.1, no hal connection is
required.

Hal Input pins:
xyzac-trt-kins.y-offset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ SUBROUTINE_PATH = ./remap_subs

[KINS]
#NOTE: for backwrds compatibility !!!!!!!!!!!!!!!!!!!
# default switchkins-type == 0 is xyzbc-trt-kins
# here switchkins-type == 0 is identity kins
# default kinstype 0 is xyzbc-trt-kins
# here kinstype 0 is identity kins
KINEMATICS = xyzbc-trt-kins sparm=identityfirst
JOINTS = 5

Expand All @@ -48,8 +48,6 @@ KINEMATICS = xyzbc-trt-kins sparm=identityfirst
HALFILE = LIB:basic_sim.tcl
POSTGUI_HALFILE = switchkins_postgui.hal

# net for control of motion.switchkins-type
HALCMD = net :kinstype-select <= motion.analog-out-03 => motion.switchkins-type

# vismach xyzbc-trt-gui items
HALCMD = loadusr -W ./xyzbc-trt-gui.py
Expand All @@ -73,9 +71,9 @@ HALCMD = setp xyzbc-trt-kins.conventional-directions 0

[HALUI]
# NOTE: kinstype==0 is identity kins because sparm=identityfirst
# M429:identity kins (motion.switchkins-type==0 startupDEFAULT)
# M428:xyzbc kins (motion.switchkins-type==1)
# M430:userk kins (motion.switchkins-type==2)
# M429:identity kins (kinstype 0, startupDEFAULT)
# M428:xyzbc kins (kinstype 1)
# M430:userk kins (kinstype 2)
MDI_COMMAND = M429
MDI_COMMAND = M428
MDI_COMMAND = M430
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ Uses remapped user m codes for kins switch:
M428: XYZBC (TCP)
M430: userk Kinematics

A hal net is required to connect the
analog out pin N, Example (for N=3):

net :kinstype-select <= motion.analog-out-03
net :kinstype-select => motion.switchkins-type
The kinematics type is selected with
G12.1 and G13.1, no hal connection is
required.

Hal Input pins:
xyzbc-trt-kins.x-offset
Expand Down
Loading