Results 1 to 15 of 15
Like Tree5Likes
  • 1 Post By angelw
  • 1 Post By angelw
  • 1 Post By angelw
  • 1 Post By Rich L
  • 1 Post By angelw

Thread: Need some simple circular interpolation help

  1. #1
    Rich L is offline Cast Iron
    Join Date
    Sep 2006
    Location
    Denver, CO
    Posts
    335

    Default Need some simple circular interpolation help

    Folks,

    I've run into a G-coding problem I can't seem to resolve. Here are the details:

    Machine - gang tool lathe with C-axis running G7.1 (G107)
    Control - Fanuc Oi Mate TB
    Material diameter .5 aluminum

    Error message: 021 Illegal Plane Axis Commanded

    G18 is set in memory as default as well as commanded

    I've just been trying to test this capability so I wrote a small program to exercise G7.1 in preparation for some live tool engraving. The program doesn't have any real funtionality yet but just moves the axes around so that I can see that I've got the fundamentals down. Then I'll work out the true details. Here's the short program - it's just meant to engrave a circle in the side of the cylinder:

    O0099 (CYL INTERP TEST)
    M20 (RESET TO NORMAL SPINDLE MODE)
    M05 (STOP SPINDLE)
    G28 U0
    G28 W0
    G98 G18
    G40 G80
    M21 (ENTER C-AXIS MODE)
    T0101 (CALL FAKE TOOL)
    G0 X.5 (MOVE OVER TO EXTENDED SURFACE)
    G0 Z.1 (MOVE IN JUST OFF FACE)

    G28 H0. (ORIENT SPINDLE)

    G7.1 C.250 (ENTER CYL INTERP MODE)

    G1 X.49 F100 (MOVE TO ENGRAVING DEPTH)
    G0 Z0. (MOVE INTO FACE)

    G18 (I put this in after I got the error, but still got the error)
    (G19 gives me the same error)


    (The first of the following G02 lines produces the error)
    G02 Z-.250 C90. R.250 F200
    G02 Z -.5 C0. R.250 F200
    G02 Z-.250 C-90. R.250 F200
    G02 Z0. C0. R.250 F200

    (I had the following straight line code in before I put the G02 lines in shown above and the following two lines worked)
    (G1 Z-.5 C90. F200)
    (G1 Z0. C180. F200
    )

    G1 X.6 (BACK OFF PART)
    G1 Z.1 (BACK OFF PART)

    G7.1 C0. (EXIT CYL MODE)

    G0 Z1.

    M20
    M30

    I don't understand why the straight linear G1 "ZC" code works but the circular code G2 "ZC" code doesn't. I originally tried to code 2 semicircles but broke that up into the quadrants hoping that would rid the error. I've looked at the example given in the Fanuc Descriptions manual til I'm blue in the face. What am I missing?

    Any hints, please?

    Cheers,
    Rich

  2. #2
    allen3944 is offline Aluminum
    Join Date
    Feb 2009
    Location
    south carolina
    Posts
    139

    Default

    have you tried G17 instead of G18 or G19?

  3. #3
    Rich L is offline Cast Iron
    Join Date
    Sep 2006
    Location
    Denver, CO
    Posts
    335

    Default

    A couple things I've done since posting, but to no avail, are:

    changed the R value in the G2 commands to be acceptable - they were too small.

    placed G1 "ZC" code right in front of the G2 code and the G1 codes execute but then it throws the error "21" (Illegal Plane Axis Commanded) at the G2 code:

    now it reads:
    G1 Z-.5 C90. (THIS WORKS)
    G1 Z0. C0. (THIS WORKS)
    G2 Z-.250 C90. R.500 (THIS THROWS THE ERROR)
    ...

    took the F numbers (feed) off the G2 lines

  4. #4
    Rich L is offline Cast Iron
    Join Date
    Sep 2006
    Location
    Denver, CO
    Posts
    335

    Default

    Quote Originally Posted by allen3944 View Post
    have you tried G17 instead of G18 or G19?
    Yes - I get a "28" error - illegal plane select

  5. #5
    Greg White is offline Titanium
    Join Date
    Jan 2007
    Location
    Pinckney Mi.
    Posts
    2,462

    Default

    9th the plane selection,try g17 maybe 18 maybe 19.
    Gw

  6. #6
    Rich L is offline Cast Iron
    Join Date
    Sep 2006
    Location
    Denver, CO
    Posts
    335

    Default

    Quote Originally Posted by Greg White View Post
    9th the plane selection,try g17 maybe 18 maybe 19.
    Gw
    G18 was in the original post and is default as well as commanded. I got the error.

    G17 and G19 were tried and got "028 Illegal Plane Select"

    So here's another shot at this. I looked at parameter 1022 which sets each axis in the basic coordinate system. Since outside of circular interpolation while in cylindrical interpolation mode, the system seems to be happy with G18, I'm curious about the setting I have for 1022. It is set at

    X 1 (X axis of basic three axes)
    Z 3 (Z axis of basic three axes)
    C 5 (Axis parallel to X axis)

    "C 5" seems odd. Do you think it should be "C 7" ( Axis parallel to the Z axis)?

    It seems as if the control doesn't like seeing either Z or C in the G2 command and my leading guess is that it's translating the C to a parallel X command per the parameter and that doesn't look too awfully good to the G7.1 mode.

    I haven't just changed it because I'm scared to change those sacred parameters along with the dangers of not doing it correctly.

    So what do y'all think? I'm posting a lot to my own post so I hope it helps you vastly experienced helpers!

    Cheers,
    Rich

  7. #7
    Tonytn36 is offline Diamond
    Join Date
    Dec 2007
    Location
    Southeastern US
    Posts
    4,891

    Default

    C should be parallel to the Z axis, not the X axis for a C-axis spindle on a lathe.

  8. #8
    angelw is online now Stainless
    Join Date
    Sep 2010
    Location
    Victoria Australia
    Posts
    1,652

    Default

    Hi Rich,
    With Cylindrical Interpolation, you must set parameter #1022 to specify whether the rotation axis is the X–, Y–, or Z–axis, or an axis parallel to one of these axes. Then specify the G code to select a plane for which the rotation axis is the specified linear axis. For example, when the rotation axis is an axis parallel to the X–axis, G17 must specify an Xp–Yp plane, which is a plane defined by the rotation axis and the Y–axis or an axis parallel to the Y–axis. Only one rotation axis can be set for cylindrical interpolation.

    See the attached picture to get an idea of how to determine which axis is the rotation axis or parallel to one of the axes. For example, if the machine were a typical 4 axes, vertical machining center, with the axis around which the 4th axis rotates being parallel with the X axis (typical A axis configuration), then either Y or Z could be set in parameter #1022, as both Y and Z are parallel to the rotating cylinder. The best way I find to determine this, is to look at the edge of the unwrapped cylinder and see which axis its parallel to. In the case of the attached sketch, the edge is parallel to both Y and Z. However, the axis set in #1022 will also have an effect of the plane setting G code (G17 - 19) and whether G02 or G03 is used; see the attached sketch.

    For Circular interpolation between the Z axis and C axis, the C axis of parameter #1022 could be set to 5 (axis parallel with the X axis). In this case, the command for circular interpolation is:
    G18 Z... C...
    G02 (G03) Z... C... R...

    The C axis of parameter #1022, could also be set to 6 (axis parallel with the Y axis). In this case, however, the command for circular interpolation is:
    G19 C... Z...
    G02 (G03) Z... C... R...

    cylindrical1.jpg

    Regards,

    Bill

  9. #9
    Rich L is offline Cast Iron
    Join Date
    Sep 2006
    Location
    Denver, CO
    Posts
    335

    Default

    Quote Originally Posted by angelw View Post

    For Circular interpolation between the Z axis and C axis, the C axis of parameter #1022 could be set to 5 (axis parallel with the X axis). In this case, the command for circular interpolation is:
    G18 Z... C...
    G02 (G03) Z... C... R...

    (Above is exactly what does not work - I know the statement is generic)

    The C axis of parameter #1022, could also be set to 6 (axis parallel with the Y axis). In this case, however, the command for circular interpolation is:
    G19 C... Z...
    G02 (G03) Z... C... R...

    (I doubt that the above would work 'cause I don't have "Y")

    Which leaves us with ... Z !

    Click image for larger version. 

Name:	Cylindrical1.JPG 
Views:	1004 
Size:	48.8 KB 
ID:	40833

    Regards,

    Bill
    Bill, Tonytn36, thanks for the reply and please ignore my post on the other forum on which you are a contributor. Oops, I just noticed you replied while I was typing.

    Help me understand, please. Your picture seems to relate more to a vertical center than to a lathe (my lathe). I have no Y axis and, indeed, my C-axis (the spindle) is parallel to the Z axis of my lathe. So, my 1022 "C" parameter should be 7 (parallel to Z)? Right?

    It also seems as though G18 does not factor into any linear commands as I can execute a simultaneous 3D XZC G1 command. It only gets in my way (I shouldn't be so harsh) during circular interp commands when within or whitout a C-axis mode.

    So what do you think? Change it to "7" ??

    Cheers,
    Rich

  10. #10
    angelw is online now Stainless
    Join Date
    Sep 2010
    Location
    Victoria Australia
    Posts
    1,652

    Default

    Quote Originally Posted by Rich L View Post
    Bill, Tonytn36, thanks for the reply and please ignore my post on the other forum on which you are a contributor. Oops, I just noticed you replied while I was typing.

    Help me understand, please. Your picture seems to relate more to a vertical center than to a lathe (my lathe). I have no Y axis and, indeed, my C-axis (the spindle) is parallel to the Z axis of my lathe. So, my 1022 "C" parameter should be 7 (parallel to Z)? Right?

    It also seems as though G18 does not factor into any linear commands as I can execute a simultaneous 3D XZC G1 command. It only gets in my way (I shouldn't be so harsh) during circular interp commands when within or whitout a C-axis mode.

    So what do you think? Change it to "7" ??

    Cheers,
    Rich
    Hi Rich,

    Yes, the sketch is of a 4 axis vertical machining center with an A axis. I answered this same question in another Thread that applied to a machining center. However, the same principles apply. In the case of a machine with a C axis, the axis of the cylinder is parallel to (and the same as) the Z axis. Accordingly, the edge of the unwrapped cylinder is parallel to both the X and Y (if the machine has one) axis. Sorry if I confused you with the sketch.

    If I comprehend your post correctly, you're using cylindrical interpolation on what would be the circumference of a workpiece held in a chuck, or some other holding device, and the axis around which it rotates is the Z axis (conventional C axis configuration). The tool being used is a live tool being applied in the X axis. That all being true, then you would set parameter #1022 to 5, as the edge of the unwrapped cylinder is parallel to the X axis.

    If you're not aware, when you apply G07.1 you specify the radius of cylinder at the machining level, ie G07.1 C(radius).

    I understand your comment regarding the G18 and being able to generate the shape, but one of the advantages of using Cylindrical Interpolation is that circular interpolation can be performed the same as if the cylinder was unwrapped and a flat surface. Its like having a dog and barking yourself to not use G02/G03 when a radius feature is programmed. In any case, you would use G18 if "5" is set in parameter #1022 and interpolation is between the Z and C axes.

    The attached picture is a direct cut and paste from a Fanuc pdf manual. This example uses "5" set in #1022.

    cylindrical2.jpg

    Regards,

    Bill
    zcapo likes this.

  11. #11
    Rich L is offline Cast Iron
    Join Date
    Sep 2006
    Location
    Denver, CO
    Posts
    335

    Default

    Thanks again for the reply.

    Attached is my unwrapping of the problem and I'm having trouble seeing how "5" applies (even though it may work for some!) since the manual says "7" means C is parallel to Z. However, I do know that Fanuc manuals aren't always clear.

    Yep, I've reviewed that example in the manual many times before and I might just try it after checking out all the dimensions. There is one thing that I just noticed and that is the G18 command says " ... G18 Z0 C0" Could that be the problem? I'll try it. If not, how is this example really different in any critical way from what I posted.

    You know, I saw that first drawing you posted in a thread that originated in 2007 on the other CNC forum. The complainant had the exact same problem I have now - he couldn't understand why no matter what plane he called he got the same "21" error. That thread talked a bit about parameters and kind of faded with no success.

    So, I seem to be stuck, still. This all started with the parameter set at 5; commanded G18 and got lucky 21 at the first G2 block.

    By the way, I did try this with G18 in the program with the parameter set at 5, 6, and 7. No joy.

    Thanks for your patience.

    Cheers,
    Rich
    Attached Thumbnails Attached Thumbnails zc-plane.jpg  

  12. #12
    angelw is online now Stainless
    Join Date
    Sep 2010
    Location
    Victoria Australia
    Posts
    1,652

    Default

    Quote Originally Posted by Rich L View Post
    Thanks again for the reply.

    Attached is my unwrapping of the problem and I'm having trouble seeing how "5" applies (even though it may work for some!) since the manual says "7" means C is parallel to Z. However, I do know that Fanuc manuals aren't always clear.

    Yep, I've reviewed that example in the manual many times before and I might just try it after checking out all the dimensions. There is one thing that I just noticed and that is the G18 command says " ... G18 Z0 C0" Could that be the problem? I'll try it. If not, how is this example really different in any critical way from what I posted.

    You know, I saw that first drawing you posted in a thread that originated in 2007 on the other CNC forum. The complainant had the exact same problem I have now - he couldn't understand why no matter what plane he called he got the same "21" error. That thread talked a bit about parameters and kind of faded with no success.

    So, I seem to be stuck, still. This all started with the parameter set at 5; commanded G18 and got lucky 21 at the first G2 block.

    By the way, I did try this with G18 in the program with the parameter set at 5, 6, and 7. No joy.

    Thanks for your patience.

    Cheers,
    Rich
    Hi Rich,

    With regards to your drawing, I can understand your reasoning and it was how I looked at Cylindrical Interpolation the first time I used it; it took a bit to get my head around it. However, what you're looking at as being parallel to the Z axis in your drawing is the surface of the cylinder, whereas, if you were to draw an arrow indicting the direction, + and -, of rotation of the cylinder, then the arrow is perpendicular to Z and parallel to the X axis; you see what I mean.

    I've used the example from the Fanuc manual many times to demonstrate the successful implementation of the Cylindrical Interpolation Option for clients buying this option for machines that originally did not have it. I use this as an example so that the client always has something to relate back to. This example works "as is" on a lathe with a C axis, and I have a version of the same part with axes addresses converted to work with an A axis. When applying the program to a 4 axis machining center, 6 or 7 can be set in #1022, but the G02/G03 command are reversed respectively.

    Its hard to believe, and its not mentioned in the Fanuc manual, but I've seen strange results if the G17 - G19 is not placed with the initial Z and C (W0 H0) command. You may note that in the Fanuc example I posted, the G18 is applied to the Z and C in incremental mode. Accordingly, there is no actual move initiated by that block. In most programs, I generally put G17 - G18 in a safety block at the very beginning of the program. Although this does not result in an alarm when Cylindrical Interpolation is invoked, the tool path resulting was incorrect during circular interpolation with the G18 not programmed with the Z and C as shown in the example program in my last post. What seems to be missing in the Fanuc manual is that G17 - G19 must be programmed with the Interpolation Axes before G07.1 is programmed

    The order in which the axes are specified seems also to be important. In the machining center example shown in the sketch I attached in an earlier post, the following applies:
    Before entering G07.1 mode, if you set PRM1022(A)=6(Parallel to Y), you have to specify G17 X_A_. If you set PRM1022(A)=7, you have to specify G18 A_X_. Note the sequence of the A and X in each case. It seems to be the plane in which the cylinder is developed. But none of this is stated in the Manual.

    Rich wrote:
    You know, I saw that first drawing you posted in a thread that originated in 2007 on the other CNC forum. The complainant had the exact same problem I have now - he couldn't understand why no matter what plane he called he got the same "21" error. That thread talked a bit about parameters and kind of faded with no success.

    Can't have been my sketch as I only joined the Forum late last year. But what I've posted above and in earlier post is from first hand, hands on experience. Let us know what the outcome is.

    A Lathe with a "C" axis would typically use the following format as opposed to that posted in my earlier post. However, the previous format, for example using G91, will apply if the control is set to use G code system B or C. Most lathes are set to use G Code system A. The G code system used is set with bits 6 (GSB) and 7 (GSC) of parameter #3401

    O0001 (CYLINDRICAL INTERPOLATION )
    N1 G00 Z100.0 C0
    G01 G18 W0 H0
    G07.1 H57299
    G01 G42 Z120.0 D01 F250
    C30.0
    G02 Z90.0 C60.0 R30.0
    G01 Z70.0
    G03 Z60.0 C70.0 R10.0
    G01 C150.0
    G03 Z70.0 C190.0 R75.0
    G01 Z110.0 C230.0
    G02 Z120.0 C270.0 R75.0
    G01 C360.0
    G40 Z100.0
    G07.1 C0
    M30


    Regards,

    Bill
    Last edited by angelw; 11-29-2011 at 03:39 AM.
    zcapo likes this.

  13. #13
    angelw is online now Stainless
    Join Date
    Sep 2010
    Location
    Victoria Australia
    Posts
    1,652

    Default

    Rich,
    The attached drawing may better explain why the X axis is selected as being the parallel axis.

    Because the Cylindrical Interpolation function effectively allows for the cylindrical surface to be unwrapped for the purpose of programming the tool path, the Pink arrow in the drawing represents the travel of the C axis in terms of linear movement when the cylindrical surface is unwrapped. From this you can see that the travel direction of the C axis is perpendicular to the Z axis and parallel to the X axis.

    cylindrical3.jpg

    Regards,

    Bill
    zcapo likes this.

  14. #14
    Rich L is offline Cast Iron
    Join Date
    Sep 2006
    Location
    Denver, CO
    Posts
    335

    Default

    Enlightening diagram - thanks!

    So I made sure #1022 was a 5 and threw in the highlighted G18 block and it stopped complaining. Cheers, mate! Thank you so much!

    Given that I'm doing this in air (fewer chips) I'll need to verify the actual tool path but just watching the "distance to go" rates it looks good.

    "Can't have been my sketch as I only joined the Forum late last year. Let us know what the outcome is." Really was your post - 5/28/11. It's just that the thread started in 2007 - that's a long thread ( http://www."the other CNC forum".com/forums/g-code_programing/30430-g17_g18_g19_lathe-3.html )

    So thanks again for your time and persistence with this and in helping me. I hope it helps the next guy, too.

    You're right, my lathe is G-code system 1.

    My new working code for G7.1 (successful plane selection)

    ...
    M21 (enter c-axis mode)
    T0101 (call fake tool)
    G0 X.5 (move over to extended surface)
    G0 Z.1 (move in just off face)

    G18 W0 H0 (select G02 G03 plane)

    G28 H0. (orient spindle)

    G7.1 C.250 (enter cyl interp mode)

    G1 X.49 F200 (move to engraving depth)
    G0 Z0. (move into face)

    G1 Z-.250 C90. (linear test movement)
    G1 Z0. C0. (linear test movement)

    G02 Z-.250 C90. R.500 (circular interp test movement)
    G02 Z-.500 C0. R.500 (circular interp test movement)
    G02 Z-.250 C-90. R.500 (circular interp test movement)
    G02 Z0. C0. R.500 (circular interp test movement)
    ...


    Cheers,
    Rich
    zcapo likes this.

  15. #15
    angelw is online now Stainless
    Join Date
    Sep 2010
    Location
    Victoria Australia
    Posts
    1,652

    Default

    Quote Originally Posted by Rich L View Post

    "Can't have been my sketch as I only joined the Forum late last year. Let us know what the outcome is." Really was your post - 5/28/11. It's just that the thread started in 2007 - that's a long thread ( http://www."the other CNC forum".com/forums/g-code_programing/30430-g17_g18_g19_lathe-3.html )

    So thanks again for your time and persistence with this and in helping me. I hope it helps the next guy, too.

    Rich
    Hi Rich,
    I'm glad you seem to have the problem solved and that you bothered to come back and post to the Forum that the suggestions made have helped. Often everyone is left hanging, not knowing if the problem was solved or not, and importantly for those experiencing the same issue, not knowing whether to try the resolve.

    The issue in the other Forum was slightly different to yours, but ended abruptly after my one and only post in the Thread. I know that the advice I gave was correct, and probably why the Thread ended, but because there was no feedback, newbies reading that Thread may be left wondering.

    I received your email and I'll send you a copy of the manual.

    Regards,

    Bill
    zcapo likes this.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •