Torch Height Offset Confusion?


Results 1 to 3 of 3

Thread: Torch Height Offset Confusion?

  1. #1
    Registered
    Join Date
    Nov 2013
    Posts
    45
    Downloads
    0
    Uploads
    0

    Default Torch Height Offset Confusion?

    Tom,

    I am trying to offset the Z axis on a plasma table to find the material. I am doing something wrong and need some assistance. I am using KMCNC version 4.33cc. My test G code looks like this.

    Code:
    G17 G20 G90 
    G00 X1.0 Y1.0
    M100          
    G91 G00 Z.1
    (Start Torch)
    (Move X & Y)
    (Stop Torch)
    M101
    This is the c program for the M100 and I am using Exec/Wait in the Tool Setup. The torch is spring loaded and hits a switch when it runs into the material.

    Code:
    #include "KMotionDef.h"
    
    #define TS 19 			//Tool Sensor Input
    
    //Program to send Z axis down and find top of material
    main()
    {
    Jog(2,-50000);			         //Down speed and direction
    while(!ReadBit(TS));
    Jog(2,0);			                 //Stop at material
    while(!CheckDone(2));
    Jog(2,30000);			         //Reverse off of switch
    while(ReadBit(TS));
    Jog(2,0);			                 //Stop off switch
    while(!CheckDone(2));  
    MoveRelAtVel(2,900,5000);  	 //Retract length to top of material
    while(!CheckDone(2));
    }
    The problem is when the M100 completes the Z axis DRO goes to Zero on the machine coords. This is a problem when returning the Z to the "home" position. I wrote a c program to reference the Z (M101) but it holds the last value from when the M101 was executed. So if I end the cut at Z.1 the Z DRO shows a .1 when the M101 completes.

    Here is the M101 c program.

    Code:
    #include "KMotionDef.h"
    #include "Init_Burn Table.c"
    
    main()
    {
        int SaveZLimits,ZSWN,ZSWP,LZ;  //place to save limit switch settings
    	
        // disable the limits (first save how they were set) 
        SaveZLimits = ch2->LimitSwitchOptions;
        ZSWN = ch2->SoftLimitNeg;
        ZSWP = ch2->SoftLimitPos;
        ch2->LimitSwitchOptions = 0;
        ch2->SoftLimitNeg = -1000000;
        ch2->SoftLimitPos = 1000000;
     
        // Home Z 
        Jog(2,60000);             
        while(ReadBit(Limit_Z));
        Jog(2,0);				
        while(!CheckDone(2)) ;
        Jog(2,-15000);
        while (!ReadBit(Limit_Z));
        Jog(2,0);
        while (!CheckDone(2)) ;
        MoveRelAtVel(2,-3000,30000);
        while (!CheckDone(2)) ;
        Zero(2);				                
        ch2->LimitSwitchOptions = SaveZLimits;  // restore limit settings
        ch2->SoftLimitNeg = ZSWN;
        ch2->SoftLimitPos = ZSWP;
     }
    Thanks

    Similar Threads:


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

    Default Re: Torch Height Offset Confusion?

    Hi Epiphany,

    I don't really follow that entirely, but with any C Program like this that moves any axes use the Exec/wait/sync option. Otherwise the Interpreter will be out-of-sync and a discontinuous motion may result in a position loss.

    HTH
    Regards

    Regards
    TK http://dynomotion.com


  3. #3
    Registered
    Join Date
    Nov 2013
    Posts
    45
    Downloads
    0
    Uploads
    0

    Default Re: Torch Height Offset Confusion?

    Tom,

    That did it. I was not using the sync option and that caused the problem. Now when the M100 completes my machine coords remain unchanged.

    Cheers



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

Torch Height Offset Confusion?

Torch Height Offset Confusion?