Tool changer
- Salrodri
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 2
22 Apr 2025 03:11 #326866
by Salrodri
Tool changer was created by Salrodri
Hello,
Could you please help me with my tool changer, my machine is cnc endmill emco 55 pcmill. I am using Carousel Component with counts mode, since I have a stepper motor on the tool changer.I also have a sensor that connected to sens-0 (index)at this point I can move and home the car, I can also do the tool changes.the last thing that I need to do is move the carousel back home once the tool has been changed. How can I move the car back to home with a subroutine?My tool changer does not have an arm that I can control.
Thank you,
Could you please help me with my tool changer, my machine is cnc endmill emco 55 pcmill. I am using Carousel Component with counts mode, since I have a stepper motor on the tool changer.I also have a sensor that connected to sens-0 (index)at this point I can move and home the car, I can also do the tool changes.the last thing that I need to do is move the carousel back home once the tool has been changed. How can I move the car back to home with a subroutine?My tool changer does not have an arm that I can control.
Thank you,
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
Less
More
- Posts: 23320
- Thank you received: 4947
23 Apr 2025 19:23 #326976
by andypugh
Replied by andypugh on topic Tool changer
Well, one thing I can tell you is that I never imagined that a toolchanger like that existed when I created the carousel component 
It's a neat idea, actually, I quite like the design.
You could maybe set the carousel.0.rev-pulse to some value, but to be honest I don't think that would work properly, as it assumes that the motor is allowed to slip against a hard stop, and that's not going to work in counts mode.
I think that one way to do what you want would be to add a mux2 to switch the velocity command.
Change
Then set up (and tune) the PID to park the changer and hold it there.
A better option might be to modify the carousel.comp to add an extra park state in the state machine. Do you have any familiarity with C code?

It's a neat idea, actually, I quite like the design.
You could maybe set the carousel.0.rev-pulse to some value, but to be honest I don't think that would work properly, as it assumes that the motor is allowed to slip against a hard stop, and that's not going to work in counts mode.
I think that one way to do what you want would be to add a mux2 to switch the velocity command.
Change
net car-vel carousel.0.motor-vel => hm2_[MESA](BOARD).0.stepgen.03.velocity-cmd
loadrt mux2
loadrt pid
...
net car-vel carousel.0.motor-vel => mux2.0.in1
net park-vel pid.0.out => mux2.0.in0
net switched-vel mux2.0.out => hm2_[MESA](BOARD).0.stepgen.03.velocity-cmd
net car-enable mux2.0.sel
Then set up (and tune) the PID to park the changer and hold it there.
A better option might be to modify the carousel.comp to add an extra park state in the state machine. Do you have any familiarity with C code?
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
Less
More
- Posts: 23320
- Thank you received: 4947
23 Apr 2025 19:25 #326977
by andypugh
Replied by andypugh on topic Tool changer
Alternatively this might be one case where it makes sense to define the toolchanger as an axis and drive it from pure G-code.
Please Log in or Create an account to join the conversation.
- Salrodri
- Offline
- New Member
-
Less
More
- Posts: 2
- Thank you received: 2
23 Apr 2025 20:22 #326979
by Salrodri
Replied by Salrodri on topic Tool changer
Hi Andy,
I have been working on this ATC over 3 moths now. So far I released the magic smoke of two mesa cards, but the retrofit must continue.
Thank you for creating this component, It has tough me a lot in regards how linuxcnc and a CNC machine works.
It does makes more sense driving the ATC with G-code.
I discarded this idea, because you mention that carousel component was not designed to be used as an axis.
I guess we can scratch that lol
How would you go about it driving the ATC with G-code?
would you have a bunch of if statements?
for example:
if M6T1 then G53 G0 A2 (and the rest of the operations)
if M6T2 then G53 G0 A3 (and the rest of the operations)
Would I have to update the iocontrol with G-code every time the tool changes?
I have a lot of respect and admiration of your work.
is truly an honor that you respond to my question.
Thank you,
I have been working on this ATC over 3 moths now. So far I released the magic smoke of two mesa cards, but the retrofit must continue.
Thank you for creating this component, It has tough me a lot in regards how linuxcnc and a CNC machine works.
It does makes more sense driving the ATC with G-code.
I discarded this idea, because you mention that carousel component was not designed to be used as an axis.
I guess we can scratch that lol
How would you go about it driving the ATC with G-code?
would you have a bunch of if statements?
for example:
if M6T1 then G53 G0 A2 (and the rest of the operations)
if M6T2 then G53 G0 A3 (and the rest of the operations)
Would I have to update the iocontrol with G-code every time the tool changes?
I have a lot of respect and admiration of your work.
is truly an honor that you respond to my question.
Thank you,
The following user(s) said Thank You: tommylight, Clive S
Please Log in or Create an account to join the conversation.
- andypugh
-
- Away
- Moderator
-
Less
More
- Posts: 23320
- Thank you received: 4947
02 May 2025 20:19 #327543
by andypugh
Replied by andypugh on topic Tool changer
Sorry for the late reply.
To do it all with G-code you would remove the carousel.comp from the system. It's not really helping if you define the changer as an axis.
(Note that you _could_ define the changer as an "extrajoint" if you really wanted to not have a spurious A axis appear in the GUI, but that's a topic for another day).
Your remapped toolchange routine has access to a set of built-in variables:http://linuxcnc.org/docs/stable/html/gcode/overview.html#gcode:predefined-named-parameters
Your routine could use #<_selected_pocket>
So, your toolchamge.ngc would be something like
There is no tool unload in this routine, so it won't work as-is. But is illustrates the idea. It's a lot like the rack-toolchanger example in the sim configs.
To do it all with G-code you would remove the carousel.comp from the system. It's not really helping if you define the changer as an axis.
(Note that you _could_ define the changer as an "extrajoint" if you really wanted to not have a spurious A axis appear in the GUI, but that's a topic for another day).
Your remapped toolchange routine has access to a set of built-in variables:http://linuxcnc.org/docs/stable/html/gcode/overview.html#gcode:predefined-named-parameters
Your routine could use #<_selected_pocket>
So, your toolchamge.ngc would be something like
G0 Z0 ; retract spindle
G1 F20 A#<_selected_pocket> ; Potentially mutiplied by a scaling factor
G1 F100 Z -65 ; Or whatever the tool change position is
M62 P0 ; clamp the tool
M66 P1 ; Wait for tool-clamped signal
G1 F100 Z0 ; retract spindle
G1 F20 A0 ; retract tool changer
There is no tool unload in this routine, so it won't work as-is. But is illustrates the idea. It's a lot like the rack-toolchanger example in the sim configs.
Please Log in or Create an account to join the conversation.
Time to create page: 0.085 seconds