Hi Peter,
I have recently done similar to a Busellato (which seems to be similar to the Biesse), that has 3 spindles and ganged drills.
All credit goes to Bob (Mr bevins) who shared his config, which I managed to copy and modify to suit my machine - if he hadn't done that, I might still be trying to figure it out! So I'd like to repay the favour, and try provide the bits that make it work.
First, modify your
machine.ini file RS274NGC parameter:
Code:
[RS274NGC]
PARAMETER_FILE = linuxcnc.var
USER_M_PATH = nc_subroutines
SUBROUTINE_PATH = nc_subroutines:../../nc_files/remap_lib/common_nc_subs
ON_ABORT_COMMAND = O <on_abort> call
REMAP= M6 modalgroup=6 prolog=change_prolog ngc=tool_change epilog=change_epilog
REMAP= M200 modalgroup=10 ngc=m200 #raise all tools
I have my /nc_subroutines folder in the same directory as the
.ini file, and in that folder are the
tool_change.ngc and
m200.ngc files.
From memory, the prolog and epilog are derived from the Python std-glue routines, and are referenced as:
Code:
[PYTHON]
PATH_PREPEND= ./python
PATH_APPEND= ../../nc_files/remap_lib/python-stdglue
TOPLEVEL= python/toplevel.py
(
toplevel.py is in the config /python folder but only contains the line "import remap" in my case -
remap.py is in the same folder.)
Next, the HAL connections are made between the physical output pins and the motion.digital output pins, which are the pins accessed by the M64 and M65 G-codes in the subroutines. In my case, I added this to
custom.hal, along with other stuff:
Code:
### Drill Tools ###
net drillmotor_on hm2_5i25.0.7i77.0.0.output-03 motion.digital-out-00
net drill01drop hm2_5i25.0.7i71.0.2.output-00 motion.digital-out-01
net drill02drop hm2_5i25.0.7i71.0.2.output-01 motion.digital-out-02
net drill03drop hm2_5i25.0.7i71.0.2.output-02 motion.digital-out-03
net drill04drop hm2_5i25.0.7i71.0.2.output-03 motion.digital-out-04
net drill05drop hm2_5i25.0.7i71.0.2.output-04 motion.digital-out-05
net drill06drop hm2_5i25.0.7i71.0.2.output-05 motion.digital-out-06
net drill07drop hm2_5i25.0.7i71.0.2.output-06 motion.digital-out-07
net drill08drop hm2_5i25.0.7i71.0.2.output-07 motion.digital-out-08
net drill09drop hm2_5i25.0.7i71.0.2.output-08 motion.digital-out-09
net drill10drop hm2_5i25.0.7i71.0.2.output-09 motion.digital-out-10
net drill11drop hm2_5i25.0.7i71.0.2.output-10 motion.digital-out-11
net drill12drop hm2_5i25.0.7i71.0.2.output-11 motion.digital-out-12
net drill13drop hm2_5i25.0.7i71.0.2.output-12 motion.digital-out-13
net drill14drop hm2_5i25.0.7i71.0.2.output-13 motion.digital-out-14
net drill15drop hm2_5i25.0.7i71.0.2.output-14 motion.digital-out-15
net drill16drop hm2_5i25.0.7i71.0.2.output-15 motion.digital-out-16
### Spindle Tools ###
# --- SPINDLE-AT-SPEED ---
net spindle-at-speed motion.digital-in-22 <= hm2_5i25.0.7i77.0.0.input-22
net spindle-at-zero motion.digital-in-21 <= hm2_5i25.0.7i77.0.0.input-21
net spindle20relay hm2_5i25.0.7i77.0.0.output-00 motion.digital-out-17
net spindle21relay hm2_5i25.0.7i77.0.0.output-01 motion.digital-out-18
net spindle22relay hm2_5i25.0.7i77.0.0.output-02 motion.digital-out-19
net spindle20drop hm2_5i25.0.7i77.0.0.output-05 motion.digital-out-20
net spindle21drop hm2_5i25.0.7i77.0.0.output-06 motion.digital-out-21
net spindle22drop hm2_5i25.0.7i77.0.0.output-07 motion.digital-out-22
I have attached my
tool_change.ngc (derived from included examples
manual_toolchange.ngc) and
m200.ngc (copied directly from Bob!) files for reference. Also in the /nc_subroutines folder are
restore.ngc and
on_abort.ngc, copied from the manual_toolchange examples, and on_abort is modifed to include M200 (raise all tools).
As Bob has said, the only modification to the post-processor is to add M200 before the M2 - not even strictly necessary as it will be done on the next run, but does tidy up the machine state.
I hope this helps, and that I haven't missed anything.