Page 1 of 2 12 LastLast
Results 1 to 12 of 13

Thread: i can't work out the logic for this type of program, any suggestions?

  1. #1
    Registered
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    196
    Downloads
    0
    Uploads
    0

    i can't work out the logic for this type of program, any suggestions?

    I'm sure this is quite basic to people who use parametric programming alot, I just can't quite figure it out.
    I'm trying to do it similar to below.

    #1=20.2 (Large Ř)
    #2=2.7 (Small Ř)
    #3=0.6 (Cut Size)
    #4=[[#1-#2]/2] (8.75)

    G01 Y#4 rounded up to the nearest multiple of #3

    I want it to be able to move Y axis to the nearest multiple above #4 which would be 9.00.
    Any one got any ideas?

    Thanks


  2. #2
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,957
    Downloads
    0
    Uploads
    0
    I dont know what control you have, but most with parametric take a RND or in the case of Fanuc take ROUND.
    If so #5= ROUND #4
    GO1 Y#5
    Should work.
    Al
    CNC, Mechatronics Integration and Custom Machine Design (Skype Avail).

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  3. #3
    Registered
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    196
    Downloads
    0
    Uploads
    0
    Thanks Al The Man I should have specified it is a Fanuc, is it possible to round it up?
    Its tricky because I want to round it up to the value of #3=0.6 (Cut Size)


  4. #4
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,957
    Downloads
    0
    Uploads
    0
    I assume you want to round it up only? in other words did you want to round up to a whole number above #4 + #3?
    Al
    CNC, Mechatronics Integration and Custom Machine Design (Skype Avail).

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  • #5
    Registered
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    196
    Downloads
    0
    Uploads
    0
    If possible I would like to round to a multiple of the cut size (0.6mm), so then it can calculate the amount of cuts needed. So if the cut size is changed it will round to suit the new cut size.


  • #6
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,957
    Downloads
    0
    Uploads
    0
    What if you do the round off like I showed and then compared the rounded # with #4 and if less than #4 add #3?
    A
    No wait that won't work, I have to go over that again but I think we are on the right track, unless someone else can jump in.
    l
    CNC, Mechatronics Integration and Custom Machine Design (Skype Avail).

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  • #7
    Registered
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    196
    Downloads
    0
    Uploads
    0
    The problem for me is that I need it to start at the large Ř come in the value of #4 (8.75) but if someone specifies a cut size that is not a multiple of the different Ř's it can't come in to the correct size, I think.


  • #8
    Registered Torsten's Avatar
    Join Date
    Nov 2004
    Location
    U.S.A.
    Posts
    260
    Downloads
    0
    Uploads
    0
    I belive there is a Fix function available this will
    simply remove the fractional part of a number
    and return the next lower integer.
    Just use this on the return of your devision.
    A bit rusty on Fanuc but check the manual for
    the proper syntax.
    Good Luck


  • #9
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,957
    Downloads
    0
    Uploads
    0
    Are #1 & #2 going to change or just #3?
    Al
    CNC, Mechatronics Integration and Custom Machine Design (Skype Avail).

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  • #10
    Registered
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    196
    Downloads
    0
    Uploads
    0
    Unfortunately all the parameters may change, I wish the manual had a bit on parametric programming in it, it doesn't have much at all.


  • #11
    Community Moderator Al_The_Man's Avatar
    Join Date
    Dec 2003
    Location
    Canada
    Posts
    18,957
    Downloads
    0
    Uploads
    0
    I think at this point we need to get a clearer understanding of what you want to do, as the way I read your first post is a round up to 9.00, but that does not round up to an increment of 0.6? Which is the impression I get in the later post.
    Al
    CNC, Mechatronics Integration and Custom Machine Design (Skype Avail).

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.


  • #12
    Registered
    Join Date
    Sep 2004
    Location
    Australia
    Posts
    196
    Downloads
    0
    Uploads
    0
    Sorry for the confusion, you're right I would of liked it to round to 9.00, only because the cut size is 0.6, which would equal 15 cuts (15 x 0.6) to achieve 9.00.
    I think I have worked out what to do, I just can't get the ROUND function to work.
    I thought if I could have it round out the difference between total depth divided by cut depth as per below:

    #1=20.2 (Large Ř)
    #2=2.7 (Small Ř)
    #3=0.6 (Cut Size)
    #4=[[#1-#2]/2] (8.75 depth per side)
    #5=[#4/#3] (14.58333 Depth divided by depth of cut)
    #6=[ROUND#5] This formula doesn't work though.

    If possible I would like it to round the value of #5 up to 15.00.
    I think because I don't fully understand it, I'm having trouble explaining the scenario.
    Thanks for your patience Al The Man.


  • Page 1 of 2 12 LastLast

    Similar Threads

    1. parametric programming
      By Karl_T in forum CamSoft Products
      Replies: 21
      Last Post: 05-24-2005, 03:58 PM
    2. Need Program Suggestions... Help
      By elalto in forum General CAM Discussion
      Replies: 1
      Last Post: 08-12-2004, 04:09 PM
    3. G codes
      By Citron in forum CamSoft Products
      Replies: 14
      Last Post: 06-10-2004, 11:59 PM
    4. My work in progress, suggestions welcome!
      By freezer in forum DIY CNC Router Table Machines
      Replies: 5
      Last Post: 02-15-2004, 09:11 PM

    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.