We have a VMC with OM control and I have been using G10 in the program to set the work and tool length offsets.
We use preset tools so to make a depth change, we have to alter the value in the G10 line for that tool. I would rather not change the program so I was wondering if there was variable you could add to the G10 line that would act as a wear offset for the tool lengths.
Thanks for any help....
The simple answer is yes. Don't have the info in front of me now. Oh but you wouldn't want it on the G10 line, just below it.
Is there another way to call a program from a program? That is not using the
M98 and M99 stuff? Meaning I don't want a sub and main program. Just the program changing at pallet swap time, with the pallet.
And the reason for not wanting a main and sub arrangement is because the program may need to be stopped and reset etc. that makes it difficult for someone else running the machine.
Is there another way to call a program from a program? That is not using the M98 and M99 stuff?
Aside from hard coding your pallet change code into the main program or using a Haas machine…no not that I know of. What is the problem with having a separate program for calling the pallet? How does someone else get screwed up? You can make your pallet change program call with a custom M or G code so that is all you would need in the main program.
Is there another way to call a program from a program? That is not using the
M98 and M99 stuff? Meaning I don't want a sub and main program. Just the program changing at pallet swap time, with the pallet.
And the reason for not wanting a main and sub arrangement is because the program may need to be stopped and reset etc. that makes it difficult for someone else running the machine.
Not having a pallet machine myself im guessing, however
Im assuming there is a paremeter that denotes which pallet is where that you can read, that being said, why not write your program so skips to a line number depending on which pallet is in use.
Well the way that I am reading dicer’s post is he does not want to call a subprogram of any kind. Or does he just mean I don't want M98??
“Meaning I don't want a sub and main program.”
So this would include not using M98 or any other custom code that would call a subprogram. The only way I see around this is to code the pallet change right into the main program. This would involve basically putting all the code that the pallet change needs right in the main (safe moves, safe codes, all the pertaining Mcodes etc.). This is going to be more confusing and problematic then just actually calling a subprogram.
The only other way I see it being able to be done is if he was running a Haas and used the M97.
We have a VMC with OM control and I have been using G10 in the program to set the work and tool length offsets.
We use preset tools so to make a depth change, we have to alter the value in the G10 line for that tool. I would rather not change the program so I was wondering if there was variable you could add to the G10 line that would act as a wear offset for the tool lengths.
Thanks for any help....
As Sinha stated in his last post, you could apply the change in an actual wear offset. Whether you input a value in an offset data registry or a Macro Variable registry is a toss up, so you may as well use the actual wear offset if one exists. This will depend on the Tool Compensation Memory the control has.
Often the control does not have separate Geometry and Wear offsets, so in this case a variable could be used in the program to apply the difference. As is normally the case with CNC programming, there are a few ways of achieving the desired result.
1. Structure the program so that your G10 for loading the Tool Length is only read once when the program is first loaded, then variations can be made to the actual Tool Length Offset loaded by G10. You can do this by using a block delete on the G10 line, or have a conditional statement that looks at a non volatile Macro Variable such as #500 and jumps past the G10 block if it’s set to 1. For example:
Start of program
etc
etc
If [#500 EQ 1] GOTO 10
G90 G10 L11 P_ R_
#500 = 1
N10
The draw back is that you have to remember to either turn block delete on after the first read, or set #500 to Zero when the program is first loaded.
2. Input the value of your variation to the original G10 input value in a non volatile variable such as #500, and have that value added to, or subtracted from the G10 value that’s already been loaded into the Offset Registry. For example with Tool Compensation Memory A (No Wear Offsets):
Start of program
etc
etc
G90 G10 L11 P_ R_
G91 G10 L11 P_ R#500
G90
In this case the P would be the same value in each G10 block and a minus sign or not in #500 would determine if the variation to the Tool Length Offset is added or subtracted.
3. Enter the required variation to the value loaded in the Tool Length offset by the first G10 block, into another Tool Length offset that has some numerical association with the primary Tool Length offset. For example if Tool Length offset 24 is being used in the program and is were the G10 block is loading the value, you might put the variation in Tool Length offset 124 if you have sufficient offsets. Then in your program you could have something like the following:
Start of program
etc
etc
G90 G10 L11 P_ R_
#1 = #2124 (SYSTEM VARIABLE FOR TOOL OFFSET NUMBER 124)
G91 G10 L11 P_ R#1
G90
The variable used in R does not have to be non volatile because the offset contained in the Tool Offset in this example will be retained when the machine is powered down.
As a matter of personal preference, I do not like the use of G10 unless there is no system variable associated with what we want to change. The system variable method is simpler to use (need not worry about syntax) as well as more flexible (you can read the current value, before changing it).
At pallet change I wish to call the correct program for that job or part.
If you main and sub it, then if you have to reset, like if an MOO says "check for clean up" and it isn't cleaned up. You reset, and rerun that tool. Well if it is a main and sub then its a bit of a mess to find your way back to that tool.
I will post that info, when I have the book here.
(for the guy that asked)
Bill-
Your option 3 is the one that will work for us. I will try it out
when I get back in the shop Monday. I knew about the G91
incremental move but did not think to put it after setting the
length with G90. Thanks for the help. Blaine
I have been reading this thread in the hope that I will be able to start programming my own canned cycles. I have a basic understanding of G and M codes (we don't have any CAD/CAM software at our little two man shop) and I do most of the programming, but I have run into a problem. I have to counter bore a hole to .493 ID and we don't have an end mill that size, so as I understand it, I would have to use a G13 on each of the 2,370 holes in the fixture I am building. I was wondering if there would be any way to make a canned cycle to make the same counter bore without having to enter in each hole location separately?
This is the way I have (or more accurately the Haas conversational drill program) written the drill portion of the program.
I would like to use something similar for the CB but I am at a loss as to how. Any help that you would be able to send my way would be greatly appreciated.
#510 = [#500/2] (Cbore Radius)
N10 G0 X#508 Y#509 Z0.1 (First hole position)
G1 Z-#503 F10 (Down in Z)
G13 I#510 Dxx Fx (G13 circular interp)
G0 Z0.1 (Up in Z
#504=[#504+1] (Increment hole counter)
#508=[#508+#501] (Increment X spacing)
IF [#504 GT #506] GOTO 30 (IF hole counter greater than set, jump out)
GOTO 10
N30 #508 = 0 (Reset X to 0 - or initial position)
#504 = 0 (Reset row counter)
#509 = [#509+#502] (Increment column Position
#505 = [#505+1] (increment column counter)
IF [#505 GT #507] GOTO N100 (End program)
GOTO 10
End of program stuff
If I've done this right, it should do the holes in a zig-zag pattern.....It's been a long mentally draining week and I'm writing this off the cuff so there could be a woops in it somewhere...
The Macro that you sent me worked great! My boss was impressed with that little bit of code doing all the work. I had to modify a little bit of it to make it fit the print (when I posted the question I forgot that the program would need to skip four holes that are being used to clamp the part to the table. but it was easily fixed with a few logic statements). Our shop is now convinced that Macros are the way to go for repetitive parts. Thanks again.
Bookmarks