rotary tool changer- carousel

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Re: rotary tool changer- carousel

Postby Vmax549 » Sun Jul 08, 2018 7:54 pm

Is there a need to index teh spindle ? Does teh spindle / toolholder have lugs ?? DOes it need them?

(;-) TP
Vmax549
 
Posts: 1379
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: rotary tool changer- carousel

Postby Battwell » Mon Jul 09, 2018 10:31 am

yes- it uses bt style holders so the drive dogs must engage in the spindle at the correct orientation. i tried load of things yesterday- but still having a problem with getting the spindle to stop exactly at the right angle.- even ramping up the speed from 0 to very slow- then when pulse is seen killing the pwm to analogue chanel.
there is no spindle brake.
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 381
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: rotary tool changer- carousel

Postby Battwell » Mon Jul 09, 2018 10:48 am

im pretty confident i can add rotary to my already written linear changer code (which i wrote for my big router) - that way everything is saved to profile as it goes.. it was too much work writing that to only use once!
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 381
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: rotary tool changer- carousel

Postby Vmax549 » Mon Jul 09, 2018 2:12 pm

Well there are several ways to index teh spindle . SHot pin, Cam and roller , encoder index with brake, VFD and DC injection on signal , Stepper motor and spindle signal.

What method did teh original controller use ??

Are you planning to do rigid tapping ??

(;-) TP
Vmax549
 
Posts: 1379
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: rotary tool changer- carousel

Postby Battwell » Mon Jul 09, 2018 4:13 pm

original used none of the above :-(
was done with just 1 sensor input, fwd run signal and analog.

by the way- i worked out geneva drive control ok now so no need for any additions to that
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 381
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: rotary tool changer- carousel

Postby Vmax549 » Mon Jul 09, 2018 5:15 pm

Yes but it was a servo drive so it can stop on a signal with precision (;-) then lock the rotor. If you change out teh Analog drive to a step direction you can do the same thing.

Drive to teh signal then stop and even rotate to needed position.

That is what Derek does only his setup uses a stepper motor to run teh Power Drawbar. He engages teh PDB and then refhomes to teh spindle index signal then rotates to teh correct spindle position for teh ATC then locks teh Spindle.


(;-) TP
Vmax549
 
Posts: 1379
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: rotary tool changer- carousel

Postby Vmax549 » Mon Jul 09, 2018 5:18 pm

Instead of changing teh servo drive out how about a Step/Dir to analog convertor board.

Just a thought, (;-) TP
Vmax549
 
Posts: 1379
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: rotary tool changer- carousel

Postby Battwell » Mon Jul 09, 2018 9:09 pm

theres no reverse run on the drive- has to be done via a contactor to reverse :-(
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 381
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: rotary tool changer- carousel

Postby Battwell » Mon Jul 09, 2018 9:12 pm

i think an ac servo is going to be easiest option. (built in psu etc)- just swap the motor if i can find something that will fit.
Uc300eth on router and mill
If they say it can't be done- I find a way!
Battwell
 
Posts: 381
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: rotary tool changer- carousel

Postby Meri » Fri Jul 20, 2018 8:14 pm

Maybe this helps:

Code: Select all
// Carousel toolchanger code
// Original Code by Terry Parker, Adapted to the AXYZ CNC by Arturo Duncan
// Some code for the original linear tool change which is not used was left there intentionally and is commented

//  MessageBox.Show(" New Tool Change Macro Newtool=");
 
//Tool positions definition
int Chuckopenport = 1;
int Chuckopenpin = 16;

// Tool carusel driven by the B axis.
double[] ToolB = new double[11];
ToolB[0] = 0; // Tool0 B position

//Angle at which each tool is.

ToolB[1] = 36*(1-1); // Tool1 B position
ToolB[2] = 36*(2-1); // Tool2 B position
ToolB[3] = 36*(3-1); // Tool3 B position
ToolB[4] = 36*(4-1); // Tool4 B position
ToolB[5] = 36*(5-1); // Tool5 B position
ToolB[6] = 36*(6-1); // Tool6 B position
ToolB[7] = 36*(7-1); // Tool7 B position
ToolB[8] = 36*(8-1); // Tool8 B position
ToolB[9] = 36*(9-1); // Tool9 B position
ToolB[10] = 36*(10-1); // Tool10 B position

//Read and store the position of the machine before doing the tool change so we can send the spindle to where it was when the tool change was called.

double x = exec.GetXpos();            // GetOEMDRO(83)
double y = exec.GetYpos();            // GetOEMDRO(84)
double z = exec.GetZpos();            // GetOEMDRO(85)
double a = exec.GetApos();            // GetOEMDRO(86)
double b = exec.GetBpos();            // GetOEMDRO(87)
double c = exec.GetCpos();            // GetOEMDRO(88)

//  MessageBox.Show("Newtool=");
 
// These are the machine constants.  The positions in the machine coordinate system where phisical things are.
 
double SafeZ = -.5;
double Ztoolrelease = 88;
double Ztoolpickup = 86;
int MaxToolNum = 10;            //'Max number off tools for the changer
double ToolDown   = -5.339;        //'Z Pos to Get or drop a tool
double ToolUp     = -0;       //'Z Hieght to Rapid from tool to tool
double DustCollector = 0.154;
double ToolProbePos = -3.1336;
double YTootChangePos = -7.8;
double YTootPos = -11.6913;
double SpindleSpeed = Convert.ToDouble(AS3.Getfield(870));

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


if(Currenttool == 0) // If new tool number is -1 means a missing T code, so we need to stop here...
{
MessageBox.Show("The Current TOOL # is out of range 1 - 10 , Correct the Value and Restart");
exec.Stop();
return;
}

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(Newtool == 0 || Newtool >10) // If new tool number is 0  means a missing T code, so we need to stop here...
{
MessageBox.Show("The TOOL # is out of range 1 - 10 , Correct the Value and Restart");
exec.Stop();
return;
}

if(!exec.GetLED(56)||!exec.GetLED(57)||!exec.GetLED(58)||!exec.GetLED(60)) // 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 homeing 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();
//MessageBox.Show("G00 G53 Z+ SafeZ"); // Move Z up");
exec.Code("G00 G53 Z"+ SafeZ); // Move Z up
while(exec.IsMoving()){}
// Open Dust Collector
exec.Setoutpin(2,1);                 // Open the Dust Collector
while(exec.IsMoving()){}

if(Currenttool!=0) // No need to drop down tool if current tool number is zero
{
  // Drop old tool

 // exec.Code("G00 G53 "+" B" + ToolB[Currenttool]);
  //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
// MessageBox.Show("G00 G53 Y"+DustCollector+ "B "+ ToolB[Currenttool]);
exec.Code("G00 G53 Y"+DustCollector+" B" + ToolB[Currenttool]);
while(exec.IsMoving()){}
// MessageBox.Show("exec.Code(G00 G53 Y+YTootChangePos)");
exec.Code("G00 G53 Y"+YTootChangePos);
while(exec.IsMoving()){}
// MessageBox.Show("exec.Code(G00 G53 Z+ToolDown)");
exec.Code("G00 G53 Z"+ToolDown);
while(exec.IsMoving()){}
//Wait unti spindle is off



//Check that the spindle is really off before delivering the tool
do
{
exec.Wait(50);
SpindleSpeed = Convert.ToDouble(AS3.Getfield(870));
}
//MessageBox.Show("SpindleSpeed ="+SpindleSpeed );
while(SpindleSpeed != 0);

// MessageBox.Show("exec.Code(G0 G53 Y+YTootPos+.25)");
exec.Code("G0 G53 Y"+(YTootPos+.1));
while(exec.IsMoving()){}

// MessageBox.Show("exec.Code(G1 F30 G53 Y+YTootPos)");
exec.Code("G1 F30 G53 Y"+YTootPos);
while(exec.IsMoving()){}
//MessageBox.Show("exec.Code(G4 P.75)");
exec.Code("G4 P.75");
while(exec.IsMoving()){}
// Tool Release
{exec.Setoutpin(2,14);                 // Release Tool
}
//MessageBox.Show("exec.Code(G4 P.75)");
exec.Code("G4 P.75");
while(exec.IsMoving()){}
//  MessageBox.Show("exec.Code(G1 F10 G53 Z & ToolDown+.25)");
exec.Code("G1 F10 G53 Z" + (ToolDown+.1));
while(exec.IsMoving()){}
exec.Clroutpin(2,14);           //  Clamp Tool
while(exec.IsMoving()){}
// MessageBox.Show("exec.Code(G0 G53 Z + ToolUp-2)");
exec.Code("G0 G53 Z" + (ToolUp-2.25));
while(exec.IsMoving()){}
// MessageBox.Show("exec.Code(G0 G53 BToolB[Newtool])");
exec.Code("G0 G53 B"+ToolB[Newtool]);
while(exec.IsMoving()){}
// MessageBox.Show("exec.Code(G0 G53 Z & ToolUp-2)");
exec.Code("G0 G53 Z" + (ToolUp-2.25));
while(exec.IsMoving()){}
{exec.Setoutpin(2,14);                 // Release Tool
}
// MessageBox.Show("exec.Code(G0 G53 Z & ToolDown+.25)");
exec.Code("G0 G53 Z" + (ToolDown+.1));
while(exec.IsMoving()){}
// MessageBox.Show("exec.Code(G0 G53 Z & ToolDown);");
exec.Code("G1 F10 G53 Z" + ToolDown);
while(exec.IsMoving()){}
// Clamp Tool
exec.Clroutpin(2,14);           //  Clamp Tool
while(exec.IsMoving()){}
exec.Wait(1000); // Wait one 1000msec
// MessageBox.Show("exec.Code(G1 F30 G53 Y+YTootPos-.2)");
//exec.Code("G1 F30 G53 Y"+(YTootPos+1));
//while(exec.IsMoving()){}
// MessageBox.Show("exec.Code(G00 G53 Y+YTootChangePos)");
exec.Code("G00 G53 Y"+YTootChangePos);
while(exec.IsMoving()){}
//MessageBox.Show("  exec.Code(G00 G53 Z+ SafeZ)");
  exec.Code("G00 G53 Z"+ SafeZ); // Move Z up
  while(exec.IsMoving()){}

//MessageBox.Show("  exec.Code(G00 G53 Y+ DustCollector+5)");
// exec.Code("G00 G53 Y20"); // Bang the Dust Collector
// while(exec.IsMoving()){}


// Move back to start point
//MessageBox.Show("exec.Code(G00 G53 X + Xoriginalpos +  Y + Yoriginalpos)");
exec.Code("G00 G53 X" + Xoriginalpos + " Y" + Yoriginalpos);
while(exec.IsMoving()){}

//MessageBox.Show("Reset Tool Offset");
exec.Code("G49"); // Reset Tool Offset

exec.Wait(200);
while(exec.IsMoving()){}
AS3.Setfield(Newtool,1003);

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("exec.Code(G43 H+Newtool)");
exec.Code("G43 H"+Newtool); // Load new tool offset
exec.Wait(200);
while(exec.IsMoving()){}

//MessageBox.Show("Tool change done.");
}
else
{
  exec.StopWithDeccel();
  MessageBox.Show("Tool change was interrupted by user!");
}
Meri
 
Posts: 1
Joined: Fri Jul 20, 2018 8:09 pm

PreviousNext

Return to Macros

Who is online

Users browsing this forum: No registered users and 1 guest