Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
5a2f9e7
kinematics: a switchkins module declares what each type is
grandixximo Sep 12, 2026
f6d0902
G12.1, G13.1: select kinematics from G-code
grandixximo Sep 12, 2026
ba6d2a9
motion: deprecate selecting the kinematics type from HAL
grandixximo Sep 12, 2026
f645968
configs: select kinematics with G12.1 in the switchkins sims
grandixximo Sep 12, 2026
6d962a4
tests: selecting a kinematics from G-code
grandixximo Sep 12, 2026
fda11fe
docs: G12.1 and G13.1 select the kinematics from G-code
grandixximo Sep 12, 2026
38435f0
docs: add a kinematics conventions chapter
grandixximo Aug 23, 2026
291dfc6
kinematics: add optional work frame and tool frame entry points
grandixximo Aug 23, 2026
55d74c0
trtfuncs: supply the work and tool frames for xyzac and xyzbc
grandixximo Aug 23, 2026
38a8e16
trivkins: supply the work and tool frames
grandixximo Aug 23, 2026
6882bc3
xyzacb_trsrn, xyzbca_trsrn: supply the work and tool frames
grandixximo Aug 23, 2026
1c84878
pumakins: supply the work and tool frames
grandixximo Aug 23, 2026
9c0b748
tests: cover the frame helpers
grandixximo Aug 23, 2026
502105c
kinematics: answer which joints point the tool somewhere
grandixximo Aug 24, 2026
899380a
trsrn: set the kinematics pins up once, at load
grandixximo Aug 26, 2026
ed10896
tests: check the shipped frame functions where they run
grandixximo Aug 26, 2026
68718d0
kinematics: the tool frame is the joints' alone
grandixximo Sep 4, 2026
5358290
kinematics: let the caller hold joints in the tool frame inverse
grandixximo Sep 4, 2026
0bab931
kinematics: take the tool frame inverse request as a program writes it
grandixximo Sep 4, 2026
6412472
xyzbc-trt-kins: apply the direction sign to the offsets in the inverse
grandixximo Sep 3, 2026
54e0188
scarakins: set the elbow flag for a negative elbow angle
grandixximo Sep 3, 2026
730eac1
pumakins, three21kins: compare the branch flags modulo a whole turn
grandixximo Sep 3, 2026
17201c0
userkins, millturn, matrixkins, xyzab_tdr_kins: set the kinematics pi…
grandixximo Sep 3, 2026
886ea65
kinematics: add an optional Jacobian entry point
grandixximo Sep 3, 2026
93d6633
trtfuncs, 5axiskins, maxkins: supply the Jacobian
grandixximo Sep 3, 2026
22f311c
corexykins, rotatekins, rosekins, matrixkins, millturn, userkins: sup…
grandixximo Sep 3, 2026
45323e6
xyzab_tdr_kins, xyzacb_trsrn, xyzbca_trsrn: supply the Jacobian
grandixximo Sep 3, 2026
583b87f
tripodkins, lineardeltakins, rotarydeltakins, genhexkins, pentakins: …
grandixximo Sep 3, 2026
da6e419
scarakins, scorbot-kins: supply the Jacobian
grandixximo Sep 3, 2026
7ef3209
genserkins: supply the Jacobian from its geometric one
grandixximo Sep 3, 2026
808be2b
tests: check the Jacobian of every module where it runs
grandixximo Sep 3, 2026
52d557b
switchkins: separate the dispatch from rtapi_app_main()
grandixximo Aug 11, 2026
eae7217
switchkins: let halcompile components use the switchkins core
grandixximo Aug 11, 2026
2da613d
switchkins: add an out-of-tree module template
grandixximo Aug 12, 2026
ac4bf71
kins: drop the kinematics.h include switchkins.h already provides
grandixximo Aug 12, 2026
8c1d594
kins: include switchkins.h as an exported header
grandixximo Aug 12, 2026
794fe89
switchkins: install the implementation as source for out-of-tree modules
grandixximo Aug 12, 2026
6fd4891
canon: stop printing on every kinematics switch
grandixximo Aug 24, 2026
ef029f2
kinematics: evaluate a module outside RT by binding to its live pins
grandixximo Aug 10, 2026
34e218d
twp: split the machine maths out of the tilted work plane remap
Sigma1912 Aug 23, 2026
c51e56b
twp: check the primary angle against the primary joint limits
grandixximo Aug 23, 2026
ac2f9e2
twp: keep the arc functions inside their domain
grandixximo Aug 24, 2026
f2921da
kinematics: add the parameter block form of a module
grandixximo Sep 4, 2026
facb29f
trtfuncs, xyzac-trt-kins, xyzbc-trt-kins, maxkins: move onto the para…
grandixximo Sep 4, 2026
1b7a481
corexykins, rotatekins, rosekins, tripodkins, scorbot-kins, the delta…
grandixximo Sep 4, 2026
70ad997
scarakins, pumakins, three21kins: move onto the parameter block
grandixximo Sep 4, 2026
750ae6e
millturn, xyzab_tdr_kins, xyzacb_trsrn, xyzbca_trsrn: move onto the p…
grandixximo Sep 4, 2026
00ec0ba
genserkins, genhexkins, pentakins: move onto the parameter block
grandixximo Sep 4, 2026
1cd1bd7
switchkins: seed the gui forward from the last answer for a pure type
grandixximo Sep 4, 2026
4f19f57
kinematics_user: take the joints in as well as out, and bind modules …
grandixximo Sep 4, 2026
43e497e
switchkinscomp: write the template on the parameter block
grandixximo Sep 4, 2026
7492e52
docs: describe the parameter block form of a kinematics module
grandixximo Sep 4, 2026
5e0b992
tests: check that a module answers the same outside realtime
grandixximo Sep 4, 2026
0a696f1
kinematics: take the tool offset from motion, not from a net
grandixximo Sep 4, 2026
82d72bb
tests: put the nutating head kinematics next to the tilted work plane…
grandixximo Sep 4, 2026
1619f54
interpreter: add the tilted work plane, G68.2, G68.4 and G69
grandixximo Sep 4, 2026
6d3481a
kinematics: reach the frames and the tool frame inverse from outside …
grandixximo Sep 4, 2026
f811653
motion: add the point-to-point move, interpolated in joint space
grandixximo Sep 4, 2026
4f5e460
interpreter: the point-to-point moves and the tool orientation codes,…
grandixximo Sep 4, 2026
4705dae
configs, docs: the nutating-head sims on the native tilted work plane
grandixximo Sep 4, 2026
1635a9c
5axiskins: supply the work and tool frames
grandixximo Sep 7, 2026
fdf6371
tests: give the tilted work plane a plane that tells the forms apart
grandixximo Sep 8, 2026
f89e74a
docs: say where the tilted work plane conventions come from
grandixximo Sep 8, 2026
27abe46
tests: name a sample even when nothing moved
grandixximo Sep 8, 2026
85c18fb
interpreter, motion: hold the joints a point-to-point move asks for
grandixximo Sep 8, 2026
86bf56a
interpreter: seed the kinematics from the joints the machine stands in
grandixximo Sep 8, 2026
07fca01
kinematics_user: load a module with the HAL library within reach
grandixximo Sep 9, 2026
782880f
preview: let the canon report where the joints stand
grandixximo Sep 9, 2026
919daa7
kinematics_user: take a module from the directory it is installed in
grandixximo Sep 9, 2026
01f54b3
tests: the point-to-point moves and their preview on an iterative module
grandixximo Sep 9, 2026
7789592
tests: let the point-to-point tests run against installed packages
grandixximo Sep 9, 2026
e25e8b0
genserkins: hold the inverse to a step the Jacobian is good for
grandixximo Sep 9, 2026
fa7ff89
motion: check a move against the joints the queue leaves behind
grandixximo Sep 9, 2026
60287a3
interpreter: add G53.2, solve the tool orientation without moving
grandixximo Sep 10, 2026
519b275
configs: the bridgemill sim shows off the tilted work plane family
grandixximo Sep 10, 2026
556b60e
nml: include kinematics.h with C linkage
grandixximo Sep 11, 2026
c957e24
switchkins: declare the primary kinstype from the ops table
grandixximo Sep 11, 2026
d898248
interp: G43.4 and G49 as spellings over the kinematics switch
grandixximo Sep 11, 2026
f6005b5
tests: kins-switch exercises G43.4 and G49
grandixximo Sep 11, 2026
8dd2856
docs: G43.4/G49 and the primary kinstype declaration
grandixximo Sep 11, 2026
788cc10
kinematics: kins_single answers kinematicsTypeFlags too
grandixximo Sep 11, 2026
6cb2df2
interp: "no information" matches every KINSTYPE flag
grandixximo Sep 11, 2026
5778a1b
kinematics: retire the KINS_NOT_SWITCHABLE macro
grandixximo Sep 11, 2026
b058028
kins: seed an iterative ops forward from the caller's estimate
grandixximo Sep 11, 2026
76c1d95
interp: name no parameter in the set_in_startup_code default
grandixximo Sep 11, 2026
8998a97
kinematics: refresh the shipped kins_single.c copy
grandixximo Sep 12, 2026
537ca5a
configs: drop the quill from the bridgemill sim
grandixximo Sep 12, 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
10 changes: 7 additions & 3 deletions configs/sim/axis/vismach/5axis/bridgemill/5axis.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ MACHINE = Sim-5Axis Bridge Mill (xyzbcw)
DEBUG = 0

[DISPLAY]
GEOMETRY = XYZCBW
OPEN_FILE = ./5axisgui.ngc
# GEOMETRY tells the AXIS live plot how to guess the tool position from
# the nine axis values: letters translate, ABC rotate the point. W is
# deliberately absent: the plot would add the W value as a Z offset after
# the rotations, while the kinematics spends W along the tool axis, so
# the guess never matches.
GEOMETRY = XYZCB
OPEN_FILE = ./g532-fused-orient-move.ngc
INCREMENTS = 10 mm, 1 mm, .1 mm
JOG_AXES = XYZC
DISPLAY = axis
Expand Down Expand Up @@ -41,7 +46,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
15 changes: 15 additions & 0 deletions configs/sim/axis/vismach/5axis/bridgemill/5axisgui.ngc
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
; 5axisgui.ngc - the historical demo program, unchanged.
; It drills a sphere pattern with W words. W was never a physical
; quill: no motor is connected to its joint, the kinematics folds
; the word into the XYZ slides, and the head sliding along the tool
; axis is what plunges the rigidly mounted tool. Watch the slides
; in vismach do the stroke.
;
; The quirk, then and now: the controller keeps W as a separate
; world coordinate, so the programmed XYZ point does not move and
; the preview shows nothing of the stroke; only the W DRO tracks it.
; Drilling the controller can see, check and preview is what the
; tilted work plane family is for (g532-fused-orient-move.ngc,
; g536-orient-then-move.ngc).

#<r> = 60 ; sphere radius
#<rdelta> = 5 ; safe distance
#<drilldepth> = -5
Expand All @@ -13,6 +27,7 @@
#<bdelta> = [90/#<bctmax>]

g49
g13.1 ; kinematics 0 (TCP), in case a previous run left a switch active
t#<toolno>m6g43

g53 g0 x0y0z#<zstart>b0c0 w0
Expand Down
50 changes: 45 additions & 5 deletions configs/sim/axis/vismach/5axis/bridgemill/README
Original file line number Diff line number Diff line change
@@ -1,19 +1,59 @@
This is a simulation of an XYZBCWY 5 axis bridge mill.
This is a simulation of an XYZBCWY 5 axis bridge mill with a
tilting head (B, C) and a W axis.

Example demo:
W is not a physical axis of the machine and never was: no motor is
connected to its joint. The kinematics folds a W word into the
XYZ joints, so the head slides along the tool axis and the
rigidly mounted tool goes with it: that is the whole trick, and it
is what vismach shows. There is no quill to draw because there is
no quill.

The quirk: the controller keeps W as a separate world coordinate,
so a W word leaves the programmed XYZ point untouched and the
preview cannot show the stroke; the W DRO tracks it. It also
means the planner does not see the tool-axis motion, so for
drilling the controller can check and preview, use the tilted work
plane family.

Because the W joint is virtual, a point-to-point move on it
(g53.5/g53.7 j5=) moves no motor on a real machine while the
controller believes the world moved, the opposite of a W word.
Do not drill that way.

Demo programs:

g532-fused-orient-move.ngc -- drill a sphere pattern with tilted work
planes (g68.2), using g53.2 to solve each
orientation without moving (STAY), then
one fused g0 that turns the head and
travels to the hole at the same time
(TCP motion)
g536-orient-then-move.ngc -- the same pattern with g53.6 (Heidenhain
MOVE style): reorient about the fixed
tip, then travel in the tilted plane
5axisgui.ngc --------------- the historical demo program, unchanged:
it drills the same pattern with W words,
the slides doing the stroke while the
preview stays blind to it

The tool table provides tool 100 (length 100). Load it with
t100m6g43 so the vismach tool and the kinematics pivot length
(pivotsum: 250 + tool length) match.

Example MDI:

1) $ linuxcnc 5axis.ini
2) F1 ---------- Estop off
F2 ---------- Machine on
CTRL-HOME --- home all
F5 ---------- MDI tab
3) orient vismach gui as required
4) g0w10 ; retract w
4) g0w10 ; head slides up the tool axis, tip with it
5) g43h100 ; tool offset (100)
6) g0b45 ; tilt 45 deg wrt z
7) g0c30 ; rotate 30 deg in xy
8) g0w-10 ; simulate drill
9) g0w10 ; retract drill
8) g0w-10 ; head slides back, tip plunges 10 along the tool axis
9) g0w10 ; and back
10) etc

Note: Motion for the W coordinate is incorporated
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
; g532-fused-orient-move.ngc - drill a sphere pattern with tilted work planes:
; g68.2 tilts the plane onto each hole normal, g53.2 solves the head
; orientation without moving (STAY), and one fused g0 turns the head
; and travels to the hole at the same time (TCP motion). See README
; for the other demos.

#<r> = 60 ; sphere radius
#<rdelta> = 5 ; safe distance
#<drilldepth> = -5
#<zsafe> = 20 ; clearance above the ball for start and stop
#<bctmax> = 8
#<cctmax> = 16
#<toolno> = 100
#<frate> = 1000

#<bct> = 0
#<cct> = 0
#<cdelta> = [360/#<cctmax>]
#<bdelta> = [90/#<bctmax>]

g49
g13.1 ; kinematics 0 (TCP), in case a previous run left a switch active
t#<toolno>m6g43

g53 g0 x0 y0 z0 b0 c0
g10 l20 p0 x0 y0 z[#<r>+#<rdelta>+#<zsafe>] b0 c0 ; ball center at program origin, we park above it
f#<frate>
o100 while [#<bct> lt #<bctmax>]
#<b> = [[#<bctmax>-1-#<bct>]*#<bdelta>] ; top ring first, the way in stays outside the ball
#<cct> = 0
o200 while [#<cct> lt #<cctmax>]
o210 if [[#<bct> mod 2] eq 0]
#<c> = [#<cct> * #<cdelta>]
o210 else
#<c> = [360 - [1+ #<cct>] * #<cdelta>]
o210 endif
g68.2 p1 j[90-#<b>] k#<c> ; plane Z is the sphere radius at b, c
g53.2 ; solve the orientation, stay put
g0 x0 y0 z[#<r>+#<rdelta>] b#<_orient_b> c#<_orient_c> ; one TCP turn and travel
g1 z[#<r>+#<drilldepth>]
g0 z[#<r>+#<rdelta>]
#<cct> = [#<cct>+1]
o200 endwhile
#<bct> = [#<bct>+1]
o100 endwhile

g69
g53 g0 z0 ; up, clear of the ball
g53 g0 x0 y0 b0 c0
m2
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
; g536-orient-then-move.ngc - same sphere as g532-fused-orient-move.ngc, but with g53.6
; (Heidenhain MOVE style): reorient about the fixed tip, a TCP move,
; then travel to the next hole in the tilted plane with a separate g0.
; g532-fused-orient-move.ngc fuses the turn and the travel into one move instead.

#<r> = 60 ; sphere radius
#<rdelta> = 5 ; safe distance
#<drilldepth> = -5
#<zsafe> = 20 ; clearance above the ball for start and stop
#<bctmax> = 8
#<cctmax> = 16
#<toolno> = 100
#<frate> = 1000

#<bct> = 0
#<cct> = 0
#<cdelta> = [360/#<cctmax>]
#<bdelta> = [90/#<bctmax>]

g49
g13.1 ; kinematics 0 (TCP), in case a previous run left a switch active
t#<toolno>m6g43

g53 g0 x0 y0 z0 b0 c0
g10 l20 p0 x0 y0 z[#<r>+#<rdelta>+#<zsafe>] b0 c0 ; ball center at program origin, we park above it
f#<frate>
o100 while [#<bct> lt #<bctmax>]
#<b> = [[#<bctmax>-1-#<bct>]*#<bdelta>] ; top ring first, the way in stays outside the ball
#<cct> = 0
o200 while [#<cct> lt #<cctmax>]
o210 if [[#<bct> mod 2] eq 0]
#<c> = [#<cct> * #<cdelta>]
o210 else
#<c> = [360 - [1+ #<cct>] * #<cdelta>]
o210 endif
g68.2 p1 j[90-#<b>] k#<c> ; plane Z is the sphere radius at b, c
g53.6 ; reorient about the tip, a TCP move
g0 x0 y0 z[#<r>+#<rdelta>]
g1 z[#<r>+#<drilldepth>]
g0 z[#<r>+#<rdelta>]
#<cct> = [#<cct>+1]
o200 endwhile
#<bct> = [#<bct>+1]
o100 endwhile

g69
g53 g0 z0 ; up, clear of the ball
g53 g0 x0 y0 b0 c0
m2
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 identity kinematics, 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
Loading