586,005 active members*
5,057 visitors online*
Register for free
Login
Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2007
    Posts
    578

    Check Position M6 Tool Change Code

    So found a bad bug in my M6 tool change code. There is a open loop when Z axis positions. I had my Rapid Override potentiometer at 0 which issues a feedhold. Then did a tool change, Z axis did not move into position and tool change code continued as if it was! Thankfully Z was in home position and worst was it dropped a tool holder in the machine.

    So checking my code i found this....

    Code:
    // 4. Move to toolchange position Z-1.01inches from Reference Position
    	{
    	  Move(Z, -20528);
          while (!CheckDone(2))
    	  WaitNextTimeSlice();	// wait until we are stopped
    	}
    It only checks to see if axis is done moving but not if it is in position. How do i check to see if Z axis is in position (-20528) and axis is stopped before code is allowed to continue?

    Troy

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: Check Position M6 Tool Change Code

    Hi Troy,

    Yikes!

    Independent Move commands are ignored if issued while in Feedhold. Maybe a better solution would be to check if in Feedhold (CS0_StoppingState != 0) and handle it appropriately. Either display an error or wait for Feedhold to be released before commanding the Move.

    To check if the encoder indicates Z is actually in the correct position compare ch2->Position to the desired position +/- some tolerance, as it may never be at exactly the correct position. Of course this method only works if you have encoder feedback.
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Jun 2004
    Posts
    355

    Re: Check Position M6 Tool Change Code

    I've just checked my toolchanger code, and it has no check as well.

    Tom, if there's no encoder, could the axis destination be used?

  4. #4
    Join Date
    May 2006
    Posts
    4045

    Re: Check Position M6 Tool Change Code

    Hi m_c,

    if there's no encoder, could the axis destination be used?
    Yes that should indicate if the move was truly attempted or not. You still would want to check using some small tolerance as due to numerical rounding and such the destination may not match exactly,

    But I still think it would be better to check beforehand whether the command will be ignored or not before issuing it. Or possibly both.
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Dec 2007
    Posts
    578

    Re: Check Position M6 Tool Change Code

    So , i understand what you are saying with checking to see if in a Feed Hold and checking if axis has moved but, is there an example C code program that uses both methods? Need an example to have a chance at me figuring it out.
    Would like to have both if possible in the tool change sequence.Dont need a fault if in feedhold, just wait until feedhold is released or the tool change sequence is canceled by running my Reset button code.
    Also ,there is encoder feedback.

    Thanks,
    Troy

  6. #6
    Join Date
    May 2006
    Posts
    4045

    Re: Check Position M6 Tool Change Code

    Hi Troy,

    To wait until not in Feed Hold you could code:

    Code:
    while (CS0_StoppingState != 0)  ;  // wait while in feed hold


    To wait while the Encoder is not indicating the correct position you might code:

    Code:
    while (chan[Z].Position > -20528+2 || chan[Z].Position < -20528-2)  ; // wait until Position is correct
    HTH
    TK
    http://dynomotion.com

Similar Threads

  1. Park & tool change position after tool probe.
    By Ozzybee57 in forum Mach Mill
    Replies: 8
    Last Post: 10-16-2016, 03:57 PM
  2. Replies: 2
    Last Post: 12-31-2014, 01:46 PM
  3. How to change Tool change position(About MAZATROL T1 control)
    By liushuixingyun in forum Mazak, Mitsubishi, Mazatrol
    Replies: 6
    Last Post: 01-07-2014, 01:33 AM
  4. Setting tool offsets and tool change position.
    By trishbits in forum CamBam
    Replies: 1
    Last Post: 02-08-2013, 12:18 AM
  5. change Z position of the spindle in tool change
    By michael-p in forum CNC (Mill / Lathe) Control Software (NC)
    Replies: 3
    Last Post: 08-08-2011, 09:18 PM

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
  •