Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: SteelWolf on April 01, 2015, 04:13:46 PM
-
Hello,
It seems that all my problems are related to some sort of weird axis movement (normally Z)
But now it should be a basic mach3 thing that i simply dont see.
How can this behaviour be disabled:
In my M6END file:
After probing a tool and retracting from the sensor I make X&Y movement to the workpiece but my Z-Axis moves the difference between the last during that move!
...
Tool_Offset = getVar(2002)+GetOEMDRO(49) 'get probe-trip abs
Call setOEMDRO(42, Tool_Offset)
Code "g0 g53 Z" & GetOEMDRO(54)
While IsMoving()
Wend
Code "g0 g53 Y" & GetOEMDRO(1217) &"g0 g53 X" & GetOEMDRO(1216)
While IsMoving()
Wend
...
means: on the "Code "g0 g53 Y" & GetOEMDRO(1217) &"g0 g53 X" & GetOEMDRO(1216)
While IsMoving()
Wend" it also starts to moves the Z-Axis simultaneously (this often triggers the Z-Limit switch)
Any ideas what Im missing here?
Thanks!
-
Hi,
have you already tryed this:
Code "G0 G53 X" & GetOEMDRO(1216) &" Y" & GetOEMDRO(1217)
While IsMoving()
Wend
-
I also seperated the x and y commands
it doesnt matter
it tries to "correct" the zero plane to the mill tip on the first x or y move
-
Hi,
tested your code snipped here on my Parallel Port test machine.
worked fine.
what controller are you using ?
Thomas
-
Im using the ethernet smoothstepper, but no idea if this can be a problem with the controller?
This snippet is from the M6end file
basically the same code is used in a dedicted probing routine that just measures the tool height and works without problems.
It must have something to do with previous z-correction commands or something alike.
If i change the tool offset _before_ the M6end toolprobe routine. It even tries to correct it when approaching my tool-probe.
(That means it crashes into my 4th axis when given a more negative value because the tool sensor is right behind it and it makes an interpolated move between programmed move and Z correction value.
Max
-
Hello Max,
can you post the complete M6End Macro.
maybe it something before this snippet.
Thomas
-
Unfortunately m at work right now.
I will post it when im back home.
But the problem , as mentioned above, also occurs before the probing routine (when i change the tool length manually while the spindle is at the change position)
There is the same positioning code, except it has the sensor coordinates as target.
There are just some output switch commands for leds and one If(reference check I think) before the positioning (probably not the problem)
It just acts like it _has_ to set the tool zero as its absolute zero everytime in this M6end file
Max
-
Hello Max,
i tested this:
Call setOEMDRO(42, 100)
Call setOEMDRO(1216, 40)
Call setOEMDRO(1217, 60)
Code "g0 g53 Z" & GetOEMDRO(54)
While IsMoving()
Wend
Code "g0 g53 Y" & GetOEMDRO(1217) &"g0 g53 X" & GetOEMDRO(1216)
While IsMoving()
Wend
on my testmachine (parallel port)
an it worked well.
so for the moment i am out off ideas.
Thomas
-
I found my code on dropbox:
'code "M1002"
DeActivateSignal(Output14)
DeActivateSignal(Output16)
DeActivateSignal(Output17)
If GetOEMDRO (24) <>0 Then
code "g0 g53 x" & GetOEMDRO(1218) & "g0 g53 y" & GetOEMDRO(1219) 'Move to Tool-Probe
While IsMoving()
Wend
code "g0 g53 x" & GetOEMDRO(1218) & "g0 g53 y" & GetOEMDRO(1219) 'Go to probe Position
While IsMoving()
Wend
'Probing process
code "g0 g53 z" & -GetOEMDRO(1220)
While IsMoving()
Wend
code "g31 z-1000 f700"
While IsMoving()
Wend
code "M1002"
code "M1010"
code "g53 g0 z" & GetOEMDRO(85)+3
While IsMoving()
Wend
code "g31 z-1000 f50"
While IsMoving()
Wend
code "M1002"
Axis_Pos = GetOEMDRO(85)
Tool_Offset = Axis_Pos
Call setOEMDRO(42, Tool_Offset)
Code "G0G53 Z" & GetOEMDRO(54) 'safe-Z
While IsMoving()
Wend
Code "G0G53 X" & GetOEMDRO(1216) & "G0G53 Y" & GetOEMDRO(1217)
While IsMoving()
Wend
'Restart coolant
If GetUSERLED(1200)<>1 Then
If GetOEMLED(12) Then
Else
DoOEMButton(114)
End If
SetUSERLED(1200, 1)
End If
Else
MsgBox "Keine Werkzeug-Nummer gewählt",0
End If
Still makes no sense to me :/
But thanks for your effort!
Max
-
Hello Max,
i have seen you do macro calls inside the macro.
i had also unexpected courious things when i did this.
somewhere is written not to call macros in a macro.
yust a idea.
Thomas
Was macht der deutsche Text bei der Msgbox ?
-
found it,
The only restriction is that you are advised not to call another script from within a script
from:
http://www.machsupport.com/Mach3Wiki/index.php?title=Mach_specific_Subroutines/Functions_grouped_by_purpose
Thomas
-
I already commented the macro call out (just blinking leds..) without any success :/
But ill try it again when im back home.. maybe i missed something.
Is this a wrong syntax for msgbox?
The german text says that no tool number was chosen
Max
PS:
The M6start:
'Save coolant
SetUSERLED(1200, 1)
If GetOEMLED(12) Then
DoOEMButton(114)
SetUSERLED(1200, 0)
End If
SetOEMDRO(1216,GetOEMDRO(83)) 'Save x
SetOEMDRO(1217,GetOEMDRO(84)) 'save y
Code "M1001"
Code "G0G53 Z" & GetOEMDRO(54)
While IsMoving()
Wend
code "g0 g53 x" & GetOEMDRO(33) & "g0 g53 y" & GetOEMDRO(34)
While IsMoving()
Wend
tool = GetSelectedTool()
SetCurrentTool( tool )
-
ich kann den deutschen Text schon lesen, kein Problem.
ok let's carry on in english to keep al the others in the race.
maybe one of the ethernet SS guy's can test this code, because as said
it is running here fine.
Thomas
-
The problem is that its hard to reproduce outside of the M6end file
But I will try this today to maybe isolate it a bit more.
Isnt there maybe a basic mach3 setting or "mode" that triggers this behaviour? (that I missed)
Max
-
Still no results.. it seems to only act this way inside a tool-change cycle.
It also moves Z-Axis when approaching the sensor.. so even before any G43 movement.
Greetings,
Max
-
Hi,
this macros worked here.
M6Start
'Save coolant
SetUSERLED(1200, 1)
If GetOEMLED(12) Then
DoOEMButton(114)
SetUSERLED(1200, 0)
End If
SetOEMDRO(1216,GetOEMDRO(83)) 'Save x
SetOEMDRO(1217,GetOEMDRO(84)) 'save y
'Code "M1001"
message "Fahre Save-Z"
Code "G0G53 Z" & GetOEMDRO(54)
While IsMoving()
Wend
message "Fahre zur Ref-Switch Pos."
code "g0 g53 x" & GetOEMDRO(33) & "g0 g53 y" & GetOEMDRO(34)
While IsMoving()
Wend
tool = GetSelectedTool()
SetCurrentTool( tool )
M6End:
'code "M1002"
DeActivateSignal(Output14)
DeActivateSignal(Output16)
DeActivateSignal(Output17)
If GetOEMDRO (24) <>0 Then
message "Fahre zur Tool Probe"
code "g0 g53 x" & GetOEMDRO(1218) & "g0 g53 y" & GetOEMDRO(1219) 'Go to probe Position
While IsMoving()
Wend
'Probing process
message "Z-Vorpos"
code "g0 g53 z" & -GetOEMDRO(1220)
While IsMoving()
Wend
message "Z-Probe schnell"
code "g31 z-1000 f700"
While IsMoving()
Wend
' code "M1002"
' code "M1010"
message "Z-Probe Rückzug"
code "g53 g0 z" & GetOEMDRO(85)+3
While IsMoving()
Wend
message "Z-Probe langsam"
code "g31 z-1000 f50"
While IsMoving()
Wend
' code "M1002"
Axis_Pos = GetOEMDRO(85)
Tool_Offset = Axis_Pos
Call setOEMDRO(42, Tool_Offset)
message "Z Save Pos."
Code "G0G53 Z" & GetOEMDRO(54) 'safe-Z
While IsMoving()
Wend
message "X/Y zurück"
Code "G0G53 X" & GetOEMDRO(1216) & "G0G53 Y" & GetOEMDRO(1217)
While IsMoving()
Wend
'Restart coolant
If GetUSERLED(1200)<>1 Then
If GetOEMLED(12) Then
Else
DoOEMButton(114)
End If
SetUSERLED(1200, 1)
End If
Else
MsgBox "Keine Werkzeug-Nummer gewählt",0
End If
Thomas
-
I will try it when im back from work and IKEA o:
Did you test it with differen tool length? Because with only one tool I think the error wont occur.
Max
-
Might want to readup on RunScript ()