Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tangential knife A-Axis turn command not getting included in applying height map #388

Closed
vinevinz opened this issue Mar 23, 2024 · 28 comments
Labels

Comments

@vinevinz
Copy link

vinevinz commented Mar 23, 2024

Describe the bug

Before I describe the bug, I know standard GRBL cannot control 4 axis simultaneously. My board is MKS Tiny Bee with FluidNC (apparently works great with this software). The CNC plotter has XYYZA motor all Nema17.

So, I upgraded the machine to tangential knife instead of drag. I'm using rotary cutter directly attached to A axis motor (works like charm).

Problem is, cutting mat is not that flat, probing height map results got me ~0.6mm difference from one edge to the other. As I'm applying the height map to G-Code, the A axis command actually getting removed.

Is this a bug or just the feature not implemented? Or maybe I am doing it wrong, bcs honestly I'm using 3d printer bed leveling logic here (it looks very similar anyway with klipper leveling).

I'm trying to cut circle (has not been successful yet due to uneven flatness issue)

G-Code screenshot attached

To Reproduce
Steps to reproduce the behavior:

  1. Load circle SVG, tangential knife enable on A-Axis
  2. Probe Z and height map (I am using 2 probe here, first for G38.2, second just limit switch for height map)
  3. Height-map = Z-offset -1 (my probing tool offset), max value 0.0
  4. Apply map
  5. New g-code generated without A axis

Expected behavior
G-code includes A-Axis?

Screenshots
Original G-Code
Screenshot 2024-03-23 181038

Applied height map G-Code
Screenshot 2024-03-23 181112

Other example, A-axis turn command without lifting knife getting omitted when applying height map(this is untested code, please ignore for so much knife lifting)

Screenshot 2024-03-23 182126

Applied G-Code
Screenshot 2024-03-23 182159

Thank you!

@vinevinz vinevinz added the bug label Mar 23, 2024
@svenhb
Copy link
Owner

svenhb commented Mar 23, 2024

I need to check

svenhb added a commit that referenced this issue Mar 23, 2024
@svenhb
Copy link
Owner

svenhb commented Mar 23, 2024

@vinevinz
Copy link
Author

vinevinz commented Mar 24, 2024

Sorry for late reply, kinda busy weekend here

It is working but not properly, I will attach the video of without height map and with the height map. Applying height map makes A axis goes kinda crazy on sharp corners and does not work on circles.

This is the normal WITHOUT HEIGHT MAP:

A-Axis.WITHOUT.Map.MOV

This 2 is with the height map:

A-Axis.Height.Map.Wrong.1.MOV
A-Axis.WITHOUT.Map.MOV

Free SVG attached if you wanna try

https://github.com/svenhb/GRBL-Plotter/assets/29923628/8dfa875e-67b9-49a3-b967-4644250196d2
https://github.com/svenhb/GRBL-Plotter/assets/29923628/c5af3cff-d48c-402e-9f37-c562f1a0ec87

@vinevinz
Copy link
Author

On my further analysis I think I found the problem, when applying height map to the g-code, the program doesn't respect the inserted turn command when re-writing it. It just copy whatever A-Axis command after Z lift pen.

The screenshot of the g-code after applying height map from this version of program
new inserted height map

Without height map applied, the program respects the turn command
Screenshot 2024-03-24 210225

@svenhb
Copy link
Owner

svenhb commented Mar 24, 2024

Nice cutter 👍
Please try https://github.com/svenhb/GRBL-Plotter/blob/master/GRBL-Plotter_Setup_1731c.exe
Also arc conversion works now (tested with simple shape)

@vinevinz
Copy link
Author

vinevinz commented Mar 25, 2024

Hi Sven,

Thank you, I am building dual head cutter and pen with servo to lift up the pen.

My initial testing looks promising for this version. However circle only works by disabling G2/3 arc commands, is that okay? I am new to CNC world and I don't know if that will be a problem. Besides circle every other pattern works amazing. I think only moves translated from G2/3 commands is broken.

Enabling G2/3 will make A-axis spin uncontrollably which creates beautiful art on its own. Btw I load circle from SVG not simple shapes (just for this testing purposes).
unnamed

@svenhb
Copy link
Owner

svenhb commented Mar 25, 2024

However circle only works by disabling G2/3 arc commands,

Did you try allready version "c"? For me it works with G2/G3 command - also from SVG.
https://github.com/svenhb/GRBL-Plotter/blob/master/GRBL-Plotter_Setup_1731c.exe

@vinevinz
Copy link
Author

Hi sven, sorry for late reply it was crazy week here.

Yes it is working perfectly, I think it was installation problem because I was lazy to do clean install. Thank you very much for your help on this problem.

Btw, I have new problem of start and ending edges not meeting. Can you help suggesting whether this is a software or a hardware problem?

IMG_7072
IMG_7071

@svenhb
Copy link
Owner

svenhb commented Mar 31, 2024

I assume a hardware problem: If you woud use a "regular knife" - perhaps the knife blade is too weak (too long) and bends sidewards, when cutting the circle - as a result the circle radius becomes bigger.
How stable is your holder?
image

@vinevinz
Copy link
Author

Hi Sven sorry for late reply, been doing hard work this last 2 week

I have question regarding how does the software determine starting point?
Bcs I'm using rotary cutter which always overcut, I need to adjust the SVG so it will not overcut. It will be nice and easier to know where is the starting point when adjusting the design.

Example of starting point adjustment so, just make the starting point and end point separated by few millimeters.

Screenshot 2024-04-17 172746
Screenshot 2024-04-17 173509

Update on the machine:
I have redesigned everything for Z gantry and upgraded beefier X axis. You are right it is hardware problem. I'm feeling very silly to make it this strong just to cut 0.8mm synthetic leather, no wonder the leather cutting machine cost at least 10k usd 😅

unnamed (1)

@svenhb
Copy link
Owner

svenhb commented Apr 17, 2024

If no sorting is active, the startpoint from the SVG will be used:
image

I have an option for overlap in closed figures (for laser cutting), Do you need to apply the "under cut" to each figure or just to open figures?
image

@vinevinz
Copy link
Author

Wow that is new info, I just knew SVG got a starting point! Thank you so much!

I think under cut in every figure is nice especially in closed path, I mean everytime the knife needs to lift up and change direction it needs to undercut.

@svenhb
Copy link
Owner

svenhb commented Apr 17, 2024

I implemented path shortening, not sure if it meets your needs: https://github.com/svenhb/GRBL-Plotter/blob/master/GRBL-Plotter_Setup_1731e.exe
image

@vinevinz
Copy link
Author

That one works great! Maybe just maybe if you could, can you add path shortening for the start point too?

Since rotary cutter will overcut the starting point and end point right. I will attached sample svg and picture about what I mean.

tes pola sepatu speed-starting point

image_123650291

@svenhb
Copy link
Owner

svenhb commented Apr 20, 2024

add path shortening for the start point too

Yes, I can do. What should happen with paths which are shorten then the shortening? Delete at all?

@svenhb
Copy link
Owner

svenhb commented Apr 20, 2024

@vinevinz
Copy link
Author

Yes it works great now! Thank you so much sven for the hard work, you are writing 2 new features just for me. This is a very amazing feature to have.

add path shortening for the start point too

Yes, I can do. What should happen with paths which are shorten then the shortening? Delete at all?

I think on ideal world it will be nice to give out options to delete at all or ignore path shortening for that path. But just delete at all will be fine. We can always fix it manually in the svg.

@svenhb
Copy link
Owner

svenhb commented Apr 21, 2024

I'm glad to hear it's working. Feel free to give me a star.

@vinevinz
Copy link
Author

vinevinz commented May 7, 2024

Hi Sven, I have completed my main build and I still have few questions for you, sorry for such an annoying user :(

  1. Is there anyway to use tangential axis path modification only on specific tool? For example, I load and SVG that includes path for 2 tools, 1 knife and 1 pen, but I only want the path modification only work on knife.
  2. Is there anyway to move diffrent group path simultaneously? With the same example, I load SVG containing path for 2 tools, 1 pen and 1 knife, they will each create a group based on the layer sorting on the SVG. I can't seem to move it together bcos they need to work together on same object to achieve the desired result. One draw on top, one cut on the same piece, just like your laser and pen example.

Thanks before!

@svenhb
Copy link
Owner

svenhb commented May 7, 2024

  1. I experimented with machine settings given in SVG-Meta Data - perhaps thats a solution: https://grbl-plotter.de/index.php?id=form-setup-1#format-related
    Write down whats missing to get it work.
  2. Thats not possible yet, will try to implement it, but needs longer time....

@vinevinz
Copy link
Author

vinevinz commented May 8, 2024

  1. I experimented with machine settings given in SVG-Meta Data - perhaps thats a solution: https://grbl-plotter.de/index.php?id=form-setup-1#format-related
    Write down whats missing to get it work.
  2. Thats not possible yet, will try to implement it, but needs longer time....
  1. Got it will try that out and get back to you.
  2. That is fine, I was just asking if there's any hidden feature,

By the way, I found another bug!
Applying height map sometimes adding weird move to the A axis, which turns the blade 180 for a brief moment.

Take a look at line 434 and 435, the A axis doing 180 dance
Screenshot 2024-05-08 114126

Screenshot 2024-05-08 114141

Result and image attached

Screenshot 2024-05-08 172739

unnamed (2)

Surely this move instantly chip off the tip of the rotary blade ( well im using cheap chinese ones, gotta try with the olfa japan blades later)

@svenhb
Copy link
Owner

svenhb commented May 9, 2024

From lines 433, 434 -> A0.51 to A-0.54 are just 1° difference, where is the 180° jump!? It is a motion almost only on +X (right) direction.
From the 2D view and your picture the motion must be almost only +Y or -Y (up or down) direction...
Can you upload the original graphic and show your import settings?

@svenhb
Copy link
Owner

svenhb commented May 9, 2024

And also the height map

@vinevinz
Copy link
Author

From lines 433, 434 -> A0.51 to A-0.54 are just 1° difference, where is the 180° jump!? It is a motion almost only on +X (right) direction. From the 2D view and your picture the motion must be almost only +Y or -Y (up or down) direction... Can you upload the original graphic and show your import settings?

Yes it is 1 degree difference but the blade goes from positive to negative value. Isn’t that will rotate the blade 180? I will share the file details later.

@vinevinz
Copy link
Author

vinevinz commented May 10, 2024

Shared here:

  1. SVG File
  2. Generated G-Code with Height Map applied
  3. Height Map
  4. Machine settings

You could try the gcode with path simulation, it shows the blade direction turning 180

Link removed for safety reasons

@svenhb svenhb closed this as completed in a6835c3 May 10, 2024
@svenhb
Copy link
Owner

svenhb commented May 10, 2024

I could reproduce the problem with your data and fix. Please try: https://github.com/svenhb/GRBL-Plotter/blob/master/GRBL-Plotter_Setup_1731h.exe

To reduce data, I would use this settings:
image

@svenhb svenhb reopened this May 10, 2024
@vinevinz
Copy link
Author

I could reproduce the problem with your data and fix. Please try: https://github.com/svenhb/GRBL-Plotter/blob/master/GRBL-Plotter_Setup_1731h.exe

To reduce data, I would use this settings: image

Hi sven,

this version works like charm fixing that bug. Thank you.

Apparently I can’t use your settings suggestion. Those settings will work fine with pen with bigger tip, but with blades only 0.3mm thick, it will cut jagged edges not smooth curves

@svenhb
Copy link
Owner

svenhb commented May 20, 2024

Now included in new release: https://github.com/svenhb/GRBL-Plotter/releases

@svenhb svenhb closed this as completed May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants