Skip to content

Commit

Permalink
Merge pull request #2251 from jepler/alternate-bad-merge-fix
Browse files Browse the repository at this point in the history
Alternate bad merge fix
  • Loading branch information
jepler committed Jan 9, 2023
2 parents 57c782e + c920bf7 commit ceeabdf
Show file tree
Hide file tree
Showing 109 changed files with 5,041 additions and 4,547 deletions.
2 changes: 1 addition & 1 deletion configs/sim/axis/canterp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ VERSION = 1.1
[TASK]
TASK = milltask
CYCLE_TIME = 0.001
INTERPRETER = libcanterp.so
INTERPRETER = canterp.so

[DISPLAY]
OPEN_FILE = ./canterp_example.can
Expand Down
42 changes: 42 additions & 0 deletions configs/sim/axis/vismach/5axis/table-dual-rotary/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Switchable Table Dual Rotary (tdr) Sim config

xyzab-tdr (switchable kinematics)


Demonstrations:

For a demonstration of XYZAB_TCP kinematics the user can run the preloaded demo gcode with the default offsets.

In the right hand panel of the axis gui sliders are provided to

- change the geometrical (x,z)-offsets as measured from the rotation-point of the A/B rotary-assembly to the
face center of the rotary A table. The offsets are visibly adjusted in the vismach simulation and represented by a red indicator
for the x-offset and a blue indicator for the z-offset.

- see the effects of misconfiguring the (x,y,z)-rot-point values used in the kinematics. These values represent the
physical position of the rotary-assembly in the machine as measured from the machine home position to the rotation-point
of the assembly. The rotation-point is identical to the intersection of the two rotational axes A and B when the (x,z)-offsets
are zero. When (x,z)-offsets are applied the rotation-point stays on the rotational B axis. The 'rot-point' as set by
these values as well as the true rotation-point of the rotary-assembly are indicated in the vismach simulation by a yellow cross
and a red sphere respectively.

NOTE:
For proper tool-path preview RELOAD THE CGODE after startup and after changing offset values.



***********************************************
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
REMAP = M429 modalgroup=10 ngc=429remap

[HALUI]
MDI_COMMAND = M429
MDI_COMMAND = M428
***********************************************
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
; -- RELOAD GCODE FOR PROPER TOOL-PATH PREVIEW --
g21 g90 g49 g54
; switch to identity mode
m429
; clear g54
g10 l2 p0 x0 y0 z0 a0 b0
; go to machine origin
g53 g0 x0 y0 z0 a0 b0
; set g54 for face center of rotary
g10 l20 p0 x-[#<_hal[xyzab_tdr_kins.x-rot-point]>+#<_hal[xyzab_tdr_kins.x-offset]>] y-#<_hal[xyzab_tdr_kins.x-rot-point]> z-[#<_hal[xyzab_tdr_kins.z-rot-point]>+#<_hal[xyzab_tdr_kins.z-offset]>] a0 b0
; load a tool
M61 Q2 G43 H2
; switch to tcp mode
m428
g0 b30
; go to face center of rotary a
g0 x0 y0 z0
; show basic tcp functionality
g0 x30 a180
g0 x0 a0
g0 b100
g0 y-50
g0 a90
g0 b120
g0 y0
g0 a0 b30
g0 x1
; start with square
f1000
g0 y-30 z-30
g1 z30
g1 a45
g1 y30
g1 a90 b45
g1 z-30
g1 a180 b100
g1 y30
g1 a90 b120
g1 y-30
g1 a0 b30
g0 x5
g1 y-30 z-30 a90
g1 z30 a45 b60
g1 y30 a90 b90
g1 z-30 a135 b120
g1 y-30 a0 b30
; go to machine origin
g53 g0 x0 y0 z0 a0 b0
m2
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;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

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)
(debug,STOP)
M2
o2 else
o2 endif

o<428remap>endsub
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
;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

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)
(debug,STOP)
M2
o2 else
o2 endif

o<429remap>endsub
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# switchkins pyvcp connections for:
# xyzab-tdr-kins.ini

net :kinstype.is-0 <= kinstype.is-0 => pyvcp.multilabel.0.legend0
net :kinstype.is-1 <= kinstype.is-1 => pyvcp.multilabel.0.legend1

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

net :type0-button <= pyvcp.type0-button => halui.mdi-command-00
net :type1-button <= pyvcp.type1-button => halui.mdi-command-01

net :axis-x => pyvcp.joint0
net :axis-y => pyvcp.joint1
net :axis-z => pyvcp.joint2
net :rotary-a => pyvcp.joint3
net :rotary-b => pyvcp.joint4

net :x-offset => pyvcp.x-offset-f
net :z-offset => pyvcp.z-offset-f
net :x-rot-point => pyvcp.x-rot-point-f
net :y-rot-point => pyvcp.y-rot-point-f
net :z-rot-point => pyvcp.z-rot-point-f

185 changes: 185 additions & 0 deletions configs/sim/axis/vismach/5axis/table-dual-rotary/xyzab-tdr.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
[EMC]
VERSION = 1.1
MACHINE = sim-xyzab-tdr-kins (switchkins)

[DISPLAY]
GEOMETRY = XYZA-B
OPEN_FILE = ./demos/xyzab-tdr-demo.ngc
PYVCP = ./xyzab-tdr.xml
DISPLAY = axis
MAX_ANGULAR_VELOCITY = 360
MAX_LINEAR_VELOCITY = 1000
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 2
PROGRAM_PREFIX = ../../nc_files
INTRO_GRAPHIC = emc2.gif
INTRO_TIME = 1
TOOL_EDITOR = tooledit z diam

[RS274NGC]
SUBROUTINE_PATH = ./remap_subs
REMAP = M428 modalgroup=10 ngc=428remap
REMAP = M429 modalgroup=10 ngc=429remap
PARAMETER_FILE = xyzab-tdr.var

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

KINEMATICS = xyzab_tdr_kins
JOINTS = 5

[HAL]
HALUI = halui
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
# rotation-point of the rotary-assembly can be changed using the sliders
# in the axis-gui.
# Default values (initval) and ranges (min,max) are set
# in the corresponding 'scale' sections in the file 'xyzab-tdr.xml'

# vismach xyzab-tdr-gui items
HALCMD = loadusr -W xyzab-tdr-gui
HALCMD = net :axis-x joint.0.pos-fb xyzab-tdr-gui.axis-x
HALCMD = net :axis-y joint.1.pos-fb xyzab-tdr-gui.axis-y
HALCMD = net :axis-z joint.2.pos-fb xyzab-tdr-gui.axis-z
HALCMD = net :rotary-a joint.3.pos-fb xyzab-tdr-gui.rotary-a
HALCMD = net :rotary-b joint.4.pos-fb xyzab-tdr-gui.rotary-b
HALCMD = net :tool-offset motion.tooloffset.z xyzab-tdr-gui.tool_length
HALCMD = net :tool-diam halui.tool.diameter xyzab-tdr-gui.tool_diameter
HALCMD = net :x-offset xyzab-tdr-gui.x_offset
HALCMD = net :z-offset xyzab-tdr-gui.z_offset
HALCMD = net :x-rot-point xyzab-tdr-gui.x-rot-point
HALCMD = net :y-rot-point xyzab-tdr-gui.y-rot-point
HALCMD = net :z-rot-point xyzab-tdr-gui.z-rot-point

# xyzab_tdr_kins items
HALCMD = net :tool-offset xyzab_tdr_kins.tool-offset-z
HALCMD = net :x-offset xyzab_tdr_kins.x-offset
HALCMD = net :z-offset xyzab_tdr_kins.z-offset
HALCMD = net :x-rot-point xyzab_tdr_kins.x-rot-point
HALCMD = net :y-rot-point xyzab_tdr_kins.y-rot-point
HALCMD = net :z-rot-point xyzab_tdr_kins.z-rot-point

# This is only used to preset the vismach model to the default values as set
# in the xml scale widgets
# These will be overwritten by the values in the xml
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)
MDI_COMMAND = M429
MDI_COMMAND = M428

[TRAJ]
COORDINATES = XYZAB
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]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = xyzab-tdr.tbl

[AXIS_X]
MIN_LIMIT = -200
MAX_LIMIT = 200
MAX_VELOCITY = 20
MAX_ACCELERATION = 300

[AXIS_Y]
MIN_LIMIT = -200
MAX_LIMIT = 200
MAX_VELOCITY = 20
MAX_ACCELERATION = 300

[AXIS_Z]
MIN_LIMIT = -300
MAX_LIMIT = 300
MAX_VELOCITY = 20
MAX_ACCELERATION = 300

[AXIS_A]
MIN_LIMIT = -3600
MAX_LIMIT = 3600
MAX_VELOCITY = 30
MAX_ACCELERATION = 300

[AXIS_B]
MIN_LIMIT = -180
MAX_LIMIT = 180
MAX_VELOCITY = 30
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

[JOINT_1]
TYPE = LINEAR
HOME = 0
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
MIN_LIMIT = -200
MAX_LIMIT = 200
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0

[JOINT_2]
TYPE = LINEAR
HOME = 0
MAX_VELOCITY = 20
MAX_ACCELERATION = 300
MIN_LIMIT = -300
MAX_LIMIT = 300
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0

[JOINT_3]
TYPE = ANGULAR
HOME = 0
MAX_VELOCITY = 30
MAX_ACCELERATION = 300
MIN_LIMIT = -3600
MAX_LIMIT = 3600
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0

[JOINT_4]
TYPE = ANGULAR
HOME = 0
MAX_VELOCITY = 30
MAX_ACCELERATION = 300
MIN_LIMIT = -180
MAX_LIMIT = 180
HOME_SEARCH_VEL = 0
HOME_SEQUENCE = 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
T1 P1 D1
T2 P2 Z30 D3
T3 P3 Z40 D4
T4 P4 Z50 D5

0 comments on commit ceeabdf

Please sign in to comment.