Hello Guest it is October 20, 2019, 12:27:37 AM

Author Topic: prevent G31 from writing to file  (Read 3844 times)

0 Members and 1 Guest are viewing this topic.

prevent G31 from writing to file
« on: October 06, 2012, 09:46:33 AM »
Hi,

I'm trying to build a digitizing routine where the probe rasters horizontally by a certain distance, then if it hasn't touched anything, head downwards in z until the probe contacts something.


The problem I'm anticipating is that I'll need to use G31 to stop horizontal motion if the probe contacts before the z-axis movement is initiated. However, if contact ISNT made during the horizontal movement, is a coordinate written to the saved file of measured x,y,z coordinates? If so, that would mean a coordinate is recorded in thin air :(


Is there a way to prevent this? I'm effectively trying to reproduce the raster tchnique in this video: http://www.youtube.com/watch?v=IcVv1So1n_8

Re: prevent G31 from writing to file
« Reply #1 on: October 06, 2012, 10:15:01 AM »
I've just realised that G31 will continue moving in a straight line and won't write coordinates to a file until the probe is triggered.

Is there a way to say "while x<target, keep moving, but stop if x>=target" ?
Re: prevent G31 from writing to file
« Reply #2 on: October 08, 2012, 09:21:56 PM »

This code will move X axis negative .25" if it does make probe contact at .25" it then descended Z axis in the negative direct for up to an inch.

  Code "G31X -.25 F" & Probing_Feed 'G31 X~ Y~ Z~ A~ B~ C~ to perform a straight probe operation
  While IsMoving() 'Waiting for the move
  Wend
  Code "G4 P0.25" 'G4 P~ . Dwell the axes non-moving for time in seconds or milliseconds
  Probe_Move_neg_X = GetVar(2000)   'Store probe location at the time the probe contacts
 If Probe_Move_neg_X  <  .25 then
   Code "G31 Z-1 F" & Probing_Feed 'G31 X~ Y~ Z~ A~ B~ C~ to perform a straight probe operation
  While IsMoving() 'Waiting for the move
  Wend
  Code "G4 P0.25" 'G4 P~ . Dwell the axes non-moving for time in seconds or milliseconds
  Probe_Move_neg_Z = GetVar(2002)   'Store probe location at the time the probe contacts
End If