Page 1 of 3

linear tool change macro

PostPosted: Sun Nov 24, 2019 8:20 pm
by tracar
i can not find the macro for the type of tool changer i have,
i have 10 tool holder clips along the x axis with tools in them, you have to position above the needed tool, open chuck , drop on it, close chuck, and pull out on the y axis to get tool.
i have attached this photo , bottom left photo is what i have

Re: linear tool change macro

PostPosted: Sun Nov 24, 2019 11:56 pm
by tracar
http://www.youtube.com/watch?v=w4BDpvg5hdE


similar to this.

if anyone has a m6 macro for this let me know :) thanks

Re: linear tool change macro

PostPosted: Sun Dec 01, 2019 5:01 pm
by tracar
Grrrrrrrrrrrrrrrr, lol i cant believe this does not exist.

Re: linear tool change macro

PostPosted: Sun Dec 01, 2019 6:58 pm
by Vmax549
There is a M6 linear macro included with every copy of UCCNC. ;)

(;-) TP

Re: linear tool change macro

PostPosted: Sun Dec 01, 2019 8:45 pm
by tracar
it will work great if im plucking a tool holder out if a hole,
my maxhine uses clips to hold the toolholder. and has to use motion on the x to clip and unclip

Re: linear tool change macro

PostPosted: Mon Dec 02, 2019 3:20 am
by Vmax549
Please understand that UCCNC is not a machine tool manf. It is a CNC control software / Hardware manf. They cannot include every form of a tool changer as macros. You will have to adapt teh example linear ATC macro to fit teh function of your machine. Just like everyone else has had to do. OR get/pay someone to do it for you.

Just a thought, (;-) TP

Re: linear tool change macro

PostPosted: Mon Dec 02, 2019 10:11 am
by NikolayUA24
Maybe you should look at this option tool change.
https://youtu.be/i5Vgb4ftkHs

Re: linear tool change macro

PostPosted: Mon Dec 02, 2019 8:36 pm
by tracar
im not here knocking the product in any way, i love it!! i have 2 of them :) i also had to ask for help on my first build as i was not proficient in code writing :( Geremy was a massive help and with that i built my first machine,
i have recently upgraded to a larger machine, where i know how to hookup all the pneumatic side, the sensors, and so on, but i do not understand the macro stuff, aside from changing some of the numeric values in them .... this new machine has well have a look at the added link, its the general idea, but 10 tool clips., the standard m6 wont work without a few things added, as to which i have no idea how. that's why im asking here if anyone has something similar and if they can send me a copy of the m6 i can mod to fit

this link is what i need it to do.
https://www.youtube.com/watch?v=bd5a0ky27mM



this is the same as my new machine,
https://www.youtube.com/watch?v=sC2rfyyCM4w

minus the boring head. and the stock ATC

Re: linear tool change macro

PostPosted: Mon Dec 02, 2019 10:40 pm
by Robertspark
USE WITH CAUTION..... I CANNOT TEST IT.....

You need to setup:
int Chuckopenport = 1;
int Chuckopenpin = 16;
double SafeZ = 0; // Safe retract at Z home height (in machine coordinates)
double Ztoolload = -5; // Z tool load and unload (in machine coordinates)
double Xtoolload = 0; // X tool load and unload (in machine coordinates)

The problem is you did not give me the Z co-ordinates that the tool is loaded and unloaded from the tool holder, so I guessed it would be machine co-ordinate (minus) -5 " because I presume that your machine homes to Z=0 at the top of the Z axis travel....... this also provides the Safe Z position..... you could set any of these as another number.


Code: Select all
//Example linear toolchanger code

//Tool positions definition
int Chuckopenport = 1;
int Chuckopenpin = 16;

double[] ToolY = new double[11];

double Xtoolload = 0; // Z tool load and unload (in machine coordinates)

double ToolX = -10; // Tool1 X position

ToolY[0] = 0; // Tool0 Y position
ToolY[1] = 5; // Tool1 Y position
ToolY[2] = 10; // Tool2 Y position
ToolY[3] = 15; // Tool3 Y position
ToolY[4] = 20; // Tool4 Y position
ToolY[5] = 25; // Tool5 Y position
ToolY[6] = 30; // Tool6 Y position
ToolY[7] = 35; // Tool7 Y position
ToolY[8] = 40; // Tool8 Y position
ToolY[9] = 45; // Tool9 Y position
ToolY[10] = 50; // Tool10 Y position

double SafeZ = 0;  // Safe retract at Z home height (in machine coordinates)

double Ztoolload = -5; // Z tool load and unload (in machine coordinates)

int Newtool = exec.Getnewtool();
int Currenttool = exec.Getcurrenttool();

if(Newtool == -1) // If new tool number is -1 means a missing T code, so we need to stop here...
return;

if(Newtool <1 || Newtool >10) // Tool number is out of range, so we need to stop here...
return;

if(Newtool == Currenttool) // Same tool was selected, so do nothing, stop here...
return;

if(!exec.GetLED(56)||!exec.GetLED(57)||!exec.GetLED(58)) // If machine was not homed then it is unsafe to move in machine coordinates, stop here...
{
  MessageBox.Show("The machine was not yet homed, do homing before executing a tool change!");
  exec.Stop();
  return;
}

while(exec.IsMoving()){}

// Get current XY machine coordinates to return to this position at the end of the macro

double Xoriginalpos = exec.GetXmachpos();
double Yoriginalpos = exec.GetYmachpos();

// Stop spindle if running and Move Z up

exec.Stopspin();
exec.Code("G00 G53 Z"+ SafeZ); // Move Z up
while(exec.IsMoving()){}

if(Currenttool==0)
{
// ASK if you want to unload the current tool within a slot...... OR confirm no tool is presently loaded.....
  MessageBox.Show("Tool Zero Currently Loaded, will need to be unloaded before inserting next tool");
  exec.Stop();
  return;
}


if(Currenttool!=0) // No need to drop down tool if current tool number is zero
{
  // Move to old tool position on XY plane
  exec.Code("G00 G53 X" + Xtoolload + " Y" + ToolY[Currenttool]);
  while(exec.IsMoving()){}
    exec.Code("G00 G53 Z" + Ztoolload);
  while(exec.IsMoving()){}
  exec.Code("G00 G53 X" + ToolX);
  while(exec.IsMoving()){}

  // Drop current tool
 
 // exec.Code("G00 G53 Z"+ Ztoolrelease); // Move Z axis down to tool holder position
 // while(exec.IsMoving()){}
  exec.Setoutpin(Chuckopenport, Chuckopenpin); // Open the chuck with pneumatic valve
  exec.Wait(1000); // Wait one 1000msec
  exec.Code("G00 G53 Z"+ SafeZ); // Move Z up
  while(exec.IsMoving()){}
}

// Move to new tool position on XY plane
exec.Code("G00 G53 " Y" + ToolY[Newtool]);
while(exec.IsMoving()){}
// Pick new tool

exec.Code("G00 G53 Z" + Ztoolload); // Move Z axis down to tool holder position
while(exec.IsMoving()){}
exec.Clroutpin(Chuckopenport, Chuckopenpin); // Close the chuck with pneumatic valve
exec.Wait(1000); // Wait one 1000msec
exec.Code("G00 G53 X" + Xtoolload);
while(exec.IsMoving()){}

// Move back to start point

exec.Code("G00 G53 X" + Xoriginalpos + " Y" + Yoriginalpos);
while(exec.IsMoving()){}

// Measure new tool will go here....
exec.Code("G43 H"+Newtool); // Load new tool offset

exec.Wait(200);
while(exec.IsMoving()){}
if(!exec.Ismacrostopped()) // If tool change was not interrupted with a stop only then validate new tool number
{
  exec.Setcurrenttool(Newtool); //Set the current tool -> the new tool
  MessageBox.Show("Tool change done.");
}
else
{
  exec.StopWithDeccel();
  MessageBox.Show("Tool change was interrupted by user!");
}



Re: linear tool change macro

PostPosted: Mon Dec 02, 2019 10:47 pm
by ger21
You're running a Morbidelli with UCCNC?