Need Help! Tool length Offset activated as part of Initialization file


Results 1 to 9 of 9

Thread: Tool length Offset activated as part of Initialization file

  1. #1
    Member
    Join Date
    Feb 2008
    Location
    Canada
    Posts
    215
    Downloads
    0
    Uploads
    0

    Default Tool length Offset activated as part of Initialization file

    Hi Tom,

    My current work flow is the following:

    -Turn on KmotionCNC and hit “initialize”
    -Run home sequence
    -Have to perform a tool change and spindle must pick up a tool in order for it to start reading the tool offset for Z. (I have ATC)
    -Run home again and then zero the Fixture offset global values.

    I find that these steps have to be performed in order for it to operate correctly otherwise it is unreliable and will crash into a limit of the material.

    I think the biggest issue is making sure that the Tool length parameter is active when I start to set the XYZ for part zero. I’ve done all of this without performing the initial tool change and then Kmotion doesn’t taken the tool length into consideration until it starts running G code and crashes deep into the table bed is there a way to have the initialization file automatically ask for and set the tool height offset right when it turns on? I’m thinking a prompt screen that asks what too is in the spindle, and then applies that tool height and makes it active right away, before homing would be best? Or would the tool offset have to be applied after the machine homing sequence?

    Similar Threads:


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

    Default Re: Tool length Offset activated as part of Initialization file

    Hi slimneil,

    You didn't describe your workflow for how you determine and use offsets (Tool and Fixture). Here are some thoughts:

    Running the home sequence a 2nd time shouldn't change anything (unless your Home program does something unusual).

    Of course the Fixture/Global offsets must be set correctly before running a Job. Most Users use the "Save Always" option to keep the same values that were last used. Optionally you can use the Settings file (see Default.set) to force them to zero on KMotionCNC startup if that helps.


    I think the biggest issue is making sure that the Tool length parameter is active when I start to set the XYZ for part zero.
    When using a Tool to touch off and set a fixture offset it is important to have the Tool length compensation for that Tool active. Tool Length Compensation for a tool is enabled in GCode with G43Hn and turned off with G49. The Tool Length/Offset Immediately Option will have Tool Length Compensation turned on for a Tool Selected using the on screen Tool Drop Down Selector. The 1st Tool will be selected on KMotionCNC Start up.


    is there a way to have the initialization file automatically ask for and set the tool height offset right when it turns on? I’m thinking a prompt screen that asks what too is in the spindle, and then applies that tool height and makes it active right away
    Yes. Is there an automatic way to determine what Tool is in the Spindle on Startup? Many Users write the Last Tool to a disk file every time a Tool is changed. Then recover the Last Tool on startup or Initialization.

    However you determine the current Tool on startup (by reading the Disk file or asking the Operator) you could set KMotionCNC to that Tool and apply the compensation for that tool with code such as:

    Code:
    #include "KMotionDef.h"
     
    #define TMP 10 // which spare persist to use to transfer data
    #include "KflopToKMotionCNCFunctions.c"
     
    #define LAST_TOOL_VAR 8     //  -1=Spindle empty, 0=unknown, 1-4 Tool Slot loaded into Spindle
     
    main()
    {
        char s[80];
        sprintf(s,"T%dG43H%d",persist.UserData[LAST_TOOL_VAR],persist.UserData[LAST_TOOL_VAR]);
        MDI(s);  //send the T and H words and Turn on Compensation
    }


    Regards
    TK http://dynomotion.com


  3. #3
    Member
    Join Date
    Feb 2008
    Location
    Canada
    Posts
    215
    Downloads
    0
    Uploads
    0

    Default Re: Tool length Offset activated as part of Initialization file

    Quote Originally Posted by TomKerekes View Post
    Of course the Fixture/Global offsets must be set correctly before running a Job. Most Users use the "Save Always" option to keep the same values that were last used. Optionally you can use the Settings file (see Default.set) to force them to zero on KMotionCNC startup if that helps.
    -We have the offsets set to save always also.

    Quote Originally Posted by TomKerekes View Post
    Tool Length Compensation for a tool is enabled in GCode with G43Hn and turned off with G49. The Tool Length/Offset Immediately Option will have Tool Length Compensation turned on for a Tool Selected using the on screen Tool Drop Down Selector. The 1st Tool will be selected on KMotionCNC Start up.
    -This is what i noticed also, I had to use the tool drop down to prompt a tool change and then the corresponding Tool length compensation would apply.

    Are you telling me that the Tool 1 compensation is automatically applied on start up when the "Tool Length/Offset Immediately Option" is active? My Tool 1 is the shortest tool so this could explains why i have crashes. If is by default assumes that T1 is in it at start up this could cause issues when (taking a short cut) and using the cutting tool to set the part zero.

    Quote Originally Posted by TomKerekes View Post
    However you determine the current Tool on startup (by reading the Disk file or asking the Operator) you could set KMotionCNC to that Tool and apply the compensation for that tool with code such as:.....
    Do i add this code to my Initialization file? Am i correct in assuming that once the operator enters the tool in the machine that offset is loaded right then and there? So if i used that tool to zero the part height the correct offset would be applied and then all other tool changes would use their correct tool offset.

    Another issue we found is that the Spindle won't actually turn on when running a G code file for the first time if we haven't performed a tool change either from drop down menu or M6 command. Can this be corrected in the initialization file also? is it because it is waiting for a tool to be selected and by using the above code, the issue should be addressed?



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

    Default Re: Tool length Offset activated as part of Initialization file

    Hi slimneil,

    We have the offsets set to save always also.
    It isn't clear why you would want/need to clear these to zero. They would either be set previously and still correct, or if using different stock they would need to be determined again. When setting the offsets the previous values shouldn't have any effect.


    Are you telling me that the Tool 1 compensation is automatically applied on start up when the "Tool Length/Offset Immediately Option" is active?
    Yes, on startup the first Tool in the dropdown list is shown and the compensation for the shown tool is in effect.


    Do i add this code to my Initialization file? Am i correct in assuming that once the operator enters the tool in the machine that offset is loaded right then and there? So if i used that tool to zero the part height the correct offset would be applied and then all other tool changes would use their correct tool offset.
    You didn't explain how your ATC works and if/how the current tool can be determined. If it can't then you might add code in the Initialization file to:

    #1 check if the Last Tool is known or unknown.
    #2 if unknown, ask the Operator
    #3 after the Operator enters the Tool number use the code to set the loaded tool and have the compensation for that tool immediately applied.


    Another issue we found is that the Spindle won't actually turn on when running a G code file for the first time if we haven't performed a tool change either from drop down menu or M6 command. Can this be corrected in the initialization file also? is it because it is waiting for a tool to be selected and by using the above code, the issue should be addressed?
    You haven't told us how your Spindle works or how your ATC works or the code used to control them. But I would guess that you have some protection code to prevent the the Spindle from being turned on while a Tool Change is in progress. That is probably not being initialized properly.

    Regards
    TK http://dynomotion.com


  5. #5
    Member
    Join Date
    Feb 2008
    Location
    Canada
    Posts
    215
    Downloads
    0
    Uploads
    0

    Default Re: Tool length Offset activated as part of Initialization file

    Hi Tom,

    -I think i worked out my issues with the tool height, it all comes back to where the machine is on start up because the Global offset values screw me up when i am working in fixture offsets when i home the machine, they don't automatically clear. Do you have any example code in the C folder of what i can add to my homing C Code to clear the Global offset values once it homes? I've attached my Homing file.

    -I've fixed the issue with the machine not knowing the tool offset until i perform a tool change. I added code to the Initialization file so that it asks what tool is in the spindle.

    -The only item left is the fact that Upon power up the spindle won't turn on until I've done a tool change. Kmotion CNC knows the tool and offset in the spindle but won't turn on until a proper tool change occurs. It's like my initialization file doesn't activate the Spindle axis, i looked but couldn't figure out where i was going wrong in the initilization/ M3 / M6 C code . I've also attached my Tool change and spindle on C code file for your reference.

    Thanks for the help!
    -Dan



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

    Default Re: Tool length Offset activated as part of Initialization file

    Hi Dan,

    I think i worked out my issues with the tool height, it all comes back to where the machine is on start up because the Global offset values screw me up when i am working in fixture offsets when i home the machine, they don't automatically clear. Do you have any example code in the C folder of what i can add to my homing C Code to clear the Global offset values once it homes?
    If offsets are screwing up when finding tool height then I would think you would want to clear them when finding tool height not only when homing.

    You could clear the Global Offset by issuing an MDI("G52Z0")



    The only item left is the fact that Upon power up the spindle won't turn on until I've done a tool change. Kmotion CNC knows the tool and offset in the spindle but won't turn on until a proper tool change occurs. It's like my initialization file doesn't activate the Spindle axis, i looked but couldn't figure out where i was going wrong in the initilization/ M3 / M6 C code . I've also attached my Tool change and spindle on C code file for your reference.
    I don't find any attachments.

    Regards
    TK http://dynomotion.com


  7. #7
    Member
    Join Date
    Feb 2008
    Location
    Canada
    Posts
    215
    Downloads
    0
    Uploads
    0

    Default Re: Tool length Offset activated as part of Initialization file

    How do I add that "MDI("G52Z0")" line to my Home C code? I get an error "undefined symbol" when i try to add it at the end.

    Files attached this time...

    Attached Files Attached Files


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

    Default Re: Tool length Offset activated as part of Initialization file

    Hi Dan,

    How do I add that "MDI("G52Z0")" line to my Home C code? I get an error "undefined symbol" when i try to add it at the end.
    You must include the MDI and related functions with:

    #define TMP 10 // which spare persist to use to transfer data
    #include "KflopToKMotionCNCFunctions.c"

    like in the other examples


    The only item left is the fact that Upon power up the spindle won't turn on until I've done a tool change. Kmotion CNC knows the tool and offset in the spindle but won't turn on until a proper tool change occurs. It's like my initialization file doesn't activate the Spindle axis, i looked but couldn't figure out where i was going wrong in the initilization/ M3 / M6 C code . I've also attached my Tool change and spindle on C code file for your reference.
    You forgot to include your Initialization C Program.

    Also please include a screen shot of how you have the Actions in KMotionCNC configured for S, M3,M4,M5,M6

    You would need to troubleshoot why the Spindle doesn't run. Your Spindle Jog Program just commands the Axis to Jog Assuming it is enabled. I don't know how your system is built and wired. Is there some sort of interlock? I see the Tool Change manipulates many IO bits such as:

    ClearBit(ToolChangeSafety); //Turns on the Active Toolchange signal
    ClearBit(Schroud_Up); //Clear Schroud Up Signal
    ClearBit(Spindle_CW_On);//Turns off the Spindle On Signal

    Check the states of all your IO before and after the Tool Change to see what is different and makes the difference on the Spindle working or not.

    HTH

    Regards
    TK http://dynomotion.com


  9. #9
    Member
    Join Date
    Feb 2008
    Location
    Canada
    Posts
    215
    Downloads
    0
    Uploads
    0

    Default Re: Tool length Offset activated as part of Initialization file

    Thanks Tom, i'll check these out when I'm back in town.



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

Tool length Offset activated as part of Initialization file

Tool length Offset activated as part of Initialization file

Tool length Offset activated as part of Initialization file