Results 1 to 11 of 11

Thread: Macro Math formula problem

  1. #1
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    6
    Downloads
    0
    Uploads
    0

    Macro Math formula problem

    Hi all here is the problem the new citizens when using H cant go past 9999. So I was wanting to maybe make a (while/do) formula that can do the formula and decide how many times it needs to divide itself so I can make a universal program to work with older and newer machines. (I am Thread whirling B.T.W.) Here is what I was thinking so far. I haven't tried this yet just wanting some feedback to see if I'm going in the right direction.

    Example

    #501= Thread length
    #502= Pitch
    #503=[[[#501+.05]/#502]*360]
    IF[#503LT9999.]GOTO77
    #504=2
    WHILE[#503GT9999.]DO1
    #506=#503/#504
    #503=#506
    #504=#504+1
    END1

    Basically what I want is to pass the #503 and #504 variable down to the the next while/do with the new numbers to perform the whirling as needed in increments less than 9999. (I'm just not sure if you can do it like this or if it will confuse the machine)

    example for the next while/do in the program.

    #507=[[#503/360]*#502]
    #508=1
    WHILE[#504GT1]DO2
    #509=#507*#508
    X-.075Z#509H[[[#507]/#502]*360]
    G50 C0
    #508=[#508-#504]+#504
    #508=#508+1
    #504=#504-1
    END2

    So what I am wanting this to do is create the amount of H loops I need and each one will subtract till at 0 and also I need it to add to the final z each loops so if I started off at .250 for each z the second z needs to be .5 3rd .75 etc. Not even sure if I'm even close to being right or if its even possible just wanted to through this out to some of you programing wiz's and see what you think.

    I know I could use G32 and have separate programs but I like to tinker


    Thanks
    Last edited by Machinist_X; 08-24-2011 at 09:49 PM.


  2. #2
    Registered
    Join Date
    Feb 2008
    Location
    The Edge of Obscurity
    Posts
    240
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by Machinist_X View Post
    ...the new citizens ...
    What are considering new?
    Control the process, not the product!
    Machining is more science than art, master the science and the artistry will be evident.


  3. #3
    Registered
    Join Date
    Jul 2010
    Location
    united states
    Posts
    40
    Downloads
    0
    Uploads
    0
    So you want us to stare blankly at macro programming because you like to tinker?

    sure, i'm game.


  4. #4
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    6
    Downloads
    0
    Uploads
    0

    Smile

    As for how old of machine's i would say any we have from the last 6 or 7 years or so, also we installed a new motherboard on a m12 2m3 and it now wont take H past 9999.

    Lol Tea hole yep. No I was just wanting you guys to punch in some numbers for 501 and 502 and see if you thought it would work out b4 I tested it in a machine. Hopefully this week I will have time to put it in a machine and test it to see if it works just thought I would throw it out b4 I tried to test it to see if I was close or way wrong and needed to do it a different way.


  • #5
    Registered
    Join Date
    Feb 2008
    Location
    The Edge of Obscurity
    Posts
    240
    Downloads
    0
    Uploads
    0
    There are more concise ways to achieve what you want to do.
    The issue is not with the machines ability to read a C value beyond 9999 but rather the softwares ability to accept an input value greater than 9999 for C or H.
    For that reason, you would not need to us G50 C0 in your WHILE/DO loop.

    Here is the basic problem at hand...

    • Given the total thread length and pitch, how many full rotations exsist?
    • How do I handle the last partial rotation


    Once you determine these two things, you can achieve what you want in a single W/D loop.
    If you want to put some more thought into it using the above ideas, I would be happy to assist you here.
    If not, that's fine too, and good luck to you.
    Control the process, not the product!
    Machining is more science than art, master the science and the artistry will be evident.


  • #6
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    6
    Downloads
    0
    Uploads
    0
    Thanks for the reply pro-process and if there is a better way to do what I'm trying to do I would greatly appreciate your assistance. Thanks


  • #7
    Registered
    Join Date
    Feb 2008
    Location
    The Edge of Obscurity
    Posts
    240
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by Machinist_X View Post
    Thanks for the reply pro-process and if there is a better way to do what I'm trying to do I would greatly appreciate your assistance. Thanks


    Well, I've given you the two main components of what you need to solve your issue ...

    Quote Originally Posted by ProProcess View Post
    ...
    Here is the basic problem at hand...

    • Given the total thread length and pitch, how many full rotations exsist?
    • How do I handle the last partial rotation


    ....
    I'm not going to write out your soloution for you.
    Give the info I'ver provided, what can YOU come up with that is different than what you've already done?
    Show some code using the new info and lets work form there.
    I would be happy to help you work through the thinking.
    Good luck!
    Control the process, not the product!
    Machining is more science than art, master the science and the artistry will be evident.


  • #8
    Registered
    Join Date
    Jan 2005
    Location
    USA
    Posts
    277
    Downloads
    0
    Uploads
    0
    How often do you think you will need to do 10 thousand loops?
    Seems to me that nine thousand, nine hundred and ninety nine should be enough.


  • #9
    Registered
    Join Date
    Feb 2008
    Location
    The Edge of Obscurity
    Posts
    240
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by cogsman1 View Post
    How often do you think you will need to do 10 thousand loops?
    Seems to me that nine thousand, nine hundred and ninety nine should be enough.
    The issue is not that the loop is 9,999 it's that the Input for commanding C/H can only handle up to 9999 as in

    Code:
    G1 G98 Z3.7 H9999(THIS IS THE MAX INPUT FOR C OR H)
    So if you had a thread that was 3/8"-16 and it was 2.5 long and you wanted to thread whirl using C/H instead of G32...

    1/16=.0625
    2.5 / .0625 = 40 revoloutions.
    360° * 40 revolutions = 14,400°

    so that code would be...

    Code:
    G1 Z0
    Z2.5 H14400.(THIS WILL ALARM AS THE INPUT IS OUT OF RANGE)
    According to the OP this limitation did not exsist in some older models and the OP want to Macro a utility that will be usable on new and old machines.
    Not a bad idea .
    Control the process, not the product!
    Machining is more science than art, master the science and the artistry will be evident.


  • #10
    Registered
    Join Date
    Aug 2010
    Location
    United States
    Posts
    6
    Downloads
    0
    Uploads
    0
    Sorry for the slow response back but I don't get online much but thank you very much Pro-Process for the hints in the right direction after I read your post I didn't think I would figure out a easier way but put a couple of days into thinking about what you said and it clicked. I got a nice streamlined macro'd program that I will now start using for all my whirl programs thanks again.


  • #11
    Registered
    Join Date
    Feb 2008
    Location
    The Edge of Obscurity
    Posts
    240
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by Machinist_X View Post
    Sorry for the slow response back but I don't get online much but thank you very much Pro-Process for the hints in the right direction after I read your post I didn't think I would figure out a easier way but put a couple of days into thinking about what you said and it clicked. I got a nice streamlined macro'd program that I will now start using for all my whirl programs thanks again.
    Cool!
    Control the process, not the product!
    Machining is more science than art, master the science and the artistry will be evident.


  • Similar Threads

    1. Need Help!- Macro problem w/16i
      By marcwdci in forum Fanuc
      Replies: 13
      Last Post: 06-29-2011, 09:21 AM
    2. Scale math formula ?
      By timmydabull in forum Mastercam
      Replies: 3
      Last Post: 08-31-2008, 12:50 AM
    3. Drill Macro problem
      By toolmanwaz in forum CamSoft Products
      Replies: 5
      Last Post: 04-01-2008, 11:47 AM
    4. VF0E Macro Problem
      By stang5197 in forum Haas Mills
      Replies: 1
      Last Post: 06-14-2007, 06:34 PM
    5. Math Formula Required
      By Kiwi in forum Mechanical Calculations/Engineering Design
      Replies: 51
      Last Post: 08-20-2006, 08:44 AM

    Posting Permissions


     


    About CNCzone.com

      We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

    Follow us on

    Facebook Dribbble RSS Feed


    Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.