Mach Discussion > VB and the development of wizards

Auto tool zero Help

(1/2) > >>

rlbob:
Hello,
I just buy chinise VEVOR 3 Axis 3040 CNC. the manufacturer has given the following code for auto tool zero, but it doesn't work:

'Rem   Probe Down by PEU (Based on Erniebro Work)
FeedCurrent = GetOemDRO(818)    'Get the current settings
ZCurrent = GetDro(2)
Code "G4 P1"         'Pause 1 second to give time to position probe plate
Code "F1"         'slow feed rate to 10 MM/MIN
GageH = GetOEMDRO (1002)
Rem   Probe Down by PEU (Based On Erniebro Work)
FeedCurrent = GetOemDRO(818)    'Get the current settings
ZCurrent = GetOemDro(802)
Code "G4 P1"         'Pause 1 second to give time to position probe plate
Code "F1"         'slow feed rate to 10 MM/MIN
GageH = GetUserDRO(1152)
ZNew = ZCurrent - 30      'probe down 30mm
Code "G31 Z" &ZNew
While IsMoving()
Wend
Call SetDro (2,GageH)
FinalMove = GageH * 1
Code  "G0 Z" &FinalMove
Code  "G0 Z" &30
Code "F" &FeedCurrent        'restore starting 


Can somebody help me? I'm new to mach3.

JohnHaine:
What horrible code! Seems to repeat itself.  Despite the comments the probe feed rate is 1mm/minute so you could be waiting a long time!
Have you checked that the digitise input is working in the diagnostics tab? Where have you put that code?

rlbob:
Yes. I checked in diagnostics tab, input works well. I copy this code  in "Auto Tool Zero" script.

TPS:
this is a very simple/basic z-probe script for metric use:


--- Code: ---
'simple Z-probe
GageH = 20   'enter the gauge height here
FeedCurrent = GetOemDRO(818)  'Get the current settings
ZNew = GetOemDro(802) - 30      'probe down 30mm
Code "G31 Z" &ZNew & " F10"   'do the probing with 10mm/s
While IsMoving()
Wend
Call SetDro (2,GageH)
Code  "G91 G0 Z10"
Code  "G90"
Code "F" &FeedCurrent                 'restore starting

--- End code ---

JohnHaine:
That looks good! Simple and should do the job.  Only comment is that if the touch isn't detected in the 30mm the touch plate will get squashed.  A refinement is to probe down at say 50mm/min until touch, then withdraw say .5mm, then probe slowly at say 5mm/min.

When you say you copied the code into the "Auto Tool Zero" script, do you mean that you pasted it into the button script?  That should be fine, though for historical reasons my script is in a macro (M900) which is called from the button script.

Navigation

[0] Message Index

[#] Next page

Go to full version