Hello Guest it is May 07, 2024, 12:52:13 PM

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TPS

1821
VB and the development of wizards / Re: centerpiece full (change)
« on: April 05, 2018, 01:40:44 AM »
Rem VBScript To center probe outside diameter Metric Version
Speak (" psizionarsi CINQUE millimetri sopra il pezzo") 'Avviso Vocale
response = MsgBox ("   5 mm    SOPRA IL PEZZO")

Sleep (1000) ' pausa di 1 secondi
Speak (" CONFERMARE centro pezzo pieno") 'Avviso Vocale
Message "INIZIO CENTRO PEZZO PIENO"
Sleep (1000) ' pausa di 1 secondi
response = MsgBox ("CONFERMARE CENTRO PEZZO PIENO")
 
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
CurrentToolDiameter = GetOemDRO(43) 'gets the current tool diameter

If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty

    Call ProbeGrounded()
    Exit Sub

Else

    XCurrent = GetDro(0)
    YCurrent = GetDro(1)
    OutsideDiameter = GetUserDRO(1152)

    Code "G4 P1" 'Pause 1 second to give time to position probe plate
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    Code "F50" 'slow feed rate to 100mm/sec
    Code "G90 G0 X" &XNew + OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe Left

    XNew = Xcurrent - OutsideDiameter * .6
    Code "G31 X" &XNew
    While IsMoving() 'wait for the move to finish
    Wend
    XPos1 = GetVar(2000) 'get the probe touch location
    Code "G91 G0 X2"
    Code "G91 G0 Z10"
    Code "G90 G0 X" &XCurrent 'rapid move back to start point
    Code "G91 G0 X" &XCurrent - OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe Right

    XNew = XCurrent + 75 'probe 75mm to right
    Code "G31 X" &XNew
    While IsMoving()
    Wend
    XPos2 = GetVar(2000)
    Code "G91 G0 X-2"
    Code "G91 G0 Z10"
    XCenter = (XPos1 + XPos2) / 2 'center is midway between XPos1 and XPos2
    Code "G90 G0 X" &XCenter 'rapid move to the x center location
    While IsMoving ()
    Wend
    Call SetDro (0,0.000)
    Code "G4 P0.25"
    Code "G90 G0 Y" &YNew - OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe up

    YNew = YCurrent + 75
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos1 = GetVar(2001)
    Code "G91 G0 Y-2"
    Code "G91 G0 Z10"
    Code "G90 G0 Y" &YCurrent
    Code "G91 G0 Y" &YCurrent + OutsideDiameter * .6
    Code "G91 G0 Z-10"

Rem Probe down

    YNew = YCurrent - 75
    Code "G31 Y" &YNew
    While IsMoving()
    Wend
    YPos2 = GetVar(2001)
    Code "G91 G0 Y2"
    Code "G91 G0 Z10"
    YCenter = (YPos1 + YPos2) / 2

Rem move To the center

    Code "G90 G0 Y" &YCenter
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    While IsMoving ()
    Wend
    Call SetUserDro (1152,YPos2 - YPos1 - CurrentToolDiameter)

    Code "G4 P0.25"

    Code "F" &CurrentFeed 'restore starting feed rate
   Call ReturnG90G91State()
   Exit Sub
End If
 
Sub ProbeGrounded()
   Code "(Probe plate is grounded, check connection and try again)"
   Call ReturnG90G91State()
End Sub

Sub ReturnG90G91State()
   If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
      Code "G91"
   End If
   If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
      Code "G0"
   End If
   
   
End Sub 

1822
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 05, 2018, 01:27:32 AM »
try to use a Input instead of OEMTrig.

what Controller are you using?

1823
VB and the development of wizards / Re: ATC Geneva wheel for mill
« on: April 04, 2018, 12:21:41 PM »
Hello,

i think the Problem is in this Sub:


'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
   NTool = 16 ' Number of tools changer holds
   CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
   If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
      CWPos = CWPos + NTools
   End If
   CCWPos = NTools - CWPos
   If CWPos < CCWPos Then
      call CW()
   Else
      call CCW()
   End If
End Sub

should be IMHO


'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
   NTools = 16 ' Number of tools changer holds
   CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
   If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
      CWPos = CWPos + NTools
   End If
   CCWPos = NTools - CWPos
   If CWPos < CCWPos Then
      call CW()
   Else
      call CCW()
   End If
End Sub


1824
G-Code, CAD, and CAM discussions / Re: Mach3 stops at the macro. Why?
« on: April 04, 2018, 01:43:39 AM »
HI,
there is a fault in your M20 macro at the SUB StopRewindSleep

Code: [Select]
'-------------------------------------------
Sub StopRewindSleep ()
   DoOEMButton(1003)
   DoOEMButton()
   Sleep(150)
End Sub


the DoOEMButton(), because the Argument is not optional.

because of the Name of the SUB i think it should be:

DoOEMButton(1002)


1825
General Mach Discussion / Re: Probing - what would i need?
« on: April 03, 2018, 02:23:33 PM »
But do you measure tool lengths "on" the machine i.e. tell you want to load tool 10 into the carousel so you fit tool 10, it goes and measures the offset, stores it and then unloads the spindle into the carousel??

that's what i am doing on my older machine, but on the Tongil, i measure them offline with
the function, that the length is written direct into tooltable.

1826
no the M6 is not defect.
it seams to be handled different between G-Code call, and macro call.
i guess it is affected, because it is a "System" macro like M3 M4...

1827
General Mach Discussion / Re: Probing - what would i need?
« on: April 03, 2018, 12:05:05 PM »
Hi Dave,

during the retrofit of my TongIl TNV40 (witch is still not finished), i came also to the
probing  / toollength question.

i am trying to explain, how i want to "handle" this, just to give you (maybe) some ideas.

some basic's of the TongIl
-BT40 spindle toolclamp spring loaded and pneumitc tool release
-16 place umbrella toolchanger

i got to the question 16 places, but i have more than 16 Tools? ???
so i created Screen and script functionality to use the full range of Mach Tooltable,
according to the 16 place TC. means i created a Little database (well it is a Textfile) to
create a relationship between Tools (Mach tooltable) and TC places.
so now i can "book in" a tool to TC place and M6 handles to get the tool from the right
TC place. that gave me the "range" of the full Mach tooltable.

next question BT40 spindle, but i have a lot of SK40 Tools?  ???
they are principly the same, exept the pick and place height of Z-axis, and a different look pin (lenght).
look pin's are avaliable, so no Problem, but the different pick/place , ok added this Information also
to my "extrenal" datebase some Scripting, done.


next question was how to handle the tool lenght?  ???
out of your thread i "grabbed" the idea of the tool lenght setter.
so some material laying around ,some Screen work, some VB Scripting later
the tool setter was finished , toollenght is stored automatcly in the Mach tooltable.

next question surface probing?  ???
i digged out a 3d touch probe (chineese) witch i buyed years ago, did some testing,
tolerance 0.01-0.02mm good enough for what i do.
again some Screen work, some Scripting and it does what i Need.

after all this i recogized, i don't Need a touchplate (or sensor, witch i use on an older machine) to
get the tool lenght.

i write this only to give you some more idea's,
if you want to take some, the coding is no Problem.

Thomas



1828
ok,
i have tested this on my machine, where i can do a real toolchange.

and you are absolute right, the macro is not waiting for the M6 to be finished.

so i made a Little Workaround.

code for the M6 call:

Code: [Select]
SetUserLed(1400,0)

Code "M6 T8"

While GetUserLed(1400) = 0
Sleep(50)
Wend

and then the last line in M6 is:

Code: [Select]
SetUserLed(1400,1)

so the calling macro has to wait until M6 set's UserLed(1400).

you have also to find an other mechanism to know that the run of M6 was faulty,
to cancel the main macro as well.

the trick with the UserLed is "dirty".
i would get the M6 code in a function inside your main macro, and create a returnvalue to
have the control in main macro by a fault.

1829
General Mach Discussion / Re: Probing - what would i need?
« on: April 03, 2018, 07:41:31 AM »
i have also no idea about the Quality of These part's.

i buyed mine, figured out the tolerance was below 0,05mm,
and that was good enough for this case.

1830
only covered the code into a

Sub Main()

End Sub

and replaced the MachMSG to MSGBox, they seemed not to work on my System.