svenhb / GRBL-Plotter

A GCode sender (not only for lasers or plotters) for up to two GRBL controller. SVG, DXF, HPGL import. 6 axis DRO.
https://grbl-plotter.de/
GNU General Public License v3.0
693 stars 176 forks source link

Help with drad tool compensation #277

Closed Darkmorro closed 2 years ago

Darkmorro commented 2 years ago

Describe the solution you'd like

  1. How can I make the direction of the knife at the beginning of cutting the contour coincide with the direction of the knife at the end of cutting the previous one? Sometimes the Gcode is generated so that the direction of the knife differs by almost 180 degrees from the direction of the cut. In this case, when the knife is turned, the material is pushed.
  2. How to make it so that when generating Gcode, the start of the spindle is ignored? I don't need a code like "M3 S1000" while I delete the line manually.
  3. I use the received Gcode in mach3. Generated files open in math3 as empty. If you copy the received code without changes to the txt file, it opens without problems. How can the situation be corrected?

Describe alternatives you've considered

Additional context

svenhb commented 2 years ago
  1. You need to play with the "Correct start angle" image
  2. Save an upload your machine settings, so I can check. If Z axis is enabled, spindle will switched on always.
  3. You may try other save option: image
svenhb commented 2 years ago

How to make it so that when generating Gcode, the start of the spindle is ignored? I don't need a code like "M3 S1000" while I delete the line manually.

Why you need to delete this command? What is physically connected to the spindle output pin?

Darkmorro commented 2 years ago

1,3 Thanks, got it.

Why you need to delete this command? What is physically connected to the spindle output pin?

A spindle is connected to the output contact. When I use a CNC router as a plotter, I do not need to turn on the spindle. Instead of a milling cutter, I install a vane knife in the spindle. GRBL-Plotter_20220407_194919.zip

svenhb commented 2 years ago

Perhaps it helps to set the spindle speed to 0. On the other hand, if drag tool is enabled, the chance that also the spindle is needed is minimal. Will see if can avoid switching on/off the spindle, taking account of this (and perhaps other) option.

Darkmorro commented 2 years ago

Maybe I can try in a couple of days. I'll let you know the result right away.

svenhb commented 2 years ago

I added a checkbox to disable spindle on: https://github.com/svenhb/GRBL-Plotter/releases image

Darkmorro commented 2 years ago

Thank you! Now everything works as it should. Another question: when working with a tangential knife, I noticed one moment when cutting circles of small radius (20mm or less). Judging by the operation of the machine, there is not enough speed of the A axis relative to the speeds of X and Y. Thus, the machine works in jerks. First, they work out the X and Y axes, stop and wait until the A axis takes the desired value. On large circles (200mm or more) there are no such problems, the machine works smoothly.

svenhb commented 2 years ago

there is not enough speed of the A axis relative to the speeds of X and Y

I think it is a problem of the firmware, and you should try to increase the value of $113 A Max rate, mm/min In your case it would degree/min. Or you may try to work with 36° per turn and adapt your $103 setting to match this - this hepled me a lot, when using Z as tangential axis. When importing graphics, GRBL-Plotter takes account of the 36°/turn...

Darkmorro commented 2 years ago

Question #1 is relevant again. I put symbols in the figure to make it easier to understand, I also attach a file with settings. I use a vane knife without tangential control. At the beginning of the program, the knife blade looks along the positive value of the X axis (Green arrow with marker 1) The knife comes to the point of the beginning of the cut, descends into the material and changes its direction (towards the arrow with marker 2) then the program execution does not raise any questions and the knife completes the trajectory with direction under marker 3, rises and moves to the beginning of the next path. Further, it is repeated by analogy: the direction of the knife changes in the material from marker 3 to marker 4. Thus, material damage occurs when the knife direction changes from 1 to 2 and from 3 to 4 (orange mark). Changing the angle value does not help, reducing the knife offset reduces the problem, but does not eliminate it completely. Test GRBL-Plotter_20220412_201055.zip .

svenhb commented 2 years ago

I think it is a special problem with circles... How should the start of the path look like?

svenhb commented 2 years ago

It helps, if you add a starting line at the circle: image image

Darkmorro commented 2 years ago

I marked the starting points as it seems to me to be correct (the point is selected first with the minimum Y, then with the minimum X of the remaining ones for each curve), the beginning of the cut is always counterclockwise. Thus, there will be no idle turn in the material. I work only with closed contours, I can’t imagine how such an algorithm will show itself with open curves. test2 .

svenhb commented 2 years ago

The problem is, I can't forsee, where the knife is looking to, when starting a figure. Also, in your case; you might want to cut a ring, so the start-path of the outer ring must be different, than of the inner ring..

Darkmorro commented 2 years ago

If we assume that by default at the beginning of the program the knife is always directed in the direction of increasing X, then the problem with determining the starting point of the first curve disappears. If a circle is cut, then at the end point the direction of the knife will be close to the start. So close that this small deviation can be neglected (provided that the starting points of the cut and the direction are always chosen according to the same rule). And if you complete the cut at a point coinciding with the initial one, then this minimum deviation will not be.

Darkmorro commented 2 years ago

Also, in your case; you might want to cut a ring, so the start-path of the outer ring must be different, than of the inner ring..

I agree, the starting points will be different, but they must be selected according to the same rule. For example: we select a closed contour, we calculate its points with the minimum Y, from these points we select one with the smallest X, the cutting direction is always counterclockwise. Sorry, I do not know how your program works, maybe what I write sounds stupid.

svenhb commented 2 years ago

Up to now I don't know the start angles: 1st I create path with modifications and angle informations, 2nd I do grouping and sorting figures. Also user can sort or delete figures... But in principle you are right.

BTW in e.g. incscape the path direction is the information if it's outside or inside path: The inner path is clockwise, the outer path counter clockwise image

Darkmorro commented 2 years ago

Of course, I don’t quite represent the technical capabilities of the program, I see two ways to get around the problem: one.

  1. Somehow manually select the starting point and direction of each path manually 163005683-2704fcf7-0d5d-4a47-973d-7d6c7f0d02ba .
svenhb commented 2 years ago

Ok, in short words:

Sounds logic and actionable

svenhb commented 2 years ago

BTW: this new rule does not apply to brushes, which was the first intention for this path-modification: https://github.com/svenhb/GRBL-Plotter/wiki/Drag-tool-compensation

svenhb commented 2 years ago

Check new release 1.6.6.2: https://github.com/svenhb/GRBL-Plotter/releases You may also use the overlap option below... image

Darkmorro commented 2 years ago

I tried. Of course, one check is not enough, but it seems to me that the algorithm works correctly for rectangular shapes. For the circle, the initial direction is chosen correctly, but the starting point is not chosen quite correctly, taking into account the offset of the knife, part of the circle will turn out to be cut off. I think that the starting point of the circle should be a little lower and to the right by the amount of offset, so that the tip of the knife coincides with the quadrant Test3 .

svenhb commented 2 years ago

If you compare original circle (red) with drag-knife path of same circle (yellow) - for me it looks correct: image

Darkmorro commented 2 years ago

You're right. Everything is correct. But I found another problem. Sometimes the trajectory is distorted. Defect No. 1 and No. 2 sometimes appears on the circles. Defect No. 3 also appears on complex curves Test4 .

svenhb commented 2 years ago

Can you upload the original graphics?

Darkmorro commented 2 years ago

Can you upload the original graphics?

Oh sure 1 (2)

svenhb commented 2 years ago

I think the problem are some cubic shapes, which are may not "clean". E.g. one circle, made of a cubic shape, results to this coordinates - note the wired y values at the beginning, which finally caused the wired cutting path:

k:49   x:67.09106 y:5.99980
k:48   x:67.09106 y:6.00011
k:47   x:67.03628 y:5.18590
k:46   x:66.87672 y:4.40500
k:45   x:66.61952 y:3.66454
k:44   x:66.27183 y:2.97168

To get rid of this behavior, you need to change this limit, than it works: image

Darkmorro commented 2 years ago

To be honest, I didn’t understand anything how it works, all the circles are made by the corresponding function. I just tried changing the ratio. It seems that I managed to choose the right one, I will most likely check tomorrow.

svenhb commented 2 years ago

I built in an extra check in drag tool compensation: https://github.com/svenhb/GRBL-Plotter/releases

Darkmorro commented 2 years ago

I think the problem are some cubic shapes, which are may not "clean". E.g. one circle, made of a cubic shape, results to this coordinates - note the wired y values at the beginning, which finally caused the wired cutting path:

To be honest, I didn’t understand anything how it works, all the circles are made by the corresponding function. I just tried changing the ratio. It seems that I managed to choose the right one, I will most likely check tomorrow.

Everything is working! Thank you!

Darkmorro commented 2 years ago

Found another problem associated with circles of small diameters. More precisely all, but on small it is especially noticeable. The offset of the tip of the knife in my case is 3mm. For example, we take a circle with a diameter of 10mm (in the example it is black), the actual cutting line is purple, a circle with a diameter of about 11mm is cut out. with an extra cut at the starting point. The cut starts at point A, then B, then C, then D and ends at point A. In fact, the trajectory is more complicated, shortened for convenience. I think that with such a trajectory, the spindle coordinates at point A should be (8; 0), at point B (10; 2), at point C (8; 10), at point D (0; 8). In the resulting z-code, the corresponding points are offset from the center.

Received code:

G00 X4.580 Y0.000  
G01 Z-1.800 F1000 (PD)
G01 X7.580 Y0.060 F1000 
G01 X8.585 Y0.080  
G01 X9.493 Y0.899  
G01 X10.218 Y1.884  
G01 X10.732 Y2.994  
G01 X11.014 Y4.184  
G01 X11.052 Y5.406  
G01 X10.845 Y6.612  
G01 X10.401 Y7.751  
G01 X10.044 Y7.983  
G01 X9.580 Y8.968  
G01 X8.690 Y9.807  
G01 X7.651 Y10.451  
G01 X6.503 Y10.874  
G01 X5.294 Y11.059  
G01 X4.072 Y10.998  
G01 X2.888 Y10.695  
G01 X1.788 Y10.160  
G01 X0.817 Y9.416  
G01 X0.014 Y8.493  
G01 X-0.587 Y7.428  
G01 X-0.964 Y6.265  
G01 X-1.100 Y5.049  
G01 X-0.990 Y3.831  
G01 X-0.639 Y2.660  
G01 X-0.061 Y1.582  
G01 X0.722 Y0.642  
G01 X1.676 Y-0.123  
G01 X2.764 Y-0.681  
G01 X3.942 Y-1.011  
G01 X5.162 Y-1.098  
G01 X6.375 Y-0.939  
G01 X7.531 Y-0.541  
G01 X7.568 Y-0.267  
G01 X7.580 Y0.000  
G00 Z5.000 (PU)

Tets 5

svenhb commented 2 years ago

With your settings d=10 mm, knife-r = 3 mm I get this result: With the start point at 8;0 it should also work and would be more correct, but the other coordinates... You should try with a real drag-knife... image

Darkmorro commented 2 years ago

So far I am solving the problem like this: I cut out holes of typical diameters, measure the actual size, reduce the size of the hole in the drawing by the difference.

svenhb commented 2 years ago

What is the difference, for your example: Circle diameter 10 mm, knife offset 3 mm? The calculated path is shown here in green: between extended s1 and extended s2: The red line shows the knife offset image

Darkmorro commented 2 years ago

That's just the point, I did not see such a problem on curves that are not circles. Your example is correct.