Newbie Subprogram problems


Results 1 to 11 of 11

Thread: Subprogram problems

  1. #1
    Registered
    Join Date
    Jul 2008
    Location
    USA
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default Subprogram problems

    Ok, so I got my machine running a single part now I want to run multipule parts.
    I have modified the program to include a subprogram that contains the tool path, and have setup 4 work positions. The problem i have is that it repeats the subprogram at the first work position after each call.

    Runs sub at E1
    Runs sub at E1 again
    Runs sub at E2
    Runs sub at E1 again
    Runs sub at E3
    Runs sub at E1 again
    Runs sub at E4
    Runs sub at E1 again
    End program

    Here is an example of my program

    N1O1 (BOTM-1M)
    N2 (12-2-2010)
    N3 (1-1/8 round x 1.2")
    N4 L100
    N5 G0 X.8125 Y.0933
    N6 Z.0
    N7 G1 X-.8125
    N8 Y.4933
    N9 X.8125
    N10 Y.833
    N11 X-.8125
    N12 G0 Z.2
    N13 M17
    N14 M30
    N15 T1M6
    N16 G0 G17G40G49G80G90
    N17 G0 X.8125 Y.0933 S5000 M3 E1
    N18 G8
    N19 Z.2 H1 M7
    N20 L101
    N21 E2
    N22 L101
    N23 E3
    N24 L101
    N25 E4
    N26 L101
    N27 M5M9
    N28 G0 X.0 Y.0 Z.0 H0
    N29 M2

    Is there anything obvious there that would make it repeat the sub after every call?

    The control is in format 1

    Thanks for the help

    Similar Threads:


  2. #2
    Registered
    Join Date
    Jul 2008
    Location
    USA
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default

    Please......someone has to have an idea as to what I am doing wrong.



  3. #3
    No posers SBC Cycle's Avatar
    Join Date
    Apr 2008
    Location
    United States
    Posts
    1577
    Downloads
    2
    Uploads
    0

    Default

    Quote Originally Posted by cclark440 View Post
    Is there anything obvious there that would make it repeat the sub after every call?

    The control is in format 1

    Thanks for the help
    Nothing obvious that I can see but I run Format 2. The only thing that looks different than how I would do it is the comments before the L100. The manual says it's ok but after the "O" word my first line is the L100.

    One problem that I have had with Subroutines/Subprograms is if I insert a line somewhere and don't renumber the program lines. There is nothing in the manual that would indicate that would be a problem but yet it happens...



  4. #4
    Registered
    Join Date
    Jan 2006
    Location
    USA
    Posts
    64
    Downloads
    0
    Uploads
    0

    Default

    Hi Guys,
    I copied your program with notepad and then inserted it into NCPlot exactly
    as it was. Loaded it into a CNC88 machine running in format 1. Typed in
    four fixture offset locations. I used four different x locations and didn't change y. I needed to add a feed rate since yours had none. It ran perfectly as I would expect it to. Can't say why it did not run correctly on your machine, it should have. I only have two comments to offer and they are not related to the problem. I don't think that G8 is apporiaite for this particular routine as the intersections are hard corners and need the deceleration. Second I would put the the first location in your offset calls (ie E2 G0 X.8125 Y.0933) so that when the call is made the machine moves to the first point in the sub instead of going to the last point then back to the first. The distance is short in this case so it doesn't matter but if the distance were long then it is a lot of wasted motion. Hope I didn't confuse you with my wording. Hope you discover the problem. If you do let us know.
    Gary



  5. #5
    Registered
    Join Date
    Jul 2008
    Location
    USA
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default

    Gary thanks for checking that out. I will make the changes to the program that you suggested and see if it works.

    I do have a question about G8. I guess I don't really understand when to and when not to use it. I have been programming mills for almost twenty years and never used this type of code. Honestly I have never seen a code like this before. The closest thing I can compare it to that I have used is exact stop on Okumas. That is used when feeding fast around tool paths and you want to make sure corners don't get cut. To me G9 mode is slow and the few parts I have made haven't had any issue. If some one can explain why I would need deceleration I would appreciate it.



  6. #6
    Registered Neal's Avatar
    Join Date
    Mar 2003
    Location
    Chatsworth, Ca
    Posts
    900
    Downloads
    0
    Uploads
    0

    Default

    The G8 code turns off the feed rate ramping at the end of EACH block. G9 turns this ramping back on again. Format 1 defaults to G9 and Format 2 defaults to G8. Normally you would run with the G8 invoked to achive a smooth block to block operation. The G9 code will cause the feed rate to ramp down at the end of the block and the ramp up at The deceleration would be needed if you have a situation where the cutter does not quite get to a corner destination before the other axis starts to move. In other words any where that you need to be sure that the tool "settles" into the final position before moving on the the next move.

    I hope that clarifies it for you.

    Neal



  7. #7
    Registered
    Join Date
    Jul 2008
    Location
    USA
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default

    Thanks Neal,

    That was what I was thinking it was for just wasn't sure.



  8. #8
    No posers SBC Cycle's Avatar
    Join Date
    Apr 2008
    Location
    United States
    Posts
    1577
    Downloads
    2
    Uploads
    0

    Default

    There's usually a G8 at the beginning of all my programs. I turn on the ramping if I'm running high feed with corners that are 90 degrees or more. The sharp reversal or stop of the ballscrew is not healthy at high speeds. Other than that, ramping is not usually necassary IMO. I don't know if most would agree with that or not, just how I run.

    Again, I run Format 2.



  9. #9
    Registered
    Join Date
    Jul 2008
    Location
    USA
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default

    It just seems to me that G8 really slows the program down. It seems slower than it needs to be.



  10. #10
    Registered Neal's Avatar
    Join Date
    Mar 2003
    Location
    Chatsworth, Ca
    Posts
    900
    Downloads
    0
    Uploads
    0

    Default

    Actually the program runs faster with the G8 in effect. This is because there is no ramping down and back up of the feed rate at every block. Instead the feed remains constant from block to block therby reducing the overall cycle time.
    The G9 code will slow down the overall cycle time.

    Neal



  11. #11
    Registered
    Join Date
    Jul 2008
    Location
    USA
    Posts
    19
    Downloads
    0
    Uploads
    0

    Default

    Right, my bad. I was thinking the codes backwards. G9 makes it slow.



Posting Permissions

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


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Subprogram problems

Subprogram problems