sspeed33317 wrote: I have a question, I have two tool changers, a side arm and a carousel, the carousel is on the machine now and
is a geneva wheel... In order to make the geneva into a rotary axis i was wondering if i could refit the geneva motor with a servo
and rotary encoder instead of using a grey code on the carousel wheel itself. Effectively turning the carousel into a rotary axis.
You could, but there shouldn't be any need.
The "carousel" HAL component that I have written should operate most forms of carousel without hardware modifications.
Have you tried looking at the files in my sample configuration? There are a few parts to it that need to fit together.
1) The "carousel" HAL component. "sudo comp --install --install-docs carousel.comp" should install that. Then it is available for use if you want to.
2) Add an extra few digital IO lines for G-code, change one line in the HAL file. This change is safe:
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
num_dio=6
3) Put the toplevel.py and remap.py files in your config directory. (You can do this without anything breaking)
4) Get the carousel control HAL file working with your carousel. You should be able to add a the (short) toolchange.hal file to your INI file [HAL] section. You probably need to change the number of pockets etc to suit your machine.
You should then be able to move the carousel from MDI with M68 E0 Q{pocket number} followed by M64 P0 to start the carousel and M65 P0 to stop it.
4) Get the toolchange.ngc G-code routine working on your machine. You can set the G-code parameters #<tool-in_spindle>, #<selected_tool> and #<selected_pocket> in MDI then call O<toolchange>CALL.
Various switches need to be wired up in HAL to move actuators and sense positions. look in toolchange.hal to see what the tol change routine is expecting. As an example the signal for moving the carousel in to the spindle is
net arm-act motion.digital-out-02 so if that was a parallel port output 17 you would add
net arm-act parport.0.pin-17-out to that HAL file.
5) Once the G-code routine is working you can re-map the M6 command to run the tool change G-code routine. First some extra items in the INI file [RS274NGC] and section and either a new [PYTHON] section or modifications to the existing [PYTHON] section
Code:
[RS274NGC]
PARAMETER_FILE = vmc.var
SUBROUTINE_PATH = ./
REMAP=M6 modalgroup=6 prolog=change_prolog ngc=toolchange epilog=change_epilog
[PYTHON]
TOPLEVEL=./toplevel.py
PATH_APPEND= ./
PATH_APPEND= /usr/share/linuxcnc/ncfiles/remap_lib/python-stdglue/
4) Put the toplevel.py and remap.py files in your config directory.
And that should be it.
Do you need spindle alignment too?