Hello Guest it is March 28, 2024, 08:59:31 PM

Author Topic: Predefined action does not perform the expected operation "Zero X"  (Read 2292 times)

0 Members and 1 Guest are viewing this topic.

Offline Bill_O

*
  •  563 563
    • View Profile
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #10 on: January 25, 2021, 05:02:01 PM »
Brian,

The head shifts work great.

Bill
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #11 on: January 26, 2021, 12:10:50 PM »
Yeah that is a Mach4 original because I have needed it in the past on OEM's I have worked with :) It sure is nice to see people using the stuff I came up with in my little brain ;)
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #12 on: February 02, 2021, 11:25:34 AM »
Ok so i had mistaken how G92 works and have now removed all G92. The only problem i have now is that tool offset is accounted for but applied after toolchange.

So i do a Z probe move, probe triggers and i save the position. (local ZBefore = mc.mcAxisGetPos(inst, 2)
I go to manual toolchange position and put up a dialog to change tool.
After pressing ok the machine returns to probe location and does another probe move. When the probe triggers i set the axis position to the saved value. (mc.mcAxisSetPos(inst, 2, ZBefore)  )

Now i get my problem: When my program now continiues after running the script my position is offset Per the tool table resulting in my job continues "selected tools offset" higher than it started...
What is the best way to correct this?
Can i just add the offset before setting the axis position like:
mc.mcAxisSetPos(inst, 2, ZBefore + mc.mcToolGetData(finst, mc.MTOOL_MILL_HEIGHT,  mc.mcToolGetSelected(inst))  )
?????
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #13 on: February 02, 2021, 11:42:24 AM »
Are  you trying to touch off the offset at every toolchange? If so we have some files that will do that for  you that have been done and tested in the past.

Thanks
Brian
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #14 on: February 02, 2021, 12:06:54 PM »
Exactly! The offsets i set are estimated offsets as i use ER25 Collet with a wide range of tools...

Which files are you talking about?
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #15 on: February 02, 2021, 12:39:55 PM »
Hold please ;) I am going to see if Rob can find and post this here ...
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com

Offline Rob G

*
  •  16 16
    • View Profile
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #16 on: February 02, 2021, 01:57:32 PM »
Here are two tool touch off sequences.  One is in an m6 with a tool touch off implemented in it.  In the m6, the tool is probed in the same position on the machine table either with a touch off block or a genuine probe. 
 
The other,  is a stand alone touch off script. It contains variables at the the beginning of the script that can be edited to manipulate the probing process.  The variables  could easily be added to a tool change macro, or could be turned into registers and linked to DRO's on the screen for instant manipulation.

Take a look at these and let me know if you need any help getting any of this working in your scripts, or current tool change macro.

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #17 on: February 02, 2021, 07:07:21 PM »
Thank you for the help!
Reading the script code i see no big difference in what is beeing done. but looking at the bigger picture i can see how my approach could introduce exponential error reprobing an already probed definition. I intend to update my solution using your scripts so is the below correct?

Start up workflow should be something like:
Prerequisite is to have the touch off probe (or block) X,Y and Z position stored in registry or in variables in your script. Zposition stored would typically be the Spindle Collet offset determined by probing the touch off probe with no tool mounted (Precision is not an issue as any error will be cancelled by the TLO when probed).


-Ref. All Home - Because we need to know where we are in relation to the touchoff probe position
-Mount your first tool and probe it for TLO (using tool_touch_off.mcs). This will update the tool table using:
      mc.mcToolSetData(inst, mc.MTOOL_MILL_HEIGHT, CurTool, OffsetVal)
-Run your program! When you encounter an M6 Tool Change, the machine will no longer need to probe the current tool as its value has already been updated in the Tool Table when setting up the machine during startup. Therefore the current tool can be removed without probing. After challenging the user to mount the new tool the user continues the script and the machine basically runs the same TLO Probe routine as was run during startup but using the Selected (new) tool as input.

Offline Bx3mE

*
  •  68 68
    • View Profile
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #18 on: February 02, 2021, 07:13:17 PM »
And also... is this the Zposition captured by the controller during the last G31?
local probedz = mc.mcCntlGetPoundVar(inst, mc.SV_PROBE_POS_Z) -- Z Probe position in Machine coords

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Predefined action does not perform the expected operation "Zero X"
« Reply #19 on: February 03, 2021, 06:50:55 PM »
mc.SV_PROBE_POS_X to mc.SV_PROBE_POS_C for user coordinates

and

mc.SV_PROBE_MACH_POS_X  to mc.SV_PROBE_MACH_POS_C for machine coordinates.

If the probe does not strike, the end points of the G31 move is stored.  This gives you the ability to determine if the probe struck or not with a little bit of math. 

All positions are captured, no matter which axis was moving during the G31. 

Steve