Tool changer with "binary" input

21 Dec 2018 07:03 #122676 by eriksalo
Hi; I have a VMC with a 20 position tool changer. Trying to understand how to make this work with LinuxCNC.

My questions are:

1) Where to start? I see Andy Pugh's Vismach Tool Changer that looks close and also a Triac toolchanger that looks close.

2) The tool changer has six "bits" or sensors. I have them wired to inputs an can see them in HAL
One of the senors actuates every time the changer achieves a new tool position
The remaining five "bits" are binary for which tool is in position (e.g. 00001=T1, 00010=T2, 00011=T3, 00100=T4, etc)

How do I deal with that in LinuxCNC?


21 Dec 2018 11:34 - 21 Dec 2018 11:40 #122686 by billykid
Hi, I did something similar for a friend of mine who has a turret with 12 tools.
with the help of the forum we managed to control the change.
place the hal section so you can see the components we used.

loadrt bitslice count=1 personality=4
loadrt conv_s32_u32 count=1
loadrt timedelay count=4
# ---segnali cambio utensile manuale per ucn ---

setp timedelay.0.on-delay 0.1
setp 0.1
setp oneshot.0.width 0.5
setp oneshot.0.retriggerable 0
setp oneshot.0.rising 1
setp oneshot.1.width 0.5
setp oneshot.1.retriggerable 0
setp oneshot.1.rising 1
net cambiato hm2_5i22.0.gpio.073.in_not
net cambiato =>
net cambio-fault hm2_5i22.0.gpio.087.in_not
net toolnumber iocontrol.0.tool-prep-number =>
net unsigned-toolnumber conv-s32-u32.0.out =>
net tool-change-request iocontrol.0.tool-change =>
net delay0_sig timedelay.0.out =>
net delay0_sig timedelay.0.out => hm2_5i22.0.gpio.041.out
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
net tool-change-confirmed iocontrol.0.tool-changed <= oneshot.0.out
net bit0 bitslice.0.out-00 => hm2_5i22.0.gpio.042.out
net bit1 bitslice.0.out-01 => hm2_5i22.0.gpio.043.out
net bit2 bitslice.0.out-02 => hm2_5i22.0.gpio.044.out
net bit3 bitslice.0.out-03 => hm2_5i22.0.gpio.045.out
Last edit: 21 Dec 2018 11:40 by billykid.
21 Dec 2018 19:32 #122716 by Henk
Look at carousel component. I used it for a 30 atc. A very handy compoment for most tool carousels and turrets.
23 Dec 2018 19:48 #122793 by andypugh
The Carousel component should be able to handle this for you.

You will need the version from "master" as that adds a strobe (and parity) input, and it sounds like you need the strobe.

As it is just a ".comp" file the updated version can be easily added to a 2.7 installation.
23 Dec 2018 21:10 #122798 by eriksalo
Thanks for your replies:

I'm having trouble with the basic structure of how to do this.

For context, the carousel is all hydraulic (Rotate CW/CCW - Fast/Slow, Move to spindle fast/slow) and has a locking pin (up/down), Tool clamp (on/off), air blast. The spindle/Zaxis has to move up and down during the tool change.

I think my steps are to:

1) Re-map an M6 command into something (an o sub routine?) I don't think classic ladder can work since the z axis needs to move. Use the o subroutine to move the z axis up, tell carousel to select correct tool, move carousel in, check the sensors, air blast, clamp, etc, etc.

2) Create a .hal file for the carousel component and define all the in's and out's and then . (Where do I deal with the carousel lock, here?)

Somewhere, I need to be able to tune the timing of the motors rotating the carousel so that they line up right at the point where the lock can engage.

Overall, I've found LinuxCNC 100% solid as a rock. That said, for me it's been incredibly difficult to use, seems every feature I add takes me 10x longer than it should. Once done, the solution was always really simple!

Thanks; Erik
23 Dec 2018 22:05 #122800 by andypugh
I suggest starting with a G-code subroutine (probably looking a lot like the one in the VMC_toolchange sims) to move the axes and perform the sequence.
An M6 command in that subroutine will trigger the tool-change pin and send the required pocket number to the carousel component.
The carousel component will control the motor directions, and then can tell LinuxCNC to carry on through the "iocontrol.0.tool-changed" pin, and then the G-code subroutine can can handle the rest of the sequence.

Get the subroutine working first, only re-map the M6 command to call it at a later stage, when it appears to work.
23 Dec 2018 22:18 #122804 by eriksalo
Andy, thanks!
30 Dec 2018 05:57 #123132 by eriksalo
OK, so I have carousel working (nearly) just great!

Like everything for me with LinuxCNC, it was really hard to get started and figure out all the contextual things I didn't understand. And like everything, once done I see how completely simple it was.

Carousel selects the correct tool for me every time, moving forward when that's closer and reverse when that way is closer.

The only thing I have left to do is I need to get the carousel to stop in a slightly different position. It stops when it sees the strobe bit and the correct binary sequence but It either rotates a bit too far or not quite far enough... it's off about half the diameter of the ~1" diameter locking pin.

Any suggestions how I can add a small adjustment / correction factor to carousel's motion?

Thanks; Erik
30 Dec 2018 10:24 #123138 by andypugh

eriksalo wrote: Any suggestions how I can add a small adjustment / correction factor to carousel's motion?

Does it consistently go too far, or not far enough?
Is the pin pneumatic / solenoid such that you could operate the pin then give the motor a pulse?
30 Dec 2018 21:43 - 30 Dec 2018 21:44 #123172 by eriksalo
It goes about 1/2" too far (a bit less than 10 degrees of rotation) when going forward and about 1/4" not far enough when going reverse.

I could set carousel to only go 1 direction and then do a short reverse like a ratchet changer

All of the carousel motors are hydraulic driven by relays. The pin comes down with a fair amount of force, enough that the carousel can not rotate when the pin is partially extended pressing against the carousel but not engaged in the hole.
Last edit: 30 Dec 2018 21:44 by eriksalo.
Time to create page: 0.087 seconds
Powered by Kunena Forum