Hello Guest it is April 20, 2024, 01:40:42 AM

Author Topic: Moving tool magazine with 14 drill heads  (Read 2281 times)

0 Members and 1 Guest are viewing this topic.

Moving tool magazine with 14 drill heads
« on: May 02, 2021, 04:30:13 PM »
Dear group of colleagues!

I have a T-shaped tool head on my machine. It has 14 pneumatic cylinders with drill bits at the end.
These, in one block, move together with the spindle at the same time. Between these drill bits there are 2 pieces, at the end of which there is a 90 degree angle of inclination. Drills can be inserted into each of its extensions.
Everything works fine.
My question would be how to rewrite the tool change macro, M6Start macro, in VBasic so that the coordinates of 14 tools are written into the current working coordinates if I select tool T1 .... 14. The tools work perfectly down and up on an M-code command.
 There is 32mm between the tools. Thanks in advance for the advice!
aha2re@gmail.com
Re: Moving tool magazine with 14 drill heads
« Reply #1 on: May 02, 2021, 04:44:03 PM »
Dear group of colleagues!

The translation is incorrect ...
My question would be how to rewrite the tool change macro, M6Start macro, in VBasic so that the coordinates of 14 tools are written into the current working coordinates if I select tool T1 .... 14. Thanks in advance for the advice! :-)

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Moving tool magazine with 14 drill heads
« Reply #2 on: May 03, 2021, 01:56:19 AM »
you can use G52 for this.
something like this might work:

Code: [Select]
Sub Main

'Get tool information
newtool = GetSelectedTool() ' get the newtool
acttool = GetCurrentTool() ' get the acttool
Message "New Tool = " &newtool
Sleep(200)

' new and acttool = 0
If ((newtool = 0) and (acttool = 0)) Then
message("new and old tool = 0 -> abort toolchange  !")
Sleep(500)
Exit Sub
End If

' new tool = 0
If (newtool = 0) Then
DoButton(1003)
message("new tool = 0 -> abort toolchange  !")
Sleep(500)
Exit Sub
End If

' new and acttool are the same
If newtool = acttool Then
message("acttool and newtool are the same -> do nothing!")
Sleep(500)
Exit Sub
End If
 
'check toolnumber in range
If  (((newtool > 14) Or (newtool < 1)) And (newtool <> 0)) Then
DoButton(1003)
Message (" toolnumber " & newtool & " is not in range (1-" &MaxTool &"). abort toolchange  ! ")
MsgBox (" toolnumber " & newtool & " is not in range (1-" &MaxTool &"). abort toolchange  ! ")
Exit Sub
End If

'toolnumber 1 mastertool
If  newtool = 1 Then
Code ("G52 X0 Y0")
End If

'toolnumber 2
If  newtool = 2 Then
Code ("G52 X32 Y0")
End If

'toolnumber 3
If  newtool = 3 Then
Code ("G52 X64 Y0")
End If

'And so ON



'set new tool
SetCurrentTool( newtool )
Code ("G43 H" & newtool)
Message " "

End Sub




anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Moving tool magazine with 14 drill heads
« Reply #3 on: May 03, 2021, 03:41:04 PM »

Hello TPS!
Thank you very much for your idea and help!
I'll try tomorrow!
I'll give you feedback!
Until then, have a nice evening!
Re: Moving tool magazine with 14 drill heads
« Reply #4 on: May 13, 2021, 01:25:57 PM »
Hello TPS
Thank you for the example program!
Syntax error- writes to Mach3. I experimented with the program. The program works well up to the line 'check toolnumber in range' ....
After that down again syntax error message. I've tried to look at similar programs, but I'm not an expert in VisualBasic.
What do you think might be your problem?
Thank you in advance for your answer!
Zoli :-)
aha2re@gmail.com

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Moving tool magazine with 14 drill heads
« Reply #5 on: May 14, 2021, 01:54:46 AM »
i have tested this here, and it works:

'start code ------------------------------------------------------------------------
Sub Main

   'Get tool information
   newtool = GetSelectedTool()      ' get the newtool
   acttool = GetCurrentTool()      ' get the acttool   
   Message "New Tool = " &newtool
   Sleep(200)

   ' new and acttool = 0
   If ((newtool = 0) and (acttool = 0)) Then
      message("new and old tool = 0 -> abort toolchange  !")
      Sleep(500)
      Exit Sub
   End If   

      ' new tool = 0
   If (newtool = 0) Then
      DoButton(1003)
      message("new tool = 0 -> abort toolchange  !")
      Sleep(500)
      Exit Sub
   End If   

   ' new and acttool are the same
   If newtool = acttool Then
      message("acttool and newtool are the same -> do nothing!")
      Sleep(500)
      Exit Sub
   End If
 
   'check toolnumber in range
   If  (((newtool > 14) Or (newtool < 1)) And (newtool <> 0)) Then
      DoButton(1003)
      Message (" toolnumber " & newtool & " is not in range (1-" &MaxTool &"). abort toolchange  ! ")
      MsgBox (" toolnumber " & newtool & " is not in range (1-" &MaxTool &"). abort toolchange  ! ")
      Exit Sub
   End If      

   'toolnumber 1 mastertool
   If  newtool = 1 Then
      Code ("G52 X0 Y0")
   End If      

   'toolnumber 2
   If  newtool = 2 Then
      Code ("G52 X32 Y0")
   End If      

   'toolnumber 3
   If  newtool = 3 Then
      Code ("G52 X64 Y0")
   End If      

'And so ON


      
   'set new tool
   SetCurrentTool( newtool )
   Code ("G43 H" & newtool)
   Message " "

End Sub
'end code ------------------------------------------------------------------------




anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Moving tool magazine with 14 drill heads
« Reply #6 on: May 17, 2021, 12:59:28 PM »
Dear TPS!
Thank you so much for helping with this software issue!
I tried the software several times, it no longer writes a problem. It runs normally. Switches tools. The Toolpath monitor shows that it shifts the coordinate and drills well there as well.
But, he doesn't physically do it. No error is written, the program runs. Resets to default.
Could something be wrong? I enclose the photos. Thank you in advance for your answer!
M811 Tool 1 goes down,
M911 Tool 1 resets
M813 Tool 3 goes down
M913 Tool 3 resets

Offline TPS

*
  •  2,505 2,505
    • View Profile
Re: Moving tool magazine with 14 drill heads
« Reply #7 on: May 18, 2021, 02:20:08 AM »
in your sample code:

Code: [Select]
N10
N11 M6 T1
N15
N20 G0 Y100
N35 G0 X100
N40 M3
N50 M811
N55 G1 Z+60 F500
N66 Z100
N77 M911
N78
N88
N89 M6 T3
N90 M3
N91 M813
N93 G1 Z+60 F500
N96 Z+100
N97 M913
N98 M5
N99 G92.1
N100 G1 X-340.0 Y-40 Z100 F3500
N200 M30

you what to do two drill's at X100 Y100 first with tool1 second with tool3.
the coordinate offset for the Tools is done in M6.

therefore you must do a new move with X and Y after you call M6 for tool3.

Code: [Select]
N10
N11 M6 T1
N15
N20 G0 Y100
N35 G0 X100
N40 M3
N50 M811
N55 G1 Z+60 F500
N66 Z100
N77 M911
N78
N88
N89 M6 T3
N90
N91 G0 Y100
N92 G0 X100
N93
N94 M3
N95 M813
N96 G1 Z+60 F500
N97 Z+100
N98 M913
N99 M5
N100 G92.1
N101 G1 X-340.0 Y-40 Z100 F3500
N200 M30
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Moving tool magazine with 14 drill heads
« Reply #8 on: June 07, 2021, 02:18:46 PM »
Dear TPS!
Thank you so much for your help in programming the machine!
What do I owe?
Trying a lot, we realized the logic of the program.
The machine is already working. Do the tasks.
We still have work to do with it.
Rhapsodically folds the 3336 code.
We will try to replace the SSD memory with an HDD.
We will then try the Mach3 update.