Toolchanger plugin

This is where you talk about Plugins. How they are made and how they work, show examples.

Toolchanger plugin

Postby rocketbob » Mon Jan 15, 2018 2:23 pm


I'm in the process of gutting a Heidenhain control off my BP412 that has a toolchanger.

Does anyone have any examples I could start with? I've got two other mills running Mach3 and have seen several examples in VBA. Its straightforward and I'm a software engineer so C# so that part isn't a huge challenge for me.

On my BP412 the old Fanuc spindle control has a spindle index function. The tangs of the spindle have to rotate to the toolchange position for the tangs of the tools to line up when the carousel is moved into position. There's already an encoder on the spindle for this purpose, but I'm not sure yet if its a quadrature encoder. Might have to change it out for something modern. Along this vein my question is how does one control the spindle with a macro with uccnc while it runs normally under PID control? In Mach it looks like the spindle is switched to be another axis to index it, the toolchange is done, then the spindle axis flipped back to operate as a spindle. I assume the same idea is how its done with uccnc?

Posts: 2
Joined: Sat Jan 13, 2018 4:30 pm

Re: Toolchanger plugin

Postby cncdrive » Mon Jan 15, 2018 9:11 pm

Take a look at the M6 macro which installs with the UCCNC, that is an example tool changer code for a linear toolchanger.
In my opinion it is a good starting point to use that code, it could be easily modified to fit any other type of toolchangers.

How you can control the spindle to position it for the toolchanger depends on how the spindle is controlled?
If it is controlled with step/dir then you could programmatically change pin number on the spindle setup page, then call the apply settings button code to apply the settings and then control the axis as a positioning axis and finally change the pins back.
Changing the pins you can use the Setfield and Validatefield functions to write the DROs on the screen.
Take a look at the html documents in the UCCNC/Documentation folder for some more detailed info on the macro and screen functions.
You can also look up Robertspark on the forum, he has an even better organised documentation of these, you can find a link to that in the forum signature of Rob, just search one of his posts on the forum...
Site Admin
Posts: 1612
Joined: Tue Aug 12, 2014 11:17 pm

Re: Toolchanger plugin

Postby Vmax549 » Tue Jan 16, 2018 3:28 am

It is ALL dependant on HOW the machine does the functions now.

What mechanism rotates teh tool changer? DC motor ? indexing device ?? Geneva drive ??

What drives the spindle servo, VFD, VFD/encoder

How does the spindle index ?? encoder , shotpin ??

It really all depends , (;-) TP
Posts: 740
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Toolchanger plugin

Postby rocketbob » Tue Jan 16, 2018 8:46 pm

Ok thanks will check those macros out.

Fanuc spindle drive controls the spindle. There is an input to set it to index mode, which spins the spindle shaft until the spindle nose dogs are lined up for a toolchange. A parameter in the drive sets the index position, based on feedback from a belt driven encoder. I want to remove the Fanuc drive, and will possibly replace the 7hp spindle motor as well. VFD's in that HP range with encoder feedback are pretty salty. Some can even handle the spindle index.

I'm thinking seriously about replacing the spindle motor with a 4.25hp DC treadmill motor, which should be plenty for my needs, along with an encoder and servo board to drive it. The power that the existing 7hp three phase AC motor requires is beyond what the building is wired for.

Toolchanger: A single-phase AC motor controls the carousel. There are two proximity sensors on the carousel. One for tool #1, and one for whenever a tool station is in and indexed position. The entire carousel has an air cylinder which moves the carousel in and out, and limit switches on both ends, to move it into position under the spindle when the Z axis is homed.

Posts: 2
Joined: Sat Jan 13, 2018 4:30 pm

Return to Plugins

Who is online

Users browsing this forum: No registered users and 3 guests