Hi! I'm currently using GRBL workspace as front-end for my CNC router and got

Hi!

I’m currently using GRBL workspace as front-end for my CNC router and got weird problem with tool change routine on M6 g-code command. Position for tool return was way off and I broke one of my twist drills :slight_smile:

In Autodesk Fusion 360 I’ve made few operations with 1/8 end mill(on picture it’s from “Adaptive1” through “2D Contour11”, tool is T12) and one with twist drill(op name is Drill1, tool is T3). Everything was running as expected until I’ve clicked on “Send Position” button as completion for tool change routine, coordinates were way off and I did not noticed that, results as usual were quite unexpected :slight_smile:

As you could see on second picture coordinates for tool return are X102.19 Y272.087 Z3 but in NC-file last coordinates before tool change are X52.721 Y271.98 Z37.1

My NC-file starting from line number 9686:


G3 X52.721 Y271.98 J-21.587
G0 Z37.1
M5

(Drill1)
M9
T3 M6
S5000 M3
G54
M9
G0 X145.954 Y119.55

I’ve previously used tool change feature few times, everything was OK, only difference this time was that I placed Z0 onto router table, usually it’s stock top.

Fusion’s post-processor for output is Generic GRBL.

Complete NC file if it helps:

Could you see what the Gcode widget says the XYZ should be on that line by mousing over it and looking at that flyout menu? I’m curious if the Gcode widget is calculating the ongoing XYZ correctly for you. It should be, because it doesn’t actually calculate it on it’s own, rather it asks the 3D viewer to give it what coordinates it rendered for that line of Gcode. Your 3D view looks nice and correct. Question: do you have multiple tool changes in your Gcode file? Is it possibly it was showing the reposition XYZ from an earlier M6?

@jlauer I will try to run this code one more time but It will be only tomorrow.

Question: do you have multiple tool changes in your Gcode file? Is it possibly it was showing the reposition XYZ from an earlier M6?

Actually Fusion 360 includes in output commands for tool change before first operation so technically yes, it’s multiple tool changes but first coordinates were something like X0 Y0 Z0

@jlauer OK, I’ve ran code second time and position error still there.

Jog panel shows exact coordinates for tool return in this pictures, GCode widget coordinates:

line 9682, last move before tool change
https://drive.google.com/open?id=0B5NfNsKzoKH0Z2labERFZG1KMms

line 9684, comment, op name
https://drive.google.com/open?id=0B5NfNsKzoKH0S0RzZFRTbWVpWk0

line 9686, tool change command
https://drive.google.com/open?id=0B5NfNsKzoKH0SUZsZWxSUTdsRGs

I must say that in lines 9683-9687 coordinates are different in pop-up window from line to line but there are no actual movement in gcode.

Yeah, that Z looks off on the End position. The 3D viewer looks correct though. Let me look deeper. I wonder if you found a bug that’s been in there a while.

@jlauer If I could help somehow with this problem drop me a note.

Actually, yes you can. Can you watch your Javascript console as you mouse over the line of Gcode? You have to turn on Javascript console output in ChiliPeppr in the upper right corner to see the debug messages. Then look at the publish/subscribe data being sent/received as you mouseover. That’s the XYZ coming back from the 3D viewer. Can you see if the Z value is zero in there? Or if it is the correct number? That will help deduce where the bug may be.

@jlauer Looks like I’ve overlooked something, by saying “Javascript console” do you mean developers console in browser or it somewhere in ChiliPeppr interface? Do you mean this console https://developers.google.com/web/tools/chrome-devtools/console/ ?

While searching where to switch on debug messages I’ve noticed that AdBlock Plus in my browser blocked something on workspace page, could it be a cause for such ChiliPeppr behavior? I’m not sure but it’s possible that I’ve installed it after last time I’ve used tool change feature in ChilliPeppr.

@jlauer I’ve made few pictures of log messages, but there a lot of properties for those objects, what should I look for exactly?
https://drive.google.com/open?id=0B5NfNsKzoKH0MjVTNDNZYnJmMlE
https://drive.google.com/open?id=0B5NfNsKzoKH0MjVTNDNZYnJmMlE

The Gcode widget in TinyG workspace looks correct, but the widget in Grbl does not. Not sure why. I’ve never worked on the Grbl version of the widget. It was orginally Jarrett Luft. Could you possibly look deeper into what’s the difference?

TinyG Gcode Widget: https://goo.gl/photos/8V7A8oQ6NWG2DFGw7

@jlauer Maybe it would be easier for me to contact with Jarrett directly? Or he doesn’t mantain grbl workspace now?

You could give it a try. @Jarret_Luft

@jlauer I’ve noticed that coordinates in GCode window are constantly late by 3 lines, so I removed all “service” commands(G21, G17, G90 and so on) from beginning of nc-file and now coordinates are only one line late, but when I droped file in workspace I was asked about units(mm vs inches) and G21 line was added before any g-code from file. Does it mean something? :slight_smile:

You shouldn’t have to remove any of those lines. Why would it work in TinyG workspace, but not in Grbl workspace? They both use the same 3D viewer, which is what figures out the XYZ coordinates for each move. The Gcode widget simply asks the 3D viewer widget for the XYZ values for each line.

@jlauer Yes, I got it, but obviously there are some problem with lines indexing and it’s affected by service commands(or comments, or empty lines) and not by simple move commands.

I’ve checked Jarret’s gitbub, tweeter and so on, looks like he is offline for some time, also I’ve sent him email letter but he didn’t responded for now.

@jlauer sorry, but I bother you again :slight_smile: Now I have problems with 3d viewer in workspace.

Path in Fusion 360 simulation
https://drive.google.com/open?id=0B5NfNsKzoKH0N0xpeXA2SDJxWm8
Path in ChiliPeppr
https://drive.google.com/open?id=0B5NfNsKzoKH0S3ptM0VUUzRsb0E

Another path in Fusion
https://drive.google.com/open?id=0B5NfNsKzoKH0dEQxU202UzE4c0E
Same in ChiliPeppr
https://drive.google.com/open?id=0B5NfNsKzoKH0bjR4c0gtenZMY0k

All pics + nc-files in one folder
https://drive.google.com/open?id=0B5NfNsKzoKH0MmdjNzdzM1dQWTg
https://drive.google.com/open?id=0B5NfNsKzoKH0MmdjNzdzM1dQWTg