Hello Guest it is November 26, 2020, 05:00:35 AM

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

461
German / Re: Bauteil ausrichten
« on: July 09, 2019, 02:39:00 PM »
das ist meine Lösung für 4 Punkte, aber sehr spezifisch, dennoch sollte das Grundprinzip klar werden.

Code: [Select]
'Antasten Werkstück (gedreht)
Public Function TouchG()
Message "Antasten schraeges Bauteil"

'Parameter holen
X = GetUserDro (1055) 'delta der X-Punkte
Y = GetUserDro (1056) 'delta der Y-Punkte
CurrentToolDiameter = GetUserDro (1027)

'Parameter prüfen
If X = 0 Then
MSGBox "Delta X zu klein!",vbOK + vbCritical ,"Fehler !"
Exit function
End If
If Y = 0 Then
MSGBox "Delta Y zu klein!",vbOK + vbCritical ,"Fehler !"
Exit function
End If

'PI vorbesetzen -----------------------------------------------
pi=4*Atn(1)

'Koordinatendrehung ausschalten
Code "G69"
Sleep(200)

'X / Y auf null setzen
    Call SetDro (0,0)
    Call SetDro (1,0)
Sleep(200)

'die Y Seite vermessen

'P1 antasten
Probe 100,0,0
'Koordinaten P2
    X1 = GetVar(2000)
    Y1=0

'Vorposition P2 anfahren
Message("Vorposition P2 anfahren")
    Y2 = Y
    Code "G91 G1 X-" &X & "F1800"
WaitForMove(True)
    Code "G91 G1 Y" &Y2
WaitForMove(True)

'P2 antasten
Probe 100,0,0
'Koordinaten P2
    X2 = GetVar(2000)

    'die X Seite vermessen -----------------------------------------------

'Vorposition P3 anfahren
Message("Vorposition P3 anfahren")
X3 = X1 + (CurrentToolDiameter/2) + 10
    Code "G91 G1 X-" &X & "F1800"
WaitForMove(True)
    Code "G90 G1 Y-30"
WaitForMove(True)
    Code "G90 G1 X" &X3
WaitForMove(True)

'P3 antasten
Probe 0,100,0
'Koordinaten P3
    Y3 = GetVar(2001) 

'Vorposition P4 anfahren
Message("Vorposition P4 anfahren")
    X4 = X3 + X
    Code "G91 G1 Y-20 F1800"
WaitForMove(True)
    Code "G90 G1 X" &X4
WaitForMove(True)

'P4 antasten
Probe 0,100,0
'Koordinaten P4
    Y4 = GetVar(2001) 'get the probe touch location

'Z auffahren
Code "G91 G01 Y-0.2 F1800"
WaitForMove(True)
    Code "G91 G1 Z20"
WaitForMove(True)

'Brechnung
t1= (X4-X3)*(Y1-Y3)-(Y4-Y3)*(X1-X3)
b1= (Y4-Y3)*(X2-X1)-(X4-X3)*(Y2-Y1)
ua=t1/b1

'Nullpunkt berechnen
XH=X1+ua*(X2-X1) ' X Home  distance away
YH=Y1+ua*(Y2-Y1) ' Y Home  distance away

' Message("Koordinaten Nullpunkt : X " &XH &" Y " &YH)
' Sleep(200)


'Winkel aus der längeren Seite berechnen
If X>Y Then
'längere Seite=X
a=(Y4-Y3)
b=(X4-X3)
v=a/b
NewAngle=Atn(v)*(180/pi)
Else
'längere Seite=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
' Message("Neuer Winkel : " &NewAngle )
' Sleep(200)

'zum neuen Nullpunkt fahren
'Winkel = errechneter Winkel + 45°
siWi = 2*Pi/360*(NewAngle+45)
hyWi = SQR((CurrentToolDiameter/2)*(CurrentToolDiameter/2)*2)

Dx = hyWi * Cos(siWi)
Dy = hyWi * Sin(siWi)
' Message("Koordinaten Berechnung : X " &Dx &" Y " &Dy)
' Sleep(200)

'Zu neuen Nullpunkt fahren
    Code "G90 G1 X" &XH+Dx & " Y" &YH+Dy
WaitForMove(True)

'neuen Nullpunkt setzen
    Call SetDro (0,0)
    Call SetDro (1,0)

'Koordinatendrehung setzen
    Call SetOemDro (118,NewAngle)

'Koordinaten ausgeben
' Message "X1 " &X1 &" Y1 " &Y1 & "   X2 " &X2 &" Y2 " &Y2 & "   X3 " &X3 &" Y3 " &Y3 & "   X4 " &X4 &" Y4 " &Y4

'wieder auf absolut stellen
Code "G90"
Message ""

End Function

462
FAQs / Re: parallel port to serial
« on: July 09, 2019, 02:33:49 PM »
if you are on the "retrofit road" IHMO the first things are (before buying anything):

-figure out witch stepper Motors are mounted, to get a idea witch stepper Controllers will fit.
-figure out witch spindle is mounted, to get a idea witch Controller will fit.

SmoothStepper is not a bad idea, even i am not a fan of These 5v Controllers.

463
FAQs / Re: parallel port to serial
« on: July 09, 2019, 02:41:29 AM »
after a while of searching on the net, it Looks like the machine has a standalone Controller, and the Serial Interface is
used for file Transfer (GCode or HPGL). But found no Information about the used protocol.

if the supplier is not able to give some documentation, it will be very hard maybe impossible to figure this out.

anyway it will not be "compatible" to Mach3/4.

the only way i see is to use the existing stepper's and do a "retrofit" with new stepper Controllers and external Motion
controler. plus an other new controler for the spindle.

464
Tangent Corner / Re: It's a Dog thing.
« on: July 08, 2019, 02:00:59 PM »
it is allway's the Point of view.
a cat likes mouses raw, i don't like them well done.

465
General Mach Discussion / Re: Plasma ignition and stop lag problem
« on: July 06, 2019, 06:59:30 AM »
if your run in Plasma mode with THC on, it will allways wait until torch on Signal Shows up.

466
General Mach Discussion / Re: Crazy zero
« on: July 06, 2019, 03:04:59 AM »
from your code:

...
Z0.6
G28 G91 Z0.
G90
...

from Mach3 GCode help:
G28 should not be used in one line with G90/G91


Switch your machine ti single BLK mode and step through code to see where exactly the move up is initiated.




467
General Mach Discussion / Re: Plasma ignition and stop lag problem
« on: July 06, 2019, 02:51:05 AM »
there is a G04 in your GCode witch causes the delay


...
Z1
Z0
M3
G4P1
G3X-0.8I-1.3J-50.4F2000
...

468
General Mach Discussion / Re: Crazy zero
« on: July 06, 2019, 02:47:23 AM »
pls post your GCode.

469
General Mach Discussion / Re: Work offset not remembered
« on: July 05, 2019, 02:15:47 AM »
you can put the following code into macropump, then the Offset will be saved every 60 seconds.

just make sure OEMDRO(1300) is not used

Code: [Select]
Const LastMsDRO = 1300 'DRO for data
Dim LastMs As Long

LastMs = GetUserDRO(LastMsDRO)
If LastMs > 6000 Then
LastMs = 0
'save the actual workoffset
Open "C:\Mach3\ActOffset.txt" For Output As #1 ' Open to write file.
'get the actual offset
wo = GetOEMDro(46)+53
Write #1, wo
Close #1
End If
LastMs = LastMs + 10
'save data
SetUserDRO(LastMsDRO,LastMs)

470
General Mach Discussion / Re: Work offset not remembered
« on: July 04, 2019, 01:32:30 PM »
ok with a Little trick

create a button on your Screen witch has the "Name" shutdown Mach or something like this.

this is the code for the button:
Code: [Select]
Sub Main()
'save the actual workoffset
Open "C:\Mach3\ActOffset.txt" For Output As #1 ' Open to write file.
'get the actual offset
wo = GetOEMDro(46)+53
Write #1, wo
Close #1

'shut down Mach3
SendKeys "%+{F4}"
End Sub

create a macro in C:\Mach3\macros\your Profile Name    for example M889.M1S

this would be the code for the macro:
Code: [Select]
Sub Main()
'read last workoffset
Open "C:\Mach3\ActOffset.txt" for Input As #2 ' Open to read file.
Line Input #2, FileData ' Read a line of data.
Close #2
' make sure that we only restore the WO once
If FileData <> "999" Then
Code "G"&FileData
End if

'clear the WO data
Open "C:\Mach3\ActOffset.txt" For Output As #1 ' Open to write file.
Write #1, 999
Close #1

End Sub

then add the M889 to your initialization string

now after restart and pressing the reset button the last workoffset should be restored