Probe auto offset

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Probe auto offset

Postby renotec » Thu Feb 24, 2022 7:01 pm

Hi all,

Because my probe is offset from the spindle (about +50mm X, Y), I have to enter manually X, Y offset value every time after probing (probe screen, page 2, out corner).
Is there anyway "Zero Probed Axis" option subtract offset automatically ? (similar like "move offset" in Camera page).

Thank you in advance.
renotec
 
Posts: 6
Joined: Sun Feb 02, 2020 1:40 pm

Re: Probe auto offset

Postby Battwell » Thu Feb 24, 2022 7:31 pm

use g52 X ... Y....
replace the .... with whatever your offset is.

this is a temporary offset. ( i use it for my laser)
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Probe auto offset

Postby dezsoe » Thu Feb 24, 2022 7:38 pm

There will be an option to offset the probe results, but that is not finished yet. Here is a macro that moves the current work offset. Save it as Mxxxx.txt where xxxx is 20000..21999 and place a button on screen with this number to call it. (Of course, you may call the macro from MDI if you don't want a button.)

Code: Select all
// ================================================================================================
// Offset current fixture
// ================================================================================================

// offsets: X, Y, Z, A, B, C

double[] offsets = {1.0, -1.0};

int fixture = GetFixture();

int fieldbase = _G54_WorkoffsetX + 6 * (fixture - 1);

string cmd = "G10 L2 P" + fixture.ToString();

for (int i = 0; i < offsets.Length; ++i)
  cmd += " " + "XYZABC"[i] + (AS3.Getfielddouble(fieldbase + i) + offsets[i]).ToString("F6");

exec.AddStatusmessage(cmd);

exec.Codesync(cmd);
while (exec.IsMoving()) ;

// ================================================================================================

#Events

// ================================================================================================

const int _G54Button = 118;                                                     // G54..G59 buttons (118..123)
const int _G54_WorkoffsetX = 133;                                               // + 6 * (FixtureNo - 1) + (Axis - 1)

int GetFixture()
{
  for (int i = 0; i < 6; ++i)
    if (AS3.Getbuttonstate(_G54Button + i))
      return i + 1;
  return 0;
}

// ================================================================================================
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Probe auto offset

Postby crjohnson » Mon Feb 06, 2023 9:49 am

Hi Dezsoe,

I am looking to mount my probe to the side of the spindle as mentioned in the original post, if using your macro above, will all the other probing options still work as normal?

I would like to setup the tool length and work piece offset in the future (for different tool lengths, tool changes etc), but do not know if this will function as per normal.

If I also want to mount the probe in the spindle, will I have to change the offsets in the macro to zero? Or just use the standard probing functions as per normal?
Thank you,
Craig
crjohnson
 
Posts: 33
Joined: Wed Feb 23, 2022 4:46 am


Return to Macros

Who is online

Users browsing this forum: No registered users and 11 guests