Fully automatic xyz cnc probe macro
-
Cool if G68 works!
I feel like I'm doing a lot of guessing here, but i'm fairly certain you can calculate the angle you need using meta commands.
RRF supports the atan function which you can use to calculate the small angle in a right triangle.
Here's a drawing and some notes (super messy, sorry!).
-
@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!! -
Since you have a vacuum table, I would flip the problem:
- Insert a pointy thing in your chuck.
- Do a G0 move to location (0,0)
- Align part of the part at that location
- Do a G0 move to location (100,0)
- Rotate the part to align rotation in the X-Y plane
- Turn on the vacuum
I get that the part may be unusually-shaped, but you need known coordinates on the part to locate it using the coordinate-system transformation method anyway, so instead of doing that, just make G0 moves to those known locations and orient the part correctly.
-
@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. -
@tyrod
Just found m673 align plane on rotary axis. Alas, it doesn’t support xy axis! I wonder if there’s a workaround? -
@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! -
@tyrod
You could put a request in the firmware wishlist section for an R parameter to be added to G10http://www.linuxcnc.org/docs/2.6/html/gcode/gcode.html#sec:G10-L2_
-
@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 -
@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 -
@tyrod OwenD wrote an intro-document for g code meta commands. Check it out!
https://forum.duet3d.com/topic/16495/conditional-g-code-introduction-tutorial-pdf
-
@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. -
@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)!
-