Probing. Auto search Z=0


Results 1 to 3 of 3

Thread: Probing. Auto search Z=0

  1. #1
    Registered
    Join Date
    Mar 2013
    Location
    Russian Federation
    Posts
    2
    Downloads
    0
    Uploads
    0

    Question Probing. Auto search Z=0

    Probing. Auto search Z=0

    Hello.

    I am sorry if I repeat a question.
    I Russian therefore it is difficult to me to find information about my problem on this forum.

    I want to write a script which will find the zero plane.
    I made a touch plate and connected electric part.
    Plate thickness - 1,535 mm.
    I want that after a contact the script changed Z coordinate for 1,535 mm. But I don't know how to make it :-(

    I wrote script:

    Code:
    #include "KMotionDef.h"
    
    main()
    {	Jog(2,-2000);         // start moving
    	while (ReadBit(15)) ; // wait for switch (input #15) to change
    	EnableAxisDest(2, 1473.6);  // Set Z to 1.535 mm (960 steps/mm)
    	Jog(2,0);		      // stop
    	Move(2,4800); 		  // Move to Z=5 mm (960 steps/mm)
    }
    But it changes machine coordinates of system, but not working coordinates.

    What I do incorrectly?
    Help me to write the correct script please.

    Similar Threads:


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default

    Hi Michael-Yurov,

    Do you want to run this from a GCode program or a User Button?

    How about trying it this way?

    See the code below. Assign it to M Code M100. Configure it with option Exec/Wait/Sync. It will not change the Machine Coordinates but after it finishes the tool should be at a physical height of 5mm. So then use G92 to set the Program Coordinates to Z of 5mm. So code in GCode:

    M100
    G92 Z5


    #include "KMotionDef.h"

    #define TO_CNTS 960.0
    #define BLOCK_HEIGHT 1.535
    #define FINAL_HEIGHT 5.0

    main()
    {
    Jog(2,-2000); // start moving
    while (ReadBit(15)) ; // wait for switch (input #15) to change

    // sample the counts where we at the touch block height and
    // since we know what that height is compute where to move
    // in counts so we will be at the desired final height
    Move(2,ch2->Dest + (FINAL_HEIGHT-BLOCK_HEIGHT)*TO_CNTS);
    while (!CheckDone(2)) ; // wait till finished
    }


    Regards

    Regards
    TK http://dynomotion.com


  3. #3
    Registered
    Join Date
    Mar 2013
    Location
    Russian Federation
    Posts
    2
    Downloads
    0
    Uploads
    0

    Default

    TomKerekes, many thanks!
    I will try it tomorrow.
    I think, it will suit me.

    But, how to write a script if I want to start it by the user button?
    How I can execute the G92 Z5 command in a script?

    Maybe I can find it in examples?



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

Probing. Auto search Z=0

Probing. Auto search Z=0