Check Position M6 Tool Change Code


Results 1 to 6 of 6

Thread: Check Position M6 Tool Change Code

  1. #1
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    578
    Downloads
    0
    Uploads
    0

    Default 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

    Similar Threads:
    www.tsjobshop.com, www.homecncstuff.elementfx.com


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

    Default 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.

    Regards
    TK http://dynomotion.com


  3. #3
    Member
    Join Date
    Jun 2004
    Location
    Scotland
    Posts
    355
    Downloads
    0
    Uploads
    0

    Default 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
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default 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.

    Regards
    TK http://dynomotion.com


  5. #5
    Member Need TECH Help!'s Avatar
    Join Date
    Dec 2007
    Location
    United States
    Posts
    578
    Downloads
    0
    Uploads
    0

    Default 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

    www.tsjobshop.com, www.homecncstuff.elementfx.com


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

    Default 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

    Regards
    TK http://dynomotion.com


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

Check Position M6 Tool Change Code

Check Position M6 Tool Change Code