In the hal file these are the signals needed for spindle orient Some signals are here for normal spindle operation loadrt and addf commands not shown here. Don't forget them though net spindle-pos hm2_[HOSTMOT2](BOARD).0.encoder.01.position => near.1.in1 orient.0.position pid.1.feedback motion.spindle-revs net spindle-velocity hm2_[HOSTMOT2](BOARD).0.encoder.01.velocity => near.0.in2 scale.0.in motion.spindle-speed-in net velocity-mode motion.spindle-on => or2.3.in0 pid.0.enable net spindle-vel-cmd motion.spindle-speed-out => abs.0.in pid.0.command net spindle-angle motion.spindle-orient-angle => orient.0.angle # ORIENT_OFFSET value in ini normally 0 net orient-mode motion.spindle-orient => orient.0.enable pid.1.enable mux2.0.sel or2.3.in1 net spindle-pos-cmd orient.0.command => pid.1.command near.1.in2 ##in vismach net spindle-abs scale.0.out => abs.1.in pid.0.feedback net spindle-vel-pid pid.0.output => mux2.0.in0 net spindle-pos-pid pid.1.output => mux2.0.in1 net spindle-cmd mux2.0.out => abs.2.in net spindle-cmd-abs abs.2.out => hm2_[HOSTMOT2](BOARD).0.pwmgen.00.value net spindle-orient-fwd abs.2.is-positive => or2.2.in1 net spindle-fwd abs.0.is-positive => or2.2.in0 net spindle-dir or2.2.out => timedelay.0.in # the delay is so my directon relay switches during my spindle driver inhibit time net relay-delay timedelay.0.out => hm2_[HOSTMOT2](BOARD).0.gpio.017.out # Direction relay setp near.1.difference 0.5 # this was set high for testing net spindle-pos hm2_[HOSTMOT2](BOARD).0.encoder.01.position => near.1.in1 orient.0.position pid.1.feedback motion.spindle-revs net spindle-pos-cmd orient.0.command => pid.1.command near.1.in2 ##in vismach setp edge.5.both 0 setp edge.5.in-edge 0 setp edge.5.out-width-ns 50000000 net spindle-in-pos-raw near.1.out edge.5.in #not needed v2.8+, use orient.0.is-oriented net spindle-in-pos edge.5.out motion.spindle-is-oriented # this will set the motion.spindle-locked bit you can use to initiate the rest of the carousel commands Before i added the REMAP line in the ini file, i tested the orient command using MDI input: M19 R0 P1 and varied the angle to make sure it was turning In the ini file i added the following: [RS274NGC] SUBROUTINE_PATH = /home/tom/linuxcnc/nc_files/:/home/tom/linuxcnc/nc_files/ngcgui_lib/:/home/tom/linuxcnc/nc_files/ngcgui_lib/utilitysubs/ REMAP=M6 modalgroup=6 prolog=change_prolog ngc=change epilog=change_epilog ORIENT_OFFSET = 0 and add the python section as shown [PYTHON] TOPLEVEL=./toplevel.py PATH_APPEND= ./ PATH_APPEND= ../../nc_files/remap_lib/python-stdglue/ The files: due to a hdd crash, i don't have all the sim files so i pulled examples from /master/ in my /home/tom/linuxcnc/nc_files directory i added: change.ngc which i copied from /master/nc_files/remap-subroutines/ to my nc_files directory toolchange.ngc is a more complete example of a working tool changer found in /master/configs/sim/axis/vismach/VMC_toolchange remap.py and toplevel.py are also in that directory as well as in: /master/configs/sim/axis/remap/rack-toolchange/python their contents may vary. i didn't check i put these in my 'root' config directory: /home/tom/linuxcnc/configs/Sherline/ stdglue.py was found in /master/configs/sim/axis/nc_files/remap_lib/python-stdglue which i copied the whold remap_lib to my nc_files directory if you want to use the carousel comp instead of the toolchange.ngc file above an example of the carousel comp can be found in /master/configs/sim/axis/vismach/VMC-toolchange toolchange_index.hal in the example it is triggered by motion.digital-out-00 but could be remapped to trigger off the motion.spindle-locked signal after orient is done