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)!
Latest posts made by tyrod
-
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)!
-
RE: Fully automatic xyz cnc probe macro
@hebigt
Hey Hebigt, thanks for that! I read through it. While I now have a better understanding how I could make macros do a lot more work for me, unfortunately my knowledge on the language is nil. I think I have found a c++ program to calculate the angle in degrees that g68 needs. But have no idea how to use it. I just don’t have the knowledge I would need and a crash course in c++ or whatever needed is not in the cards. -
RE: Fully automatic xyz cnc probe macro
@tyrod
Owend, I would still need to find the rotational offset required to shift xy axis to line up with my stock shown in my drawing. That’s why I thought g68 was a good way to go. I was looking at meta commands and found reference to tan under function subheading, dc42 was referring to deamon.g and I followed that link and that’s when I found it. I have some idea how to: 1st probe x, set to g92 x0 as the base, move, say,50mm and do second probe and that would give me the distance of the perpendicular. So now I know length of base and length of perpendicular to be able to use the tan function to calculate the degree rotation of xy plane. I think(not sure) I can use m114 to report x and y coordinates to host. From here I have no idea if it’s possible to get the required calculations performed by meta command(or daemon.g) or however it’s done to then add the angle in degrees to g68 and run it which would theoretically rotate the xy axis to match the stock material. Easy to remove by using g69 as well -
RE: Fully automatic xyz cnc probe macro
@owend
Thanks owend, I looked at the link and I noticed it says “ when a rotation is in affect jogging an axis will only move that axis in a positive of negative direction and not along the rotated axis” does that mean only jogging ignores the rotation but gcode follows the rotation? I assume so, I hope -
RE: Fully automatic xyz cnc probe macro
@tyrod
I guess there’s not enough interest in this at this time since it’s mainly a cnc thing. I can still use a macro to probe twice on x axis then use tan on a calculator to get what I need. Maybe dc42 or another of the many smart contributors could comment on this idea? I think this may need its own gcode like the m673 align plane on rotary axis one. I’ll carry on and try to write a macro with a pause to input the g68 and degrees. Thanks to everyone who replied! -
RE: Fully automatic xyz cnc probe macro
@tyrod
Just found m673 align plane on rotary axis. Alas, it doesn’t support xy axis! I wonder if there’s a workaround? -
RE: Fully automatic xyz cnc probe macro
@alankilian
Ahh, the k.i.s.s method
I already do that but the issue is that it’s difficult to keep the original 0,0 from shifting in some cases. I really believe a software solution would benefit all cnc users. As a lot of cnc users are probing it seems an automatic probing solution is a logical step forward. I’m really hoping someone can help. -
RE: Fully automatic xyz cnc probe macro
@hebigt
Wow! All Greek to me! Trigonometry etc was a long time ago I just turned 64 on the 13th. Anyway I searched through the info on meta commands and it’s nothing I can deal with. That being said, I went online and found what I think I need to calculate the angle in degrees(for g68)
Not sure but I think picture b would be the correct way. Side note, I believe probing y would have to come after doing this but not z height.
I’ve searched to see if there is a complete formula to do this that is usable as a meta command but I’m not sure of what to do with it even if I did. I need help!! -
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
@hebigt
Thanks for your reply, checked your link but I don’t think it’s what would work. I’ll see if I can explain the function a bit better, x any y are 90 degrees to one another, now if I place a work piece down with dowels or whatever is used for alignment of stock to x and y axis, then all I need is to do one probe of x then y then z, subtract half probe width and I have all I need to proceed. But, i have a vacuum table so no dowel holes. So the best I can do is get it close, but x and y will always be skewed slightly. So, if after turning on the vacuum and securing the piece I do a a single xyz probe, the work piece will still be skewed with relation to the true xy positioning. But if I was able to do either an x or y second probe a certain distance(say 25 mm) away from the first probe, that would tell the machine to skew both x and y planes to suit the position of the workpiece. And if that could be done, no matter what type of work holding you use, you won’t need a known x or y plane(I always use x because y is my motive axis. Does that make sense? Or maybe I’m wrong about this?