603,965 active members*
2,440 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 21
  1. #1
    Join Date
    Nov 2005
    Posts
    219

    Sprocket milling macro ???

    I think I remember seeing some sort of a calculator on this forum that would right your g-code for milling a sprocket but I cant find it now.

    My second question is does anyone have a macro for milling sprockets in a lathe?? The tooth profile is nothing but radius's on this part that I am doing.'

    It is 15.165 in diameter with 30 teeth, using #120 roller chain.

    I got a good start on it today using G12.1 but it took me 8 hrs to prg. half of it. (LOTS OF NUMBERS).

    The other option I thought of was some kind of a repeat event, Maybe a WHILE DO macro that I am familar with.

    Any idea guys???
    thanks
    Jon

  2. #2
    Join Date
    Nov 2005
    Posts
    274
    Quote Originally Posted by theemudracer View Post
    I think I remember seeing some sort of a calculator on this forum that would right your g-code for milling a sprocket but I cant find it now.

    My second question is does anyone have a macro for milling sprockets in a lathe?? The tooth profile is nothing but radius's on this part that I am doing.'

    It is 15.165 in diameter with 30 teeth, using #120 roller chain.

    I got a good start on it today using G12.1 but it took me 8 hrs to prg. half of it. (LOTS OF NUMBERS).

    The other option I thought of was some kind of a repeat event, Maybe a WHILE DO macro that I am familar with.

    Any idea guys???
    thanks
    Jon
    Send me the G-Code (Private Mesage) you wrote for the first few teeth and I will see if I can come up with a macro that will do what you need. I am having a slow week since my hard drive on my main desktop crashed and burned friday so I got some time on my hands

    Bluesman

  3. #3
    Join Date
    Nov 2005
    Posts
    274
    Quote Originally Posted by theemudracer View Post
    I think I remember seeing some sort of a calculator on this forum that would right your g-code for milling a sprocket but I cant find it now.

    My second question is does anyone have a macro for milling sprockets in a lathe?? The tooth profile is nothing but radius's on this part that I am doing.'

    It is 15.165 in diameter with 30 teeth, using #120 roller chain.

    I got a good start on it today using G12.1 but it took me 8 hrs to prg. half of it. (LOTS OF NUMBERS).

    The other option I thought of was some kind of a repeat event, Maybe a WHILE DO macro that I am familar with.

    Any idea guys???
    thanks
    Jon
    Oh stink you need to send me the print too

    Bluesman

  4. #4
    Join Date
    Nov 2005
    Posts
    219
    Ok sounds good. I will try to have the night shift guy email me the info this evening and I will post it. Other wise it will be tomorrow before I can get you the print and prg.

    thanks
    Jon

  5. #5
    Join Date
    Nov 2005
    Posts
    219
    Here is the complete prg. I also attached the .dxf file of the part.

    %
    O7005(411-47004 SPROCKET)
    M118M32
    G40G28U0
    G99G28B0


    (ROUGHING END MILL)
    G54G98
    T0202
    M43
    G0C0.
    G97S2000M13
    G0Z10.
    X16.
    G12.1
    G42G1X15.1574C0.F15.
    G03X14.1254C.3187R.8073
    G02X13.9492C1.1567R.4375
    G03X14.8262C1.5757R.8073
    G03X13.6842C1.7801R.8073
    G02X13.1634C2.5815R.4375
    G03X13.847C3.0825R.8073
    G03X12.645C3.1638R.8073
    G02X11.8024C3.8935R.4375
    G03X12.2626C4.4547R.8073
    G03X11.053C4.4092R.8073
    G02X9.9254C5.0354R.4375
    G03X10.1424C5.6321R.8073
    G03X8.978C5.4618R.8073
    G02X7.6146C5.9571R.4375
    G03X7.5788C6.5634R.8073
    G03X6.5108C6.2758R.8073
    G02X4.9712C6.6185R.4375
    G03X4.6838C7.2078R.8073
    G03X3.7588C6.8155R.8073
    G02X2.1104C6.9907R.4375
    G03X1.5844C7.5372R.8073
    G03X.8426C7.0573R.8073
    G02X-.8426C7.0573R.4375
    G03X-1.5844C7.5372R.8073
    G03X-2.1104C6.9907R.8073
    G02X-3.7588C6.8115R.4375
    G03X-4.6838C7.2078R.8073
    G03X-4.9712C6.6185R.8073
    G02X-6.5108C6.2758R.4375
    G03X-7.5788C6.5634R.8073
    G03X-7.6146C5.9571R.8073
    G02X-8.978C5.4618R.4375
    G03X-10.1424C5.6321R.8073
    G03X-9.9254C5.0354R.8073
    G02X-11.053C4.4092R.4375
    G03X-12.2626C4.4547R.8073
    G03X-11.8024C3.8935R.8073
    G02X-12.645C3.1638R.4375
    G03X-13.847C3.0825R.8073
    G03X-13.1634C2.5815R.8073
    G02X-13.6842C1.7801R.4375
    G03X-14.8262C1.5757R.8073
    G03X-13.9492C1.1567R.8073
    G02X-14.1254C.3187R.4375
    G03X-15.1574C0.R.8073
    G03X-14.1254C-.3187R.8073
    G02X-13.9492C-1.1567R.4375
    G03X-14.8262C-1.5757R.8073
    G03X-13.6842C-1.7801R.8073
    G02X-13.1634C-2.5815R.4375
    G03X-13.847C-3.0825R.8073
    G03X-12.645C-3.1638R.8073
    G02X-11.8024C-3.8935R.4375
    G03X-12.2626C-4.4547R.8073
    G03X-11.053C-4.4092R.8073
    G02X-9.9254C-5.0354R.4375
    G03X-10.1424C-5.6321R.8073
    G03X-8.978C-5.4618R.8073
    G02X-7.6146C-5.9571R.4375
    G03X-7.5788C-6.5634R.8073
    G03X-6.5108C-6.2758R.8073
    G02X-4.9712C-6.6185R.4375
    G03X-4.6838C-7.2078R.8073
    G03X-3.7588C-6.8155R.8073
    G02X-2.1104C-6.9907R.4375
    G03X-1.5844C-7.5372R.8073
    G03X-.8426C-7.0573R.8073
    G02X.8426C-7.0573R.4375
    G03X1.5844C-7.5372R.8073
    G03X2.1104C-6.9907R.8073
    G02X3.7588C-6.8115R.4375
    G03X4.6838C-7.2078R.8073
    G03X4.9712C-6.6185R.8073
    G02X6.5108C-6.2758R.4375
    G03X7.5788C-6.5634R.8073
    G03X7.6146C-5.9571R.8073
    G02X8.978C-5.4618R.4375
    G03X10.1424C-5.6321R.8073
    G03X9.9254C-5.0354R.8073
    G02X11.053C-4.4092R.4375
    G03X12.2626C-4.4547R.8073
    G03X11.8024C-3.8935R.8073
    G02X12.645C-3.1638R.4375
    G03X13.847C-3.0825R.8073
    G03X13.1634C-2.5815R.8073
    G02X13.6842C-1.7801R.4375
    G03X14.8262C-1.5757R.8073
    G03X13.9492C-1.1567R.8073
    G02X14.1254C-.3187R.4375
    G03X15.1574C0.R.8073
    G40G1X16.F40.
    G13.1
    M09
    G28U0.
    M15
    M40
    G0Z5.

    (.500 FINISH)
    G54G98
    T0909
    M43
    G0C0.
    G97S1668M13
    G0Z-.6
    X16.
    G12.1
    G42G1X15.1574C0.F10.
    G03X14.1254C.3187R.8073
    G02X13.9492C1.1567R.4375
    G03X14.8262C1.5757R.8073
    G03X13.6842C1.7801R.8073
    G02X13.1634C2.5815R.4375
    G03X13.847C3.0825R.8073
    G03X12.645C3.1638R.8073
    G02X11.8024C3.8935R.4375
    G03X12.2626C4.4547R.8073
    G03X11.053C4.4092R.8073
    G02X9.9254C5.0354R.4375
    G03X10.1424C5.6321R.8073
    G03X8.978C5.4618R.8073
    G02X7.6146C5.9571R.4375
    G03X7.5788C6.5634R.8073
    G03X6.5108C6.2758R.8073
    G02X4.9712C6.6185R.4375
    G03X4.6838C7.2078R.8073
    G03X3.7588C6.8155R.8073
    G02X2.1104C6.9907R.4375
    G03X1.5844C7.5372R.8073
    G03X.8426C7.0573R.8073
    G02X-.8426C7.0573R.4375
    G03X-1.5844C7.5372R.8073
    G03X-2.1104C6.9907R.8073
    G02X-3.7588C6.8115R.4375
    G03X-4.6838C7.2078R.8073
    G03X-4.9712C6.6185R.8073
    G02X-6.5108C6.2758R.4375
    G03X-7.5788C6.5634R.8073
    G03X-7.6146C5.9571R.8073
    G02X-8.978C5.4618R.4375
    G03X-10.1424C5.6321R.8073
    G03X-9.9254C5.0354R.8073
    G02X-11.053C4.4092R.4375
    G03X-12.2626C4.4547R.8073
    G03X-11.8024C3.8935R.8073
    G02X-12.645C3.1638R.4375
    G03X-13.847C3.0825R.8073
    G03X-13.1634C2.5815R.8073
    G02X-13.6842C1.7801R.4375
    G03X-14.8262C1.5757R.8073
    G03X-13.9492C1.1567R.8073
    G02X-14.1254C.3187R.4375
    G03X-15.1574C0.R.8073
    G03X-14.1254C-.3187R.8073
    G02X-13.9492C-1.1567R.4375
    G03X-14.8262C-1.5757R.8073
    G03X-13.6842C-1.7801R.8073
    G02X-13.1634C-2.5815R.4375
    G03X-13.847C-3.0825R.8073
    G03X-12.645C-3.1638R.8073
    G02X-11.8024C-3.8935R.4375
    G03X-12.2626C-4.4547R.8073
    G03X-11.053C-4.4092R.8073
    G02X-9.9254C-5.0354R.4375
    G03X-10.1424C-5.6321R.8073
    G03X-8.978C-5.4618R.8073
    G02X-7.6146C-5.9571R.4375
    G03X-7.5788C-6.5634R.8073
    G03X-6.5108C-6.2758R.8073
    G02X-4.9712C-6.6185R.4375
    G03X-4.6838C-7.2078R.8073
    G03X-3.7588C-6.8155R.8073
    G02X-2.1104C-6.9907R.4375
    G03X-1.5844C-7.5372R.8073
    G03X-.8426C-7.0573R.8073
    G02X.8426C-7.0573R.4375
    G03X1.5844C-7.5372R.8073
    G03X2.1104C-6.9907R.8073
    G02X3.7588C-6.8115R.4375
    G03X4.6838C-7.2078R.8073
    G03X4.9712C-6.6185R.8073
    G02X6.5108C-6.2758R.4375
    G03X7.5788C-6.5634R.8073
    G03X7.6146C-5.9571R.8073
    G02X8.978C-5.4618R.4375
    G03X10.1424C-5.6321R.8073
    G03X9.9254C-5.0354R.8073
    G02X11.053C-4.4092R.4375
    G03X12.2626C-4.4547R.8073
    G03X11.8024C-3.8935R.8073
    G02X12.645C-3.1638R.4375
    G03X13.847C-3.0825R.8073
    G03X13.1634C-2.5815R.8073
    G02X13.6842C-1.7801R.4375
    G03X14.8262C-1.5757R.8073
    G03X13.9492C-1.1567R.8073
    G02X14.1254C-.3187R.4375
    G03X15.1574C0.R.8073
    G40G1X16.F40.
    G13.1
    M09
    G28U0.
    G0Z5.
    M40
    M30
    %
    Attached Files Attached Files

  6. #6
    Join Date
    Nov 2005
    Posts
    219

    Sprocket Macro I Wrote .

    I figured it out guys, with the help of Bluesman.
    It works good so far.



    %
    O0049(SPROCKET MACRO TEST)
    /2M98P9999
    #502=[#501+.1]
    #503=-[23.4684-#500+1.5]
    #504=-[23.4684+[#503-.145]]
    M118M32
    G40G28U0
    G99G28B0

    #5224=0.(G54 FOR C AXIS)
    #528=30.(# OF SPROCKET TEETH)
    #529=12.(DEGREE PER TOOTH)
    #530=0.(TOOTH COUNTER)
    #531=0.(INITIALIZING C INCRMENT TO 0.)
    (ROUGHING END MILL)
    G54G98
    T0202
    M43
    G0C0.
    G97S100M13
    G0Z5.
    X16.
    WHILE[#530NE#528]DO1
    G54G0C0.
    G12.1
    G42G1X15.1574C0.F60.
    G03X14.1254C.3187R.8073
    G02X13.9492C1.1567R.4375
    G03X14.8262C1.5757R.8073
    G40G1X15.5F120.
    G13.1
    #530=[#530+1.](TOOTH COUNTER)
    #531=[#531+#529](INCREMENT C BY #529)
    #5224=#531(INCREASING G54C0. TO CURRENT PO
    END1
    G0C0.
    #5224=0.
    M40
    G28U0.
    M30

  7. #7
    Join Date
    Feb 2006
    Posts
    340
    Quote Originally Posted by theemudracer View Post
    /2M98P9999
    #502=[#501+.1]
    #503=-[23.4684-#500+1.5]
    #504=-[23.4684+[#503-.145]]
    It looks like this isn't used at all.

    May I suggest a few possible changes.
    Code:
    #528=30.(# OF SPROCKET TEETH)
    #529=12.(DEGREE PER TOOTH)
    Make Degree a the calculation of the other, UNLESS you intend to use this for non-360 deg sprockets. Insures you always have even spacing of x number of teeth.
    Code:
    #529=360/#528
    Change
    Code:
    WHILE[#530NE#528]DO1
    to
    Code:
    WHILE[#530LT#528]DO1
    Catch it if somehow it is past #528 It should never happen, but keeps it from running an infinite loop if it does.

    And a personal preference for readability
    Code:
    #531=[#531+#529](INCREMENT C BY #529)
    #5224=#531(INCREASING G54C0. TO CURRENT PO
    could be 1 line... <shrug>

    Nice job working it out. If you make more gears besides this one, do you intend to make it a universal macro handling diameter, and perhaps changes in the profile?

    Dale

  8. #8
    Join Date
    Nov 2005
    Posts
    219
    Quote Originally Posted by dpuch View Post
    It looks like this isn't used at all.

    May I suggest a few possible changes.
    Code:
    #528=30.(# OF SPROCKET TEETH)
    #529=12.(DEGREE PER TOOTH)
    Make Degree a the calculation of the other, UNLESS you intend to use this for non-360 deg sprockets. Insures you always have even spacing of x number of teeth.
    Code:
    #529=360/#528
    Change
    Code:
    WHILE[#530NE#528]DO1
    to
    Code:
    WHILE[#530LT#528]DO1
    Catch it if somehow it is past #528 It should never happen, but keeps it from running an infinite loop if it does.

    And a personal preference for readability
    Code:
    #531=[#531+#529](INCREMENT C BY #529)
    #5224=#531(INCREASING G54C0. TO CURRENT PO
    could be 1 line... <shrug>

    Nice job working it out. If you make more gears besides this one, do you intend to make it a universal macro handling diameter, and perhaps changes in the profile?

    Dale

    This was basically just a test prg., testing the basic theory,that has some needed changes as you pointed out. My intentions are to make it a 9000# prg. and use a G65 and load the variables from the main calling prg.

    My intentions are also to figure out the math on how to create a tooth profile with different radi. and Diameter dimenisions. Now that will be challenge. For now I can just measure it out on Autocad and get my start and end points for the radius's.

  9. #9
    Join Date
    Feb 2006
    Posts
    340
    You will have to figure out the trig/math to create the points needed by hand, using the normal set of definitions you have for sprockets. Once you have that, your almost there.

    If 1 tooth is 12 deg, the center of the middle arc is at 6, each end is at 6 +- the arc radius.... Not that simple to get it all, but... Draw it out with the lines needed to calculate the trig for each point and I think it will not take you too long. I don't know enough about it to help more than that

    I did have fun drawing up a gear though.

    Dale

  10. #10
    Join Date
    Nov 2005
    Posts
    219
    yea this will be the hardest macro I have done yet as fas as all the trig that will be needed to complete the formula.

    thanks
    Jon

  11. #11
    Join Date
    Feb 2006
    Posts
    340
    One thing that may make it a little easier, center the macro at C0 instead of starting it there. That cuts the calcs needed in half.

    Edit: err, actually it shouldn't matter... But looking at your X and C numbers, either they are wrong or I don't understand how the X and C programming should work. Is X=pos from center, and C=rotation in deg? I'm used to X Y Z...

    Dale

  12. #12
    Join Date
    Nov 2005
    Posts
    219
    Quote Originally Posted by dpuch View Post
    One thing that may make it a little easier, center the macro at C0 instead of starting it there. That cuts the calcs needed in half.

    Edit: err, actually it shouldn't matter... But looking at your X and C numbers, either they are wrong or I don't understand how the X and C programming should work. Is X=pos from center, and C=rotation in deg? I'm used to X Y Z...

    Dale
    LOL You dont understand how G12.1 works on a lathe... X is the diameter position from center and C is basically a "Y" dimension from center using radius instead of diameter. G12.1 basically turns Y axis needed movements into C axis degrees. I believe it does start at C0.

  13. #13
    Join Date
    Feb 2006
    Posts
    340
    LOL ok, I think I get it now... Funky lathe guys :rainfro: and their weird g-codes

    Seriously, It seems my suggestion to start at C- center on C0 and finish with a mirrored C+ position would make things slightly easier then. There could be some reason you don't but that would be my suggestion.

    Oh, and a way to automatically add rough/finish to the macro. If you can call cuttercomp for a different offset than the current one... Use an unused offset register and copy the current CC + your finish pass amount to that and use it for your rough pass.

    Check these variable numbers for your machine, but I think they would be right.
    #2430=[#[2400+#4120]+#[2600+#4120]]]+0.01 (Set T30 radius comp to current tools +0.01)
    Rough= G42 D30 (T30 radius comp)
    Finish= G42 D20 (T20 radius comp)

    Dale

  14. #14
    Join Date
    Nov 2005
    Posts
    219
    Quote Originally Posted by dpuch View Post
    LOL ok, I think I get it now... Funky lathe guys :rainfro: and their weird g-codes

    Seriously, It seems my suggestion to start at C- center on C0 and finish with a mirrored C+ position would make things slightly easier then. There could be some reason you don't but that would be my suggestion.

    Oh, and a way to automatically add rough/finish to the macro. If you can call cuttercomp for a different offset than the current one... Use an unused offset register and copy the current CC + your finish pass amount to that and use it for your rough pass.

    Check these variable numbers for your machine, but I think they would be right.
    #2430=[#[2400+#4120]+#[2600+#4120]]]+0.01 (Set T30 radius comp to current tools +0.01)
    Rough= G42 D30 (T30 radius comp)
    Finish= G42 D20 (T20 radius comp)

    Dale
    I dont quite follow you because the way I see it, it does start at C0. ?????

    G54G98
    T0202
    M43
    G0C0.
    G97S100M13
    G0Z5.
    X16.
    WHILE[#530NE#528]DO1
    G54G0C0.
    G12.1
    G42G1X15.1574C0.F60. (ON THIS LINE)
    G03X14.1254C.3187R.8073
    G02X13.9492C1.1567R.4375
    G03X14.8262C1.5757R.8073
    G40G1X15.5F120.
    G13.1

    Ok I just re-read your post and I think I understand now. The way I read the fanuc manual, when using G12.1 the control assumes the C-axis is at 0. when given the G12.1 command. I might try it your way to see thou. Just to make sure I am understanding you correctly this is what I think you are saying. Since I am starting at the peak of a tooth at C0. I would just be moving C0. to the middle of the Root radius. So the Peak of the teeth on either side of the Root raidius would be the same #, one + and one - #??

    Is this what you are suggesting??

    Roger on the cutter comp deal, thanks

  15. #15
    Join Date
    Apr 2007
    Posts
    10
    G12.1 is polar coordinate conversion in case you wanted to look into it.

    Its kind of an axis substitution, Its main use is to simplify programming to make things easier to program by hand/edit by hand. A lot of time cam software spits out ginormous amounts of code in very small increments (due to the use of angular C coordinates in decimal degrees. Using the polar coordinate conversion the code is as previously mentioned programmed using xy coordinates (sort of) instead of X in linear and C in angular. it does replace the C coordinates with a "Y dimension".

    kinda like how on mazatrol or other conversational controls you have the option of using XC or XY input to program live tooling.

  16. #16
    Join Date
    Feb 2006
    Posts
    340
    Quote Originally Posted by theemudracer View Post
    I would just be moving C0. to the middle of the Root radius. So the Peak of the teeth on either side of the Root raidius would be the same #, one + and one - #??
    Yep, that is it. You could just start the tool at C0 then move it to the C- you needed to begin the tooth if G12.1 forces you to start at C0

    Dale

  17. #17
    Join Date
    Oct 2007
    Posts
    88
    depending on your machine capabilities, you might also try an external rotery broach. maybe somma or slater tools. it will save a ton of time if you can.

  18. #18
    Join Date
    Nov 2005
    Posts
    274
    Quote Originally Posted by theemudracer View Post
    LOL You dont understand how G12.1 works on a lathe... X is the diameter position from center and C is basically a "Y" dimension from center using radius instead of diameter. G12.1 basically turns Y axis needed movements into C axis degrees. I believe it does start at C0.
    Jon,
    Did I ever send you that Fanuc Macro Programming manual I got from there class in Chicago(Bang Bang). It has some info in there that may be usefull. I can not remember if I ever sent it to you If you need it let me know

    Bluesman

  19. #19
    Join Date
    Nov 2005
    Posts
    219
    Quote Originally Posted by Bluesman View Post
    Jon,
    Did I ever send you that Fanuc Macro Programming manual I got from there class in Chicago(Bang Bang). It has some info in there that may be usefull. I can not remember if I ever sent it to you If you need it let me know



    Bluesman
    Yes you did, I have learned alot from it.



    Quote Originally Posted by dpuch View Post
    Yep, that is it. You could just start the tool at C0 then move it to the C- you needed to begin the tooth if G12.1 forces you to start at C0

    Dale

    I still think I will do it my way. Im not going to do that wasted move on every tooth of a 30 tooth sprocket. thanks anyway and there is more than one way to skin a cat.HA HA

  20. #20
    Join Date
    Oct 2007
    Posts
    88
    another option is to try a rotary broach (wobble broach). be sure to check your horsepower capabilities. you can find them at somma. a guy named Justin Gaerte proved it works very good and much much faster. 1-800-648-9918 is the work number over there.

Page 1 of 2 12

Similar Threads

  1. RFQ: Sprocket (closed)
    By mcraig79 in forum Employment Opportunity
    Replies: 7
    Last Post: 07-03-2007, 12:30 PM
  2. Gear sprocket software
    By PlasmaGuy in forum Mechanical Calculations/Engineering Design
    Replies: 4
    Last Post: 05-15-2007, 11:27 PM
  3. Milling Macro
    By sencinia in forum MetalWork Discussion
    Replies: 2
    Last Post: 04-04-2007, 02:20 PM
  4. Macro for milling round bar
    By sencinia in forum MetalWork Discussion
    Replies: 0
    Last Post: 03-31-2007, 04:58 PM
  5. Sprocket teeth
    By MattMachinist in forum MetalWork Discussion
    Replies: 0
    Last Post: 04-18-2006, 03:06 AM

Posting Permissions

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