Machsupport Forum
Mach Discussion => VB and the development of wizards => Topic started by: fragger6662000 on July 16, 2012, 06:46:55 AM
-
Hi
I am trying to carry out a protected move macro so if i move the machine and the probe hit something it will stop.
I have got the macro to work by comparing the target position and the g31 triggered position but cannot get the macro to stop exicuting
i have tried
code "m0" and Dooembutton(3)
if i do the second i cannot gcode program to load when loading.
I am trying to get the cycle to work in this manor
#100=0 (x position)
#101=0 (y position)
#102=0 (z position)
M1000 (is the protected move macro)
thanks
-
There is no protected move mode in MACH3. AND in its current state I don't think you can create it in CB macros.
First you would need to be able to SEE when you were in G0 mode and then create a macropump or brain to stop when in G0 mode AND the Probe LED goes active.
Just a thought, (;-) TP
-
I am created the protected move by using a g31 X Y Z
then comparing the current position with the target position.
if the difference between the target is greater than 0.1mm for example you know that the probe has been triggered
so then i want to stop the macro
i have tried
message "path obstrujected"
code "M0"
but this seams not to work and the M0 is ignored.
I have tried
STOP
but then nothing happened
-
But you are not creating a protected move as in the real world you do NOT know what the actual value of the move should be you just probe in a direction with overrun to make sure you get to the intended target.
A protected move would be during a G00 move and the probe HIT something THEN you want the motion to stop.
What you are doing is a Compare to know values +/- .
Post your macro code.
(;-) TP
-
i have not got the code here but this is how it works
set #100#101 #102 to the xyz position you want to go to.
then call the macro EG M1000
in M1000
get #100 #101 #102
code "g31x" #100 "y" #101 "z" #102 "f1000"
then i compare the finished position with the DRO position
if the error on any axis is >100um then you can assume the probe has hit some thing.
so if the target = the dro then continue
else
STOP THE process.
-
All i want to do is stop the macro process and gcode program with it stopping the pre processing
I have already have the protected moves working.
-
Something along these lines will work. The #2000 Var is set for testing ONLY. Please Note that the probe STOPPED axis dro position will never be the same as the trip position(#2000) so it is best to use the trip position to compare. Also note that IF you did not calibrate the probe then the trip position is NOT the same as the actual touch point. it will be OFF by the switch travel to trip value.
'Macro to Probe, Compare values to stop
SetVar(2000,.4)
SetVar(100,1)
SetVar(200,1)
Code"G31 X#100 Y#200 F20"
While Ismoving()
Wend
If GetVar(2000) >= GetVar(100) Then
Message" Target Missed Mach3 will stop "
DoButton(3)
End
End If
If GetVar(2000) < (GetVar(100)-.5) Then
Message " Premature Target Strike Mach3 will Stop"
DoButton(3)
End If
End
(;-) TP
-
Great so not
STOP
But
END
Thanks