I've edited this post because I may have asked the wrong question before. Does anyone know of a way to write a macro to not only automate XYZ probe but to add in 2 separate X or Y points of probing to get exact position of a part that has been removed for some reason and now milling has to be resumed at exactly the same point. I know a simple peg system would work for a stock piece of material but after machining the first time the outer perimeter may have changed making it impossible to use the original alignment method, even flipping the part over is problematic. I have seen it done by other controllers(i believe it was UCCNC). I'm not a programmer by any means. I understand how to make simple macros but am unable to use any variables which i believe would be needed to accomplish this. I've searched the forums for a solution but so far nothing fits the bill Codes such as G38, G60 G10, M581, G17, G18, G19 and M556 may provided a solution but it's beyond my abilities Do all you cnc'ers think this would be a useful macro to have?
Rod
Best posts made by tyrod
-
Fully automatic xyz cnc probe macro
-
RE: Fully automatic xyz cnc probe macro
@hebigt
hi, yes, m556 looked good to me at first until i looked into its function a little closer. its used to correct misalignment of the frame. so with a misaligned frame the xy planes arent perpendicular to each other. i think what i want is G68 coordinate rotation. then i could rotate the xy plane to match the stock xy planes. note That i have visible xy lines to get my stock very close. what im trying to achieve is perfect realignment of stock if removed for any reason. G68 uses angle input to rotate xy plane keeping them perpendicular.
i can write a macro to probe all axis, even the 2 probe points on x axis. i would probe once, set that point to x0, then move a specific amount and do another g38.2 then read that point with M114 and this is where i get stuck. i would need a formula to take the length of the 2 points and their x differential and apply an angle . the BIG question is, how do i get gcode to do this automatically what formula would work. im not a programmer so meta commands and variables etc,etc are beyond my capabilities. -
RE: Fully automatic xyz cnc probe macro
@tyrod I just found “Feature request-workpiece angle compensation CNC” by jay_s_uk and in it he wrote a script to do exactly what I wanted. I just searched for g68 and it’s on the second search page. I haven’t the time right now to try it. Thank you jay_s_uk! (And everyone else)!