terjeio / ioSender

A GCode Sender for Grbl and grblHAL written in C# (Windows only).
BSD 3-Clause "New" or "Revised" License
220 stars 66 forks source link

Probing and gcode rotation #94

Open raenji-sk opened 3 years ago

raenji-sk commented 3 years ago

Hi, would it be possible to add a feature to the probing part of the sender. One that would probe along one axis at two points in order to determine the angle if the stock is not exactly squared to the axes and then calculate and rotate the gcode in order to compensate? Uccnc has this for example and it seems to be pretty useful for example for two sided jobs.

terjeio commented 3 years ago

@einencool Good question. Is the 0,0 origin set to the corner before probing and is the job origin the same? Have you tried with selecting the rotation center before probing, maybe like this?

image

Or did you probe with no job loaded? If you had a job loaded can you share that?

But I don't know how the work flow was planned.

I have not given it much tought since it is perhaps a bit complicated depending on the job? Establishing and selecting the correct rotation center first is important - if possible...

einencool commented 3 years ago

Hi @terjeio I didn't load a program, because it was just a test to see if and how it works.

I didn't know what the points for rotation center are for. But my problem is, that the origin x0y0 before is not set correctly, because the edge is like mentioned above not the real x0y0 point.

In an old thread that you took for your buildings of the probing tab from another software, there was also the discussion about the origin while rotating the workpiece.

Now in this state it's a nice to have, but without the correct alignment sadly not usable. But the first tries are done and now we can begin with the fine tuning :-)

raenji-sk commented 3 years ago

Using a corner finding probe with a hole centered above the XY0 seems to do the job. First run the center probing wizzard to find the center of the hole and then use angle probing to determine the angle. Other solution would probably require probing along both X and Y to determine the angle (provided that the stock is square) to find the lines/vectors along each and set XY 0 to a point where they intersect.

einencool commented 3 years ago

In this case you are right, but when there is such an option, than it should work as supposed.

But when we have to use a corner finder with hole , than this should be mentioned directly in the program. Because for now it doesn't give the right values.

But Terje has a hint in the program, that it should be used with care, and these are my thoughts, to get this feature work in the right way :-)

raenji-sk commented 3 years ago

I'd say it is not polished in regard to user friendliness, but it was added only recently. Also some sort of documentation would be helpful for sure. It was something I was missing with the grbl controllers. Many others like uccnc or industrial machines like haas have this implemented. So I am very grateful that @terjeio did bother with it and made it work. So let's wait for what he has to say about it. I belive all ideas are welcome and it will get even better.

einencool commented 3 years ago

Yes you're right, and I followed this great software nearly from the beginning and mentioned this point around one year ago ;-)

So I'm also very happy that it is going to be THE perfect program. Terje knows that I was waiting for it a long time :-)

Here you can see the discussion last year :-)

https://github.com/terjeio/ioSender/issues/41#issuecomment-655274404

terjeio commented 3 years ago

I have not spent much time with actually using the rotation functionality other than checking that the transform works. To make it work as expected I belive the rotation origin and the CAM output has to agree. Currently X0Y0, corners, mid edges and center are supported. I could add manual input for the rotation center (and tool diameter too?) but it will be better to generate gcode that matches the choices currently available? I have a feeling this could get a bit complicated...

einencool commented 3 years ago

I‘ve just read a little bit about rotation and the X0Y0 Point.

When I understood it right in the „Vers.by“ article, then the rotation should be done at first, and after that, the origin Point should be measured. But after the coordinate System is rotated, the Measurement / Probing should work in the „new coordinate system“. So the points will be touched in the „rotated angle“ and you have always the right point for probing. This is also how it‘s done on a 3D coordinate measuring machine. The Points are touched in the „vector direction“…

This is a screenshot from the „vers.by“ Homepage I linked in the other thread: IMG_1789

einencool commented 3 years ago

Oh, one extra point, can you please add an extra field for the „edge length“? Then it is possible to measure two points with extra defined offset, maybe 100mm or so ;-)

terjeio commented 3 years ago

This is a screenshot from the „vers.by“ Homepage I linked in the other thread:

This is for LinuxCNC where a command is sent to the controller to rotate the coordinate system. Grbl/grblHAL does not support that, instead the gcode itself is rotated in the sender. I would think that makes quite a difference. To make ioSender behave the same way the rotation has to be applied on the fly to every gcode command sent to the controller, even probing commands. I'll rather such add rotation support in the controller than the sender as I fear adding it to the sender will be a lot of work and quite messy...

Oh, one extra point, can you please add an extra field for the „edge length“?

Instead of using "Offset" as I do now?

einencool commented 3 years ago

Ah ok, didn‘t know, that LinuxCNC works different in this area. You posted this article last year, so I thought that you try to implement it like it‘s in LinuxCNC. But since I don‘t know much of it, you can make it the way you want it and how you can make it work :-)

In my opinion it would make more sense to add an extra field in the „rotation tab“ for the „edge length“ so that you have the normal „offset“ how far the probe clears the edge for the first touch off, and after it clears the edge it should drive the desired „edge length“ (maybe 100mm) for the second probing point.

If it would be the „normal offset“, the distance is really small (for me around 5mm) and if I set it for the rotation to 100mm and forget to redo it, then it could crash into my workholding clamps or something similar.

But maybe I just want to much :-) When other people can work with your rotation implementation and they are satisfied with the results, then maybe I‘m just to critical :-) So have a nice evening and thank you for your continuous work

raenji-sk commented 3 years ago

I'll rather such add rotation support in the controller

That would be pretty cool.

It works for me as it is now. I have one part that needs finishing tomorrow. I want to add a chamfer on the back side and plan to use the rotation probing to get it spot on. Will let you know how it went.

As for the naming of the offset vs edge length, it was pretty obvious what was what. But I'd welcome something like they show on vers.by website. Give each parameter a name (letter, number) and display them in the "probing wizzard" picture. That way it would be super clear to see wich parameter influences which move during the probing routine, and not just the angle probing, but all of them.

raenji-sk commented 3 years ago

@terjeio @einencool Tried the rotation with a real cut, the chamfer I mentioned before. It is not totally accurate, but that's not the IOSenders fault. Point is, it seems to work just fine. Added a short video about it to my YT channel: https://youtu.be/t8bsmd0WDr8

einencool commented 3 years ago

Look good, and when you are working with a touch plate with the hole for the corner it should work very good.

But the calculation for users without touch plate is sadly not correct.

But like I said, when the users are satisfied with it, then there should be a hint in the program. That the rotation should only be used if a touch plate with hole is used. Then everyone could decide for himself, if he will use it, or not :-)

Because whole only using a 3d finder or something similar, the corner itself is not calculated correctly, the rotation itself is working fine...

raenji-sk commented 3 years ago

Well while I did make a corner probe, I used the hole center to find its own xy0 and not to locate zero on another part as the corner probe was the actual part being machined. I machined one side and then turned it around to make the chamfer. The larger plate underneath was just sort of a placeholder.

Don't have a fancy 3d probe yet, but should it not be even easier and more precise to locate the xy0 with let's say a probe from Vers or Sorotec?

I mean you can locate any feature in the part when doing the second side, like hole, boss, pocket etc. Or use a locating dowel pin, corner of a vise jaw, a jig... And just reference that in CAM as workpiece xy zero.

I think there are not many occasions you have to rely solely on the xy0 in one of the corners.

But yes, ideally it should work on the rotated corner as well.

einencool commented 3 years ago

Don't have a fancy 3d probe yet, but should it not be even easier and more precise to locate the xy0 with let's say a probe from Vers or Sorotec?

I mean you can locate any feature in the part when doing the second side, like hole, boss, pocket etc. Or use a locating dowel pin, corner of a vise jaw, a jig... And just reference that in CAM as workpiece xy zero.

I think there are not many occasions you have to rely solely on the xy0 in one of the corners.

But yes, ideally it should work on the rotated corner as well.

well, when the workpiece is not square to the axis, it is in this case not possible with a 3d Finder to probe the edge absolutely perfect. Like i mentioned a few posts ago, the calculation is not correct and so the x0y0 is not perfectly aligned. (See the picture of my 3D Finder, then you see that x0y0 is around 1mm off per side)

When you add a touchplate with hole above the edge of the workpiece, it’s no problem with a 3D Finder, because the calculation for a round part is always right, and so the edge will be measured correct.

if it’s not clear what i mean, I’ll add a sketch to show what i mean :-)

:Edit Here’s the sketch I mean, i hope it’s good to unterstand This is only edge finding with 3D Finder 21ADB468-4A73-4496-A85F-9B1B87D00580

and this is CENTER Finding with extra Touch Plate. 5816F068-BC9E-4E94-9B71-033020B55176

and because of this problem the rotation function is not really usable because the X0Y0 is not set correctly

terjeio commented 3 years ago

@einencool can this be solved by adding a offset to corner probed XY position based on the angle and the diameter of the probe tip?

einencool commented 3 years ago

Hmm, I can't imagine, that this will really work, because you never get the "real" edge. When the starting point is not right over the edge, then in my opinion is not possible to work.

For my thinking it would only be possible, to probe all 3 points in one shot. Then you get the straight line and one point on the other side and then you can calculate the rotation and the edge...

raenji-sk commented 3 years ago

Let me join the drawing frenzy 🤣

Looking at some Haas CNC videos they probe both X and Y for angle for example. So maybe something like that would work.

Artboard 1@3x

On the other hand I find this to be most useful for double sided jobs. The first side easy to either align or machine so that its square with the CNC. But when doing the other side you most likely have a boss / hole, pocket feature somewhere in the part already. So you can probe that for XY 0 and also use that as XY 0 in CAM. That's something I did and it works. And you do not need a touch probe with a hole for any of that.

Artboard 2@3x

In the video I did make a touch probe, but I probed the probe itslef... So something like example no.2. If the hole was elsewhere it would not matter as it would rotate the gcode around those other coordinates. It maybe is a bit confusing example with the touch probe being machined.... Also, what seems to be a problem with using one? It's easy to make or buy one.

terjeio commented 3 years ago

The HAAS way should work even if the two sides are not at a right angle? Do you have links to the videos?

einencool commented 3 years ago

Only one point from my side, and then you can do what you think... I'm working every day with a 3d coordinate measurement machine. And when it is possible you make every time only a 3-2-1 point reference system.

3 points for a surface (Z-Axis) 2 points for a line (maybe X-axis) 1 point ( maybe Y-Axis)

If you need more of this, then the software begins to compensate points, and what way you would rotate, if the workpiece has only 88dg and not a (theoretical) right angle?

Just my 2 Cents... And sure we can do everything with an extra touch off plate... Greets Chris

raenji-sk commented 3 years ago

@einencool We can discuss more options. I just suggest what I think is OK based on how I use the CNC and what I've seen on many videos showing probing not only on hobby grade routers but mostly big VMCs.

@terjeio https://www.youtube.com/watch?v=amWolMgEM-Q Here's the video from HAAS showing their probing macro. Their stock part is not exactly 90°, but close at about 89,95° .