We are trying to implement CNCjs with Smoothieware for our CNC machine upgrade project. All is working really well however we are drawing a blank at tool change time.
Smoothieware uses the 'stop streaming gCode' approach to pausing the machine, this enables jogging the machine around and probing commands by sending new commands. It won't stop on an M0 command. Unless I'm missing something, I can't see how to implement this philosophy in CNCjs. Can somebody point me in the right direction or could we make this a feature request?
If it's not already implemented, my idea of how this could work in CNCjs: The event system could be extended to include a tool change trigger. This could then allow the user to insert a set of commands to execute the tool change (e.g. spindle stop, coolant stop, move to tool change location, etc.) including a stop stream system command (I believe %wait lets the planner queue empty?)
M0/M1 (Program Pause) and M2/M30 (Program End) are currently not handled by CNCjs, I will add two event triggers (i.e. M0,M1 Program Pause and M2,M30 Program End) and implement the expected behaviors (https://github.com/grbl/grbl/issues/681#issuecomment-101047305) in the 1.9 releases:
M0, M1 Program Pause and G-code: Pause eventsM2, M30 Program End and G-code: Stop eventsAdding a M6/tool change trigger would be cool as well.
Sure. The support for M6 tool change should be the first priority.
The preliminary support for pausing G-code execution with M0, M1, M2, M6, and M30 commands is now available in the master branch. You can run any macros or jog during a pause. I will make a thorough test in the next few days.
Sadly, I've not been able to install directly from github to do testing. Unless I think of something, I'll have to wait for it to be pushed out via npm/windows installer.
T
Just did a test, works great on smoothie.
[x] Restore work position after completion
(1) Move to Z-safe height defined by user
(2) Move to the previous position along the X and Y axis
(3) Move to the previous position along the Z axis
[x] Restore modal state after completion
Modal Group | Member Words
:----- | :-----
Coordinate System Select | G54, G55, G56, G57, G58, G59
Plane Select | G17, G18, G19
Distance Mode | G90, G91
Feed Rate Mode | G93, G94
Units Mode | G20, G21
Spindle State | M3, M4, M5
Coolant State | M7, M8, M9
[x] Update M6 Tool Change instructions on wiki
https://github.com/cncjs/cncjs/releases/tag/v1.9.11
CNCjs 1.9.11 is now available with M6 tool change support. You can upgrade to 1.9.11 and read the wiki page at https://github.com/cncjs/cncjs/wiki/Tool-Change to learn how to create a tool change macro.
Most helpful comment
The preliminary support for pausing G-code execution with M0, M1, M2, M6, and M30 commands is now available in the master branch. You can run any macros or jog during a pause. I will make a thorough test in the next few days.