# EMC controller parameters for a simulated machine.
# General note: Comments can either be preceded with a # or ; - either is
# acceptable, although # is in keeping with most linux config files.

# General section -------------------------------------------------------------
[EMC]
VERSION = 1.1
MACHINE =              lathe_c
#DEBUG =               0x7FFFFFFF
DEBUG = 0

# for details see nc_files/subroutines/maco_instructions.txt
[DISPLAY]
DISPLAY = gmoccapy
LATHE = 1
BACK_TOOL_LATHE = 0

# Cycle time, in milliseconds, that display will sleep between polls
CYCLE_TIME =            100

# Highest value that will be allowed for feed override, 1.0 = 100%
MAX_FEED_OVERRIDE =     1.5
MAX_SPINDLE_OVERRIDE =  1.2
MIN_SPINDLE_OVERRIDE = .5


# Prefix to be used
PROGRAM_PREFIX = /home/debian/linuxcnc/nc_files

# Introductory graphic
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5

# list of selectable jog increments
INCREMENTS = 1.000 mm, 0.100 mm, 0.010 mm, 0.001 mm

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Grayscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

# Task controller section -----------------------------------------------------
[RS274NGC]
RS274NGC_STARTUP_CODE = G18 G21 G40 G49 G54 G80 G90 G94 G8 M9 M5 G64 P0.005
PARAMETER_FILE = sim.var
SUBROUTINE_PATH = macros

# Motion control section ------------------------------------------------------
[EMCMOT]
EMCMOT =              motmod
COMM_TIMEOUT =          1.0
BASE_PERIOD  =          100000
SERVO_PERIOD =          1000000

# Hardware Abstraction Layer section --------------------------------------------------
[TASK]
TASK =                  milltask
CYCLE_TIME =            0.001

# Part program interpreter section --------------------------------------------
[HAL]
HALFILE = core_sim_lathe_C.hal
HALFILE = spindle_sim.hal
HALFILE = simulated_home_lathe.hal

# Single file that is executed after the GUI has started.
POSTGUI_HALFILE = gmoccapy_postgui.hal

HALUI = halui

# Trajectory planner section --------------------------------------------------
[HALUI]
#No Content

[TRAJ]
COORDINATES =      X Z C
LINEAR_UNITS =     mm
ANGULAR_UNITS =    degree
DEFAULT_LINEAR_VELOCITY = 50
MAX_LINEAR_VELOCITY = 234
POSITION_FILE =    position.txt
#NO_FORCE_HOMING = 1

# First axis
[EMCIO]
EMCIO = 		io
CYCLE_TIME =    0.100

# tool table file
TOOL_TABLE = lathe.tbl

[KINS]
KINEMATICS = trivkins coordinates=XZC
JOINTS = 3

[AXIS_X]
MIN_LIMIT = -50.0
MAX_LIMIT = 200.0
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0

[JOINT_0]
TYPE =                          LINEAR
MAX_VELOCITY =                  166
MAX_ACCELERATION =              1500.0
BACKLASH = 0.000
INPUT_SCALE =                   4000
OUTPUT_SCALE = 1.000
MIN_LIMIT =                     -50.0
MAX_LIMIT =                     200.0
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET =                    0.0
HOME =                           10
HOME_SEARCH_VEL =                200.0
HOME_LATCH_VEL =                 20.0
HOME_USE_INDEX =                 NO
HOME_IGNORE_LIMITS =             NO
HOME_SEQUENCE = 1
HOME_IS_SHARED = 1

# Third axis
[AXIS_Z]
MIN_LIMIT = -75.0
MAX_LIMIT = 1000.0
MAX_VELOCITY = 166
MAX_ACCELERATION = 1500.0

[JOINT_1]
TYPE =                          LINEAR
MAX_VELOCITY =                  166
MAX_ACCELERATION =              1500.0
BACKLASH = 0.000
INPUT_SCALE =                   4000
OUTPUT_SCALE = 1.000
MIN_LIMIT =                     -75.0
MAX_LIMIT =                     1000.0
FERROR = 0.050
MIN_FERROR = 0.010
HOME_OFFSET =                    1.0
HOME =                           -10
HOME_SEARCH_VEL =                200.0
HOME_LATCH_VEL =                 20.0
HOME_USE_INDEX =                 NO
HOME_IGNORE_LIMITS =             NO
HOME_SEQUENCE = 0
HOME_IS_SHARED = 1


[AXIS_C]
MAX_VELOCITY = 90.0
MAX_ACCELERATION = 1200.0

[JOINT_2]
TYPE =                          ANGULAR
HOME =                          0.0
MAX_VELOCITY =                  90.0
MAX_ACCELERATION =              1200.0
BACKLASH = 0.000
INPUT_SCALE =                   40
OUTPUT_SCALE = 1.000
FERROR = 5.0
MIN_FERROR = 1.0
HOME_OFFSET =                    0.0
HOME_SEARCH_VEL =                0.0
HOME_LATCH_VEL =                 0.0
HOME_USE_INDEX =                 NO
HOME_IGNORE_LIMITS =             NO
HOME_SEQUENCE = 1

# section for main IO controller parameters -----------------------------------
[MACROS]
MACRO = i_am_lost
MACRO = halo_world
MACRO = jog_around
MACRO = increment xinc yinc
MACRO = go_to_position X-pos Y-pos Z-pos


