Hello Guest it is May 11, 2021, 10:27:37 AM

Author Topic: CNC Lathe turret tool changer help?  (Read 12356 times)

0 Members and 1 Guest are viewing this topic.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #20 on: October 13, 2015, 06:02:46 AM »
Wow sir, u are awesome!!! Thank u so very much!

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #21 on: October 16, 2015, 07:05:19 PM »
Well, it does work great, however, turret change is not repeatable. Meaning when I call for t0101 it could goto tool 2/6/3 etc. there is no repeat able way for this.

So I was thinking,

Can I just run 1 wire for each tool change position?, would you know what the code would be?

I would make each input oemtrigger 1-8 and the tool changer down switch to active 1.

I am thinking mach3 cant add the inputs nicely enough to make it work.

Or plc?
Re: CNC Lathe turret tool changer help?
« Reply #22 on: October 16, 2015, 09:31:08 PM »
Didn't see it mentioned here but the inputs ought to be in reversed order left to right, because then they give you the tool number in 4 bit binary. Tool 1 is 0001, tool 2 is 0010, tool 3 is 0011, tool 4 is 0100, and so on.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #23 on: October 16, 2015, 10:04:46 PM »
would that make any difference as to repeatability? .... let me try it and see...

Offline TPS

*
  •  2,128 2,128
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #24 on: October 17, 2015, 05:26:43 AM »
 t0101  ???

your tool numbers can only be T1 - T8

whow should the program know in witch place t0101 is located.

Thomas
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #25 on: October 17, 2015, 07:05:28 AM »
Ohh ya... it needs to know, I thoughts that's what was in the program haha.

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #26 on: October 17, 2015, 07:37:29 AM »
Here is how the turret works...

The encoder puts out a series of signals, on active pins 1-4,

Tool#   active1   active2   active3   active 4 (Active# is the input number in mach3)
1              1          0            0         0
2              0          1            0         0
3              1          1            0         0
4              0          0            1         0
5              1          0            1         0
6              0          1            1         0
7              1          1            1         0
8              0          0            0         1

So if you see above, the macro needs to get selected tool.

Activate output 5
wait 1 sec
Activate output 6

' now is needs to find the right tool, for example if I wanted tool one, I put in t0101, then using the above table, the macro needs to sense that Active 1 is (HI) and active 2, 3, and 4, are (LOW), this indicates its at tool one,

Tool#   active1   active2   active3   active 4 (Active# is the input number in mach3)
1               1           0           0            0

Then deactivate output 5
wait 1 sec
deactivate output 6
wait for oemtrigger for turret seated,
then continue program.

Same for tool 2-8, one more example: If I wanted tool 7, I put in t0707 on the mdi line, then using the above table, the macro needs to sense that Active 1,2 and 3, is (HI) and active 4, is (LOW), this indicates its at tool seven,

Tool#   active1   active2   active3   active 4 (Active# is the input number in mach3)
7              1           1           1            0

Does this clarify it a bit :)? Any ideas as to the macro needed? THANK YOU!
Re: CNC Lathe turret tool changer help?
« Reply #27 on: October 17, 2015, 08:09:14 AM »
Ohh ya... it needs to know, I thoughts that's what was in the program haha.



t0101  ???

your tool numbers can only be T1 - T8

whow should the program know in witch place t0101 is located.

Thomas
t0101  ???

your tool numbers can only be T1 - T8

whow should the program know in witch place t0101 is located.

Thomas

Thomas,
T0101 in binary format is T5.  Bit positions for binary: 8 4 2 1 so 0101 is 4+1=5. So if you read the inputs pins into a variable as a binary number it can be converted directly to the correct tool number in decimal. Computers only use binary, they just show you decimal because your eyes glaze over when you see a long string of zeros and ones!

Offline mike^3

*
  •  117 117
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #28 on: October 17, 2015, 08:23:45 AM »
I think I follow ya, but, When I put in the MDI line T0101 (it means in mach 3, change to tool 1 with offset 1), it activates the tool change macro.

The macro needs to see the inputs and goto them accordingly... I mapped the inputs to the table seen above, how we want to hangle those inputs is up for grabs, just need to call a tool, then sense the inputs, then stop the tool, and update the tool and keep running program...



Offline TPS

*
  •  2,128 2,128
    • View Profile
Re: CNC Lathe turret tool changer help?
« Reply #29 on: October 18, 2015, 04:06:09 AM »
Sorry,

i debugged with T0101

it gives you not Tool 1 Offest 1

the GetSelectedTool() gives you 101 as Tool number.

i know the difference between binary and decimal.

That is whant my subfunction:
Code: [Select]
'function to get the actual turret positiom
Function GetTurret() As Long
GetTurret = 0
    If IsActive(Input1) Then
        GetTurret = GetTurret + 1
    End if
    
    If IsActive(Input2) Then
        GetTurret = GetTurret + 2
    End if

    If IsActive(Input3) Then
        GetTurret = GetTurret + 4
    End if

    If IsActive(Input4) Then
        GetTurret = GetTurret + 8
    End if
    
End Function


it convertes binary inputs to a decimal value.

but i have seen you are trying an other way in an other thread.

Thomas



 
anything is possible, just try to do it.
if you find some mistakes, in my bad bavarian english,they are yours.