Servo Driven Toolchanger - Page 3


Page 3 of 3 FirstFirst 123
Results 41 to 48 of 48

Thread: Servo Driven Toolchanger

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

    Default Re: Servo Driven Toolchanger

    Tom,
    I tried to add code to my init program. The result i get is after an axis disabled condition i can not get it to re-enable.And rest of init code seems to be hanging. That said, wouldn't this code also cause a fault when referencing the axis? As the referencing ccode disables the axis to zero then re-enables.
    Attached is my 3 axis main init code.

    Troy

    Attached Files Attached Files
    www.tsjobshop.com, www.homecncstuff.elementfx.com


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

    Default Re: Servo Driven Toolchanger

    Hi Troy,

    The result i get is after an axis disabled condition i can not get it to re-enable.And rest of init code seems to be hanging.
    Oops. The purpose of WasEnabled is to only EStop once, not many times. So code this:

    Code:
           // if any axis disables and was enabled do EStop
            if (WasEnabled && (!ch0->Enable || !ch1->Enable || !ch2->Enable || !ch5->Enable))

    That said, wouldn't this code also cause a fault when referencing the axis? As the referencing ccode disables the axis to zero then re-enables.
    Good point. In that case you might set a Virtual Bit to disable the check while homing is disabling. ie.
    Code:
           // if any axis disables and was enabled do EStop
            if (ReadBit(48) && WasEnabled && (!ch0->Enable || !ch1->Enable || !ch2->Enable || !ch5->Enable))


    Regards
    TK http://dynomotion.com


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

    Default Re: Servo Driven Toolchanger

    Tom,
    So, i can use the same type of code to block my axis limit pop up message during referencing? Here is a snippet of the X axis limit switch from main init code.

    Code:
    // Handle axis X minus limit switch
    	result = Debounce(ReadBit(XMINUSLIMITBIT), &xmcount, &xmlast, &xmlastsolid);
    	if (result == 1)
    	{
    		ClearBit(152);
    
    		MsgBox("X - Limit. Jog opposite direction.", MB_OK | MB_ICONEXCLAMATION);
    	}
    How would i change the 'if' statement to also look at the state of VirtualBit that i will set at beginning of my referencing Ccode program?

    Thanks,
    Troy

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


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

    Default Re: Servo Driven Toolchanger

    Hi Troy,

    In this case you would only want to display the message when the original condition AND (logical and operator '&&') a ReadBit(48) is equal to '==' 0

    Regards
    TK http://dynomotion.com


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

    Default Re: Servo Driven Toolchanger

    Leaving the pop up window issue for now as i cant get an estop to occur when axis disables.Here is code i added to main init but there nothing happens when axis is disabled.
    Code:
    .......
    
    {
    		double Tau = 0.002;		//seconds for low pass filtertime constant
    		KLP = exp(-TIMEBASE / Tau);
    		printf("Tau=%f KLP=%f\n", Tau, KLP);
    	}
    
    	BOOL WasEnabled = TRUE;
    
    	for (;;)					// loop forever
    	{
    		//if any axis disables and was enabled do Estop
    		if (WasEnabled && ( !ch5->Enable))
    		{
    			WasEnabled = FALSE;
    			DoPC(PC_COMM_HALT);
    		}
    
    
    		SetStateBit(1059, BLOCK_DELETE_CHECKED);
    
    		//From SetFROwithpot.c and SetSSOwithpot.c
    .......
    Any coders for hire? This ccode stuff is getting the best of me.

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


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

    Default Re: Servo Driven Toolchanger

    Hi Troy,

    Why are you only checking Axis 5? See the example in post 42.

    Regards
    TK http://dynomotion.com


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

    Default Re: Servo Driven Toolchanger

    Quote Originally Posted by TomKerekes View Post
    Hi Troy,

    Why are you only checking Axis 5? See the example in post 42.
    I could not get code to work so i was trying to simplify code as much as i could.

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


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

    Default Re: Servo Driven Toolchanger

    Ah. So I assume you were disabling Axis 5?

    But I think you want PC_COMM_ESTOP not PC_COMM_HALT

    HTH

    Regards
    TK http://dynomotion.com


Page 3 of 3 FirstFirst 123

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

Servo Driven Toolchanger

Servo Driven Toolchanger