add an H4 parameter to G0/G1 for just halt when endstop is hit ?
-
i'm using the duet on a CNC
i use a touchplate as probe to ensure that my tool bit is always at the height i want from the ground (manual change)BUT as these tools are from different sizes i'm not sure about the margin i have from the maximum Z available
so on my gcode when i go up to clearance etc i use
G0 Z67 H3
(max height) followed by a
M208 Z67
to put back the limit of 67 mm or else i limit my axis possibility for the next tool.i tried H1 but then it changes my current position and i loose the job made by the probe.
what i just want is a move and you just don't go further if an endswitch is hit. and you get the position (the one that is set as max limit on H3)
also this would be good for relative coordinates mode.thanks
-
The more standard way to do this, and avoid ever changing the axis limits, is to use two touchplates for tool changes. One is fixed to the machine, semi-permanently, one is movable and will be used to set work Z just like you are doing now.
At start-of-job, execute a macro that probes straight down, just like today, the operator puts the moveable plate on top of the stock, below the tip of the bit (or probe), before probing. Therefore, that probe will set Work Z zero to the probe results (minus the thickness of the plate).
The new function, in the same macro, is: After that first probe, move to a safe Z, move XY to the fixed plate, and probe it. The macro does NOT reset work Z zero from this second probe, it just stores the results for later use during tool changes.
Later, when changing tools, another macro probes the fixed plate (only) with the new tool, adjusts work Z, and everything is fine after that.
No involving limits, no risk of hitting limits, etc, etc.
.
This write up BARELY scratches the surface (ha ha) of two plate probing. There are a ton of examples out there on how to write the macros for different machines, macros that adjust work Z, macros that adjust tool offset instead, and on and on.
Anyway, try two plate tool changes instead of messing with axis limits.
-
I never wanted to probe the upper of the stock as i'm not sure it's 100% flat
and when i do the cam the only thing i'm sure is the martir position, and so that's why i put the Z0 on the martyr
this way i can perform face then change tool and cut for example.Therfore from what i read under the lines of your answer: do you mean that we can have some sort of scripts and code and functions in the macros ??
-
@psychotik2k3 said in add an H4 parameter to G0/G1 for just halt when endstop is hit ?:
Therfore from what i read under the lines of your answer: do you mean that we can have some sort of scripts and code and functions in the macros ??
Duet/RepRap does not implement anything special for Macros (that I'm aware). Everything must be done with standard G-Codes. For example, remembering the position of the fixed plate could only be done with some clever manipulation of tool offsets. This will change when DC42 adds conditional G-Code (and some other things) to a future release.
and when i do the cam the only thing i'm sure is the martir position, and so that's why i put the Z0 on the martyr
Not sure what Martir/Martyr is???
I never wanted to probe the upper of the stock as i'm not sure it's 100% flat
That doesn't matter for two-plate probing, followed by facing, and finish cuts. In fact, it is one of the reasons that two plate probing was developed: The facing operation may very well remove all of the "top" of the stock, leaving no place to put a movable plate for the tool-change to probe with the finishing tool. Two plate probing compensates for all of that, by its very nature.
-
Having said all of that... as @psychotik2k3 pointed out, there really are not any functions or even simple math in Duet/RepRap today. That may make two plate probing impossible.
-
Simple math will come with conditional GCode. I think the H4 idea is good too and I will add it to the RRF3 work list.
-
thanks @dc42 for the H4.
To answer @Danal the martyr is the bottom wood plank you have on a CNC, it is called like that because itùs purpose is to be scratched, milled etc if your tool goes a little too deep. it's expendable.
in fact what misses me the most on the GCODE environment is the abylity to have few registers, where you can store the position and use it.
(but i'm a coder so that's why i struggle without registers ) -
@psychotik2k3 said in add an H4 parameter to G0/G1 for just halt when endstop is hit ?:
To answer @Danal the martyr is the bottom wood plank you have on a CNC, it is called like that because itùs purpose is to be scratched, milled etc if your tool goes a little too deep. it's expendable.
Spoil board in english btw
-
@psychotik2k3 RRF already can store positions ... See G60 and the R parameter of G0. The saved position can only be used for G0/G1 moves though.
-
@psychotik2k3 said in add an H4 parameter to G0/G1 for just halt when endstop is hit ?:
To answer @Danal the martyr is the bottom wood plank you have on a CNC, it is called like that because itùs purpose is to be scratched, milled etc if your tool goes a little too deep. it's expendable.
Got it. "Spoil Board" is common in the shops I've visited (USA). Nice to pick up a new term... I'll pull it out in somebody's shop, just for fun.
and when i do the cam the only thing i'm sure is the martir position, and so that's why i put the Z0 on the martyr
There is no "right" or "wrong" answer here... still... I always put Z0 on the top-of-stock, and therefore all cutting is negative Z values.
I'm curious: If Z0=Martyr (spoil), how do you zero the machine, physically, if the stock covers every bit of the martyr? This is a fairly common occurrence for me, because I tend to get stock in pieces that are "round numbers" in barbarian units, such as 24x48 inches. And that's what my machine cuts. So with fresh stock, I couldn't see the Martyr/Spoil to probe for zero...?
Again, no right or wrong, just curious.
-
@Danal said in add an H4 parameter to G0/G1 for just halt when endstop is hit ?:
I'm curious: If Z0=Martyr (spoil), how do you zero the machine, physically, if the stock covers every bit of the martyr?
I guess this is where work coordinate systems come in. Also useful for fixtures.
https://duet3d.dozuki.com/Wiki/Gcode#Section_G54_to_G59_3_Select_coordinate_systemMachine would be homed like normal, and the spoil board or fixture will have a known offset. I have yet to try this with RRF, but expect it to work like the others.
Edit just tried this in RRF3, face off spoil board at an abitrary Z height, drill a 25mm grid of 1/8" holes for dowels and return to the front left hole. I jog 1/2 the dowel width and do
G10 L20 P2 X0 Y0 Z0
now I have a work coordinate system inG55
that is at the top of my spoil board, at the front left corner when stock is aligned to the first row/column of dowels. This seems to persist across reboots and power off. Next step is to add tool height sensor and tool length offset. -
(Not asking about Work Coords, or etc. got all that, just asking about how, physically, to probe when Z0 = bottom of stock / top of spoil.)
So... probe before attaching stock to Martyr/Spoil? Yes? That makes sense.
Again, no right/wrong, but interesting side effects. Consider a hypothetical case: I'm going to cut into 5mm thick stock. Assume the stock is actually 4.95 thick (for whatever reason).
-
Z=0=Martyr/Spoil. All my cuts are .05 "too shallow" in the stock, measured from surface of stock. Parts inserted into holes stick up. If the resulting machined part itself is inserted into a hole in something else, it will likely fit as the "thickness" in the machined areas is correct (e.g. original bottom to newly machined top).
-
Z=0=Top-of-Stock. Cuts are now proper depth from top. Excess stock "below" the cut is .05 thicker than it should be. Parts inserted in holes fit properly. If the resulting machined part itself is inserted into a hole in something else, it will likely not fit as the "thickness" is "thin" by .05.
Hmmm... very interesting. Still no "right/wrong" overall... but there may be a "better/worse" depending on the intended application of the machining. Hmmm....
Thanks for helping me "think out loud" about Z0
-
-
@Danal said in add an H4 parameter to G0/G1 for just halt when endstop is hit ?:
(Not asking about Work Coords, or etc. got all that, just asking about how, physically, to probe when Z0 = bottom of stock / top of spoil.)
But if you use work coordinates with known tool lengths you don't have to probe (if the setup is rigid enough). Just set the work coordinates after facing the spoil board.
-
@bearer said in add an H4 parameter to G0/G1 for just halt when endstop is hit ?:
@Danal said in add an H4 parameter to G0/G1 for just halt when endstop is hit ?:
(Not asking about Work Coords, or etc. got all that, just asking about how, physically, to probe when Z0 = bottom of stock / top of spoil.)
But if you use work coordinates with known tool lengths you don't have to probe (if the setup is rigid enough). Just set the work coordinates after facing the spoil board.
Agreed! Same thing. The tool face has set the Z0, whether by facing or probing, it is still the lowest point of the tool.
At the same time, this assumes both "no tool wear" and "tool lengths are at least as accurate as probing". Could be true that neither make enough difference to worry about in given setups. For example, much commercial CNC repetitive work chooses to operate this way, and it works great.
Could be true, as in my case with collets but no tool holders, that "known tool lengths" is a non-starter. Probing (or some form of "touching off") at tool change, including start-of-cut, is the only choice. Preserving Z0 from facing the Martyr/Spoil is literally impossible (assuming the stock is cut with a different bit than was used to face the spoil).