Hello Guest it is September 19, 2019, 05:16:54 AM

Author Topic: Mach 3 toolchange for dummies???  (Read 60502 times)

0 Members and 1 Guest are viewing this topic.

Re: Mach 3 toolchange for dummies???
« Reply #80 on: June 21, 2011, 11:35:21 AM »
Yup, that worked. Turns out I had the "plugin enabled" section checked.

I would try the plugin, but I cant find it anywhere...

Anyway, I will get back to work on this this afternoon. Thanks again Hood.

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: Mach 3 toolchange for dummies???
« Reply #81 on: June 21, 2011, 12:16:07 PM »
Plugin is part of the Mach download, just needs enabled. I have  never used it and as far as I know you need to use Brains for it. Dont think you can use OEM triggers and other I/O but could be wrong. Likewise I am not sure if VB works with the plugin, think it does but.....
All of the above definitely work with the standard serial interface.

Hood
Re: Mach 3 toolchange for dummies???
« Reply #82 on: June 21, 2011, 12:54:56 PM »
Sorry to go off topic but in the standard serial interface can you add more than one serial modbus?

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: Mach 3 toolchange for dummies???
« Reply #83 on: June 21, 2011, 01:03:31 PM »
Dont think so.
Hood
Re: Mach 3 toolchange for dummies???
« Reply #84 on: June 21, 2011, 01:18:08 PM »
Ok, so last night before my encoder trace problem surfaced, I finally had the Ah-Ha moment...

I realized what does what in this tool changer equation. I was getting the VB script for the toolchange Macro for Mach confused with the VB script that runs on the cubloc!

I discovered this when the cubloc studio VB editor would not reckognise VB commands that were used in Fdos's macro. When Cubloc studio did not reckognise these commands I realsied it was because I was trying to edit/run/test VB script that was native to Mach! Of course I could not use this in Cubloc studio! what was I thinking?

Now, I finally put it together that the VB script (macro) in Mach is a totally seperate piece of code from the VB script running in the Cubloc. Sure, they have to talk over modbus, but each has a distinct role to play.

Mach3 VB script Macro is used to call a toolchange (in MDI or Gcode). it determines what tool position it is in, and if it is not in the position that is requested by the toolchange, it changes the tool (only in Mach) it really only changes a DRO or Register.

Meanwhile, the Cubloc VB toolchange code has been monitoring the DRO or Register in Mach for any changes. If a change is detected, it preforms its toolchange physically by means of running its VB script that triggers relays which trigger air solenoids/airmotor. The VB script also interprets the position sensors for the turret rotational position and the turret up or down sensor. Using the information from these sensors allows the VB script to raise, lower, rotate, etc.. into the correct tool position.

Also, The Mach toolchange macro requests a move to safe Z&X locations suitable for a toolchange.

All thats left is for the Cubloc to report to the Mach macro that the tool has changed to the requested position, and that the turret is locked down correctly. The Mach macro can then allow the Gcode to resume with the new tool and its appropriate offset. IF the Cubloc does not sucessfully change the tool, the Mach macro should recieve a fault signal from the cubloc which triggers Mach to go into Estop mode.

I think I understand it all now!

Each piece has its role, and these roles must be kept seperate in my mind and in reality if this toolchanger is going to be made to work.

NOW, I am awaiting a call from Garret at Cubloc (Comfile) to ask him to help me setup Modbus communication between Mach and the Cubloc.
__________________

Does it look like my understanding of how this all works together is correct?
Re: Mach 3 toolchange for dummies???
« Reply #85 on: June 21, 2011, 03:34:13 PM »
Between Hood helping me find the right settings window and a call to Garrett at Cubloc, I have finally got modbus communicationg between Mach3 and the Cubloc.

I dont have any information being passed back and forth yet, but I did test communication, and it did work!!!!

Offline Hood

*
  •  25,849 25,849
  • Carnoustie, Scotland
    • View Profile
Re: Mach 3 toolchange for dummies???
« Reply #86 on: June 21, 2011, 03:43:21 PM »
GetInput(*)
and
SetModOutput(*,*)
is how I talk to the PLC in VB so should be similar.
Hood
Re: Mach 3 toolchange for dummies???
« Reply #87 on: June 21, 2011, 11:08:20 PM »
Thanks Hood, I am going to do testing with the following tool change macro-

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
'Toolchange Macro for Mach3 and Hardinge CHNC 8 station turret.
'June 20th 2011 (based upon Macros from Hood and Fdos & possibly others)
 

   
   
Tool = GetSelectedTool() 
If Tool = GetCurrentTool() Then           'Ignore and Exit if already there
  End
End If
 

   


If Tool <1 Then                  'If tool called is < 1
  MsgBox ("Error! Tool "& tool & " Out Of Range")   'error message
  DoOemButton (1003)                       'Stop Button
  End                                      'End macro
End If

If Tool >8 Then                  'If tool called is > 8
  MsgBox ("Error! Tool "& tool & " Out Of Range")
  DoOemButton (1003)                   
  End                                     
End If




Message ("Waiting for Turret Station " & tool)




If Tool=1 Then                            'tool = 1

  Call SetModOutput (66,1)            'Reg D12
    Do
      If GetInput (67) = tool  Then          'Reg D13
        Call SetModOutput (66,0)         'Reset D12
        Exit Do
      End If
    Loop
End If


 
If Tool=2 Then                            'tool = 2

  Call SetModOutput (66,2)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=3 Then                            'tool = 3

  Call SetModOutput (66,3)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=4 Then                            'tool = 4

  Call SetModOutput (66,4)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If
 
 
 
If Tool=5 Then                            'tool = 5

  Call SetModOutput (66,1)           
    Do
      If GetInput (67) = tool  Then         
        Call SetModOutput (66,0)         
        Exit Do
      End If
    Loop
End If


 
If Tool=6 Then                            'tool = 6

  Call SetModOutput (66,2)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=7 Then                            'tool = 7

  Call SetModOutput (66,3)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If


 
If Tool=8 Then                            'tool = 8

  Call SetModOutput (66,4)
    Do
      If GetInput (67) = tool  Then
        Call SetModOutput (66,0)
        Exit Do
      End If
    Loop
End If
 
 
Message ("Station " & tool & " OK")      'Status Msg       
SetCurrentTool( tool )

End
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%



I have the above saved as M6Start.m1s in my mach3/lathe/macro folder. I know that the macro runs because I get a "Waiting for turret X" message when I manually enter in a toolchange like T0101.

Now that I have Modbus communication, the next step is to figure out how Fdos acomplished the following-



$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
For anyone thats interested here's the M6Start macro for the 4 station turret on my Hardinge.

It passes the requested station # to the Cubloc PLC via a holding register mapped to 66 in mach and D12 on the Cubloc.

The Cubloc always has it's actual station # available in D13 (67 in Mach) via it's turret encoder routine.   = 0 when invalid = 1 to 4 for valid stations.

I'll probably post the Cubloc program when it's developed a bit more.

The Macro below is partially based on Hoods Churchill Macro.  Thanks Robin...


Wayne.....
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

*********, I'm lost...
Re: Mach 3 toolchange for dummies???
« Reply #88 on: June 21, 2011, 11:17:57 PM »
I sent Fdos an Email also, to see if he can chime in and give me some guidance. I hope he gets the email!
Re: Mach 3 toolchange for dummies???
« Reply #89 on: June 23, 2011, 07:36:15 PM »
No luck raising Fdos. Sadly.


"It passes the requested station # to the Cubloc PLC via a holding register mapped to 66 in mach and D12 on the Cubloc.

The Cubloc always has it's actual station # available in D13 (67 in Mach) via it's turret encoder routine.   = 0 when invalid = 1 to 4 for valid stations."

Can anyone explain the above quote from Fdos?

It appears to say that holding register 66 in mach is autopolled and reported to D12 on the plc. Furthermore,  that the plc code writes a station number to D13 and Mach autopolls this and reports this on holding register 67.

Am I right?