Oh my!...it worked! Now I have a couple questions bout the syntax if you don't mind!:
1. What is "L50" in the G10 line?
2. Maybe I'll close the sub and have it move up to the front of the part with the G31 line...there should be no interference IF there is no part in the sub. But what happens if there IS interference and the torque limit is exceeded? It "skips" the G31 line or...??? Or does it stop and alarm out with some sort of "torque limit exceeded" message but at least nothing got broken?
Thank you, again, for your help! This is going to be huge!
G10 L50 enables parameter writing. G11 disables it. You should
NOT run this code if you don't completely understand what it's doing!
That section of code is explicitly changing the contents of parameter 2060#6, which is the relevant parameter on the machine I wrote it for (18i-TB, parameter 2060 is the per axis torque limit, the subspindle on this machine is axis number 6), there are no guarantees that it's the same on yours, and you
MUST do your due diligence before running it.
The second part changes it back to it's original value, but 8010 is the original value of
mine - yours is likely to be different, so take care!
Thank you! 1) what is the "Q" word in your G31 line? and 2) I totally get your example and the conditional branch "node" if you will after the G31 line, but how does the example earlier in this thread work without any branching, for instance:
G10 L50
N2060 P6 R1000 ( P is the axis number, in my case B is 6. R is an arbitrary value that I picked out of thin air, seems to equate to about 40% axis load.)
G11
G98 G31 P99 B-xxx Fxxx
G10 L50
N2060 P6 R8010 ( 8010 is just what it was set at previously.)
G11
OR would the position check line just be put in right after that???
Thank you, again!
The Q in G31 only works on newer Fanucs, it lets you specify a percentage of the fixed torque limit without doing any of the workarounds discussed ITT.
It doesn't do anything on the 18i-TB that my original example above was written for, but it's important to note that the control will happily accept it anyway, no alarm, but no reduced torque. Nice way to have a crash if you're sharing code between machines.
I use G31 P98 Qx on my 31i-b5 and it works great.
Re. position checks, the example I wrote there is simply the mechanics of a functional torque skip on a machine that doesn't have built in support for it. You do whatever checks you need to do after that.
I misread your original post, and was giving it a position check in my code that it sounds like you don't need. My mistake. On my control the Q word is the torque value at which it skips, in percent (as a whole number with no decimal per what I am told). It is in reference to the axis servo torque, the percentage values you would see on the load monitor page.
When executing a G31 move, the move should just stop at the moment the torque load percentage exceeds the set Q value, and move on to the next line of code. So in your example with a Q50 added to the G31 line it would move the B until the B axis hits 50% load, regardless of position, then go to the G10 line below. There may be some significant differences in our controls though if your manual is using the P and R words. My understanding of the Q word is that it simply applies to the axis making the move on the G31 line.
If you were doing a position check then I would think you would want to do it immediately.
I'll just reiterate - G31 Qx only applies to newer controls. Also, it's not a direct equivalent percentage, the range for Q is 0-255 which scales to 0-100% load, so to approximate 50% load you would use Q128, not Q50.