587,672 active members*
4,421 visitors online*
Register for free
Login
Results 1 to 12 of 12
  1. #1
    Join Date
    Nov 2005
    Posts
    219

    G12.1 Polar cordinate interpolation

    I run a lathe with live tools with an 18-i controller
    I have this new part to make and the enginners said it was up to me to decide if we could make this part on my machine or out source it.
    It is a fairly simple part except for one issue.

    It is turned and then bored. No problem right. Wrong.
    The center of I.D. hole is .063 off center to the O.D. of the part that we turn down. My idea is to bore the center on center and make the rest of the part off center.
    I was testing some of my theorys with using G12.1 to create an off center round part on the O.D.

    It works, but I have to incrementally step Z over to take another cut. I was wondering if I could helical intrepulate in the G12.1 mode? The prg is below and works with no errors but wondering if there is a better way.

    #100=2.4 (pin diameter)
    #101=.063 (off center amount)
    #120=-.75 (Z DEPTH)
    #121=.025(STEP AMOUNT)
    (ROUGHING END MILL)
    G54G98
    T0505
    M43
    G0C0.
    G97S1500M13
    G0Z.3
    X#502
    WHILE[#5042GT#120]DO1
    G54G0C0.
    G1W-#121F30.
    G12.1
    G03X[#101/2]C[#100/2]R[#100/2]F100.
    G03X-[#100+#101]C0.R[#100/2]
    G03X-[#101/2]C-[#100/2]R[#100/2]
    G03X[#100-#101]C0.R[#100/2]
    G13.1
    END1
    G0X#502
    M40
    G28U0.
    M30

  2. #2
    Join Date
    May 2007
    Posts
    1003

    I have several questions, and a comment or two.

    What kind of material is the part? I assume the O.D. is turned leaving no more than a skim cut on one side for the endmill, yes? I would think your cycle time is pretty bad, no? Must be some pretty tough material to only be taking .025 DOC in Z-axis. What size endmill are you using?

    We machine eccentric bushings of various sizes. Parts are run on barfeed machines for the first operation. O.D. is finish turned and the I.D. drilled or bored leaving enough material to clean up on the finish bore eccentric operation.

    Most are small enough to run in a 16C collet that has been bored the offset requirement in the tool room using a fixture made specifically for holding the 16C collets. We do have one larger part that is run in a chuck for the 2nd operation. A slug of aluminum was turned to clean up, then mounted in a 4-jaw chuck with the correct offset, and bored to the O.D. size of the part. Cut thru one side.

    Works well, and definitely faster than trying to finish the O.D. with live tooling. I like using live tooling, but they sure slow cycle times down.

    BTW, don't you just love programming that way? I use to make a new program every time the stock size was changed for a part. Now whenever they start changing stock sizes on me, I change the program to use variables and a While statement to figure DOCs for a G71 roughing cycle that I also add.

    Same thing with drills. One program will run an insert drill, a carbide drill, a spade drill, or an HSS drill. Nice! Glad I finally taught myself to use these functions.

  3. #3
    Join Date
    Nov 2005
    Posts
    219
    Quote Originally Posted by g-codeguy View Post
    What kind of material is the part? I assume the O.D. is turned leaving no more than a skim cut on one side for the endmill, yes? I would think your cycle time is pretty bad, no? Must be some pretty tough material to only be taking .025 DOC in Z-axis. What size endmill are you using?

    We machine eccentric bushings of various sizes. Parts are run on barfeed machines for the first operation. O.D. is finish turned and the I.D. drilled or bored leaving enough material to clean up on the finish bore eccentric operation.

    Most are small enough to run in a 16C collet that has been bored the offset requirement in the tool room using a fixture made specifically for holding the 16C collets. We do have one larger part that is run in a chuck for the 2nd operation. A slug of aluminum was turned to clean up, then mounted in a 4-jaw chuck with the correct offset, and bored to the O.D. size of the part. Cut thru one side.

    Works well, and definitely faster than trying to finish the O.D. with live tooling. I like using live tooling, but they sure slow cycle times down.

    BTW, don't you just love programming that way? I use to make a new program every time the stock size was changed for a part. Now whenever they start changing stock sizes on me, I change the program to use variables and a While statement to figure DOCs for a G71 roughing cycle that I also add.

    Same thing with drills. One program will run an insert drill, a carbide drill, a spade drill, or an HSS drill. Nice! Glad I finally taught myself to use these functions.
    The material is nothing special, around 60,000 yield. Yes I turned it to just skim the one side. I was going after a good surface finish, that was the reason for .025 DOC in Z axis. I was using .625 solid carbide endmill with a weldon flat. The endmill I was using was tappered on the bottom. Low on the corners, high in the center. My lathe does not have a Y axis and I think it may be neccesary to get a good flat surface in a timely manner. Maybe a heavier cut would help the surface finish.

    Eccentric bushing is exactly what we are making. O.D. is 4.75 and I.D. is 3.00 with a .063 offset.

    Yea I really like program using variables. It makes things so flexable and you can really make things idiot proof or mistake proof. I have wrote several safety macros that have saved my night guys several times..( or should I say it saved me from coming in to a pilled up machine in the morning HA HA)

  4. #4
    Join Date
    May 2007
    Posts
    1003
    Mind telling me what you are talking about when you say "safety macros"? I use a counter on insert drills that stops the machine after a set number of parts, and tells the operator to check the drill inserts. Would be interested in knowing what macros could stop a machine from crashing. Thanks.

  5. #5
    Join Date
    Nov 2005
    Posts
    219
    This is one that I wrote to run at the first of every prg. It is called by a G code, G11 to be exact since every prg. has work offsets it runs this within the first couple of lines of the program.

    This one compares the tool geometry in the X and Z axis to an amount that I have set to be a safe length. If a tool is tool long in the z axis it will hit the back wall when doing certain operations on the main spindle. If a tool is too long in the X axis it will collide with the way covers as the turret rotates.

    This prg. stops both of these things from happening.


    O9015(TOOL LENGTH CHECKER MACRO)
    M118
    M161
    (TOOL LENGTH CHECKER ON Z)
    #5204=0.
    #2715=#2705(SETTING T0515=T0505)
    #2725=#2705(SETTING T0525=T0505)
    IF[#530EQ7407]GOTO1000
    IF[#530EQ7507]GOTO1000
    IF[#530EQ7047]GOTO1000
    IF[#530EQ1999]GOTO1000
    IF[#530EQ85]GOTO1000
    #1=2801
    WHILE[#1LE2849]DO1
    #100=#[#1]
    IF[#100GT6.7]THEN#3000=110(TOOL LENGTH IN #100 TO LONG)
    #1=[#1+1.]
    END1

    N1000
    (TOOL LENGTH CHECKER ON X)
    #1=2701
    WHILE[#1LE2749]DO1
    #100=#[#1]
    IF[#100GT8.77]THEN#3000=110(TOOL LENGTH IN #100 TO LONG)
    #1=[#1+1.]
    END1
    M99



    This is a macro that I wrote to drill and tap holes in the z axis. After positiong in the Z axis it compares the machine position to a value that I determinded that was a safe distance away from the sub spindle to complete a drill or tap cycle witout running into the collet nose. I only have this problem when drilling or tapping holes in the center of the collet with less than 1.5" of material hanging out of the collet. We drill alot of bolt patterens in the end of pins so it will skip the "safety check line" if there is more than 2 holes programmed (X wont be on center) to drill on the G65 line of the main calling prg

    (5/16 DRILL)
    T0299
    G54
    M43
    G0C0.
    G97M13S4000
    G65P9004A0.B2.C83.D-1.F20.X1.25Z.1

    ](A= starting degree position,B= # of holes to be drilled, C= G cycle 83 for drilling 84 for tapping. D= drill depth or tapped depth, F= feed rate ipm. X= bolt patteren diameter, Z= starting position in the Z axis.)



    (3/8 TAP)
    G54
    T0606
    M43
    G0C0.
    G65P9004A0.B2.C84.D-.75F.0625S1400.X1.25Z.1





    O9004(DRILL&TAP MACRO)
    IF[#4120EQ0606.]THEN#130=14
    IF[#4120EQ0616.]THEN#130=13

    #103=[360./#2]
    #104=#103(TEST)
    G28U0.
    G0Z#26
    M08
    #530=0
    G98

    IF[#2GT1.]GOTO5022
    IF[#5022GT-8.5259]THEN#3000=1(TURRET WILL HIT CHUCK)
    N5022


    WHILE[#530LT#2]DO1
    IF[#7GT0.]GOTO50
    G0H#103
    IF[#7LT0.]GOTO52
    N50IF[#530EQ0.]GOTO51
    #103=[#5025+#104](1/28/08 TEST)
    G0A#103
    N51
    N52G0X#24
    IF[#3NE84.]GOTO100
    G97M#130S#19
    G99
    M126
    M129
    N100
    G[#3]X#24R[#26-#26]Q#17F#9Z#7
    IF[#3NE84.]GOTO150
    G80
    M127
    M128
    N150#530=[#530+1]
    IF[#7LT0.]GOTO200
    IF[#530EQ1.]GOTO200
    #103=[#103+#104](TEST)
    N200END1
    #530=#0
    G28U0.M9
    G80
    M15
    M40
    M140
    M9

    N9000G99
    M99

  6. #6
    Join Date
    Feb 2008
    Posts
    10
    Do you have simultaneous machining? Do you have a full c-axis sub? Maybe turn od on main spindle and mill offcenter in sub?

  7. #7
    Join Date
    Nov 2005
    Posts
    219
    Quote Originally Posted by Pecker View Post
    Do you have simultaneous machining? Do you have a full c-axis sub? Maybe turn od on main spindle and mill offcenter in sub?
    Im not sure what you mean by simultaneous machining. Although the sub is indexable in .001 of a degree I am told it is not a full c-axis untill I tell the control to switch the contouring control to the 2nd spindle with a parameter change. I have not had the need to contour anything on the sub yet.


    I think I can do both features in the main spindle.

    I guess I could turn the od on the main and try to bore the I.D. off center with a live tool on the main also. Then pass off and face the back side off.

  8. #8
    Join Date
    May 2007
    Posts
    1003
    Thanks, theemudracer. You are definitely doing more with variables than I am. Appreciate the examples. Was some work on your part just to post them. Thanks. I had used the 500 series to make master programs for some families of parts years ago. The last year of two I've gotten serious about using them for lots of other things. Changed my masters to use the 500 series only for controlling such things as diameters or critical groove widths, etc.

    I have seen posts using the #5000 series to pick off geometry values, but wouldn't know where to find which variable correlates to which tool. Really don't think I have a need for them at this time. Our parts are relatively simple.

    I've hit the way covers before with the cut-off tool. It has to extend as far as possible to always clear the subspindle chuck. Once was enough. I now know what the maximum value can be for the X-geometry. Setting it in a program to stop the machine wouldn't help much. Tool would hit before the program was ever run while indexing the turret around to touch off the tools.

    I've never used the local variables. Where are the values coming from for such calls as Z#26 or S#19? Or do I need to study your examples closer to find out for myself? Same thing for [#3]. I see you are using it to for your drill/tap call, but don't see where it gets its value from.

    There is a parametric course offered on line. I have every intention of taking it even though I only program for lathes. Because I don't program mills, I will probably have to struggle a lot more than most to understand using them.

  9. #9
    Join Date
    Nov 2005
    Posts
    219
    Yea the X tool length checker is only good if you touch some tools off and do not make a complete revolution of the turret and then start the prg. But it will work.

    Local variables are passed from the main prg. to a macro prg. in the G65 line. For instance in the G65 line of the drill and tap macro call, The Z value sets #26, S value sets #19. C value sets #3 variable. PM me your email address and I will send you some excellent material for learning macros.
    This is how I learned it.

  10. #10
    Join Date
    Nov 2005
    Posts
    219
    I also have a macro for cutting a snap ring groove or any type of groove for that matter. It will even chamfer the corners of the groove if you want.

    If you want it just email me.

  11. #11
    Join Date
    May 2007
    Posts
    1003
    Thanks mudracer for the sample programs. It was much easier to see how to use local variables with a G65 call from a working program. On my programs that used common variables for both the barstop (when loading a new bar), and variables for the cut-off tool, I was able to delete 23 lines of program. Plus any changes to the variables will automatically be loaded when a particular operation is called up. My old way the operator had to remember to run the first part of the program in order to load the changed variable(s) before proceeding to the desired operation. Didn't always happen, and then I was called because the program wasn't working correctly. HAHa.

    I also saw the correct way to use another logic operator (too embarrassed to say which one) so that I could further simplify some parts of existing programs.

    Also want to thank you for the pdf files. Had a chance to look at them tonight, and they show more examples than the manuals we have at work. Plan on printing out some of them for further study.

    Thanks a ton, friend.

  12. #12
    Join Date
    Nov 2005
    Posts
    219
    No probem. Glad I could finally help someone. We are all still learning.

Similar Threads

  1. How do you use polar interpolation
    By positiverake in forum G-Code Programing
    Replies: 14
    Last Post: 04-26-2024, 09:26 AM
  2. cnc lathe Cartesian-to-polar interpolation
    By knightlord in forum MetalWork Discussion
    Replies: 6
    Last Post: 01-31-2007, 07:24 AM
  3. Uni-Polar or Bi-Polar, or does it matter?
    By imagineer in forum Stepper Motors / Drives
    Replies: 1
    Last Post: 12-05-2006, 05:53 PM
  4. 0,0,0 cordinate help
    By dneisler in forum Mastercam
    Replies: 8
    Last Post: 07-13-2006, 05:18 AM
  5. Electronic Utopia Bi-Polar Board (or other Bi-Polar boards)
    By ranman in forum Stepper Motors / Drives
    Replies: 51
    Last Post: 05-29-2005, 02:25 PM

Posting Permissions

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