586,106 active members*
2,987 visitors online*
Register for free
Login
IndustryArena Forum > Machine Controllers Software and Solutions > G-Code Programing > i can't work out the logic for this type of program, any suggestions?
Results 1 to 13 of 13
  1. #1
    Join Date
    Oct 2004
    Posts
    198

    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
    Join Date
    Dec 2003
    Posts
    24221
    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

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

  3. #3
    Join Date
    Oct 2004
    Posts
    198
    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
    Join Date
    Dec 2003
    Posts
    24221
    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

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

  5. #5
    Join Date
    Oct 2004
    Posts
    198
    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. #6
    Join Date
    Dec 2003
    Posts
    24221
    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

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

  7. #7
    Join Date
    Oct 2004
    Posts
    198
    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. #8
    Join Date
    Nov 2004
    Posts
    260
    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. #9
    Join Date
    Dec 2003
    Posts
    24221
    Are #1 & #2 going to change or just #3?
    Al
    CNC, Mechatronics Integration and Custom Machine Design

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

  10. #10
    Join Date
    Oct 2004
    Posts
    198
    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. #11
    Join Date
    Dec 2003
    Posts
    24221
    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

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

  12. #12
    Join Date
    Oct 2004
    Posts
    198
    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.

  13. #13
    Join Date
    Oct 2004
    Posts
    198
    We received in the mail the remainder programming manuals, damn that made it easier, the command to round up is #6=FUP[#5]

    Thanks alot guys.

Similar Threads

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