Hello, I am a good ways through building a conversion for my 3 axis BP mill. I purchased a Cat40 spindle from a Tree mill that has a ball bearing gripper that is operated by an air cyllinder inside the spindle itself. I have almost finished construction of an aluminum (7/8's thick) structure that mounts onto my mill from the Knee ways up to above where the head normally is. The entire head and ram assembley (with my traditional cnc Z axis quill) will be removed and sold. The aluminum structure has robust linear roller (not ball) ways that carry the spindle and motor and its associated parts (like a traditional VMC)
My tool changer is of a fairly novel design. When the spindle and its housing are fully retracted (Z+ limit) (about 30 inches from the mills table(gaining a ton of Z height with this conversion BTW)) a hole that is in the position of the front of the original Ram is opened. from this opening a carriage emerges riding on smaller linear rails that houses the tools. I plan on a carraige with 6 tools for now. The spindle then deposits the tool in its original location, retracts and descends to pick up the new tool. Spindle then retracts again, carraige retracts also and then the spindle descends to its lotation for machining.
I have the spindles air cyllinder functional and it is controlled with a C6 board and solenoid through Mach with a M998 and M999 command.
I have read Hoss's "wine rack" style macro about a thousand times trying to wrap my head around how it works. I have been studying the VB mach manual and reading everything I can find.
Here is what I want to do.
Code calls for tool change.
Macro determines if tool called is tool in use.
If tool called is not tool in use, retract spindle(Z) fully.
Move tool carriage axis (in this case I will use U because I already have a 4th axis) to current tool loaded in spindles location.
Lower spindle(Z) to tool storage depth.
Activate M998 to release tool.
Retract spindle (Z) fully.
Move tool carraige axis to called tool location.
Lower spindle (Z) to tool storage depth.
Activate M999 to grab tool.
Retract spindle(Z) fully.
Retract tool carraige to its home location. (I presume this will be U0, and I plan on having the tools in locations such as U2, U4, U6, etc..)
Lower spindle(Z) to its program location (with correct Z offset) and resume machining.
Here is my Macro so far-
I have yet to test it, as I am away from the machine till tonight. Am I on the right track?
If GetSelectedTool() = GetCurrentTool() Then
End
End If
If CurrentTool() = 1 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U0 F20" 'U tool position 1 at 20IPM.
While IsMoving()
Code "G53 G1 Z18 F20"
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
If CurrentTool() = 2 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U4 F20" 'U tool position 2 at 20IPM.
While IsMoving()
Code "G53 G1 Z18 F20"
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
If CurrentTool() = 3 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U8 F20" 'U tool position 3 at 20IPM.
While IsMoving()
Code "G53 G1 Z18 F20"
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
If CurrentTool() = 4 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U12 F20" 'U tool position 4 at 20IPM.
While IsMoving()
Code "G53 G1 Z18 F20"
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
If CurrentTool() = 5 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U16 F20" 'U tool position 5 at 20IPM.
While IsMoving()
Code "G53 G1 Z18 F20"
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
If CurrentTool() = 6 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U24 F20" 'U tool position 6 at 20IPM.
While IsMoving()
Code "G53 G1 Z18 F20"
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
If GetSelectedTool = 1 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U4 F20" 'U tool position 1 at 20IPM.
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G1 Z18 F20" 'Move to Z tool pickup height at 20IPM.
While IsMoving()
DeActivateSignal(Output1) 'Clamps drawbar.
Sleep 1 'Pauses one second for drawbar to fully clamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G0 U-4" 'retracts U tool rack to home position at rapid speed.
While IsMoving()
End If.
If GetSelectedTool = 2 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U8 F20" 'U tool position 2 at 20IPM.
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G1 Z18 F20" 'Move to Z tool pickup height at 20IPM.
While IsMoving()
DeActivateSignal(Output1) 'Clamps drawbar.
Sleep 1 'Pauses one second for drawbar to fully clamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G0 U-4" 'retracts U tool rack to home position at rapid speed.
While IsMoving()
End If.
If GetSelectedTool = 3 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U8 F20" 'U tool position 3 at 20IPM.
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G1 Z18 F20" 'Move to Z tool pickup height at 20IPM.
While IsMoving()
DeActivateSignal(Output1) 'Clamps drawbar.
Sleep 1 'Pauses one second for drawbar to fully clamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G0 U-4" 'retracts U tool rack to home position at rapid speed.
While IsMoving()
End If.
If GetSelectedTool = 4 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U12 F20" 'U tool position 4 at 20IPM.
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G1 Z18 F20" 'Move to Z tool pickup height at 20IPM.
While IsMoving()
DeActivateSignal(Output1) 'Clamps drawbar.
Sleep 1 'Pauses one second for drawbar to fully clamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G0 U-4" 'retracts U tool rack to home position at rapid speed.
While IsMoving()
End If.
If GetSelectedTool = 5 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U16 F20" 'U tool position 5 at 20IPM.
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G1 Z18 F20" 'Move to Z tool pickup height at 20IPM.
While IsMoving()
DeActivateSignal(Output1) 'Clamps drawbar.
Sleep 1 'Pauses one second for drawbar to fully clamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G0 U-4" 'retracts U tool rack to home position at rapid speed.
While IsMoving()
End If.
If GetSelectedTool = 6 Then
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G1 U20 F20" 'U tool position 6 at 20IPM.
While IsMoving()
ActivateSignal(Output1) 'Unclamps drawbar.
Sleep .5 'Pauses half second for drawbar to fully unclamp.
Code "G53 G1 Z18 F20" 'Move to Z tool pickup height at 20IPM.
While IsMoving()
DeActivateSignal(Output1) 'Clamps drawbar.
Sleep 1 'Pauses one second for drawbar to fully clamp.
Code "G53 G0 Z24" 'Z full retract at rapid speed.
While IsMoving()
Code "G53 G0 U-4" 'retracts U tool rack to home position at rapid speed.
While IsMoving()
End If.