Hello Guest it is April 26, 2024, 11:23:19 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

2131
German / Re: Bauteil ausrichten
« on: December 30, 2017, 03:05:05 AM »
Servus Marco,

diesen Code:

Code: [Select]

Angle = GetOemDro(118)

pi=4*Atn(1)

CurrentToolDiameter = GetOemDRO(43)
X = GetUserDro (1053)
Y = GetUserDro (1054)
Z = GetUserDro (1055)

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
PlateThickness = GetUserDRO(1051)
ToolLength = GetOemDRO(42)

MoveXDistance = ((X * 1.1) + CurrentToolDiameter)
MoveYDistance = ((Y * 1.1) + CurrentToolDiameter)
MoveDistance = .5 + CurrentToolDiameter
MoveZDistance = .5

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

'Get top of part

'DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P4" ' this delay gives me time to get from computer to hold probe in place
Code "G91 G31Z-2.0 F4" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
'Call SetDro (2, PlateThickness)

ZProbePos = GetVar(2002) 'get the axact point the probe was hit
'Code "G0 Z" &PlateThickness
'While IsMoving ()
'Wend
Code "G1 G91 F40 Z" &MoveZDistance 'put the Z retract height you want here
While IsMoving ()
Wend

'Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate


'Call SetDro (2,GetDro(2)-Z)

'Probe The X sides

    XCurrent = GetDro(0)
    YCurrent = GetDro(1)

    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 "F4" 'slow feed rate to 4 ipm


Rem Probe Y Face Side

    Code "G90 G0 X" &-MoveDistance
    Code "G4 P0.25"
    Code "G91 G0 Z" &-MoveZDistance-.2
    Code "G4 P0.25"
    XNew = Xcurrent + 3
    Code "G31 X" &XNew 'Probe X1,Y1 (P1) location
    While IsMoving() 'wait for the move to finish
    Wend
    X1 = GetVar(2000) 'get the probe touch location
    Y1=0 ' Should always be zero
    Y2 = Y-0.5 '1/2 inch back from end of block

    Code "G91 G0 X-.25"
    Code "G4 P0.25"
    Code "G91 G0 Y" &Y2
    Code "G4 P0.25"
    Code "G31 X" &XNew 'Probe X2,Y2 (P2) location
    While IsMoving() 'wait for the move to finish
    Wend
    X2 = GetVar(2000) 'get the probe touch location
    'Y2= Block length - 1/2 inch

    Code "G91 G0 Z" &MoveZDistance+.2
    Code "G4 P0.25"
    Code "G91 G0 Y" &-Y2 'Go back to the first spot
    Code "G4 P0.25"
    Code "G91 G0 X" &CurrentToolDiameter+.1 'rapid move back to start point
    Code "G4 P0.25"

Rem Probe X Face Side

    Code "G90 G0 Y" &-MoveDistance
    Code "G4 P0.25"
    Code "G91 G0 Z" &-MoveZDistance-.2
    Code "G4 P0.25"
    YNew = YCurrent + 3
    Code "G31 Y" &YNew 'Probe X3,Y3 (P3) location
    While IsMoving()
    Wend
    Y3 = GetVar(2001)   'get the probe location
    'X3=0
    X4 = X-0.5 '1/2 inch back from end of block

    Code "G91 G0 Y-.25"
    Code "G4 P0.25"
    Code "G91 G0 X" &X4
    Code "G4 P0.25"
    Code "G31 Y" &YNew 'Probe X4,Y4 (P4) location
    While IsMoving() 'wait for the move to finish
    Wend
    Y4 = GetVar(2001) 'get the probe touch location
    'X4= Block Width - 1/2 inch

    Code "G90 G0 Z" &MoveZDistance+1    'Back up and clear
    Code "G4 P0.25"

t1= (x4-x3)*(y1-y3)-(y4-y3)*(x1-x3)
b1= (y4-y3)*(x2-x1)-(x4-x3)*(y2-y1)
ua=t1/b1

t2= (x2-x1)*(y1-y3)-(y2-y1)*(x1-x3)
b2= (y4-y3)*(x2-x1)-(x4-x3)*(y2-y1)
ub=t2/b2

XH=x1+ua*(x2-x1) ' X Home  distance away
YH=y1+ua*(y2-y1) ' Y Home  distance away


If X>Y Then
   'LongestSide=X
   a=(Y4-Y3)
   b=(X4-X3)
   v=a/b
   NewAngle=Atn(v)*(180/pi)
Else
   'LongestSide=Y
   a=(X2-X1)
   b=(Y2-Y1)
   v=b/a
   NewAngle=Atn(v)*(180/pi)
   If NewAngle > 0 Then
     NewAngle=NewAngle-90
   Else
     NewAngle=NewAngle+90
   End If
End If

Rem move To the Block Lower Corner

    Code "G90 G0 Y" &YH + CurrentToolDiameter/2
    Code "G90 G0 X" &XH + CurrentToolDiameter/2
    While IsMoving ()
    Wend
    Call SetDro (1,0.000)
    While IsMoving ()
    Wend
    Code "G4 P0.25"
    Call SetDro (0,0.000)
    Call SetDro (1,0.000)

    Call SetOemDro (118,NewAngle) ' now you can rotate the block


'Call SetDro (2,Z + PlateThickness)

    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"
Else
Code "G90"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
Else
Code "G1"
End If
End Sub                 


habe ich hier im Forum gefunden, vielleicht hilft er ja ein bisschen.

Gruß Tom

2132
German / Re: Bauteil ausrichten
« on: December 29, 2017, 01:57:32 PM »
wäre schön, wenn Du die Lösung hast, diese hier zu posten.
Dann könnte ich das bei meiner Fräse auch implementieren.

Gruß Tom

2133
German / Re: Bauteil ausrichten
« on: December 29, 2017, 01:54:18 PM »
ich denke mal, man braucht mindesten 3 Punkte (Geometrie ist nicht meins),
einen an der Y Richtung, zwei in X Richtung,
um X0,Y0 auch zu bestimmen.

Gruß Tom

2134
German / Re: Bauteil ausrichten
« on: December 29, 2017, 01:51:24 PM »

[/quote]
Ich glaube ich verstehe jetzt, wo der Knackpunkt liegt. Der Nullpunkt liegt ja bei einem verschobenen Prüfling nicht da, wo ich ihn erwarten würde. Da muss ich noch mal drüber nachdenken.



das meinte ich, warum der Winkel alleine nicht reicht.

Gruß Tom

2135
German / Re: Bauteil ausrichten
« on: December 29, 2017, 01:49:26 PM »
sicher gibt es ein ATN(x) Funktion

siehe Attachments.

zur Sicherheit hab ich mal VBScript Comandos auch mit drangehängt.

Gruß Tom

2136
German / Re: Bauteil ausrichten
« on: December 29, 2017, 01:32:25 PM »
OK,

VB ist C++nur viel einfacher (zumindest manchmal).

So um jetzt weiterzukommen brauche ich ein paar Info's

Du hast geschrieben, das Du die X,Y,Z Achse schon automatisch vermessen kannst.

Wie machst Du das genau ?

Für G68 (oder genau gesagt, das was Du damit machen willst) brauchen wir ja nicht nur den
Winkel, sondern auch die linke unter Ecke (X0,Y0), um die wir dann das Werkstück drehen.

Ich stelle mir jetzt Deine Anforderung ungefähr so vor:

1. Werkstück auflegen
2. Werkstück vermessen, vollautomatisch auf Knopfdruck, hier wird X0 Y0 und der Winkel bestimmt
3. Fräsen

mal ganz grob heruntergebrochen.

Gruß Tom
  

2137
German / Re: Bauteil ausrichten
« on: December 29, 2017, 01:10:03 PM »
Servus Marco,

ok, jetzt geht es Richtung VB Scripting.
Wie weit hast Du Dich damit schon beschäftigt?

Gruß Tom

2138
Brains Development / Re: Stop any movement of axis if Input is not active
« on: December 29, 2017, 06:50:12 AM »
OK, no problem.

in your macrofolder (normaly  C:\Mach3\macros\yourprofilename)
should be a macro called macropump.m1s .
if not create one with Texteditor and put These code in:

Code: [Select]

Sub Main()

  IF ((GetoemDRO(806) > 0) and (Input1 = False)) Then
    DoOEMButton(1003)
  End If

End Sub


make sure that in Config -> General Config -> Run Macro Pump is enabled.
Restart Mach3

test.

Thomas

2139
German / Re: Bauteil ausrichten
« on: December 29, 2017, 02:57:53 AM »
Servus ocram12,

das ist mit Mach3 auch möglich.
G68/G69 ist hier die gewünschte Funktion.

Zuerst mal mußt Du Dir aber einen Kantentaster bauen/kaufen,
und in Betrieb nehmen.

Dazu gibt es hier hier im Forum einige Info's.

Der Rest ist dann "nur" noch ein kleines macro, das 2 Punkte misst,
und dann den Winkel ausrechnet.

Gruß Tom

2140
Brains Development / Re: Stop any movement of axis if Input is not active
« on: December 29, 2017, 02:43:46 AM »
Hi,

i think you have to "split" this into two parts.

part 1 witch is in the macro what enables the nailer.
here you have to wait for the Input after the nailing something like this:

Code: [Select]

'wait for Input1
While Input1 = false
Sleep(200)
Wend


part 2 will be in macropump, and only stop X-Axis if x-Axis is running and Input1 is off

Code: [Select]

IF ((GetoemDRO(806) > 0) and (Input1 = False)) Then
  DoOEMButton(1003)
End If


Thomas