osp300 : avoid wrong corrections :)


Results 1 to 20 of 20

Thread: osp300 : avoid wrong corrections :)

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

    Default osp300 : avoid wrong corrections :)

    hello guys and girls

    i started working on this, since the issue raised in this thread : http://www.cnczone.com/forums/okuma/...-question.html

    my first posts in there were pretty vague, only from a theoretical perspective

    latest posts are about stable solutions, that i use with succes while running real programs

    recently i focused on reducing system load created by those procedures

    results are ok now, i will share and discuss "variants" ...

    Similar Threads:
    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    v1

    use OCHK* procedures, with syntax as below
    Code:
        CALL OCHK1 LV01=2 LV02=1 LV03=-28.921-1 LV04=2 LV05=1
        CALL OCHK2 LV01=2 LV02=2 LV03=58.067-1         LV05=1
    this procedures are simple and deliver "safety"

    it is possible to check if main or 2ndary offset is :
    ... bigger than a given value ( initial_offset - tolerance <= actual_offset )
    ... restrained within a domain ( initial_offset - tolerance_1 <= actual_offset <= initial_offset + tolerance_2 )

    examples and stuf about this variant is inside here : http://www.cnczone.com/forums/okuma/...-question.html

    normally, CALL OCHK* ( o check ) should be right after the turret index, thus to avoid begining any movements with wrong offsets in this case, VTOF* [ LV01 ] + VTWO* [ LV01 ] from *.ssb file may be replaced with VETF*, because index occured

    i use CALL OCHK* before turret index because i compute next tool corections before going @ safe position, as described here : http://www.cnczone.com/forums/okuma/...positions.html

    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 deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    v2

    i wrote this variant to reduce system load created by v1

    while v1 uses CALL OCHK* statements with variables, v2 puts code from OCHK* procedure inside main program

    case 1) checking if actual corection is greater than a minimal value
    case 3) case 1 + actual corection is lower than a maximal value
    case 2) case 3 with "minimal" and "maximal" values at same difference relative to a "target value"

    now let's exapand this a bit :
    ... initial / target / reference offset : "i"
    ... actual offset : "a"
    case 1) i - tolerance <= a
    case 3) i - tolerance_1 <= a <= i + tolerance_2
    case 2) case 3 with " tolerance_1 = tolerance_2 = tolerance"

    equivalent formulas :
    case 3) - tolerance_1 <= a - i <= + tolerance_2
    case 2) | a - i | <= + tolerance

    equivalent code :
    case1)
    Code:
        LV01 = VTOFX [ ...+0 ] + VTWOX [ ...+0 ]
        IF [ LV01 GE X_offset-... ] NCSKX
            NRPT M0
                 GOTO NRPT
        NCSKX
    
        LV01 = VTOFZ [ ...+0 ] + VTWOZ [ ...+0 ]
        IF [ LV01 GE Z_offset-... ] NCSKZ
            NRPT M0
                 GOTO NRPT
        NCSKZ
    there are 2 checks, one for X and another for Z axis / offset

    replace " ...+0" from "VTOF* [ ...+0 ] + VTWO* [ ...+0 ]" with offset link; examples :
    ... primary offset : turret post, or
    ... secondary offset : whatever value you have, or
    ... secondary offset = primary offset + constant_value, if all 2ndaries offsets are at same distance relative to primary offsets, for example i use :
    ..... post 1 : primary 1, secondary 21
    ..... post 2 : primary 2, secondary 22
    ..... post n : primary n, secondary n+20

    replace "X_offset-..." and / or "Z_offset-..." with "initial offset - tolerance"
    ... inital offset is a correct offset value, for which the program works fine
    ... adjust tolerace as required

    case 2)
    Code:
        LV01 = ABS [ VTOFX [ ...+0 ] + VTWOX [ ...+0 ] - Z_offset ] 
        IF [ LV01 LE ... ] NCSKX
            NRPT M0
                 GOTO NRPT
        NCSKX
    
        LV01 = ABS [ VTOFZ [ ...+0 ] + VTWOZ [ ...+0 ] - X_offset ]
        IF [ LV01 LE ... ] NCSKZ
            NRPT M0
                 GOTO NRPT
        NCSKZ
    case 3)
    Code:
        LV01 = VTOFX [ ...+0 ] + VTWOX [ ...+0 ] - Z_offset
        IF [ [ [ LV01 GE -... ] AND [ LV01 LE +... ] ] EQ 1 ] NCSKX
            NRPT M0
                 GOTO NRPT
        NCSKX
    
        LV01 = VTOFZ [ ...+0 ] + VTWOZ [ ...+0 ] - X_offset
        IF [ [ [ LV01 GE -... ] AND [ LV01 LE +... ] ] EQ 1 ] NCSKZ
            NRPT M0
                 GOTO NRPT
        NCSKZ


    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    v3

    this variant checks only "wear" corections, as some operators input corections only inside "wear field"

    this values are read from VTWO*

    consider input corection as an actual data that needs to be checkes : "a"

    case 1) minimal_value <= a
    case 3) minimal_value <= a < maximal_value
    case 2) case 3 with "minimal_value" and "maximal_value" at same distance from a

    this cases are pretty similar with the previous ones

    case 1 )
    Code:
        IF [ VTWOX [ ...+0 ] GE -... ] NCSKX
            NRPT M0
                 GOTO NRPT
        NCSKX
    
        IF [ VTWOZ [ ...+0 ] GE -... ] NCSKZ
            NRPT M0
                 GOTO NRPT
        NCSKZ
    replace "...+0" with offset link
    replace "..." with minimal_ value / tolerance

    case 2)
    Code:
        IF [ ABS [ VTWOX [ ...+0 ] ] LE ... ] NCSKX
            NRPT M0
                 GOTO NRPT
        NCSKX
    
        IF [ ABS [ VTWOZ [ ...+0 ] ] LE ... ] NCSKZ
            NRPT M0
                 GOTO NRPT
        NCSKZ
    case 3)
    Code:
        IF [ [ [ VTWOX [ ...+0 ] GE -... ] AND [ VTWOX [ ...+0 ] LE +... ] ] EQ 1 ] NCSKX
            NRPT M0
                 GOTO NRPT
        NCSKX
    
        IF [ [ [ VTWOZ [ ...+0 ] GE -... ] AND [ VTWOZ [ ...+0 ] LE +... ] ] EQ 1 ] NCSKZ
            NRPT M0
                 GOTO NRPT
        NCSKZ




    also, if an operator inputs corections inside main field, than there will be no worries, since "main offsets" are initialized from code
    Code:
        VTOF* [ offset_link ] = good_value


    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
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    all this variants eliminate operator mistakes, so worry no more at least on lathe

    their code is simple, while coding ( inputing values into structure ) it will take a while ... recomended for series

    after a program becamed stable, i create a list with offset values from the machine, and i use this values as reference

    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
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    offsets may be read from the screen, or written inside a file by running a program

    here are some variants for offset extraction :

    this one uses a loop :
    Code:
      ( CLOSE C )
    
        FWRITC offset-v1.txt;A
    
        PUT ' '
        WRITE C
        PUT '	'
        PUT 'main offsets'
        WRITE C
        PUT ' '
        WRITE C
    
        CALL OSUB LV02 =  0
    
        PUT ' '
        WRITE C
        PUT '	'
        PUT 'secondary offsets'
        WRITE C
        PUT ' '
        WRITE C
    
        CALL OSUB LV02 = 20
    
      ( PUT ' ' )
      ( WRITE C )
        CLOSE C
    
    M02
    
     ( . . . . . . . . . . . . . . . . . . . )
    
    OSUB
    
        LV01 = 0
    
        N1  LV01 = LV01 + 1
            LV03 = LV01 + LV02
            PUT LV03
            PUT '	'
            PUT 'X'
            PUT VTOFX [ LV03 ]
            PUT '	'
            PUT 'Z'
            PUT VTOFZ [ LV03 ]
            WRITE C
        IF [ LV01 LT 12 ] N1
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . )
    this one is linear; it goes through entire offsets links, even if some of them are not linked to the turret
    Code:
      ( CLOSE C )
    
        FWRITC offset-v2.txt;A
    
        LV01 = 1
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 1 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 1 ]
        WRITE C
    
        LV01 = 2
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 2 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 2 ]
        WRITE C
    
        LV01 = 3
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 3 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 3 ]
        WRITE C
    
        LV01 = 4
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 4 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 4 ]
        WRITE C
    
        LV01 = 5
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 5 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 5 ]
        WRITE C
    
        LV01 = 6
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 6 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 6 ]
        WRITE C
    
        LV01 = 7
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 7 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 7 ]
        WRITE C
    
        LV01 = 8
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 8 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 8 ]
        WRITE C
    
        LV01 = 9
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 9 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 9 ]
        WRITE C
    
        LV01 = 10
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 10 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 10 ]
        WRITE C
    
        LV01 = 11
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 11 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 11 ]
        WRITE C
    
        LV01 = 12
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 12 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 12 ]
        WRITE C
    
        LV01 = 13
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 13 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 13 ]
        WRITE C
    
        LV01 = 14
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 14 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 14 ]
        WRITE C
    
        LV01 = 15
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 15 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 15 ]
        WRITE C
    
        LV01 = 16
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 16 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 16 ]
        WRITE C
    
        LV01 = 17
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 17 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 17 ]
        WRITE C
    
        LV01 = 18
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 18 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 18 ]
        WRITE C
    
        LV01 = 19
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 19 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 19 ]
        WRITE C
    
        LV01 = 20
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 20 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 20 ]
        WRITE C
    
        LV01 = 21
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 21 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 21 ]
        WRITE C
    
        LV01 = 22
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 22 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 22 ]
        WRITE C
    
        LV01 = 23
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 23 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 23 ]
        WRITE C
    
        LV01 = 24
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 24 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 24 ]
        WRITE C
    
        LV01 = 25
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 25 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 25 ]
        WRITE C
    
        LV01 = 26
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 26 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 26 ]
        WRITE C
    
        LV01 = 27
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 27 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 27 ]
        WRITE C
    
        LV01 = 28
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 28 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 28 ]
        WRITE C
    
        LV01 = 29
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 29 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 29 ]
        WRITE C
    
        LV01 = 30
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 30 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 30 ]
        WRITE C
    
        LV01 = 31
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 31 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 31 ]
        WRITE C
    
        LV01 = 32
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 32 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 32 ]
        WRITE C
    
        CLOSE C
    
    M02
    this one keeps from the previous only those values that are linked to the turret ; in my case [ 1 .. 12 ] + [ 20 .. 32 ]
    Code:
      ( CLOSE C )
    
        FWRITC offset-v3.txt;A
    
        PUT ' '
        WRITE C
        PUT '	'
        PUT 'main offsets'
        WRITE C
        PUT ' '
        WRITE C
    
        LV01 = 1
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 1 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 1 ]
        WRITE C
    
        LV01 = 2
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 2 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 2 ]
        WRITE C
    
        LV01 = 3
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 3 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 3 ]
        WRITE C
    
        LV01 = 4
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 4 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 4 ]
        WRITE C
    
        LV01 = 5
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 5 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 5 ]
        WRITE C
    
        LV01 = 6
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 6 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 6 ]
        WRITE C
    
        LV01 = 7
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 7 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 7 ]
        WRITE C
    
        LV01 = 8
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 8 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 8 ]
        WRITE C
    
        LV01 = 9
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 9 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 9 ]
        WRITE C
    
        LV01 = 10
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 10 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 10 ]
        WRITE C
    
        LV01 = 11
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 11 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 11 ]
        WRITE C
    
        LV01 = 12
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 12 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 12 ]
        WRITE C
    
        PUT ' '
        WRITE C
        PUT '	'
        PUT 'secondary offsets'
        WRITE C
        PUT ' '
        WRITE C
    
        LV01 = 21
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 21 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 21 ]
        WRITE C
    
        LV01 = 22
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 22 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 22 ]
        WRITE C
    
        LV01 = 23
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 23 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 23 ]
        WRITE C
    
        LV01 = 24
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 24 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 24 ]
        WRITE C
    
        LV01 = 25
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 25 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 25 ]
        WRITE C
    
        LV01 = 26
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 26 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 26 ]
        WRITE C
    
        LV01 = 27
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 27 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 27 ]
        WRITE C
    
        LV01 = 28
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 28 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 28 ]
        WRITE C
    
        LV01 = 29
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 29 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 29 ]
        WRITE C
    
        LV01 = 30
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 30 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 30 ]
        WRITE C
    
        LV01 = 31
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 31 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 31 ]
        WRITE C
    
        LV01 = 32
        PUT LV01
        PUT '	'
        PUT 'X'
        PUT VTOFX [ 32 ]
        PUT '	'
        PUT 'Z'
        PUT VTOFZ [ 32 ]
        WRITE C
    
        CLOSE C
    
    M02


    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 deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    system load : i verified what is the "time" cost for this procedures, by looping each variant 100 times, inside a time counter

    here are the result, thus required duration ( seconds ) for a single offset check :

    variant 1 : 0.03750
    variant 2 : 0.02125
    variant 3 : 0.02375

    not bad

    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    on lathe, each tool may require 2 checks, for bought X and Z offsets / corections

    thus durations from previous post will double :

    variant 1 : 0.03750 x 2 = 0.0750
    variant 2 : 0.02125 x 2 = 0.0425
    variant 3 : 0.02375 x 2 = 0.0475

    this numbers represent duration for checking 2 corections / index

    more tools > more time required ; please check attached table so to have an idea of required duration as number of tools increases

    for perfectionists, if you consider that 0.5 seconds / program is acceptable to check offsets, than use variant 1 for less than 8 tools above, switch to variant 2 )

    variant 3 is "oranged" because it performs slower than variant 2; requires ~12% more time

    i like v1

    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 deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    this procedures check corections at each cycle / program run, even if the operator is not changing them

    thus, they are always active ...

    if you are looking for a passive method, please check attached image ... however, posibilities in here are restricted, because those limits are not particular to offsets, thus making it impossible to treat each tool in particular, but this does not mean that it may not be ok for some setups

    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    for mills same ideea can be used

    this can be done inside a tool change maro, so to take out code from the main program



    kitty salutes you over and out ...

    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    hello again so far, "corections" are read and their values are analyzed ; "corection " is : offset + wear

    in previous posts i refered to analization method as "case"; "cases" are :
    ... lower limit <= corection <= bigger limit ( referred in previous posts as case 3 )
    ...... i will reffer to this case as " bounding "
    ... corection >= lower limit ( referred in previous posts as case 1 )
    ...... i will reffer to this case as " minimal "
    ... | corection - reference_value | <= limit ( referred in previous posts as case 2 )
    ...... i will reffer to this case as " symetrical bounding "
    ... corection should not be modified ( referred in a previous post as VTOF* [ offset_link ] = good_value )

    concludent examples for each analization method:
    ... ( symetrical ) bounding : restrains corections inside a ( symetrical ) domain
    ...... bounding X offset :
    ......... id knife may cut too hard or break if too much "+" corection; also the insert holder may touch the hole it too much "-" corection
    ......... drill with 2 inserts should not receive a corection bigger than the allowable excentricity, which is inside tool's catalogue; also, this type of tool, can not receive corections that are oposite the excentricity direction
    ......... any live tool with it axis paralel to Z axis
    ...... bounding Z offset :
    ......... any live tool with it axis paralel to X axis
    ......... an OD thread knife, that may hit the spindle if going too much left, or may hit the part if going to o much right
    ... minimal : restrains corections to be greater than a given value
    ...... minimal X offset : OD tools if their X offset is too little, than they may crash; if their X offset is too big, than they will cut air
    ...... minimal Z offset : frontal tools if their Z offset is too little, than they may crash; if their Z offset is too big, than they will cut air
    ... corection should not be modified :
    ...... a bar puller

    thus, use :
    ... " bounding " when there are low clearances
    ... " minimal " when something may happen towards X- or Z-; things should be fine in the opposite direction
    ... " symetrical bounding " each time " bounding " can receive symetrical limits, so to speed up the code
    ... " corection should not be modified " to block something




    this cases are coded in different ways, which i reffered in previous posts as "variants"

    now i will share how to simplify codes and make them compute even faster

    this is a must, because these codes are always active, and may lead to downtime on cycles with short duration

    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
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    analization methods : bounding, minimal, symetrical bounding, block are not there only to check corections

    idea behind them can be used as you consider

    on normal lathe setups, is enough to check X and Z offsets; this involves using "2 analization methods" or " repeating one for bought offsets " ; why not using a single method ? thus why not optimizing code for common things ?

    until now i treated each method as an individual, but normally, X and Z offsets work togheter

    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
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    normally i check corections inside the OCHK procedure, described as "variant 1" somewhere in this thread

    "variants 2 and 3" reduce overall time, by taking code from the OCHK procedure and putting it inside the main program

    is possible to keep the procedure and target even lower times ; available syntaxes :

    CALL OCHK1 LV01=11 LV02=1 LV03=37.659-1 LV04=2 LV05=1
    ... means check primary X offset of post 11 to be >= 37.659-1 and <= 37.659-1+2
    CALL OCHK1 LV01=11 LV02=2 LV03=33.250-1 LV04=2 LV05=1
    ... means check primary Z offset of post 11 to be >= 33.250-1 and <= 37.659-1+2
    OCHK1 :
    ... variables : LV01=turret_post LV02=1-Xoffset,2-Zoffset LV03=minimal_value LV04=tolerance LV05=1-primary offset, 2-secondary offset
    ... uses " bounding " method : minimal_value <= corection <= minimal_value+tolerance

    CALL OCHK2 LV01=11 LV02=1 LV03=37.659-1 LV05=1
    ... means check primary X offset of post 11 to be >= 37.659-1
    CALL OCHK2 LV01=11 LV02=2 LV03=33.250-1 LV05=1
    ... means check primary Z offset of post 11 to be >= 33.250-1
    OCHK2 :
    ... variables : LV01=turret_post LV02=1-Xoffset,2-Zoffset LV03=minimal_value LV05=1-primary offset, 2-secondary offset
    ... uses " minimal " method : corection >= minimal_value

    CALL OCHK3 LV01=11 LV02=1 LV03=37.659 LV04=1 LV05=1
    ... means check primary X offset of post 11 to be <= 37.659±1
    CALL OCHK3 LV01=11 LV02=2 LV03=33.250 LV04=1 LV05=1
    ... means check primary Z offset of post 11 to be <= 33.250±1
    OCHK3 :
    ... variables : LV01=turret_post LV02=1-Xoffset,2-Zoffset LV03=minimal_value LV05=1-primary offset, 2-secondary offset
    ... uses " symetrical bounding " method : corection <= reference value ± tolerance

    CALL OCHK4 LV01=11 LV02=37.659-1 LV03=2 LV04=33.250-1 LV05=2
    ... uses " bounding " method for bought X and Z primary offsets of post 11
    ... LV02 <= X offset <= LV02 + LV03
    ... LV04 <= Z offset <= LV04 + LV05

    CALL OCHK5 LV01=11 LV02=37.659-1 LV03=33.250-1
    ... uses " minimal " method for bought X and Z primary offsets of post 11
    ... LV02 <= X offset
    ... LV03 <= Z offset

    CALL OCHK6 LV01=11 LV02=37.659 LV03=1 LV04=33.250 LV05=1
    ... uses " symetrical bounding " method for bought X and Z primary offsets of post 11
    ... LV02 - LV03 <= X offset <= LV02 + LV03
    ... LV04 - LV05 <= Z offset <= LV04 + LV05

    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 deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    OCHK1, 2 and 3 requires 0.040 seconds, thus 0.080 for checking 2 offsets
    OCHK4 requires 0.040 for checking 2 offsets
    OCHK5 and 6 requires 0.020 for checking 2 offsets

    i keep all this inside res-ochk.ssb :

    Code:
    OCHK1
    
        IF [ LV05 EQ 1 ] NEND1
             LV01 = LV01 + 20
            NEND1
    
        IF [ LV02 EQ 1 ] N1
        IF [ LV02 EQ 2 ] N2
    
            N1 LV02 = VTOFX [ LV01 ] + VTWOX [ LV01 ]
               GOTO NEND2
    
            N2 LV02 = VTOFZ [ LV01 ] + VTWOZ [ LV01 ]
               GOTO NEND2
        
            NEND2
    
        IF [ [ [ LV02 GE LV03 ] AND [ LV02 LE LV03+LV04 ] ] EQ 1 ] NEND3
    
            N3 M0
               GOTO N3
    
            NEND3
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK2
    
        IF [ LV05 EQ 1 ] NEND1
             LV01 = LV01 + 20
            NEND1
    
        IF [ LV02 EQ 1 ] N1
        IF [ LV02 EQ 2 ] N2
    
            N1 LV02 = VTOFX [ LV01 ] + VTWOX [ LV01 ]
               GOTO NEND2
    
            N2 LV02 = VTOFZ [ LV01 ] + VTWOZ [ LV01 ]
               GOTO NEND2
        
            NEND2
    
        IF [ LV02 GE LV03 ] NEND3
    
            N3 M0
               GOTO N3
    
            NEND3
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK3
    
        IF [ LV05 EQ 1 ] NEND1
             LV01 = LV01 + 20
            NEND1
    
        IF [ LV02 EQ 1 ] N1
        IF [ LV02 EQ 2 ] N2
    
            N1 LV02 = ABS [ VTOFX [ LV01 ] + VTWOX [ LV01 ] - LV03 ]
               GOTO NEND2
    
            N2 LV02 = ABS [ VTOFZ [ LV01 ] + VTWOZ [ LV01 ] - LV03 ]
               GOTO NEND2
        
            NEND2
    
        IF [ LV02 LE LV04 ] NEND3
    
            N3 M0
               GOTO N3
    
            NEND3
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK4
    
        LV06 = VTOFX [ LV01 ] + VTWOX [ LV01 ]
        LV07 = VTOFZ [ LV01 ] + VTWOZ [ LV01 ]
    
        IF [ [ [ LV06 GE LV02 ] AND [ LV06 LE LV02+LV03 ] AND [ LV07 GE LV04 ] AND [ LV07 LE LV04+LV05 ] ] EQ 1 ] NEND
    
            NRPT M0
                 GOTO NRPT
    
            NEND
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK5
    
        IF [ [ [ VTOFX [ LV01 ] + VTWOX [ LV01 ] GE LV02 ] AND [ VTOFZ [ LV01 ] + VTWOZ [ LV01 ] GE LV03 ] ] EQ 1 ] NEND
    
            NRPT M0
                 GOTO NRPT
    
            NEND
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK6
    
        IF [ [ [ ABS [ VTOFX [ LV01 ] + VTWOX [ LV01 ] - LV02 ] LE LV03 ] AND [ ABS [ VTOFZ [ LV01 ] + VTWOZ [ LV01 ] - LV04 ] LE LV05 ] ] EQ 1 ] NEND
    
            NRPT M0
                 GOTO NRPT
    
            NEND
    
    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    futher optimization should be achieved if codes from OCHK are moved from the ssb file inside the main program

    this should make the code perform faster, by using messy codes ... however, at this point i could not gain any more time economy

    i think that the ~0.020 may be the "ping" time, like you can not go under this duration




    before sharing this, all tests were carried on messy codes, that don't look well and are not organized inside a *.ssb

    starting from there, i tried to simplify CALL OCHK statements, and i was expecting increased durations, but it did not happen

    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 deadlykitten's Avatar
    Join Date
    Jun 2015
    Location
    Antarctica
    Posts
    4131
    Downloads
    0
    Uploads
    0

    Default Re: osp300 : avoid wrong corrections :)

    i think that the ~0.020 may be the "ping" time, like you can not go under this duration
    when you mess up with optimizations, there is a point that is hard to go over, even if code is better

    durations at this scale does not matter into general machining

    however, all codes are trigering signals at this scale : for example, machine reads a simple G03, while interpolation is done internal, at this "miliseconds" scale

    sometime ago i saw a video, showing how Okuma Super Nurbs is faster than competition, because of this "internal" thing

    an electronist should explain this better

    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    i redesigned OCHK1 2 and 3; fact is that those 3 are the 1st procedures i wrote when developing this "safety codes", and it has been a while since than

    they were build to check a single value

    how lathe involves checking 2 main values ( X and Z offsets ), than each OCHK1 2 or 3 should be repeated twice

    later i wrote code for OCHK4 5 and 6, that can check bought offsets

    this makes OCHK1 2 and 3 pretty useless, or more correct, there are low chances to use this procedures when OCHK4 5 and 6 are there

    however, there are situations when a single value should be verified :
    ... insert nose
    ... wear
    ... one offset is fix / constant, and the other is variable :
    ...... drill in ID holder : X_constant Z_variable
    ...... drill in live holder :
    ......... paralel to S axis : X_constant Z_variable
    ......... paralel to X axis : X_variable Z_constant

    in these cases, OCHK 1 2 and 3 may be required, but not in their actual form, because they were build to verify offsets

    now i changed them, so to verify anything, not just offsets

    code is more simplistic now



    there are 3 analyzing methods, explained in previous posts :
    ... bounding ( mM ) : lower_limit <= value_2_check <= upper_limit
    ... minimal ( m ) : value_2_check >= lower_limit
    ... symetrical bounding ( mM simetric) : ( mM ) with " upper_limit - value_2_check = value_2_check - lower_limit "

    OCHK1 2 and 3 check a single value by using one of those methods
    OCHK4 5 and 6 check 2 values by using one of those methods

    OCHK1 2 and 3 requires 0.016 seconds to perform ( each one )
    OCHK4 requires 0.040 seconds to perform
    OCHK5 and 6 requires 0.020 seconds to perform ( each one )

    Code:
    OCHK1 ( valoare ** min  ** toleranta=max-min )    ( mM )
          (    1    **  2   **         3         )    ( 0.016 )
    
        IF [ [ [ LV01 GE LV02 ] AND [ LV01 LE LV02+LV03 ] ] EQ 1 ] NEND
             NRPT M0
                  GOTO NRPT
        NEND
     
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK2 ( valoare ** min  )    ( m )
          (    1    **  2   )    ( 0.016 )
    
    
        IF [ LV01 GE LV02 ] NEND
             NRPT M0
                  GOTO NRPT
        NEND
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK3 ( valoare ** nominal ** max=|min| )    ( mM simetric )
          (    1    **    2    **     3     )    ( 0.016 )
    
        IF [ ABS [ LV01-LV02 ] LE LV03 ] NEND
             NRPT M0
                  GOTO NRPT
        NEND
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK4 ( offset_link ** min_X ** toleranta_X=max_X-min_X ** min_Z ** toleranta_Z=max_Z-min_Z )    ( mM 2x )
          (      1      **   2   **            3            **   4   **            5            )    ( 0.038 )
    
        LV06 = VTOFX [ LV01 ] + VTWOX [ LV01 ]
        LV07 = VTOFZ [ LV01 ] + VTWOZ [ LV01 ]
    
        IF [ [ [ LV06 GE LV02 ] AND [ LV06 LE LV02+LV03 ] AND [ LV07 GE LV04 ] AND [ LV07 LE LV04+LV05 ] ] EQ 1 ] NEND
    
             NRPT M0
                  GOTO NRPT
    
        NEND
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK5 ( offset_link ** min_X ** min_Z )    ( m 2x )
          (      1      **   2   **   3   )    ( 0.020 )
    
        IF [ [ [ VTOFX [ LV01 ] + VTWOX [ LV01 ] GE LV02 ] AND [ VTOFZ [ LV01 ] + VTWOZ [ LV01 ] GE LV03 ] ] EQ 1 ] NEND
    
             NRPT M0
                  GOTO NRPT
    
        NEND
    
    RTS
    
     ( . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . )
    
    OCHK6 ( offset_link ** nominal_X ** max_X=|min_X| ** nominal_Z ** max_Z=|min_Z| )    ( mM simetric 2x )
          (      1      **     2     **       3       **     4     **       5       )    ( 0.020 )
    
        IF [ [ [ ABS [ VTOFX [ LV01 ] + VTWOX [ LV01 ] - LV02 ] LE LV03 ] AND [ ABS [ VTOFZ [ LV01 ] + VTWOZ [ LV01 ] - LV04 ] LE 
    
    LV05 ] ] EQ 1 ] NEND
    
             NRPT M0
                  GOTO NRPT
    
        NEND
    
    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    consider a tool with offsets : X37.659 Z33.250 and radius0.8 at post11

    this examples work anytime / anywhere : before or after turret index

    1) bloking corections lower than -1 and greater than +0.5 mm

    Code:
        CALL OCHK1 LV01=VTOFX[11]+VTWOX[11] LV02=37.659-1 LV03=1.5 ( |-1|+0.5 )
        CALL OCHK1 LV01=VTOFZ[11]+VTWOZ[11] LV02=33.250-1 LV03=1.5
    
            or
    
        CALL OCHK4 LV01=11 LV02=37.659-1 LV03=1.5 LV04=33.250-1 LV05=1.5
    2) bloking corections lower than -1 mm

    Code:
        CALL OCHK2 LV01=VTOFX[11]+VTWOX[11] LV02=37.659-1
        CALL OCHK2 LV01=VTOFZ[11]+VTWOZ[11] LV02=33.250-1
    
            or
    
        CALL OCHK5 LV01=11 LV02=37.659-1 LV03=33.250-1
    3) bloking corections greater than 1 mm in absolute value

    Code:
        CALL OCHK3 LV01=VTOFX[11]+VTWOX[11] LV02=37.659 LV03=1
        CALL OCHK3 LV01=VTOFZ[11]+VTWOZ[11] LV02=33.250 LV03=1
    
            or
    
        CALL OCHK6 LV01=11 LV02=37.659 LV03=1 LV04=33.250 LV05=1
    4) blocking the radius to be always 0.8

    Code:
        VNSRX[11]=0.8
        VNSRZ[11]=VNSRX[11]
    5) blocking the offsets ( thus only wear allowed ) :

    Code:
        VTOFX[11]=37.659
        VTOFZ[11]=33.250
    6) blocking corections :

    Code:
        VTOFX[11]=37.659
        VTOFZ[11]=33.250
        VTWOX[11]=0
        VTWOZ[11]=0
    this examples work after turret index

    1) bloking corections lower than -1 and greater than +0.5 mm

    Code:
        CALL OCHK1 LV01=VETFX LV02=37.659-1 LV03=1.5 ( |-1|+0.5 )
        CALL OCHK1 LV01=VETFZ LV02=33.250-1 LV03=1.5
    2) bloking corections lower than -1 mm

    Code:
        CALL OCHK2 LV01=VETFX LV02=37.659-1
        CALL OCHK2 LV01=VETFZ LV02=33.250-1
    3) bloking corections greater than 1 mm in absolute value

    Code:
        CALL OCHK3 LV01=VETFX LV02=37.659 LV03=1
        CALL OCHK3 LV01=VETFZ LV02=33.250 LV03=1


    after this last update, i can say that examples are more credible, more easier to understand

    well, is not always easy to make things easy : i wonder why i did not thought like that from the begining

    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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    you may anytime share a list with :
    ... active offsets
    ... holder type
    ... tool type
    ... whatever you consider

    and i will show you how to avoid wrong inputs 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 ...


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

    Default Re: osp300 : avoid wrong corrections :)

    last few posts are more than enough to protect the cnc

    however, everything shared so far works, but only now it seems to be a 'finished' code

    i twisted all these from over a year ; i have this codes on the cnc from june last year : not a single error

    each procedure tested individually ... this finally got simple i feel free ... until know i always was a bit stressed when coding this stuff, but i have no more that feeling

    please, enjoy

    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

osp300 : avoid wrong corrections :)

osp300 : avoid wrong corrections :)