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
682 stars 176 forks source link

Problem with tangential knife #273

Closed Darkmorro closed 2 years ago

Darkmorro commented 2 years ago

Describe the bug Hey! I'm trying to use a tangential knife. There is a problem with unnecessary movements in the corners. Instead, having reached the corner, the knife rises, changes the direction of the blade (without changing the X and Y coordinates), goes down and cuts the arc, after that it rises again, changes the direction of the knife and goes to the beginning of the next vector. How to get rid of cutting arcs?

To Reproduce Steps to reproduce the behavior:

  1. Settings as in the tangential knife example: https://grbl-plotter.de/index.php?id=tangential-knife Only offset is 1.75
  2. I draw in Corel Draw square 100*100mm
  3. Export to svg
  4. Open svg file with GRBL plotter

Expected behavior When the blade comes to the corner, the knife should rise and on a safe Z change the direction of the blade and come with its tip to the beginning of the next vector.

Screenshots InkedIMG_20220402_134725_LI Video with problem Code:

( Use case: ? )
( SVG import by GRBL-Plotter 1.6.5.2 )
( Source: E:\Модели для фрезера\Заказы\Прокладки\Квадрат 100.svg )
(<Header >)
( G-Code lines: 55 )
( Pen Down/Up : 7 times )
( Duration ca.: 0.5 min. )
( Conv. time  : 00:00:00.0010219 )
( Original graphic dimension min:0.100;0.100  max:100.100;100.100)
(</Header >)
(<Tangential Axis="A"/>)
G54 (Setup - GCode-Header)
G90
G00 Z5.000
M3 S1000 
(<Figure Id="1" Geometry="rect" Layer="Слой_x0020_1" PathLength="103.5"> )
G00 X-1.750 Y0.000 A0.000
G01 Z0.000 F1000
G01 X101.750 Y0.000 A0.000
G00 Z5.000
G00 X101.750 Y0.000 A95.766
G01 Z0.000
G01 X101.715 Y0.350 A95.766
G01 A107.305
G01 X101.610 Y0.686 A107.305
G01 A118.842
G01 X101.440 Y0.994 A118.842
G01 A130.379
G01 X101.212 Y1.262 A130.379
G01 A141.916
G01 X100.936 Y1.479 A141.916
G01 A153.453
G01 X100.621 Y1.636 A153.453
G01 A164.990
G01 X100.281 Y1.727 A164.990
G01 A175.380
G01 X100.000 Y1.750 A175.380
G00 Z5.000
G00 X100.000 Y1.750 A90.000
G01 Z0.000
G01 X100.000 Y101.750 A90.000
G00 Z5.000
G00 X100.000 Y101.750 A185.766
G01 Z0.000
G01 X99.650 Y101.715 A185.766
G01 A197.305
G01 X99.314 Y101.610 A197.305
G01 A208.842
G01 X99.006 Y101.440 A208.842
G01 A220.379
G01 X98.738 Y101.212 A220.379
G01 A231.916
G01 X98.521 Y100.936 A231.916
G01 A243.453
G01 X98.364 Y100.621 A243.453
G01 A254.990
G01 X98.273 Y100.281 A254.990
G01 A265.376
G01 X98.250 Y100.000 A265.376
G00 Z5.000
G00 X98.250 Y100.000 A180.000
G01 Z0.000
G01 X-1.750 Y100.000 A180.000
G00 Z5.000
G00 X-1.750 Y100.000 A275.769
G01 Z0.000
G01 X-1.715 Y99.650 A275.769
G01 A287.306
G01 X-1.610 Y99.314 A287.306
G01 A298.842
G01 X-1.440 Y99.006 A298.842
G01 A310.379
G01 X-1.212 Y98.738 A310.379
G01 A321.916
G01 X-0.936 Y98.521 A321.916
G01 A333.453
G01 X-0.621 Y98.364 A333.453
G01 A344.990
G01 X-0.281 Y98.273 A344.990
G01 A355.376
G01 X0.000 Y98.250 A355.376
G00 Z5.000
G00 X0.000 Y98.250 A270.000
G01 Z0.000
G01 X0.000 Y-1.750 A270.000
G00 Z5.000
(</Figure>)
M05
M30

square 100100mm

svenhb commented 2 years ago

Hello, it looks like, you also enabled drag-knife support for import: https://github.com/svenhb/GRBL-Plotter/wiki/Drag-tool-compensation So you should disable this option: image

Darkmorro commented 2 years ago

But I need this option. I have an offset knife. I tried to disable this option and the contours are not closed, the program does not take into account the offset of the knife.

svenhb commented 2 years ago

You need to decide: either drag tool OR tangential axis. I have no idea how both could work together in the same time.

Darkmorro commented 2 years ago

Understood! Thanks for the help. Looks like I'll have to modify the knife. However, if you enable both the drag tool and tangential axis options, the result is generally correct, only you need to remove "extra lines" from the code. If somehow it is possible to get rid of them automatically, it will be possible to use both options at once.

svenhb commented 2 years ago

the result is generally correct, only you need to remove "extra lines" from the code.

Ok, perhaps you can specify when the extra lines appears and how they look like, so I don't need to search for....

Darkmorro commented 2 years ago

Yes, sure. On the example of a 100 * 100mm square, I highlighted unnecessary lines. On more complex figures, extra lines also appear, if necessary, I will provide more examples.

( Use case: ? ) ( SVG import by GRBL-Plotter 1.6.5.2 ) ( Source: E:\Модели для фрезера\Заказы\Прокладки\Квадрат 100.svg ) (

) ( G-Code lines: 55 ) ( Pen Down/Up : 7 times ) ( Duration ca.: 0.5 min. ) ( Conv. time : 00:00:00.0010219 ) ( Original graphic dimension min:0.100;0.100 max:100.100;100.100) (
) () G54 (Setup - GCode-Header) G90 G00 Z5.000 M3 S1000 (
) G00 X-1.750 Y0.000 A0.000 G01 Z0.000 F1000 G01 X101.750 Y0.000 A0.000 G00 Z5.000 **G00 X101.750 Y0.000 A95.766 G01 Z0.000 G01 X101.715 Y0.350 A95.766 G01 A107.305 G01 X101.610 Y0.686 A107.305 G01 A118.842 G01 X101.440 Y0.994 A118.842 G01 A130.379 G01 X101.212 Y1.262 A130.379 G01 A141.916 G01 X100.936 Y1.479 A141.916 G01 A153.453 G01 X100.621 Y1.636 A153.453 G01 A164.990 G01 X100.281 Y1.727 A164.990 G01 A175.380 G01 X100.000 Y1.750 A175.380 G00 Z5.000 G00 X100.000 Y1.750 A90.000 G01 Z0.000 G01 X100.000 Y101.750 A90.000 G00 Z5.000 G00 X100.000 Y101.750 A185.766 G01 Z0.000 G01 X99.650 Y101.715 A185.766 G01 A197.305 G01 X99.314 Y101.610 A197.305 G01 A208.842 G01 X99.006 Y101.440 A208.842 G01 A220.379 G01 X98.738 Y101.212 A220.379 G01 A231.916 G01 X98.521 Y100.936 A231.916 G01 A243.453 G01 X98.364 Y100.621 A243.453 G01 A254.990 G01 X98.273 Y100.281 A254.990 G01 A265.376 G01 X98.250 Y100.000 A265.376 G00 Z5.000 G00 X98.250 Y100.000 A180.000 G01 Z0.000 G01 X-1.750 Y100.000 A180.000 G00 Z5.000 G00 X-1.750 Y100.000 A275.769 G01 Z0.000 G01 X-1.715 Y99.650 A275.769 G01 A287.306 G01 X-1.610 Y99.314 A287.306 G01 A298.842 G01 X-1.440 Y99.006 A298.842 G01 A310.379 G01 X-1.212 Y98.738 A310.379 G01 A321.916 G01 X-0.936 Y98.521 A321.916 G01 A333.453 G01 X-0.621 Y98.364 A333.453 G01 A344.990 G01 X-0.281 Y98.273 A344.990 G01 A355.376 G01 X0.000 Y98.250 A355.376 G00 Z5.000** G00 X0.000 Y98.250 A270.000 G01 Z0.000 G01 X0.000 Y-1.750 A270.000 G00 Z5.000 (
) M05 M30

svenhb commented 2 years ago

Next version will have the modification: image

Darkmorro commented 2 years ago

Thanks a lot! I'll try it.

svenhb commented 2 years ago

It's now released: https://github.com/svenhb/GRBL-Plotter/releases