Newbie APPLY MACRO B ON OKUMA


Results 1 to 10 of 10

Thread: APPLY MACRO B ON OKUMA

  1. #1
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default APPLY MACRO B ON OKUMA

    HELLO,I AM STUDYING CUSTOM MACRO B AND WANTED TO KNOW HOW TO APPLY IT ON OKUMA.OUR PRODUCTION IS USING ALL MODELS OF OKUMA.I AM VERY NEW ON CNC FIELD.THANK YOU

    Similar Threads:


  2. #2
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    hi nodochau :
    ... describe a specific soubroutine that you have in mind, or
    ... share one of your soubroutines + a bit of explanations ( if you consider )

    i may give you a full code

    on okuma, is not " macro B ", but " user task 1 & 2 " ... same idea

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  3. #3
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    OK. I am a CMM programmer and my manager gave me the book Macro B for Fanuc and asked me to learn it. I did and very interested in it.We have a very good data of determine number of parts where the wear tool offset needs to be adjusted and change the new tool (finish tool).I want to write a macro to adjust the wear tool automatically and remind the operator change new tool when we reach the number of parts produced.Here what I had base on the book
    (FINISH TURNING)
    M03 S3000 G00 Z0 T0707
    #102 = 6 (number of parts which tool offset needs to be adjusted)
    #103 = 9 (number of parts which tool needs to be changed)
    #507 = #507 + 1 (Counter)
    IF [#507 LT #102] GOTO 26IF [[#507 LT #103] AND [#507 GT #102]] THEN #100 = #2007
    #101 = [#100 - 0.002]
    #2007 = #101
    IF [#507 EQ #103] GOTO 27
    #507 = 0
    N26 X0.85G01 X-0.03 F0.004
    Z-0.03 F0.08
    G41 X0.45
    G01 X0.6 Z0.03 F0.004
    Z0.75X0.742X0.82 W0.044G40 G00 X.4.723 W0 T0
    N27 #3000=1 (CHANGE INSERT NUMBER 7)
    This macro requires the counter is reset to 0.I am confused is how to call the tool offset to the "base" value when the new tool is changed? If I want to keep the counter counts because I need to know the parts for a day.I am very new on CNC field.Thank you for your reply
    Quote Originally Posted by deadlykitten View Post
    hi nodochau :... describe a specific soubroutine that you have in mind, or... share one of your soubroutines + a bit of explanations ( if you consider )i may give you a full codeon okuma, is not " macro B ", but " user task 1 & 2 " ... same idea




  4. #4
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    so you want a soubroutine that will :
    ... count the parts
    ... at 6 parts to input a "wear corection" inside the program
    ... at 6+3=9 parts to trigger "M0 ( change tool / insert, etc )" ( thus only 3 parts with tool corection )

    the soubroutine will use a master counter, that may reset automatically the 1st time the program is runned after the cnc is turned on ( possible on osp300 ) ... if you deliver only 9parts/insert, than i don't recomand resetting the counter automaticaly, but only by operator

    i recomand writing that number to a log file before reseting it : like this you will see the number of complete cycles performed each day

    is it ok so far ?

    i don't really need to see the code : is enough if you explain what you wish to do


    the number of " complete cycles " is not always = real parts; this difference is another topic, like "setup stability" kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  5. #5
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    hello again there are 3 codes in this post ; each one requires to change the insert at 9 parts, and handles the tool wear in a specific way

    ... 1st code requires the operator to input the wear
    ... 2nd code uses a common variable to store the wear value :
    ...... 1 - 5 wear = 0
    ...... 6 - 9 wear <> 0
    ......... it is up to you to input this variable into the program coordinates
    ... 3rd code updates the wear field of the wear interface, so no more need to change the program
    ...... this one is the most elegant : simply input CALL OSUB3 at the end of your program


    - codes run on osp300
    - input V1 = 0 before running the code, so to begin the counter from an initial value
    - small adjustments may be needed for a real situation / kindly

    Code:
    OSUB1
    
       NOEX V001 = V001 + 1
        NOEX LV01 = MOD [ V001 , 9 ]
     
       IF [ LV01 NE 0 ] NJUMP1
             NOEX V001 = 0                    ( master reset   )
             M0 ( change insert @ tool 123 )
        NJUMP1 NOEX
     
       IF [ LV01 NE 6 ] NJUMP2
             M0 ( input tool wear manually  )
        NJUMP2 RTS ( . . . . . . . . . . . . . . . . . . . . . )

    Code:
    OSUB2
    
        NOEX V001 = V001 + 1
        NOEX LV01 = MOD [ V001 , 9 ]
     
       IF [ LV01 NE 0 ] NJUMP1
             NOEX V001 = 0                    ( master reset   )
             NOEX V002 = 0                    ( wear   reset   )
             M0 ( change insert @ tool 123 )
        NJUMP1 NOEX
     
       IF [ LV01 NE 6 ] NJUMP2
             NOEX V002 = -0.156               ( wear   updated )
           / M0 ( tool wear updated )
        NJUMP2 RTS ( . . . . . . . . . . . . . . . . . . . . . )

    Code:
    OSUB3
    
       NOEX V001 = V001 + 1
        NOEX LV01 = MOD [ V001 , 9 ]
     
       IF [ LV01 NE 0 ] NJUMP1
             NOEX V001 = 0                    ( master reset   )
             NOEX VTWOX [ 07 ] = 0            ( wear   reset   )
             M0 ( change insert @ tool 7 )
        NJUMP1 NOEX
     
       IF [ LV01 NE 6 ] NJUMP2
             NOEX VTWOX [ 07 ] = -0.156       ( wear   updated )
           / M0 ( tool wear updated )
        NJUMP2 RTS ( . . . . . . . . . . . . . . . . . . . . . )


    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  6. #6
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    We have a very good data of determine number of parts where the wear tool offset needs to be adjusted and change the new tool (finish tool)
    6 & 9 are too little to be considered "good data" ; is like running statistics on a small sample

    ... and my manager gave me the book Macro B for Fanuc and asked me to learn it. I did and very interested in it
    that book : throw it ...... nonono, i mean read it / sorry, misspelled

    just aim 4 the boss head & keep the cover 4 urslf

    do / don't ... 6 9 ?

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  7. #7
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    Here what the current process is. We try to keep the tolerance of the OD +-.0005 with our old machine. Every part the operator has to check the OD then adjust and restart if the OD is out. And we record all the dimensions in the system. So....Again Thank you for your code and I will study the code since I just start to learn Macro B and no experience in OKUMA OSP.
    Quote Originally Posted by deadlykitten View Post
    6 & 9 are too little to be considered "good data" ; is like running statistics on a small sample that book : throw it ...... nonono, i mean read it / sorry, misspelledjust aim 4 the boss head & keep the cover 4 urslfdo / don't ... 6 9 ?




  8. #8
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    if possible, use also droop control

    also turret approaching sense should eliminate the effects of the backlash : for example is definetly better to rough OD by coming with the turret from X+ instead of from X-; so :
    ... for OD machining, be sure that the turret is coming from above ( from X+ )
    ... for ID, from X-

    ok, now to put those into pseudocode :
    ... rapid @ safe position
    ... rapid @ X start + 10mm
    ... droop on
    ... feed @ X start
    ... droop off
    ...cut

    and the code :

    Code:
        G00 X500 Z300
        G97 S1500 M03 M08
        T030303
        G00 X60+10 Z2.5
        NOEX VINPX = 0.003
        G65
        G01 X60 F100 G94
        G64
        NOEX VINPX = 0.010
        G01 Z-50 F0.15 G95
        ...etc
    and the CTR code :

    Code:
        G00 X500 Z300
        G97 S1500 M03 M08 T030303 G00 X60+10 Z2.5 M63
        NOEX VINPX = 0.003
        G65
        G01 X60 F100 G94
        G64
        NOEX VINPX = 0.010
        G01 Z-50 F0.15 G95
        ...etc
    this approach should improve stability at narrow tolerance

    depending on machine condition, those codes may deliver a signifiant improvement, at least at the begining of the cut

    for that ±0.0005 tolerance : what dimensions do you get ? can you share at least 10-20 consecutive values, so to have a clue ? just asking...

    kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  9. #9
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    I got what you mean. OD=0.8125" -0/+0.001 that is the tolerance.
    Quote Originally Posted by deadlykitten View Post
    if possible, use also droop controlalso turret approaching sense should eliminate the effects of the backlash : for example is definetly better to rough OD by coming with the turret from X+ instead of from X-; so :... for OD machining, be sure that the turret is coming from above ( from X+ )... for ID, from X-ok, now to put those into pseudocode :... rapid @ safe position... rapid @ X start + 10mm... droop on... feed @ X start... droop off...cutand the code :
    Code:
        G00 X500 Z300    G97 S1500 M03 M08    T030303    G00 X60+10 Z2.5    NOEX VINPX = 0.003    G65    G01 X60 F100 G94    G64    NOEX VINPX = 0.010    G01 Z-50 F0.15 G95    ...etc
    and the CTR code :
    Code:
        G00 X500 Z300    G97 S1500 M03 M08 T030303 G00 X60+10 Z2.5 M63    NOEX VINPX = 0.003    G65    G01 X60 F100 G94    G64    NOEX VINPX = 0.010    G01 Z-50 F0.15 G95    ...etc
    this approach should improve stability at narrow tolerancedepending on machine condition, those codes may deliver a signifiant improvement, at least at the begining of the cutfor that ±0.0005 tolerance : what dimensions do you get ? can you share at least 10-20 consecutive values, so to have a clue ? just asking...kindly




  10. #10
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    And what does "NOEX VINPX mean?



  11. #11
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    VINP* is the system variable for the in-position width; * = axis : X Z C, etc

    NOEX allows faster data processing, especially with such variables

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  12. #12
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    This macro requires the counter is reset to 0. I am confused is how to call the tool offset to the "base" value when the new tool is changed? If I want to keep the counter counts because I need to know the parts for a day.
    all programs that i shared so far also reset the counter

    to keep the counter running, simply replace this " NOEX V001 = 0 ( master reset ) " with " ( NOEX V001 = 0 ) ( master reset ) " : thus cancel the reset; soubroutine will work just fine

    ... and I will study the code since I just start to learn Macro B and no experience in OKUMA OSP
    behind those codes is a simple scheme :
    ... increase counter
    ... if counter mod 9 = 0 then reset counter
    ... if counter mod 9 = 6 then input wear



    truth is that it is not optimized, and downtime will appear; optimization requires to add the "else branch" :
    ... increase counter
    ... if counter mod 9 = 0 then reset counter
    ...... else if counter mod 9 = 6 then input wear

    there are 2 codes in this post, about including the "else branch" into the previous OSUB3
    ... 1st code is written using a faster performing code structure for the classical if-else ( find more here : https://www.cnczone.com/forums/okuma/304038-syntax.html )
    ... 2nd code is written in a more common manner
    *both of them deliver same thing

    use them as an example; develop your own style / kindly

    Code:
    OSUB3
    
    
        NOEX V001 = V001 + 1
        NOEX LV01 = MOD [ V001 , 9 ]
    
    
        IF [ LV01 EQ 0 ] NTRUE1
           ( NFALSE )    IF [ LV01 EQ 6 ]   NTRUE2
                            ( NFALSE ) GOTO NDONE1
                              NTRUE2   NOEX VTWOX [ 07 ] = -0.156        ( wear   updated )
                                     / M0 ( tool wear updated )
                                       GOTO NDONE1
             NTRUE1      NOEX V001 = 0                                   ( master reset   )
                         NOEX VTWOX [ 07 ] = 0                           ( wear   reset   )
                         M0 ( change insert @ tool 7 )
             NDONE1    ( NOEX ) RTS ( . . . . . . . . . . . . . . . . . . . . . . . . . . )
    Code:
    OSUB3
    
    
        NOEX V001 = V001 + 1
        NOEX LV01 = MOD [ V001 , 9 ]
    
    
        IF [ LV01 EQ 0 ] N1
        IF [ LV01 EQ 6 ] N2
        GOTO NOUT
    
    
        N1 NOEX V001 = 0                          ( master reset   )
           NOEX VTWOX [ 07 ] = 0                  ( wear   reset   )
           M0 ( change insert @ tool 7 )
        GOTO NOUT
    
    
        N2 NOEX VTWOX [ 07 ] = -0.156             ( wear   updated )
         / M0 ( tool wear updated )
    
    
        NOUT NOEX
    
    RTS ( . . . . . . . . . . . . . . . . . . . . . . . . )


    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  13. #13
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    i took your code, arrange it a bit, and i put it into file OS01.ssb ( thus a soubroutine with a operation )

    that operation is called from the main program : main.min

    there is also a resource file that handles :
    ... automatically wear update
    ... M0 ( change insert )
    ... keeps the counter running
    ... counter reseting once per day, right after the cnc was turned on; before resetting, the value is written to a log file

    all files are attached



    so :
    ... post 05 is about different ways to code the wear
    ... post 12 is about different ways to code the if-then syntax
    ... post 08 is about droop control and smooth turret approach so to reduce the inertia + increase positioning accuracy + backlash sense, all to improve machining stability at narrow tolreances
    ... post 04 is about scheduled counter reseting
    ... post 13 ( this one ) puts all these together into a code example ( pls check attachement )
    ...... if possible, use imaginary vectors to disable lead-in and lead-out movements during radius compensation


    i hope you find them usefull / kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  14. #14
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    Hello deadlykitten,Now I reading the variables from OKUMA. Here is the question:Since the operator finishes the setup. Open the Tool data and I see the finish tool 7 has the x-axis offset is 3.2564. So that value is the machine value? (VZOFX) and this var is the one needs to be updated? I have seen there are three system variables VBZOX, VSZOX AND VZOFX. I am confusing. I just wanted to know that the value which is shown on the screen when we open up the "tool data". I am starting to write the program to adjust the tool wear offset. I have asked some guys here but seem like I get no good answer Thanks a lot



  15. #15
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    hi there is the main offset ( VTOFX [ 07 ] ) and the wear ( VTWOX [ 07 ] )

    you may ignore the VBZOX , VSZOX and VZOFX, because they are for other things / kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  16. #16
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    So the value on the "tool data" screen is a VTOFX[07]? Can I do this: V001=VTOFX[07] IN THE MAIN PROGRAM THEN IN SUB WILL BE DIA1=V001IF.... THEN DIA1=DIA1-0.001IF WE WANT TO TEST JUST OPEN THE TOOL DATA SCREEN TO CHECK THE VALUE WHEN WE REACH NUMBER OF PARTS AS WE NEED?THANKS



  17. #17
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    hi nodochau, ' tool data ' is too general; it may include main_offset, wear, nose radius, P, etc ...

    VTOFX [ 07 ] is the system variable for the main_offset

    these codes are equivalent : V001 = VTOFX [ 07 ] , V1 = VTOFX[7], VC[1]=VTOFX[7], VC[0001]=VTOFX[7 ], etc

    inside the sub you may use also DIA1 = VTOFX[7]

    be sure to avoid the case when an operator messes with the wear field


    please, post a photo with your screen what osp do you have ? kindly

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


  18. #18
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    We have some OPS and the machine that I am going to test on is LB-15II with the OSP 5020L OSP 500L-G.Please look at the screen to see what I need to know. Tool number 7.As soon as I finish my first program (about variables-I like it the most) I will post it so that you can look at it and tell me will it work.Again, thanks a lotOh man, how to attach the pic...

    Last edited by nodochau; 05-31-2018 at 07:33 AM. Reason: add picture


  19. #19
    Member
    Join Date
    May 2018
    Location
    United States
    Posts
    74
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    File is too large to upload...



  20. #20
    Member deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4154
    Downloads
    0
    Uploads
    0

    Default Re: APPLY MACRO B ON OKUMA

    i don't know if the variables that i talked about are available on your control

    go MDI : V1 = VTOFX [ 07 ] : will V1 show the offset of the tool 7? if not, than you can use a common variable, just like the 2nd code that i shared at post #5

    kindly

    ps : upload your image as *.jpg

    we are merely at the start of " Internet of Things / Industrial Revolution 4.0 " era : a mix of AI, plastics, human estrangement, powerful non-state actors ...


Tags for this Thread

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

APPLY MACRO B ON OKUMA

APPLY MACRO B ON OKUMA