Chris Radek wrote on 08/11/2007 21:05:
> Hi all, I don't want to distract everyone from EMC2.2 but I've done
> some fun stuff in TRUNK (pre-2.3) with probing.  I don't think many
> people are using probes but I know some are, and they might like to
> try it.  I'd appreciate any reports of success or failure.
> 
> There are some new Gcodes documented here:
> 
> http://www.linuxcnc.org/docs/devel/html/gcode_main.html#sub:G38.2:-Straight-Probe
> 
> which allows much smarter probing without all the wasted motion.

NICE!

Really. This is really, really nice. Thanks a lot. I still don't have my
probe finished, but I most certainly will tackle that when I'm back from
my holidays in Florida.

> and the results are something like this (the program preview is
> I think with these new G38.x primitives there are a lot of smart ways
> you could probe a shape.  If you write one let us know!

Well, together with G43.1, I think this gives all the really difficult
parts of what I need to do dynamic (automatic) tool length adjustments
after manual tool change in some O-code sub, with no input from the
surrounding program (apart from the tool number wanted).

However:
Can a gcode-program _read_ the current tool length offset (for G43 or
G43.1 tool length offsets)?
Can a gcode-program read the current positions and current offsets?

This is basically what such a subroutine would look like in pseudo-code:

store current tool position and coordinate system
turn off tool length compensation
turn off spindle
switch to machine coordinates [1]
go to a safe height (usually highest possible Z on my machine)
go to X/Y coordinate of tool length sensor
Select the tool wanted
Use G38.2 to tip the sensor
Abort program if this fails
Use G38.4 to release sensor
If no tool is selected yet
   (does emc even allow this to happen or does it always use
    some "default" or "last used" tool?)
   Store Z(from G38.4)-Zsensor in current original_tool_length
    (where Zsensor is the approximate height of the sensor)
   Store 0 as new tool_offset assuming that the user did the touch-off
    with the first tool already, even though it wasn't yet selected)
else
   Select the tool wanted
   Use G38.2/G38.4 as above
   Store Z-Zsensor as new tool_length
   store tool_length-original_tool_length in tool_offset
endif
go back to safe height
restore original coordinate system
set G43.1 to tool_offset
go to original X/Y at safe height
go to original Z

This basically simulates the behaviour from the DOS-based CNC program I
used before EMC (and which I must admit I still use for programs which
need multiple tools). If EMC wouldn't allow the "no tool selected yet
condition", that could of course be worked around by having a variable
which is set to 0 at program start (somehow) to emulate that. Or by
having one O-sub for the first tool at and another O-sub for subsequent
tools. But the main blockers I still see is the very first line (and the
last two lines):
Store/restore the current position and coordinate system.
I couldn't see how I could read the current coordinates. And wether or
not #5220 always represents the currently selected coordinate system is
also not 100% sure from
http://www.linuxcnc.org/docs/devel/html/gcode_main.html#sub:Coordinate-Systems
or http://www.linuxcnc.org/docs/devel/html/gcode_main.html#sub:Parameters

One last question: Is using

G0 G53 X0 Y0 Z0

equivalent to

G10 L2 P9 X0 Y0 Z0
G59.3
G0 X0 Y0 Z0
G54

Assuming that the program doesn't otherwise use the G59.3 coordinate
system and was in the G54 coordinate system before each of these?

Regards,
Sven

PS: I know that the "traditional" M6 may change the (tool/working)
positions of/on all axes. But I actually like the behaviour of the old
program of returning to the previous position (though it had its
drawbacks, since it returned to the exact same _machine_ position, which
was fatal if the new tool was longer than the previous and the previous
was in contact with the working piece right before M6.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to