how to set up origins from code ?


Results 1 to 20 of 20

Thread: how to set up origins from code ?

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

    Default how to set up origins from code ?

    hello, on a mill, there are those origins that you targer with "G15 H01" > X Y Z ....

    how can i input this values from program ? on a lathe is VSZOZ for Z, and VSZOC for C

    kindly !

    Similar Threads:


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

    Default Re: how to set up origins from code ?

    thank you



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

    Default Re: how to set up origins from code ?

    hello again

    i found G92 and it seems to be the solution for what i am trying to do, ive gotten it to work by MDI but it will not function from within the program. any insight?
    if you wish, pls share the error and/or the program

    I see that using the VZOFX[#]=0 you can set your work axis to zero
    vzof* [ arg ] = 0 should target a point located at the middle of * axis travel

    for example, middle of the table should be vzofx[arg] = 0 and vzofy[arg] = 0. considering, of course, that table center is near the middle of x_travel and y_travel ( this should be default before cnc shipment, or at least after cnc instalation at client )

    but what about calculating them from the current probe location?
    the shortest way, is to read ( record ) the output of the probe let's find the output of the probe, and continue from there

    unfortunately, i can not test and send you a nice program, but try this :
    ... mdi mode : probe / master tool in position
    ... auto mode : run *.min

    using G92 :
    Code:
        G15 H=VACOD (*1)
        G56 HA
        G92 X0 Y0 Z0
    
    (
    *1 i believe that code will work without that line, because the wcs is never 0, thus it is not
    deactivated by hitting reset button
       if you wish to run this program inside a wcs<>current_wvs, then specify it
    )
    using VWK** system variables ( check attached ) :
    Code:
       G15 H1
       G56 HA
       NOEX VZOFX [ arg ] = VWKAX or VWKBX ± something ? VZOFY [ arg ] = ... VZOFZ [ arg ]= ...
    
    (
     quick tip : | vwkaz - vwkbz | = z_offset = vtofh [ vtlcn ]
    )
    again, i can not test, so i am not sure if those codes work, but at least i believe that playing with all those shared system variables should deliver what you need / 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 ...


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

    Default Re: how to set up origins from code ?

    yup ... i imagine that your 'probe' is not outputing data, so you need to "manual" gauge

    i wonder if torque skip is available for mills ? if it would work, you could use gauge from code, with your actual probe

    cycle start to continue the program with G92 X Y being the first line read
    i am not near a vmc; if i would, then i would run some trials with the system variables from previous post ... if you wish, i can guide you to do this, but now i am a bit tired

    however, pls run this program ( carefull to avoid possible collisions ) and come back with the *.txt / kindly
    Code:
    G15 H1
    G56 HA
    G00 X10 Y20 Z30
    VC[1] = VACOD
    VC[2] = VWKAX
    VC[3] = VWKBX
    VC[4] = VWKAY
    VC[5] = VWKBY
    VC[6] = VWKAZ
    VC[7] = VWKBZ
    VC[8] = VZOFX [ 1 ]
    VC[9] = VZOFY [ 1 ]
    VC[10] = VZOFZ [ 1 ]
    
    FWRITC tmp.txt;C
    
    PUT VC[1]
    PUT VC[2]
    PUT VC[3]
    PUT VC[4]
    PUT VC[5]
    PUT VC[6]
    PUT VC[7]
    PUT VC[8]
    PUT VC[9]
    PUT VC[10]
    
    
    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 ...


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

    Default Re: how to set up origins from code ?

    hello jay-z, code would be something like this :

    Code:
        G15 H1
        G56 HA
        CALL OWCS LWCS=10 LX=0 LY=0 LZ=0
        G15 H10
        G56 HA
        M0 ( check if displayed coordinates are x0y0z0 )
    M02
    
    
    OWCS
    (
     wcs[ lwcs ] will be initialized, so to store
    coordinates LX LY LZ at current position
    )
    
    
        NOEX
    $   VZOFX [ LWCS ] = VZOFX [ VACOD ] + VWKAX + LX
    $   VZOFY [ LWCS ] = VZOFY [ VACOD ] + VWKAY + LY
    $   VZOFZ [ LWCS ] = VZOFZ [ VACOD ] + VWKBY + LZ
    
    
    RTS
    i can't check it, but i can help you to implement it even if it works ( maybe ), there is needed to do so some extra-checks, so to be sure that it delivers in any situation

    Quote Originally Posted by Superman View Post
    yeah.... bloody simple
    heeei Superman he wishes to avoid the keystrokes required for panel operation, so there is needed a code that does just that

    but who am i to say that ? most of the times i reply without reading, or without understanding what i read/write; i like gambling

    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: how to set up origins from code ?

    ok, if you are going to test, pls also run the code from post #9 that outputs values inside a file: i need those values, so to write the correct formula that changes wcs

    also, when you run the code from #9, beside the file, pls share the value of Z offset of current tool


    if you have teamviewer on the machine, then, if u wish, let's talk in private / 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 ...


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

    Default Re: how to set up origins from code ?

    ... and i have a min to try out some things
    *.min or 60 seconds ? keep it up

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

    Default Re: how to set up origins from code ?

    me again : is hard to find time to test, create / debug, etc ... when i 1st put my hands on an okuma lathe, my shift ended at 3.30, but i was going home at 7 - 10 pm, for at least 6 months

    i invested a lot of time in these ... well, i am not saying that what i do is ' better '; i just wanna underline the extra-time

    also, i am aware that this is not possible anywhere, with anyperson : maybe someone has to travel 1 hour to work and back, maybe there are problems, etc ... so far i was always close to school, college, work, like 10minutes, etc, and most of my time goes into cnc's, including free time, when i could do something else

    for example now i have free time, but my mind is slow, i am tired ... i can't evolve now

    i like to help and share what i do, but i see that in many shops is a problem with finding/keeping the right person ...

    before cnc's, i was into classical machining sector for a while; after, i was stuck to a chair, and my body tonus got low, i am not longer as fast as i was before; only my mind is, but only sometimes; my medium body temperature got cca-0.2* under normal

    i am just saying / kindly



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

    Default Re: how to set up origins from code ?

    hy jay, if it works, is fine ... i can't test right now, but it should be one of the folowing :
    ... vzof* [ wcs ] = vwka* ( maybe + vzof* [ wcs ] )
    ... vzof* [ wcs ] = vwkb* ( maybe + vzof* [ wcs ] )
    | vwkaz - vwkbz | = z_offset, thus vwka is the machine, and vwkb is machine+offset, or viceversa, i don't remember who's who

    also G92 X0Y0Z0 should do the trick; i have seen that we discused about G92 in previous posts, but it has been a while, and i forgot exactly what it was / 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 ...


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

    Default Re: how to set up origins from code ?

    i never get it right from the 1st time ( not even in the end ), but i can tell that what you consider ' the hard way ' is a mere introduction to okuma's system variables ... is good to know what they can do, so please don't consider that you have lost time for no reason

    actually, is the opposite : it takes time ; is ok / 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 ...


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

how to set up origins from code ?

how to set up origins from code ?