Machsupport Forum

Mach Discussion => VB and the development of wizards => Topic started by: SteelWolf on April 01, 2015, 04:13:46 PM

Title: "Z-Correction" problem after Tool-Probing
Post 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!

Code: [Select]

...
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!
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 02, 2015, 02:59:06 AM
Hi,

have you already tryed this:

Code "G0 G53 X" & GetOEMDRO(1216) &" Y" & GetOEMDRO(1217) 

While IsMoving()
Wend
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 02, 2015, 03:29:07 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 02, 2015, 03:38:40 AM
Hi,

tested your code snipped here on my Parallel Port test machine.
worked fine.

what controller are you using ?

Thomas
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 02, 2015, 04:05:19 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 02, 2015, 05:06:14 AM
Hello Max,

can you post the complete M6End Macro.
maybe it something before this snippet.

Thomas
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 02, 2015, 05:24:43 AM
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

Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 02, 2015, 07:13:09 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 02, 2015, 08:09:24 AM
I found my code on dropbox:

Code: [Select]
'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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 02, 2015, 08:18:06 AM
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 ?
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 02, 2015, 08:22:41 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 02, 2015, 08:44:29 AM
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:

Code: [Select]


'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 )
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 02, 2015, 08:53:59 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 02, 2015, 11:46:00 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 03, 2015, 04:30:20 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: TPS on April 03, 2015, 07:31:11 AM
Hi,

this macros worked here.

M6Start
Code: [Select]
 
'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: [Select]
'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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: SteelWolf on April 03, 2015, 10:12:32 AM
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
Title: Re: "Z-Correction" problem after Tool-Probing
Post by: BR549 on April 03, 2015, 10:13:47 AM
Might want to readup on RunScript ()