[APPLICATIONS]
# uncomment to enable:
#APP = halshow --fformat %.5f switchkins.halshow

[EMC]
VERSION = 1.1
MACHINE = sim-xyzac-trt-kins (switchkins)

[DISPLAY]
            GEOMETRY = XYZ-A
           OPEN_FILE = ./demos/xyzac_switchkins.ngc
               PYVCP = ./xyzac-trt.xml
            JOG_AXES = XYZC
             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
             #EDITOR = gedit
         TOOL_EDITOR = tooledit z diam

               TKPKG = Ngcgui 1.0
         NGCGUI_FONT = Helvetica -12 normal
      NGCGUI_SUBFILE = xyzac_switchkins_sub.ngc
      NGCGUI_SUBFILE = centering.ngc

[RS274NGC]
SUBROUTINE_PATH = ./remap_subs
   HAL_PIN_VARS = 1
          REMAP = M428  modalgroup=10  ngc=428remap
          REMAP = M429  modalgroup=10  ngc=429remap
          REMAP = M430  modalgroup=10  ngc=430remap
 PARAMETER_FILE = xyzac.var

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

[HAL]
          HALUI = halui
        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
HALCMD = net  :table-x      joint.0.pos-fb             xyzac-trt-gui.table-x
HALCMD = net  :saddle-y     joint.1.pos-fb             xyzac-trt-gui.saddle-y
HALCMD = net  :spindle-z    joint.2.pos-fb             xyzac-trt-gui.spindle-z
HALCMD = net  :tilt-a       joint.3.pos-fb             xyzac-trt-gui.tilt-a
HALCMD = net  :rotate-c     joint.4.pos-fb             xyzac-trt-gui.rotate-c
HALCMD = net  :tool-offset  motion.tooloffset.z
HALCMD = net  :tool-offset  xyzac-trt-kins.tool-offset xyzac-trt-gui.tool-offset
HALCMD = net  :y-offset     xyzac-trt-kins.y-offset    xyzac-trt-gui.y-offset
HALCMD = net  :z-offset     xyzac-trt-kins.z-offset    xyzac-trt-gui.z-offset
HALCMD = sets :y-offset     20
HALCMD = sets :z-offset     10

# not currently supported by xyzac-trt-gui:
HALCMD = setp xyzac-trt-kins.x-rot-point 0
HALCMD = setp xyzac-trt-kins.y-rot-point 0
HALCMD = setp xyzac-trt-kins.z-rot-point 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)
MDI_COMMAND = M429
MDI_COMMAND = M428
MDI_COMMAND = M430

[TRAJ]
                COORDINATES = XYZAC
               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 = xyzac-trt.tbl

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

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

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

[AXIS_A]
       MIN_LIMIT = -100
       MAX_LIMIT =   50
    MAX_VELOCITY =   30
MAX_ACCELERATION =   300

[AXIS_C]
       MIN_LIMIT = -36000
       MAX_LIMIT =  36000
    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 = -100
         MAX_LIMIT =  100
   HOME_SEARCH_VEL =    0
     HOME_SEQUENCE =    0

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

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

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