586,076 active members*
3,912 visitors online*
Register for free
Login
Page 3 of 3 123
Results 41 to 48 of 48
  1. #41
    Join Date
    Dec 2007
    Posts
    578

    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

  2. #42
    Join Date
    May 2006
    Posts
    4045

    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))
    TK
    http://dynomotion.com

  3. #43
    Join Date
    Dec 2007
    Posts
    578

    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

  4. #44
    Join Date
    May 2006
    Posts
    4045

    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
    TK
    http://dynomotion.com

  5. #45
    Join Date
    Dec 2007
    Posts
    578

    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.:drowning:

  6. #46
    Join Date
    May 2006
    Posts
    4045

    Re: Servo Driven Toolchanger

    Hi Troy,

    Why are you only checking Axis 5? See the example in post 42.
    TK
    http://dynomotion.com

  7. #47
    Join Date
    Dec 2007
    Posts
    578

    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.

  8. #48
    Join Date
    May 2006
    Posts
    4045

    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
    TK
    http://dynomotion.com

Page 3 of 3 123

Similar Threads

  1. Designing servo driven bt30 setup
    By QuinnSjoblom in forum Mechanical Calculations/Engineering Design
    Replies: 42
    Last Post: 01-18-2021, 04:30 PM
  2. Need Servo Driven Mill Schematic
    By GPappy in forum LinuxCNC (formerly EMC2)
    Replies: 4
    Last Post: 11-29-2012, 03:05 AM
  3. Circular motion with servo driven router
    By bunalmis in forum Servo Motors / Drives
    Replies: 0
    Last Post: 11-12-2006, 12:30 PM
  4. Servo driven machine, do I have to put steppers on it?
    By Darc in forum Mach Software (ArtSoft software)
    Replies: 7
    Last Post: 12-12-2005, 09:03 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
  •