📄 tool_compensation.lyx
字号:
The general method includes programming an alignment move and two entry moves. The entry moves given above will be used as an example. Here is the relevant code again:\layout Standard\family typewriter \size small N0010 G1 X1 Y4.5 (make aligment move to point C)\newline N0020 G41 G1 Y3.5 (turn compensation on and make first entry move to point B)\newline N0030 G3 X2 Y2.5 I1 (make second entry move to point A)\layout StandardSee Figure 11. The figure shows the two entry moves but not the alignment move.\layout StandardFirst, pick a point A on the contour where it is convenient to attach an entry arc. Specify an arc outside the contour which begins at a point B and ends at A tangent to the contour (and going in the same direction as it is planned to go around the contour). The radius of the arc should be larger than half the diameter given in the tool table. Then extend a line tangent to the arc from B to some point C, located so that the line BC is more than one radius long.\layout Standard\begin_inset Minipageposition 1inner_position 0height "0pt"width "40col%"collapsed false\layout StandardAfter the construction is finished, the code is written in the reverse order from the construction. Cutter radius compensation is turned on after the alignment move and before the first entry move. In the code above, line N0010 is the alignment move, line N0020 turns compensation on and makes the first entry move, and line N0030 makes the second entry move.\end_inset \hfill \begin_inset Minipageposition 1inner_position 0height "0pt"width "60col%"collapsed false\layout Standard\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \begin_inset Graphics filename radius_comp_entry.png width 3in\end_inset \end_inset \layout StandardIn this example, the arc AB and the line BC are fairly large, but they need not be. For a tool path contour, the radius of arc AB need only be slightly larger than the maximum possible deviation of the radius of the tool from the exact size. Also for a tool path contour, the side chosen for compensation should be the one to use if the tool is oversized. As mentioned earlier, if the tool is undersized, the interpreter will switch sides.\layout Subsubsection*Simple Method\layout StandardIf the contour is a material edge contour and there is a convex corner somewhere on the contour, a simpler method of making an entry is available. See Figure 12.\layout StandardFirst, pick a convex corner, D. Decide which way you want to go along the contour from D. In our example we are keeping the tool to the left of the contour and going next towards F. Extend the line FD (if the next part of the contour is an arc, extend the tangent to arc FD from D) to divide the area outside the contour near D into two regions. Make sure the center of the tool is currently in the region on the same side of the extended line as the material inside the contour near D. If not, move the tool into that region. In the example, point E represents the current location of the center of the tool. Since it is on the same side of line DF as the shaded triangle, no additional move is needed. Now write a line of NC code that turns compensation on and moves to point D\layout Standard\begin_inset Minipageposition 1inner_position 0height "0pt"width "40col%"collapsed false\layout Standard\family typewriter \size small N0010 G41 G1 X2 Y2 (turn compensation on and make entry move) \layout StandardThis method will also work at a concave corner on a tool path contour, if the actual tool is oversized, but it will fail with a tool path contour if the tool is undersized.\end_inset \hfill \begin_inset Minipageposition 1inner_position 0height "0pt"width "60col%"collapsed false\layout Standard\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \begin_inset Graphics filename radius_comp_entry_simple.png width 3in\end_inset \end_inset \layout Subsubsection*Other Items Where Cutter Radius Compensation is Performed.\layout StandardThe complete set of canonical functions includes functions which turn cutter radius on and off, so that cutter radius compensation can be performed in the controller executing the canonical functions. In the interpreter, however, these commands are not used. Compensation is done by the interpreter and reflected in the output commands, which continue to direct the motion of the center of the cutter tip. This simplifies the job of the motion controller while making the job of the interpreter a little harder.\layout Subsubsection*Algorithms for Cutter Radius Compensation\layout StandardThe interpreter allows the entry and exit moves to be arcs. The behavior for the intermediate moves is the same, except that some situations treated as errors in the interpreter are not treated as errors in other machine controls. \layout StandardData for Cutter Radius Compensation \layout StandardThe interpreter machine model keeps three data items for cutter radius compensation: the setting itself (right, left, or off), program_x, and program_y. The last two represent the X and Y positions which are given in the NC code while compensation is on. When compensation is off, these both are set to a very small number (10 -20 ) whose symbolic value (in a #define) is "unknown". The interpreter machine model uses the data items current_x and current_y to represent the position of the center of the tool tip (in the currently active coordinate system) at all times.\layout Subsection*Jon Elson's Example\layout StandardAll further system-specific information refers to NIST's EMC program, but much of it applies to most modern CNC controls. My method of checking these programs is to first select tool zero, which always has a diameter of zero, so offset commands are essentially ignored. Then, I tape a sheet of paper to a piece of material that sits level in my vise, as a sort of platen. I install a spring-loaded pen in the spindle. This is a standard ballpoint pen refill cartridge made of metal, in a 1/2" diameter steel housing. It has a spring that loads the pen against the front, and a 'collet' at the front that allows the pen to retract against the spring, but keeps it centered within a few thousandths of an inch. I run the program with tool zero selected, and it draws a line at the actual part's outline. (see figure below) Then, I select a tool with the diameter of the tool I intend to use, and run the program again. (Note that Z coordinates in the program may need to be changed to prevent plunging the pen through the platen.) Now, I get to see whether the G41 or G42 compensation that I specified will cut on the desired side of the part. If it doesn't, I then edit the opposite compensation command into the program, and try again. Now, with the tool on the correct side of the work, you get to see if there are any places where the tool is 'too fat' to fit in a concave part of the surface. My old Allen-Bradley 7320 was pretty forgiving on this, but EMC is a complete stickler. If you have ANY concavity where two lines meet at less than 180 degrees on the side that a tool of finite size cuts on, EMC will stop with an error message there. Even if the gouge will be .0001" deep. So, I always make the approach on the lead-in and lead-out moves such that they just nip the corner of the part a tiny bit, providing an angle just over 180 degrees, so that EMC won't squawk. This requires some careful adjustment of the starting and ending points, which are not compensated by cutter radius, but must be chosen with an approximate radius in mind.\layout StandardThe operative commands are :\layout StandardG40 - Cancel Cutter compensation\newline G41 - Cutter Compensation, Tool Left of Path\newline G42 - Cutter Compensation, Tool Right of Path\layout StandardHere is a short file that cuts one side of a part with multiple convex and concave arcs, and several straight cuts, too. It is to clamp a high speed drilling spindle to the side of the main Bridgeport spindle. Most of these commands are straight from Bobcad/CAM, but lines N15 and N110 were added by me, and some of the coordinates around those lines had to be fudged a bit by me.\layout Standard\family typewriter \size small N10 G01 G40 X-1.3531 Y3.4\newline N15 F10 G17 G41 D4 X-0.7 Y3.1875 (COMP LEAD IN)\newline N20 X0. Y3.1875\newline N40 X0.5667 F10\newline N50 G03 X0.8225 Y3.3307 R0.3\newline N60 G02 X2.9728 Y4.3563 R2.1875\newline N70 G01 X7.212 Y3.7986\newline N80 G02 X8.1985 Y3.2849 R1.625\newline N90 G03 X8.4197 Y3.1875 R0.3\newline N100 G01 X9.\newline N110 G40 X10.1972 Y3.432 (COMP LEAD OUT\newline N220 M02\layout StandardLine 15 contains G41 D4, which means that the diameter of the tool described as tool #4 in the tool table will be used to offset the spindle by 1/2 the diameter, which is, of course, the tool's radius. Note that the line with the G41 command contains the endpoint of the move where the radius compensation is interpolated in. What this means is that at the beginning of this move, there is no compensation in effect, and at the end, the tool is offset by 100% of the selected tool radius. Immediately after the G41 is D4, meaning that the offset is by the radius of tool number 4 in the tool table. Note that tool DIAMETERS are entered in the tool table. (Jon's tool diameter is about 0.4890)\layout StandardBut, note that in line 110, where the G40 'cancel cutter compensation' command is, that cutter compensation will be interpolated out in this move. The way I have these set up, the moves in lines 15 and 110 are almost exactly parallel to the X axis, and the difference in Y coordinates is to line the tool up outside the portion of the program where cutter compensation is in force.\layout Standard\added_space_top 0.3cm \added_space_bottom 0.3cm \align center \begin_inset Graphics filename partdraw1.png width 5in\end_inset \layout StandardSome other things to note are that the program starts with a G40, to turn off any compensation that was in effect. This saves a lot of hassle when the program stops due to a concavity error, but leaves the compensation turned on. Also note in line 15 that G17 is used to select the XY plane for circular interpolation. I have used the radius form of arc center specification rather than the I,J form. EMC is very picky about the radius it computes from I,J coordinates, and they must match at the beginning and end of the move to within 10^-11 internal units, so you will have lots of problems with arbitrary arcs. Usually, if you do an arc of 90 degrees, centered at (1.0,1.0) with a radius of 1", everything will go fine, but if it has a radius that can not be expressed exactly in just a few significant digits, or the arc is a strange number of degrees, then there will be trouble with EMC. The R word clears up all that mess, and is a lot easier to work with, anyway. If the arc is more than 180 degrees, R should be negative.\layout SectionTool Compensation Sources\layout StandardThis unit borrows heavily from the published works of Tom Kramer and Fred Proctor at NIST and the cutter compensation web page of Jon Elson.\layout StandardPapers by Tom Kramer and Fred Proctor\newline http://www.isd.mel.nist.gov/personnel/kramer/publications.html\newline http://www.isd.mel.nist.gov/personnel/kramer/pubs/RS274NGC_22.pdf\newline http://www.isd.mel.nist.gov/personnel/kramer/pubs/RS274VGER_11.pdf\layout StandardPages by Jon Elson \newline http://artsci.wustl.edu/~jmelson/ \newline http://206.19.206.56/diacomp.htm \newline http://206.19.206.56/lencomp.htm \the_end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -