[EMC]
VERSION = 1.1
MACHINE = LinuxCNC-HAL-SERVO-SIM
# Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
DEBUG = 0

[DISPLAY]
DISPLAY = tklinuxcnc
CYCLE_TIME = 0.100
HELP_FILE = tklinuxcnc.txt
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
MAX_FEED_OVERRIDE = 1.2
PROGRAM_PREFIX = ../../nc_files/
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5

[RS274NGC]
PARAMETER_FILE = sim.var

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
BASE_PERIOD = 50000
SERVO_PERIOD = 1000000

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[HAL]
HALFILE = servo_sim.hal

[TRAJ]
COORDINATES = X Y Z
LINEAR_UNITS = inch
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 0.167
MAX_LINEAR_VELOCITY = 1.5
DEFAULT_LINEAR_ACCELERATION = 20.0
MAX_LINEAR_ACCELERATION = 20.0

[EMCIO]
EMCIO =   io
CYCLE_TIME = 0.100
TOOL_TABLE = sim.tbl

[KINS]
KINEMATICS = trivkins
JOINTS = 3

[AXIS_X]
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_VELOCITY = 1.67
MAX_ACCELERATION = 20.0

[AXIS_Y]
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_VELOCITY = 1.67
MAX_ACCELERATION = 20.0

[AXIS_Z]
MIN_LIMIT = -2.0
MAX_LIMIT = 4.0
MAX_VELOCITY = 1.67
MAX_ACCELERATION = 20.0

# our simulated "joints" consist of motors with 100 PPR
# (400 count per rev) encoders, coupled to 5 TPI screws
# thru a 3:1 belt reduction.
# So the scaling is 400 CPR * 3 * 5 = 6000 counts/inch
# Since we are using software encoder counters with a
# base period of 50uS (20KHz) the maximum count rate is
# 10KHz, which works out to 1.667 inches per second.

[JOINT_0]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 1.67
MAX_ACCELERATION = 20.0
COMP_FILE = screwcompX.dat
COMP_FILE_TYPE = 0
MOTOR_PPR = 100
DRIVE_RATIO = 15
INPUT_SCALE = 6000
OUTPUT_SCALE = 1.000
# extra limit related info for simulation
# the HARD_LIMIT variables determine when the simulated
# hardware limit switches trip and release
MIN_HARD_LIMIT_RELEASE = -10.5
MIN_HARD_LIMIT = -10.2
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_HARD_LIMIT = 10.2
MAX_HARD_LIMIT_RELEASE = 10.5
# the HOME_SW variables determine when the simulated
# home switch trips and releases
HOME_SW_MIN = 9.5
HOME_SW_MAX = 9.8
HOME_OFFSET = 10.0
HOME_SEARCH_VEL = 1.0
HOME_LATCH_VEL = 0.5
# PID tuning params
DEADBAND = 0.0001
PGAIN = 1500.0
IGAIN = 8000.0
DGAIN = 4.0
FF0 = 0.000
FF1 = 1.000
FF2 = 0.000
BIAS = 0.000

[JOINT_1]
TYPE = LINEAR
HOME = 0.000
MAX_VELOCITY = 1.67
MAX_ACCELERATION = 20.0
MOTOR_PPR = 100
DRIVE_RATIO = 15
INPUT_SCALE = 6000
OUTPUT_SCALE = 1.000
MIN_HARD_LIMIT_RELEASE = -10.5
MIN_HARD_LIMIT = -10.2
MIN_LIMIT = -10.0
MAX_LIMIT = 10.0
MAX_HARD_LIMIT = 10.2
MAX_HARD_LIMIT_RELEASE = 10.5
HOME_SW_MIN = 9.5
HOME_SW_MAX = 9.8
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
# PID tuning params
DEADBAND = 0.0001
PGAIN = 1500.0
IGAIN = 8000.0
DGAIN = 4.0
FF0 = 0.000
FF1 = 1.000
FF2 = 0.000
BIAS = 0.000

[JOINT_2]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 1.67
MAX_ACCELERATION = 20.0
MOTOR_PPR = 100
DRIVE_RATIO = 15
INPUT_SCALE = 6000
OUTPUT_SCALE = 1.000
MIN_HARD_LIMIT_RELEASE = -2.5
MIN_HARD_LIMIT = -2.2
MIN_LIMIT = -2.0
MAX_LIMIT = 4.0
MAX_HARD_LIMIT = 4.2
MAX_HARD_LIMIT_RELEASE = 4.5
HOME_SW_MIN = 0.0
HOME_SW_MAX = 0.1
HOME_OFFSET = 0.0
HOME_SEARCH_VEL = 0.0
HOME_LATCH_VEL = 0.0
# PID tuning params
DEADBAND = 0.0001
PGAIN = 1500.0
IGAIN = 8000.0
DGAIN = 4.0
FF0 = 0.000
FF1 = 1.000
FF2 = 0.000
BIAS = 0.000
