Home
Downloads
Mach3
Plugins
CAM Post Processors
Screensets
Purchase
Support
Forum
Tutorial Videos
Documentation
Yahoo Group
Mach Wiki
Resources
Contact Us
Links
CNCZone
German Forum
Italian Forum
Korean Forum
Portugese (Brazil) Forum
Russian Forum (RSK CNCROUTER)
Thai Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
May 25, 2012, 03:19:13 PM
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search:
Advanced search
Select from and to languages
Chinese-simp to English
Chinese-trad to English
English to Chinese-simp
English to Chinese-trad
English to Dutch
English to French
English to German
English to Greek
English to Italian
English to Japanese
English to Korean
English to Portuguese
English to Russian
English to Spanish
Dutch to English
Dutch to French
French to English
French to German
French to Greek
French to Italian
French to Portuguese
French to Dutch
French to Spanish
German to English
German to French
Greek to English
Greek to French
Italian to English
Italian to French
Japanese to English
Korean to English
Portuguese to English
Portuguese to French
Russian to English
Spanish to English
Spanish to French
Machsupport Forum
Mach Discussion
VB and the development of wizards
DROs refuse to reset in probing
Pages:
1
Go Down
« previous
next »
Author
Topic: DROs refuse to reset in probing (Read 564 times)
0 Members and 1 Guest are viewing this topic.
Mike_F
Active Member
Offline
Posts: 65
DROs refuse to reset in probing
«
on:
January 12, 2010, 06:42:35 PM »
Hi,
I have just been writing a simple script to probe the edge of a workpiece. When I step through the script, it works fine but when I run it, the X and Y DROs refuse to zero and I am always left with X at -6 and Y at +4. I have tried using the SetDro() and DoOEMButton() calls but to no avail. I am sure there is a simple explanation but it is alluding me. I also tried a search on the forum and something similar was thrown up but without conclusion.
Strange thing is that I constantly use a Z zeroing script, from which I modified the code for this one, and it works perfectly. I hope someone can help.
Mike
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
ProbeDiameter = 8 'Set Probe diameter
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
Xpos = GetDro(0)
Ypos = GetDro(1)
Zpos = GetDro(2)
' ------ Probe in X positive direction ------
Code "G31 X" & Xpos + 20 & " F50" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
XProbePos = GetVar(2000) 'get the axact point the probe was hit
'------ Re-position probe ready for Y direction probing ------
Code "G0 X" & XProbePos - 1 'Probe backs off 1mm
Code "G0 Y" & Ypos-20 'Preparation move for Y probing
Code "G0 X" & XProbePos + 10 'Preparation move for Y probing
'------ Probe in Y positive Direction ------
Code "G31 Y" & Ypos 'Probing move in Y
While IsMoving() 'wait while it happens
Wend
YProbePos = GetVar(2001) 'get the axact point the probe was hit
'------ Move probe to safe Z height and then to X0, Y0 ------
Code "G0 Y" & YProbePos - 1 'Probe backs off 1mm
Code "G0 Z" & Zpos + 30 'Retract Z
Code "G0 X" & (XProbePos + (ProbeDiameter/2))
Code "G0 Y" & (YProbePos + (ProbeDiameter/2)) 'Move to zero, zero
' DoOEMButton (1008)
Call SetDro(0,0) 'Zero X axis DRO
Code "G4 P0.5"
' DoOEMButton (1009) 'Zero Y axis DRO
Call SetDro(1,0)
Code "G4 P0.5"
Code "(X & Y axes now zeroed)"
Code "F" & CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
Exit Sub
End If
«
Last Edit: January 12, 2010, 06:44:26 PM by Mike_F
»
Logged
Mike_F
Active Member
Offline
Posts: 65
Re: DROs refuse to reset in probing
«
Reply #1 on:
January 13, 2010, 09:01:09 AM »
Hi,
Problem solved - I did a little more searching and found that I needed to add another 'While' 'Wend' with a 'Sleep(1000)' after the machine moves to zero, zero and before the re-setting of the DROs. As I inderstand it, this is to allow time for the axes to move before the code moves on to the next command.
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
ProbeDiameter = 8 'Set Probe diameter
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
Xpos = GetDro(0)
Ypos = GetDro(1)
Zpos = GetDro(2)
' ------ Probe in X positive direction ------
Code "G31 X" & Xpos + 20 & " F50" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
XProbePos = GetVar(2000) 'get the axact point the probe was hit
'------ Re-position probe ready for Y direction probing ------
Code "G0 X" & XProbePos - 1 'Probe backs off 1mm
Code "G0 Y" & Ypos-20 'Preparation move for Y probing
Code "G0 X" & XProbePos + 10 'Preparation move for Y probing
'------ Probe in Y positive Direction ------
Code "G31 Y" & Ypos 'Probing move in Y
While IsMoving() 'wait while it happens
Wend
YProbePos = GetVar(2001) 'get the axact point the probe was hit
'------ Move probe to safe Z height and then to X0, Y0 ------
Code "G0 Y" & YProbePos - 1 'Probe backs off 1mm
Code "G0 Z" & Zpos + 30 'Retract Z
Code "G0 X" & (XProbePos + (ProbeDiameter/2))
Code "G0 Y" & (YProbePos + (ProbeDiameter/2)) 'Move to zero, zero
While IsMoving()
Sleep (1000) 'Pause code while machine moves
Wend
' DoOEMButton (1008)
Call SetDro(0,0) 'Zero X axis DRO
Code "G4 P0.5"
' DoOEMButton (1009) 'Zero Y axis DRO
Call SetDro(1,0)
Code "G4 P0.5"
Code "(X & Y axes now zeroed)"
Code "F" & CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if applicable
Exit Sub
End If
The added code is in red. The routine now works brilliantly - now all I have to do is to work out how to add a button to the screen set and attach the code to it.
Mike
Logged
Pages:
1
Go Up
« previous
next »
Jump to:
Please select a destination:
-----------------------------
Mach Discussion
-----------------------------
=> General Mach Discussion
=> Mach3 under Vista
=> Quantum
=> Mach SDK plugin questions and answers.
===> Finished Plugins for Download
=> VB and the development of wizards
=> Brains Development
=> Video P*r*o*b*i*n*g
=> Mach Screens
===> Screen designer tips and tutorials
===> Works in progress
===> Finished Screens
===> Flash Screens
===> JetCam screen designer
===> Machscreen Screen Designer
===> CVI MachStdMill (MSM)
=> Feature Requests
=> Non English Forums
===> Italian
===> French
===> Spanish
===> Chinese
===> German
===> Russian
===> Romanian
===> Japanese
===> Vietnamese
=> FAQs
-----------------------------
*****VIDEOS*****
-----------------------------
=> *****VIDEOS*****
-----------------------------
General CNC Chat
-----------------------------
=> Share Your GCode
=> Show"N"Tell ( What you have made with your CNC machine.)
=> Building or Buying a Wood routing table.. Beginnners guide..
=> Show"N"Tell ( Your Machines)
-----------------------------
G-Code, CAD, and CAM
-----------------------------
=> G-Code, CAD, and CAM discussions
=> LazyCam (Beta)
-----------------------------
Third party software and hardware support forums.
-----------------------------
=> LazyTurn
=> GearoticMotion Preliminary testing
=> Tempest Trajectory Planner
=> Contec
=> dspMC/IP Motion Controller
=> HiCON Motion Controller
=> Third party software and hardware support forums.
=> Galil
=> Newfangled Solutions Wizards
=> Mach3 and G-Rex
=> Mesa
=> Modbus
=> NC Pod
=> PoKeys
=> SmoothStepper USB
=> Sieg Machines
=> Promote and discuss your product
-----------------------------
Tangent Corner
-----------------------------
=> Tangent Corner
=> Competitions
=> Polls
=> Bargain Basement
-----------------------------
Support
-----------------------------
=> Downloads
===> XML files
===> Post Processors
===> Macros
===> Tutorials
===> Others
===> Beta Brains
===> Screen Sets
===> Documents
===> MACH TOOL BOX
=> One on one phone support.
=> Forum suggestions and report forum problems.
-----------------------------
Mach4
-----------------------------
=> Mach4 pre-Alpha Testing
Loading...