|
Post by aquanub on Feb 23, 2019 20:55:05 GMT
Hey guys Is it possible in UGS to define a fixed location for the touch plate and have the power route always go to this position (g54 perhaps?).
Often times when I do a tool change, the original surface is already milled off and re-zero'ing the Z on the stock is a PITA. I currently havent been using the touch plate but I think it is time I incorporated it into my workflow.
Thanks
|
|
|
Post by riotonthebay on Feb 23, 2019 21:16:27 GMT
I'm not sure this applies to you, but I'll explain what I've been doing and someone more knowledgable may be able to jump in with how it could be made to work for you.
I've been using cncjs instead of UGS, and the behavior of cncjs is that it pauses when it encounters an M6 tool change command, at which point I run a macro to handle the actual tool change. Here's a link to the macro (it would have to be modified to work with UGS because it uses some cncjs-specific features): https://gist.github.com/zachallaun/8f5ff5f107e48ca8461715d5b6039968
Here's how the macro works:
1) Retract the router & jog to a fixed location 2) Probe the original tool so that it can capture the probe Z at the end of the original tool in a variable 3) Switch out the tool for your new one 4) Probe the new tool and set Z to be the previously captured position 5) Return to your original position so that you can resume your program
I believe pausing on M6 is a feature specific to cncjs that UGS does not share. The common wisdom around here is split your gcode into a file for each tool, which you'll still have to do (unless UGS can pause on M6 and let you run a macro). So your workflow would be 1) load & run file 1 with your first tool to completion, 2) run your macro to swap out the tool and adjust set your new Z offset, 3) load & run file 2 with your new tool to completion, etc. You'd first have to translate the macro I linked to whatever UGS requires (basically anything that begins with % or is in [BRACKETS]).
Also, big caveat that I'm still working on this macro and it's not fully tested, so please make I sure you read through and understand it before using it, test it a number of times, turn your rapids down, and have your hand hear feedhold or e-stop. =)
Once I'm confident the macro is bulletproof, I planned to do a video explaining how it works and how to use it. If I can figure out how to make it work in UGS, I'll include that in the video as well.
|
|
|
Post by aquanub on Feb 24, 2019 1:00:58 GMT
Awesome. I will look into using CNCJS, thank you so much for sharing. Time to do some reading tonight, and noted on the macro
|
|
|
Post by riotonthebay on Feb 24, 2019 2:12:39 GMT
Awesome. I will look into using CNCJS, thank you so much for sharing. Time to do some reading tonight, and noted on the macro I do also want to say: it's not necessarily the best choice to switch to cncjs, and there's definitely a reason that a lot of people (almost everyone?) here use UGS. It's actively developed, more battle-tested, and the primary developer works closely with the grbl team. I was more comfortable going with cncjs because it's written in a language (JavaScript) that I've programmed professionally for a number of years and I liked the idea of being able to dive into the code (which I've had to do a couple of times to understand undocumented features ). Anyways, please do think through the macro — I rewrote it the other day for clarity and haven't been able to test it because I've been focusing on building an enclosure for my Power Route, so I want to make sure I don't steer anyone wrong. One thing that you very likely will have to do is change the TOOL_PROBE_X and TOOL_PROBE_Y. Also, if it's not on already, I'd recommend turning on soft limits, which is a grbl setting that will trigger an alarm state if it receives any move command that would extend past the max x and y travel set for your machine. You can do this with "$20=1" in your grbl command prompt. Edit: I just did a bit more digging to see if I could figure out how to do this in UGS, and it doesn't seem that UGS macros support variables. It does support prompting the user, however, so you could make it work by literally writing down/remembering the Z value after the first probe and then prompting for it after the second probe so that you can reset the Z. But then there's the challenge of betting back to where you started… hmm, it just might not be practical with UGS
|
|
|
Post by aquanub on Feb 24, 2019 2:56:22 GMT
I'm not too tied to UGS yet so I do not mind trying cncjs. I'm not entirely new to programming (have some C and matlab experience but nothing I can't figure out, just takes me more time ) If you need help with enclosure dimensions let me know, I recently enclosed my power route as well! I appreciate your time and advice.
|
|
|
Post by riotonthebay on Mar 1, 2019 20:43:48 GMT
Hey aquanub — I spent some time today fixing & improving this macro. There were some issues going back to the correct work offset after adjusting the Z but they seem to be sorted out. It also handles metric/inch mode better. https://gist.github.com/zachallaun/8f5ff5f107e48ca8461715d5b6039968
|
|