Automatic Touch-Off after tool change

More
10 May 2015 00:16 #58522 by HolgerT
Hi. I successful configured my machine for using a metal plate to z-auto-touch-off by G38.2 command (similar to: 7xcnc.com/software/probing/z-touch-plate/). For that I do a x/y-move of the tool to the plate, which is lying on the surface of work piece and manually run that MDI_COMMAND=M102:
#!/bin/sh
# Auto antasten Z-Achse
axis-remote -m "o9102 call"
exit 0

..which calls this o-sub:
o9102 sub
( Set current Z position to 0 so that we will always be moving down )
G10 L20 P0 Z0
( Probe to Z-5 at F120)
G38.2 Z-5 F120
( Set Z0 at point where probe triggers with offset of +1.40 [this is the thickness of )
( PCB plate. One must adjust this for your plate / setup] )
G10 L20 P0 Z1.40
( Rapid up to Z5 above the material )
G0 Z5
o9102 endsub

This works very well, when I set up the machine in the beginning of my work.

My problem is the tool change in the middle of running a g-code file. If a tool change is neccessary, the machine stops by TxxM06. I can replace the tool, but I'm not able to x/y-go to the plate position, nor I'm able to run the o-sub, because Axis does not allow manual mode at this time.

Any idea to solve that problem? - Putting M102 into g-code after TxxM06 is not the solution, because x/y postion of plate differs from time to time and in rare cases, I have to give M102 twice.

Thank you very much.
-Holger

Please Log in or Create an account to join the conversation.

More
11 May 2015 01:16 #58539 by newbynobi
You can solve that, using remap.

Or you use moveoff component.

Norbert

Please Log in or Create an account to join the conversation.

More
11 May 2015 04:12 #58547 by andypugh
Have a look at this sample config, which re-maps M6 to do a touch-off

git.linuxcnc.org/gitweb?p=linuxcnc.git;a...6d;hb=refs/heads/2.6

Documentation on remap is here:
www.linuxcnc.org/docs/html/remap/structure.html

Please Log in or Create an account to join the conversation.

More
12 May 2015 00:48 #58568 by HolgerT
Thank you newbynobi and andypugh. It sounds promising and I will check this out in next days.

Regards,
Holger

Please Log in or Create an account to join the conversation.

More
12 Jul 2015 23:10 - 12 Jul 2015 23:30 #60591 by cahlfors
Hello!
I am following this thread with great interest, since I just got myself a touch-off probe. I have tried to set up my system according to the instructions above, but get the following error on startup and am a bit stumped:
Print file information:
RUN_IN_PLACE=no
LINUXCNC_DIR=
LINUXCNC_BIN_DIR=/usr/bin
LINUXCNC_TCL_DIR=/usr/lib/tcltk/linuxcnc
LINUXCNC_SCRIPT_DIR=
LINUXCNC_RTLIB_DIR=/usr/realtime-3.4-9-rtai-686-pae/modules/linuxcnc
LINUXCNC_CONFIG_DIR=
LINUXCNC_LANG_DIR=/usr/share/linuxcnc/tcl/msgs
INIVAR=inivar
HALCMD=halcmd
LINUXCNC_EMCSH=/usr/bin/wish8.5
LINUXCNC - 2.6.8
Machine configuration directory is '/home/familjen/linuxcnc/configs/BF20'
Machine configuration file is 'BF20.ini'
INIFILE=/home/familjen/linuxcnc/configs/BF20/BF20.ini
PARAMETER_FILE=linuxcnc.var
TASK=milltask
HALUI=halui
DISPLAY=axis
Starting LinuxCNC...
Starting LinuxCNC server program: linuxcncsvr
Loading Real Time OS, RTAPI, and HAL_LIB modules
Starting LinuxCNC IO program: io
Starting HAL User Interface program: halui
Starting TASK program: milltask
Starting DISPLAY program: axis
 on_abort executing
emc/task/emctask.cc 389: interp_error: Unable to open file <reset_state>
Unable to open file <reset_state>
 on_abort executing
emc/task/emctask.cc 389: interp_error: Unable to open file <reset_state>
Unable to open file <reset_state>
RTAPI: ERROR: Unexpected realtime delay on task 1
This Message will only display once per session.
Run the Latency Test and resolve before continuing.

Unexpected realtime delay: check dmesg for details.
Embeded tab command "halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -x 69206156 -c gladevcp -u python/gladevcp-handler.py manualtoolchange.glade" exited with error: 1
Shutting down and cleaning up LinuxCNC...
****  probe_screen GETINIINFO **** 
 Preference file path: /home/familjen/linuxcnc/configs/BF20/BF20.pref
Xlib.protocol.request.QueryExtension
Xlib.protocol.request.QueryExtension
Killing task linuxcncsvr, PID=18364
Killing task milltask, PID=18427
xhc-hb04: waiting for XHC-HB04 device
xhc-hb04: found XHC-HB04 device
xhc-hb04: connection lost, cleaning up
[timestamp] [threadID] facility level [function call] <message>
--------------------------------------------------------------------------------
Removing HAL_LIB, RTAPI, and Real Time OS modules
ERROR:  Can't remove RTAI modules, kill the following process(es) first
 18417Removing NML shared memory segments

Debug file information:
.
xhc-hb04.tcl: using std_start_pause_button

(gladevcp:18436): XML-CRITICAL **: XML declaration allowed only at the start of the document


(gladevcp:18436): libglade-WARNING **: did not finish in PARSER_FINISH state
**** GLADE VCP ERROR:    With xml file: manualtoolchange.glade : could not create GladeXML object

<commandline>:0: gladevcp exited without becoming ready
/usr/bin/gladevcp:185: GtkWarning: Unknown property: HAL_LED.pick-color-blink
  builder.add_from_file(xmlname)
/usr/bin/gladevcp:185: GtkWarning: Unknown property: HAL_LED.led-shiny
  builder.add_from_file(xmlname)
/usr/bin/gladevcp:185: GtkWarning: Unknown property: HAL_LED.blink-color
  builder.add_from_file(xmlname)
/usr/bin/gladevcp:185: GtkWarning: GtkSpinButton: setting an adjustment with non-zero page size is deprecated
  builder.add_from_file(xmlname)

/usr/bin/gladevcp:292: GtkWarning: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 15
  gtk.main()
/usr/bin/gladevcp:292: GtkWarning: GdkWindow 0x4600003 unexpectedly destroyed
  gtk.main()
**** GLADE VCP ERROR:    X Protocol Error: 3
18364
  PID TTY      STAT   TIME COMMAND
18427
  PID TTY      STAT   TIME COMMAND
Stopping realtime threads
Unloading hal components
[ 0.000000] [000047ea] libusbx: error [do_close] Device handle closed while transfer was still being processed, but the device is still connected as far as we know
[ 0.000075] [000047ea] libusbx: warning [do_close] A cancellation for an in-flight transfer hasn't completed but closing the device handle
                     USER        PID ACCESS COMMAND
/dev/rtai_shm:       familjen  ....m monitor_xhc-hb0

It seems related to the following line in the *.ini:
GLADEVCP=-c gladevcp -u python/gladevcp-handler.py manualtoolchange.glade

Here is the *.ini:
# Generated by stepconf 1.1 at Sun Jan 25 16:23:08 2015
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[XHC_HB04_CONFIG]
# specify layout = n for xhc-hb04-layout{n}.cfg files
layout = 2
# coords: specify 4 letters
# coords: switch labels are xyza but any unique 4 letters
#         from the set {xyxabcuvw) can be used (if the coord exists)
coords = x y z
# lowpass settings:
# coef: slows rate of change of output,  range: 0 < coef < 1
coefs = 1 1 1 1
# scale plus or minus, rotaries may require larger scale factor:
scales = 1 -1 1 1
# jogmode normal(default) or vnormal or plus-minus
jogmode = normal
# sequence 1: 0.001,0.010,0.100,1.000 (mm-based machine)
# sequence 2: 0.001,0.005,0.010,0.020 (inch-based machine)
sequence = 1
# require_pendant = no: create xhc-hb04 hal pins when pendant not connecte
#                       at startup
require_pendant = yes

[XHC_HB04_BUTTONS]
# use button names according to layout file xhc-hb04-layout{n}.cfg
# note: "start-pause" is connected for standard behavior
#        controlling halui.pause/halui.resume/halui.run
# these are examples, edit as required:

goto-zero   = halui.mdi-command-00
# syntheized per-axis buttons for goto-zero button:
goto-zero-x = ""
goto-zero-y = ""
goto-zero-z = ""
goto-zero-a = ""

start-pause = std_start_pause
rewind      = halui.program.step
# probe-input for simulating a probe:
probe-z     = motion.probe-input
macro-3     = halui.mdi-command-03

half        = halui.spindle.stop
# synthesized per-axis buttons for half button:
half-x      = ""
half-y      = ""
half-z      = ""
half-a      = ""

zero        = ""
# synthesized per-axis buttons for zero button:
zero-x      = halui.mdi-command-12
zero-y      = halui.mdi-command-13
zero-z      = halui.mdi-command-14
zero-a      = halui.mdi-command-15

safe-z      = halui.mdi-command-10
# in this sim, home-all only works first time, hold down till finished:
home        = halui.home-all
macro-1     = halui.mdi-command-01
macro-2     = halui.mdi-command-02
spindle     = halui.spindle.start
step        = xhc-hb04.stepsize-up
mode        = ""
macro-6     = halui.mdi-command-06
macro-7     = halui.mdi-command-07
stop        = halui.program.stop
reset       = halui.estop.activate

[HALUI]
# these are examples, edit as required:
# a halui hal pin is created for each MDI_COMMAND below
# halui.mdi-command-00, halui.mdi-command-01,... etc
MDI_COMMAND=G0 X0 Y0 Z0
MDI_COMMAND=(debug, example: mdi-01)
MDI_COMMAND=(debug, example: mdi-02)
#03 M110: clears notifications
MDI_COMMAND=M110
MDI_COMMAND=(debug, example: mdi-04)
MDI_COMMAND=(debug, example: mdi-05)
MDI_COMMAND=(debug, example: mdi-06)
#07 M101: example print to stdout
MDI_COMMAND=M101
MDI_COMMAND=(debug, example: mdi-08)
MDI_COMMAND=(debug, example: mdi-09)
MDI_COMMAND=(debug, example: mdi-10)
MDI_COMMAND=(debug, example: mdi-11)
#12
MDI_COMMAND= G10 L20 P0 X0
#13
MDI_COMMAND= G10 L20 P0 Y0
#14
MDI_COMMAND= G10 L20 P0 Z0
#15
MDI_COMMAND= G10 L20 P0 C0

[EMC]
MACHINE = BF20
DEBUG = GLADEVCP=-c gladevcp -u python/gladevcp-handler.py manualtoolchange.glade
0

[DISPLAY]
DISPLAY = axis
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.0
DEFAULT_LINEAR_VELOCITY = 2.50
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 25.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/familjen/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
GLADEVCP=-c gladevcp -u python/gladevcp-handler.py manualtoolchange.glade
EMBED_TAB_NAME=Probe Screen 
EMBED_TAB_COMMAND=halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -u python/probe_screen.py -x {XID} probe_icons/probe_screen.glade 

# Path to help file
HELP_FILE =             doc/help.txt

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

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

# the Python plugins serves interpreter and task
[PYTHON]
# where to find Python code
# code specific for this configuration  
PATH_PREPEND=./python
# generic support code
PATH_APPEND=../../nc_files/remap_lib/python-stdglue

# import the following Python module
TOPLEVEL=python/toplevel.py

# the higher the more verbose tracing of the Python plugin
LOG_LEVEL = 0

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
SUBROUTINE_PATH   = ../../nc_files/ngcgui_lib:../../nc_files/ngcgui_lib/utilitysubs:../../nc_files/macros
# for demo of M110:
USER_M_PATH       = ../../nc_files/ngcgui_lib/mfiles
FEATURES=30
ON_ABORT_COMMAND=O <on_abort> call 

#
# ------ remapping toolchange - related codes ----------------------
#
# see python/remap.py for the prolog and epilog handlers
# see nc_files/remap-subroutines for the NGC procedures
#
# the prepare_min.ngc and change_min.ngc are templates - fill in as needed
REMAP=M6   modalgroup=6  prolog=change_prolog   ngc=manual_change  epilog=change_epilog    
# accessible in interp as #<_[section]name>

# start of tool length touchoff probe
[TOOLSENSOR]
# Control probe rappid feed
RAPID_FEED = 600
X = 10
Y = 10  
Z = 10
MAXPROBE=-10   # abort change if no toolsensor contact after this probe distance
PROBEFEED=50

# this is not named TOOL_CHANGE_POSITION  on purpose - canon uses it and will
# interfere
[CHANGE_POSITION]
X = 10
Y = 20
Z = 30

# motion.digital-in/out-NN pins
[PINS]
CHANGE = 0  # motion.digital-out-00
PROBING = 1 # motion.digital-out-01
ENABLE = 2  # motion.digital-out-02

CHANGED = 0 # motion.digital-in-00
REFTOOL = 1 # motion.digital-in-01

TOOLNO = 0  # motion.analog-out-00
REFLEN = 1  # motion.analog-out-01
CURRLEN = 2  # motion.analog-out-02

[DWELL]
ACK_SECS=120 # timeout the change after 2 minutes

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

[HAL]
HALFILE = BF20.hal
HALFILE = custom.hal
HALFILE = xhc-hb04.tcl
HALFILE = monitor_xhc-hb04.tcl
HALFILE = manualtoolchange.hal
#POSTGUI_HALFILE= gladevcp.hal
POSTGUI_HALFILE = custom_postgui.hal
HALUI = halui

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 2.50
MAX_VELOCITY = 25.00

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
#TOOL_CHANGE_POSITION = 0 103 270
#TOOL_CHANGE_QUILL_UP = 0

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 23.75
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = -800.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -0.001
MAX_LIMIT = 420.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -15.000000
HOME_LATCH_VEL = 0.625000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

[AXIS_1]
TYPE = LINEAR
HOME = 110.0
MAX_VELOCITY = 23.75
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = -800.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 0.0
MAX_LIMIT = 110.001
HOME_OFFSET = 110.000000
HOME_SEARCH_VEL = 15.000000
HOME_LATCH_VEL = -0.625000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

[AXIS_2]
TYPE = LINEAR
HOME = 275.0
MAX_VELOCITY = 23.75
MAX_ACCELERATION = 250.0
STEPGEN_MAXACCEL = 312.5
SCALE = -800.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 0.0
MAX_LIMIT = 275.001
HOME_OFFSET = 275.000000
HOME_SEARCH_VEL = 15.000000
HOME_LATCH_VEL = -0.625000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0
Ia am a beginner on this and any pointers are appreciated.

Thanks,
/Chris
LinuxCNC 2.6.8
Last edit: 12 Jul 2015 23:30 by cahlfors.

Please Log in or Create an account to join the conversation.

More
12 Jul 2015 23:53 #60592 by andypugh
I think that the problem is that the EMBED_TAB_COMMAND that loads your probe screen is trying to use the same component name ("gladevcp") as the auto-touch-off gladevcp panel.

You need to give the two different gladevcp items different component names (and then your HAL needs to use those component names correctly to refer to the HAL pins (if any) created by the panels)

www.linuxcnc.org/docs/html/man/man9/gladevcp.9.html

sort-of explains what the various parts of the invocation do. (though there appears to be some issues with the formatting)
The following user(s) said Thank You: cahlfors

Please Log in or Create an account to join the conversation.

More
13 Jul 2015 01:47 #60596 by cahlfors
Thank you!

Indeed - changing the names resolved things and LinuxCNC now starts again.

I can now move on to the next challenge to set up the pins and make sure they work as intended and all the other stuff.

I guess this is the sort of thing that happens when I just blindly copy things I "do not fully understand" (= don't have a clue...).

Thanks also for the pointer to the docs - makes for a bit of learning!

/Chris

Please Log in or Create an account to join the conversation.

More
18 Jul 2015 02:19 - 18 Jul 2015 02:26 #60705 by cahlfors
Moving slowly forward.

With the following .ini file, I am able to get the glade panel appear, but everything in it is grayed out and there is no sign of life. The glade pins also seem dead (in HAL meter) when executing an ngc file with tool change.
# Generated by stepconf 1.1 at Sun Jan 25 16:23:08 2015
# If you make changes to this file, they will be
# overwritten when you run stepconf again

[XHC_HB04_CONFIG]
# specify layout = n for xhc-hb04-layout{n}.cfg files
layout = 2
# coords: specify 4 letters
# coords: switch labels are xyza but any unique 4 letters
#         from the set {xyxabcuvw) can be used (if the coord exists)
coords = x y z
# lowpass settings:
# coef: slows rate of change of output,  range: 0 < coef < 1
coefs = 1 1 1 1
# scale plus or minus, rotaries may require larger scale factor:
scales = 1 -1 1 1
# jogmode normal(default) or vnormal or plus-minus
jogmode = normal
# sequence 1: 0.001,0.010,0.100,1.000 (mm-based machine)
# sequence 2: 0.001,0.005,0.010,0.020 (inch-based machine)
sequence = 1
# require_pendant = no: create xhc-hb04 hal pins when pendant not connecte
#                       at startup
require_pendant = yes

[XHC_HB04_BUTTONS]
# use button names according to layout file xhc-hb04-layout{n}.cfg
# note: "start-pause" is connected for standard behavior
#        controlling halui.pause/halui.resume/halui.run
# these are examples, edit as required:

goto-zero   = halui.mdi-command-00
# syntheized per-axis buttons for goto-zero button:
goto-zero-x = ""
goto-zero-y = ""
goto-zero-z = ""
goto-zero-a = ""

start-pause = std_start_pause
rewind      = halui.program.step
# probe-input for simulating a probe:
#probe-z     = motion.probe-input
macro-3     = halui.mdi-command-03

half        = halui.spindle.stop
# synthesized per-axis buttons for half button:
half-x      = ""
half-y      = ""
half-z      = ""
half-a      = ""

zero        = ""
# synthesized per-axis buttons for zero button:
zero-x      = halui.mdi-command-12
zero-y      = halui.mdi-command-13
zero-z      = halui.mdi-command-14
zero-a      = halui.mdi-command-15

safe-z      = halui.mdi-command-10
# in this sim, home-all only works first time, hold down till finished:
home        = halui.home-all
macro-1     = halui.mdi-command-01
macro-2     = halui.mdi-command-02
spindle     = halui.spindle.start
step        = xhc-hb04.stepsize-up
mode        = ""
macro-6     = halui.mdi-command-06
macro-7     = halui.mdi-command-07
stop        = halui.program.stop
reset       = halui.estop.activate

[HALUI]
# these are examples, edit as required:
# a halui hal pin is created for each MDI_COMMAND below
# halui.mdi-command-00, halui.mdi-command-01,... etc
MDI_COMMAND=G0 X0 Y0
MDI_COMMAND=(debug, example: mdi-01)
MDI_COMMAND=(debug, example: mdi-02)
#03 M110: clears notifications
MDI_COMMAND=M110
MDI_COMMAND=(debug, example: mdi-04)
MDI_COMMAND=(debug, example: mdi-05)
MDI_COMMAND=(debug, example: mdi-06)
#07 M101: example print to stdout
MDI_COMMAND=M101
MDI_COMMAND=(debug, example: mdi-08)
MDI_COMMAND=(debug, example: mdi-09)
MDI_COMMAND=(debug, example: mdi-10)
MDI_COMMAND=(debug, example: mdi-11)
#12
MDI_COMMAND= G10 L20 P0 X0
#13
MDI_COMMAND= G10 L20 P0 Y0
#14
MDI_COMMAND= G10 L20 P0 Z0
#15
MDI_COMMAND= G10 L20 P0 C0

[EMC]
MACHINE = BF20
DEBUG = 0

[DISPLAY]
DISPLAY = axis
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.0
DEFAULT_LINEAR_VELOCITY = 2.50
MIN_LINEAR_VELOCITY = 0
MAX_LINEAR_VELOCITY = 25.00
INTRO_GRAPHIC = linuxcnc.gif
INTRO_TIME = 5
PROGRAM_PREFIX = /home/familjen/linuxcnc/nc_files
INCREMENTS = 5mm 1mm .5mm .1mm .05mm .01mm .005mm
PYVCP = custompanel.xml
GLADEVCP=-c gladevcp -u python/gladevcp-handler.py manualtoolchange.ui
#EMBED_TAB_NAME=Probe Screen 
#EMBED_TAB_COMMAND=halcmd loadusr -Wn gladevcp gladevcp -c gladevcpprobe -u python/probe_screen.py -x {XID} probe_icons/probe_screen.glade 

# Path to help file
HELP_FILE =             doc/help.txt

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

[TASK]
TASK = milltask
CYCLE_TIME = 0.010

# the Python plugins serves interpreter and task
[PYTHON]
# where to find Python code
# code specific for this configuration  
PATH_PREPEND=./python
# generic support code
PATH_APPEND=../../nc_files/remap_lib/python-stdglue

# import the following Python module
TOPLEVEL=python/toplevel.py

# the higher the more verbose tracing of the Python plugin
LOG_LEVEL = 0

[RS274NGC]
PARAMETER_FILE = linuxcnc.var
SUBROUTINE_PATH   = nc_subroutines:../../nc_files/remap_lib/common_nc_subs:../../nc_files/ngcgui_lib:../../nc_files/ngcgui_lib/utilitysubs:../../nc_files/macros
#SUBROUTINE_PATH   = ../../nc_files/ngcgui_lib:../../nc_files/ngcgui_lib/utilitysubs:../../nc_files/remap_lib/common_nc_subs:../../nc_files/macros
# for demo of M110:
USER_M_PATH       = ../../nc_files/ngcgui_lib/mfiles
FEATURES=30
ON_ABORT_COMMAND = O <on_abort> call 

#
# ------ remapping toolchange - related codes ----------------------
#
# see python/remap.py for the prolog and epilog handlers
# see nc_files/remap-subroutines for the NGC procedures
#
# the prepare_min.ngc and change_min.ngc are templates - fill in as needed
#REMAP=M6   modalgroup=6  prolog=change_prolog   ngc=manual_change  epilog=change_epilog    
# accessible in interp as #<_[section]name>

# start of tool length touchoff probe
[TOOLSENSOR]
# Control probe rappid feed
RAPID_FEED = 600
X = 0
Y = 102  
Z = 100
MAXPROBE=-10   # abort change if no toolsensor contact after this probe distance
PROBEFEED=50

# this is not named TOOL_CHANGE_POSITION  on purpose - canon uses it and will
# interfere
[CHANGE_POSITION]
X = 0
Y = 102
Z = 275

# motion.digital-in/out-NN pins
[PINS]
CHANGE = 0  # motion.digital-out-00
PROBING = 1 # motion.digital-out-01
ENABLE = 2  # motion.digital-out-02

CHANGED = 0 # motion.digital-in-00
REFTOOL = 1 # motion.digital-in-01

TOOLNO = 0  # motion.analog-out-00
REFLEN = 1  # motion.analog-out-01
CURRLEN = 2  # motion.analog-out-02

[DWELL]
ACK_SECS=20 # timeout the change after 2 minutes

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

[HAL]
HALUI = halui
HALFILE = BF20.hal
HALFILE = custom.hal
HALFILE = xhc-hb04.tcl
HALFILE = monitor_xhc-hb04.tcl
HALFILE = manualtoolchange.hal
POSTGUI_HALFILE = gladevcp.hal
POSTGUI_HALFILE = custom_postgui.hal

[TRAJ]
AXES = 3
COORDINATES = X Y Z
LINEAR_UNITS = mm
ANGULAR_UNITS = degree
CYCLE_TIME = 0.010
DEFAULT_VELOCITY = 2.50
MAX_VELOCITY = 25.00

[EMCIO]
EMCIO = io
CYCLE_TIME = 0.100
TOOL_TABLE = tool.tbl
#TOOL_CHANGE_AT_G30 = 0
#TOOL_CHANGE_POSITION = 0 103 270
#TOOL_CHANGE_QUILL_UP = 0

[AXIS_0]
TYPE = LINEAR
HOME = 0.0
MAX_VELOCITY = 23.75
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = -800.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = -0.001
MAX_LIMIT = 420.0
HOME_OFFSET = 0.000000
HOME_SEARCH_VEL = -15.000000
HOME_LATCH_VEL = 0.625000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

[AXIS_1]
TYPE = LINEAR
HOME = 110.0
MAX_VELOCITY = 23.75
MAX_ACCELERATION = 750.0
STEPGEN_MAXACCEL = 937.5
SCALE = -800.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 0.0
MAX_LIMIT = 110.001
HOME_OFFSET = 110.000000
HOME_SEARCH_VEL = 15.000000
HOME_LATCH_VEL = -0.625000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 1

[AXIS_2]
TYPE = LINEAR
HOME = 275.0
MAX_VELOCITY = 23.75
MAX_ACCELERATION = 250.0
STEPGEN_MAXACCEL = 312.5
SCALE = -800.0
FERROR = 1
MIN_FERROR = .25
MIN_LIMIT = 0.0
MAX_LIMIT = 275.001
HOME_OFFSET = 275.000000
HOME_SEARCH_VEL = 15.000000
HOME_LATCH_VEL = -0.625000
HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 0

The remap line is commented:
#REMAP=M6 modalgroup=6 prolog=change_prolog ngc=manual_change epilog=change_epilog

If I uncomment it, I get an error when opening an ngc file:

G-code error in file.ngc
near line 0 of /home/.../file.ngc:
BUG: remap_level < 0 : -1


Trying to follow the example in:
git.linuxcnc.org/gitweb?p=linuxcnc.git;a...c855b8396b0d5a116f72

Any ideas why the glade gui and pins are dead and why the remap statement produces an error?

Thanks for any help!

/Chris
Last edit: 18 Jul 2015 02:26 by cahlfors.

Please Log in or Create an account to join the conversation.

More
23 Jul 2015 18:56 #60853 by cahlfors
It appears that the remap line does not work. If I execute the code in the manual_change.ngc manually in the MDI tab in the GUI (command by command), the Glade panel gets activated and things start to happen. But with the remap statement uncommented, all that happens on an M6 is that the window header changes to manual_change.ngc, but no code ever gets executed - it just hangs there. I suspect this applies to the change_prolog.py as well. Any Python code that has ever been executed on my system, also creates a corresponding *.pyc file as well. This has not happend to change_prolog, so hence my guess it does not get called.

Ideas anyone?

/Chris

Please Log in or Create an account to join the conversation.

More
23 Jul 2015 22:47 #60862 by andypugh
Do you have a remap.py ?

Please Log in or Create an account to join the conversation.

Time to create page: 0.171 seconds
Powered by Kunena Forum