Skip to content

Commit 135b0ce

Browse files
committed
switchable kinematics
1) Control kinematics type by hal pin: motion.switchkins-type The _integer_ value of this float hal pin is passed to the kinematicsSwitch() function to select a kinematics type. 2) Uses M68 (analog out) in a hal net like: net :kinstype-select <= motion.analog-out-0N net :kinstype-select => motion.switchins-type 3) Supports 3 switchable kinematic types (0,1,2) Switching kinstype is managed by user supplied mcodes that provide for interp-motion syncrhonization: M428/M429/M130 (remap Mcode examples) M128/M129/M130 (user Mcode examples with limits updates) 4) API change for kinematics: All kinematics modules must export functions: kinematicsSwitchable() (return 1 if supported) kinematicsSwitch() (return 0 if ok) or use macro (from kinematics.h): KINS_NOT_SWITCHABLE 5) Provide a template (userkfuncs.c) and support building a user kinematics module for RIP builds 6) Supported modules: xyz[ab]c-trt-kins pumakins scarakins genserkins genhexkins 5axiskins (bridgemill) 7) file updates for src/emc/kinematics/: genserfuncs.c: separated out genserkins functions trtfuncs.c: separated out xyz[ab]c-trt-kins functions userkfuncs.c: template user kins functions ugenserkins.c: separated user program bin/genserkins (declining support, not working) 8) Docs (asciidoc fmt): docs/src/motion/switchkins.txt ****************************************************** Initial branch 24nov19 Based on work of rushabh,plopes9000,jskangas particularly: https://forum.linuxcnc.org/10-advanced-configuration/31813-tcp-5-axis-kinematics?start=90#124848 ****************************************************** misc updates: scara use 6 joints as supported by vismach scaragui switchkins sims: [RS274NGC]FEATURES=8 obsolete [RS274NGC]HAL_PIN_VARS (default is 1(enable)) update genserkins jts 6,7,8 == u,v,w with appropriate [KINS]JOINTS value support for 5axiskins (bridgemill), refactor to: 1) support module 'coordinates' parameter and allow duplicate letters for multiple joints for an axis letter 2) support A,U,V one-to-one to assigned joint 3) support switchkins puma560gui: message if missing .obj files
1 parent fd16114 commit 135b0ce

File tree

124 files changed

+6196
-2955
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+6196
-2955
lines changed

configs/sim/axis/vismach/5axis/bridgemill/5axis.ini

Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ MAX_FEED_OVERRIDE = 2.0
2222
PYVCP = 5axis.xml
2323

2424
[RS274NGC]
25+
SUBROUTINE_PATH = ./remap_subs
26+
HAL_PIN_VARS = 1
27+
REMAP = M428 modalgroup=10 ngc=428remap
28+
REMAP = M429 modalgroup=10 ngc=429remap
29+
REMAP = M430 modalgroup=10 ngc=430remap
2530
PARAMETER_FILE = 5axis.var
2631

2732
[EMCMOT]
@@ -37,12 +42,22 @@ CYCLE_TIME = 0.010
3742
HALUI = halui
3843
HALFILE = LIB:basic_sim.tcl
3944
HALFILE = 5axisgui.hal
45+
HALCMD = net :kinstype-select <= motion.analog-out-03 => motion.switchkins-type
4046
POSTGUI_HALFILE = 5axis_postgui.hal
4147

48+
[HALUI]
49+
# M428:bridgemill (kinstype==0 startupDEFAULT)
50+
# M429:identity kins (kinstype==1)
51+
# M430:userk kins (kinstype==2)
52+
MDI_COMMAND = M428
53+
MDI_COMMAND = M429
54+
MDI_COMMAND = M430
55+
4256
[TRAJ]
43-
COORDINATES = X Y Z B C W
44-
LINEAR_UNITS = 1.0
45-
ANGULAR_UNITS = 1.0
57+
COORDINATES = XYZBCWY
58+
LINEAR_UNITS = mm
59+
ANGULAR_UNITS = degree
60+
MAX_ANGULAR_VELOCITY = 360.0
4661
DEFAULT_LINEAR_VELOCITY = 200.0
4762
MAX_LINEAR_VELOCITY = 346.0
4863
MAX_LINEAR_ACCELERATION = 800.0
@@ -61,8 +76,24 @@ TOOL_TABLE = 5axis.tbl
6176
# but an extra joint (6 total) must be configured
6277
# in order to allow display of W values.
6378
# Use immediate homing for this joint (JOINT_5)
64-
KINEMATICS = 5axiskins
65-
JOINTS = 6
79+
# Note: 5axiskins is misnomer (default: xyzbcw uses 6 joints)
80+
81+
# default: xyzbcw
82+
# type0:5axiskins, type1:identity, type2:userk
83+
# x:joint0,y:joint1,z:joint2,b:joint3,c:joint4,w:joint5
84+
# JOINTS = 6
85+
# KINEMATICS = 5axiskins
86+
87+
# complex example (duplicate coord letters for y, 7 joints):
88+
# type0:5axiskins, type1:identity, type2:userk
89+
# x:joint0
90+
# y:joint1 AND joint6
91+
# z:joint2
92+
# b:joint3
93+
# c:joint4
94+
# w:joint5
95+
JOINTS = 7
96+
KINEMATICS = 5axiskins coordinates=xyzbcwy
6697

6798
[AXIS_X]
6899
MIN_LIMIT = -500
@@ -121,7 +152,17 @@ MAX_ACCELERATION = 800
121152
MIN_LIMIT = -500
122153
MAX_LIMIT = 500
123154
HOME_SEARCH_VEL = 0
124-
HOME_SEQUENCE = 0
155+
HOME_SEQUENCE = -1
156+
157+
# joints 1 and 6 used for y
158+
[JOINT_6]
159+
TYPE = LINEAR
160+
MAX_VELOCITY = 200
161+
MAX_ACCELERATION = 800
162+
MIN_LIMIT = -500
163+
MAX_LIMIT = 500
164+
HOME_SEARCH_VEL = 0
165+
HOME_SEQUENCE = -1
125166

126167
[JOINT_2]
127168
TYPE = LINEAR

configs/sim/axis/vismach/5axis/bridgemill/5axis.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
<?xml version='1.0' encoding='UTF-8'?>
22
<pyvcp>
33

4+
<vbox>
5+
<relief>"ridge"</relief>
6+
<bd>5</bd>
7+
<label>
8+
<text>"SWITCHKINS"</text>
9+
<relief>RIDGE</relief>
10+
<bd>3</bd>
11+
</label>
12+
<multilabel>
13+
<legends>[" 0:BRIDGE ", "1:IDENTITY", " 2:USERK "]</legends>
14+
<font>("DejaVu Sans Mono",16)</font>
15+
<bg>"black"</bg>
16+
<fg>"yellow"</fg>
17+
</multilabel>
18+
<button>
19+
<halpin>"type0-button"</halpin>
20+
<text>"Brigemill"</text>
21+
<bd>3</bd>
22+
</button>
23+
<button>
24+
<halpin>"type1-button"</halpin>
25+
<text>"Identity "</text>
26+
<bd>3</bd>
27+
</button>
28+
<button>
29+
<halpin>"type2-button"</halpin>
30+
<text>"userk "</text>
31+
<bd>3</bd>
32+
</button>
33+
</vbox>
34+
435
<vbox>
536
<labelframe text="Joints values">
637
<font>("Helvetica",14)</font>
@@ -59,6 +90,28 @@
5990
<format>"4.4f"</format>
6091
</number>
6192
</hbox>
93+
<hbox>
94+
<label>
95+
<text>"5: "</text>
96+
<font>("Helvetica",14)</font>
97+
</label>
98+
<number>
99+
<halpin>"joint5"</halpin>
100+
<font>("Helvetica",14)</font>
101+
<format>"4.4f"</format>
102+
</number>
103+
</hbox>
104+
<hbox>
105+
<label>
106+
<text>"6: "</text>
107+
<font>("Helvetica",14)</font>
108+
</label>
109+
<number>
110+
<halpin>"joint6"</halpin>
111+
<font>("Helvetica",14)</font>
112+
<format>"4.4f"</format>
113+
</number>
114+
</hbox>
62115
</labelframe>
63116
</vbox>
64117

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
1+
net :kinstype.is-0 <= kinstype.is-0 => pyvcp.multilabel.0.legend0
2+
net :kinstype.is-1 <= kinstype.is-1 => pyvcp.multilabel.0.legend1
3+
net :kinstype.is-2 <= kinstype.is-2 => pyvcp.multilabel.0.legend2
4+
5+
net :type0-button <= pyvcp.type0-button => halui.mdi-command-00
6+
net :type1-button <= pyvcp.type1-button => halui.mdi-command-01
7+
net :type2-button <= pyvcp.type2-button => halui.mdi-command-02
8+
19
net :jx => pyvcp.joint0
210
net :jy => pyvcp.joint1
311
net :jz => pyvcp.joint2
412
net :jb => pyvcp.joint3
513
net :jc => pyvcp.joint4
14+
net :jw => pyvcp.joint5
15+
net :jy2 => pyvcp.joint6
616

717
net :vismach-clear <= pyvcp.vismach-clear => vismach.plotclear

configs/sim/axis/vismach/5axis/bridgemill/5axisgui.hal

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ net :jy joint.1.pos-fb 5axisgui.jy
77
net :jz joint.2.pos-fb 5axisgui.jz
88
net :jb joint.3.pos-fb 5axisgui.jb
99
net :jc joint.4.pos-fb 5axisgui.jc
10+
net :jw joint.5.pos-fb
11+
net :jy2 joint.6.pos-fb
1012

1113
# Note: no joint or motor connections are used
1214
# for the w coordinate

configs/sim/axis/vismach/5axis/bridgemill/5axisgui.ngc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ o100 while [#<bct> lt #<bctmax>]
2626
#<y> = 0
2727
#<z> = [-#<rnow>]
2828
g0 x#<x> y#<y>
29-
m66e0l0
29+
m66e0l0 ; force sync
3030
g0 z#<z>
3131
g0b[-90+#<b>]
3232
#<cct> = 0

configs/sim/axis/vismach/5axis/bridgemill/README

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,16 @@ Example demo:
1919
Note: W is for tool motion at b,c angles
2020
Configure a joint for W (6 total) to
2121
allow display of W values
22+
23+
The 5axis_xyzbcwy.ini illustrates how
24+
to use multiple (2) joints for the axis y
25+
coordinate.
26+
27+
Configuration for XYZBCWY (7 joints total)
28+
J0: X
29+
J1: Y
30+
J2: Z
31+
J3: B
32+
J4: C
33+
J5: W
34+
J6: Y
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
Esta es una simulación de una fresadora de puente de 5 ejes XYZBC.
1+
Esta es una simulación de una fresadora de puente de 5 ejes XYZBCW.
2+
3+
Configuration for XYZBCWY (7 joints total)
4+
J0: X
5+
J1: Y
6+
J2: Z
7+
J3: B
8+
J4: C
9+
J5: W
10+
J6: Y
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
;M428 by remap: select kinstype=0 genhexkins
2+
o<428remap>sub
3+
#<kinstype> = 0
4+
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
5+
6+
o1 if [exists [#<_hal[motion.switchkins-type]>]]
7+
o1 else
8+
(debug,M428:Missing [RS274NGC]HAL_PIN_VARS=1)
9+
(debug,STOP)
10+
M2
11+
o1 endif
12+
13+
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
14+
M66 E0 L0 ; force synch
15+
16+
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
17+
(debug,M428: Wrong motion.switchkins-type)
18+
(debug,or missing hal net to analog-out-0x)
19+
(debug,STOP)
20+
M2
21+
o2 else
22+
o2 endif
23+
24+
o<428remap>endsub
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
;M429 by remap: select kinstype==1 Identity kinematics
2+
o<429remap>sub
3+
#<kinstype> = 1
4+
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
5+
6+
o1 if [exists [#<_hal[motion.switchkins-type]>]]
7+
o1 else
8+
(debug,M429:Missing [RS274NGC]HAL_PIN_VARS=1)
9+
(debug,STOP)
10+
M2
11+
o1 endif
12+
13+
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
14+
M66 E0 L0 ; force synch
15+
16+
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
17+
(debug,M429:Wrong motion.switchkins-type)
18+
(debug,or missing hal net to analog-out-0x)
19+
(debug,STOP)
20+
M2
21+
o2 else
22+
o2 endif
23+
24+
o<429remap>endsub
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
;M430 by remap: select kinstype==2 userk kins
2+
o<430remap>sub
3+
#<kinstype> = 2
4+
#<SWITCHKINS_PIN> = 3 ; set N as required: motion.analog-out-0N
5+
6+
o1 if [exists [#<_hal[motion.switchkins-type]>]]
7+
o1 else
8+
(debug,M30:Missing [RS274NGC]HAL_PIN_VARS=1)
9+
(debug,STOP)
10+
M2
11+
o1 endif
12+
13+
M68 E#<SWITCHKINS_PIN> Q#<kinstype> ; set kinstype value
14+
M66 E0 L0 ; force synch
15+
16+
o2 if [[#<_task> EQ 1] AND [#<_hal[motion.switchkins-type]> NE #<kinstype>]]
17+
(debug,M430:Wrong motion.switchkins-type)
18+
(debug,or missing hal net to analog-out-0x)
19+
(debug,STOP)
20+
M2
21+
o2 else
22+
o2 endif
23+
24+
o<430remap>endsub

0 commit comments

Comments
 (0)