[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]
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
