# Generated by stepconf 1.1 at Mon Mar 14 20:22:34 2022
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[EMC]
MACHINE = my-emco-compact-5
DEBUG = 0
VERSION = 1.1

[DISPLAY]
DISPLAY = gmoccapy
EDITOR = gedit
POSITION_OFFSET = RELATIVE
POSITION_FEEDBACK = ACTUAL
ARCDIVISION = 64
GRIDS = 10mm 20mm 50mm 100mm 1in 2in 5in 10in
MAX_FEED_OVERRIDE = 1.2
MIN_SPINDLE_OVERRIDE = 0.5
MAX_SPINDLE_OVERRIDE = 1.2
DEFAULT_LINEAR_VELOCITY = 1.25
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 12.50
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/johan/linuxcnc/nc_files
INCREMENTS = 1mm .1mm .01mm
#INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm
LATHE = 1
MIN_ANGULAR_VELOCITY = 0.1
MAX_ANGULAR_VELOCITY = 3600
DEFAULT_ANGULAR_VELOCITY = 360
DEFAULT_SPINDLE_SPEED = 200
CYCLE_TIME = 150
DEFAULT_SPINDLE_0_SPEED = 200
MIN_SPINDLE_0_SPEED = 100
MAX_SPINDLE_0_SPEED = 2500
MAX_SPINDLE_0_OVERRIDE = 1
MIN_SPINDLE_0_OVERRIDE = 0.5

EMBED_TAB_NAME = Spindle Speed Selection
EMBED_TAB_LOCATION = ntb_preview 
EMBED_TAB_COMMAND = gladevcp -H spindle_speed_selector.hal -x {XID} spindle_speed_selector.glade

EMBED_TAB_NAME = Macro
EMBED_TAB_LOCATION = ntb_preview 
EMBED_TAB_COMMAND = halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -U notouch=1 -U norun=0 -u macros/lathehandler.py -x {XID} macros/lathemacro.ui

EMBED_TAB_NAME = MPG
EMBED_TAB_LOCATION = ntb_preview 
EMBED_TAB_COMMAND = gladevcp -u gladevcp-handler.py -H mpg.hal -x {XID} mpg.glade

[PYTHON]
TOPLEVEL=python/toplevel.py
PATH_APPEND=python
#TOPLEVEL=/home/johan/linuxcnc/configs/sim.gmoccapy.lathe_configs/python/toplevel.py
#PATH_APPEND=/home/johan/linuxcnc/configs/sim.gmoccapy.lathe_configs/python

[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .nc,.tap G-Code File
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
RS274NGC_STARTUP_CODE = G7 G18
SUBROUTINE_PATH=custom-m-codes
USER_M_PATH=custom-m-codes
REMAP=S prolog=setspeed_prolog ngc=mysetspeed epilog=setspeed_epilog
REMAP=M0 modalgroup=4 ngc=extend_m0
REMAP=M1 modalgroup=4 ngc=extend_m1

[EMCMOT]
# base freq = 20kHz
# servo freq = 1kHz
EMCMOT = motmod
COMM_TIMEOUT = 1.0
#BASE_PERIOD = 35000
BASE_PERIOD = 50000
SERVO_PERIOD = 1000000

[HAL]
HALUI = halui
HALFILE = my-emco-compact-5.hal
HALFILE = custom.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
# add halui MDI commands here (max 64) 
MDI_COMMAND = O<myspindlespeedup> call [100]                    ;0, connected to mpg button
MDI_COMMAND = O<myspindlespeeddown> call [100]                  ;1, connected to mpg button
MDI_COMMAND = O<mytouch> call                                   ;2, connected to mpg button
MDI_COMMAND = O<myspindlegain> call [0.48483] [20.16466]   ;3, spindle speed selection AC1
MDI_COMMAND = O<myspindlegain> call [0.32571] [-8.05714]   ;4, spindle speed selection AC2
MDI_COMMAND = O<myspindlegain> call [0.20098] [22.64117]   ;5, spindle speed selection AC3
MDI_COMMAND = O<myspindlegain> call [#4998] [#4999]        ;6, called to set saved spindle 
                                                                ;   speed selection after homing

[KINS]
KINEMATICS = trivkins coordinates=XZ
JOINTS = 2

[TRAJ]
COORDINATES =  X Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
DEFAULT_LINEAR_VELOCITY = 2.5 
MAX_LINEAR_VELOCITY = 18
NO_FORCE_HOMING = 1 
DEFAULT_LINEAR_ACCELERATION = 50.0
POSITION_FILE = emcopos.txt

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

[AXIS_X]
MIN_LIMIT = -2500.0
MAX_LIMIT = 2500.0
MAX_VELOCITY = 12.5
MAX_ACCELERATION = 500

[JOINT_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 12.5
MAX_ACCELERATION = 500
STEPGEN_MAXACCEL = 625

#steps/rev = 72, 0.125 mm/9 steps => 72*(0.125/9)  mm/rev
#scale = 72/[72*0.125/9] = 72/(72/72) = 72 steps/mm
SCALE = 72

FERROR = 1.0
MIN_FERROR = 0.25
MIN_LIMIT = -2500.0
MAX_LIMIT = 2500.0
HOME_OFFSET = 0.0

[AXIS_Z]
MIN_LIMIT = -2500.0
MAX_LIMIT = 2500.0
MAX_VELOCITY = 12.5
MAX_ACCELERATION = 500

[JOINT_1]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 12.5
MAX_ACCELERATION = 500
STEPGEN_MAXACCEL = 625

#steps/rev = 72, 0.125 mm/9 steps => 72*(0.125/9)  mm/rev
#scale = 72/[72*0.125/9] = 72 steps/mm
SCALE = 72

FERROR = 1.0
MIN_FERROR = 0.25
MIN_LIMIT = -2500.0
MAX_LIMIT = 2500.0
HOME_OFFSET = 0.0
