585,737 active members*
4,543 visitors online*
Register for free
Login
Results 1 to 8 of 8
  1. #1
    Join Date
    Nov 2013
    Posts
    4

    K2 CNC Water Jet Table With Issues from 2013

    Hello
    We have a K2 CNC water jet table with a Kflop.
    Right now it has Version 4.31c load in the Kflop.
    This has never worked quite right from the beginning.
    There are 2 issues with it that just drives us crazy!
    And up till now we have had just to much work to take time to fix it.
    Now back in 2013 I dabbled in the Kflop some trying to fix but I not have time to total understand it.
    I have a bit better understanding now I think.
    Ok the 2 issues are
    1. The Z axis will not home to the same location ever time? But the X and Y axis homing works just fine no issues.
    2. The G0 speed is way too fast and always have to replace all G0 with G1 and speed.

    In an email last week with Tom K. he pointed out that K2CNC was in flashing all user programs to flash.
    For a product like there where selling that not totally a bad thing.
    But I'm understanding from Tom that there is no real way to figure out what programs are in flash now.

    So with all of that here are some questions.

    1. What if there are 2 of the version of the same program flashed in to 2 different thread spaces?

    2. Will they both try and run at the same time?

    3. Is there a way to down load the user program from a thread or down load all threads?

    4. Is there a way to clear one thread at a time? (Or do you just flash over the old program?)

    5. If I compile a program for a thread and down load it to Kflop will it run that new code until reset?

    6. If there is code in thread 7 it runs all the time even in E-Stop?

    Well thank you all in advance for the help.
    Tom H.

  2. #2
    Join Date
    May 2006
    Posts
    4045

    Re: K2 CNC Water Jet Table With Issues from 2013

    Hi Tom,

    1. The Z axis will not home to the same location ever time? But the X and Y axis homing works just fine no issues.
    You would need to locate and look at the homing code to see what it is doing. I believe I've seen some issues in the past where the K2CNC code was setting to the Encoder Position rather than zero. On some systems (ie no Encoder) that value might not always be zero.

    2. The G0 speed is way too fast and always have to replace all G0 with G1 and speed.
    The rapid speeds are determined by the KFLOP Settings. See this wiki article:
    Dynomotion

    1. What if there are 2 of the version of the same program flashed in to 2 different thread spaces?
    It wouldn't normally make sense to do this.

    2. Will they both try and run at the same time?
    Placing programs into Thread Spaces and executing them are two different steps. If both Threads are told to execute then they would both run at the same time.

    3. Is there a way to down load the user program from a thread or down load all threads?
    I think what you are saying is what we would refer to as uploading programs from KFLOP to the PC. We don't have a means of doing that. The code placed into the KFLOP Thread Spaces is compiled binary code. Not the Source C Programs.

    4. Is there a way to clear one thread at a time? (Or do you just flash over the old program?)
    Downloading new code to a Thread will over write over any existing code. Note that downloading and flashing are two different things. To Flash a program to a Thread it must first be downloaded to that thread. And then KFLOP User Data Flashed so that on the next power up that program will be restored to that Thread Space (and optionally executed).

    5. If I compile a program for a thread and down load it to Kflop will it run that new code until reset?
    Again downloading and executing (running) code are two different things. Many programs when told to execute do something and then terminate. In that case the code will not keep running it until power down but the code will remain there until over written.

    6. If there is code in thread 7 it runs all the time even in E-Stop?
    Actually the Stop Button in the current KMotionCNC Stops all Threads except Thread #1. A simple experiment can confirm that as the KMotion.exe C Program Screen shows which Threads are currently running with a Green Bar over the Thread Number.

    HTH
    Regards
    TK
    http://dynomotion.com

  3. #3
    Join Date
    Nov 2013
    Posts
    4

    Re: K2 CNC Water Jet Table With Issues from 2013

    Thanks Tom for the info.
    But I'm still a bit confused.
    Now to let you know I have done a lot of C coding for a number of different micro controllers.
    This C must be hybrid for the Kflop.
    You have said and it is in text in a number of places that the Kflop will run the code on the thread and exit.
    But I have this “K2_Home.c “program on the PC that I think has been flashed to the Kflop.
    I also have this file on the PC “K2_Home(2).out” so I'm think that this was at least compiled for thread 2?

    Code:
    int main() 
    {
        persist.UserData[HOMING_PERSIST]=0x4F; // Mode4, All Axis
        if (ReadBit(HomingStart))
        {
            ClearBit(HomingStart);
            Delay_sec(.5);
        }	
        SetBit(60);	// Set ACTIVE Bit
        SetBit(HomingStart);
        return 0;
    }
    I left off the include lines.
    I see no loop in this program so it would only run one time that I'm seeing?

    I think that I have made the connection from this program to the other homing code to move the axis.
    It is bit 60 being set to active?

    The other question is.
    We have use KMotionCNC all the time from 2013.
    So what is the minum programs that KMotionCNC needs to work?

    Tom H.

  4. #4
    Join Date
    May 2006
    Posts
    4045

    Re: K2 CNC Water Jet Table With Issues from 2013

    Hi Tom,

    This C must be hybrid for the Kflop.
    You have said and it is in text in a number of places that the Kflop will run the code on the thread and exit.
    Not sure what you mean by this. KFLOP runs the compiled binary machine code. Not the text based source code.

    But I have this “K2_Home.c “program on the PC that I think has been flashed to the Kflop.
    I also have this file on the PC “K2_Home(2).out” so I'm think that this was at least compiled for thread 2?
    That code just pulses a bit that is expected to be detected by some other running Program to perform the actual homing sequence. It is probably not Flashed to KFLOP but rather assigned to a User Button called "Home" and compiled/downloaded/executed when the button is pushed.

    I see no loop in this program so it would only run one time that I'm seeing?
    Yes it would turn the bit off for 0.5 seconds and then terminate.

    I think that I have made the connection from this program to the other homing code to move the axis.
    It is bit 60 being set to active?
    It manipulates two bits. Bit=60 and Bit=HomingStart. You didn't post the includes so we don't know what bit HomingStart is. Bit 60 is probably used to indicate to other programs that something is active for whatever reasons (ie inhibit jogging). It is probably cleared after Homing has completed.

    We have use KMotionCNC all the time from 2013.
    So what is the minum programs that KMotionCNC needs to work?
    I'm not sure what you mean. That depends on what you need the machine to do and how K2CNC decided to handle things at the time.

    Regards
    TK
    http://dynomotion.com

  5. #5
    Join Date
    Nov 2013
    Posts
    4

    Re: K2 CNC Water Jet Table With Issues from 2013

    Thank you Tom for the fast reply!
    Sorry it has been some time before getting back to this but other thing just get in the way all the time.

    I have decided to take your suggestion of getting an additional Kflop board so that has been ordered and on the way.

    I have zip up the Kflop directory from the computer for the K2CNC Water Jet Cutter so anyone willing to look at this would have all the code that goes with all of it.
    The funny thing is the KMotionDef.h file was not in this Kflop directory it was in the KMotion431c directory I copied it in to the Kflop directory in the zip file this morning.
    Also the Uploads from Kflop 10_27_16.txt file was just done this morning.

    Here is the homing code for a signal axis and in this case would be the Z(ch 2) axis.
    So what I'm seeing is the encoder is not being zeroed or at least to a hard zero.
    From what I'm see is the index_last is being set to a number when the switch changes.
    And in is assumed that it is zero.
    But I may be way off on that.


    Code:
    //-------------------------------------------------------------------------
    int Home_Single(int axis, int sw, int index, int Multiplier, int nomove)
    {
    //	printf("axis: %d switch: %d\n",axis,sw);
    	int index_last;
    	int index_this;
    	int home_vel = Multiplier * 2000;
    	int backup_vel = Multiplier * -1000;
    	int offset;
    	int SPI; //steps per inch
    
    	if (!ReadBit(ESTOP_SW)) return;
    
    	Jog(axis, home_vel);		
    
    	while (!ReadBit(sw)) // wait for switch to change
    	{
    //		printf("%d\n",test);
    		Delay_sec(.001);	// little delay for debounce
    		Home_Abort_If_Needed();
    		if (CheckDone(axis))
    			break;
    	}
    	Jog(axis,0);		      	// StopMotion
    
    	if (!ReadBit(ESTOP_SW)) return;
    
    	while(!CheckDone(axis)) 
    		;
    
    	index_this = ReadBit(index);
    	index_last = index_last;
    	Jog(axis, backup_vel);          	// start moving
    	while (ReadBit(sw) || (index_this == index_last) ) 	// wait for switch to change
    	{
    	//	SetStateBit(46,ReadBit(index));
    		index_last = index_this;
    		index_this = ReadBit(index);
    		Home_Abort_If_Needed();
    		if (CheckDone(axis))
    			break;
    	}
    	Jog(axis,0);		      	// StopMotion
    
    	while (!CheckDone(axis)) ;
    
    	Delay_sec(.1);
    	Zero(axis);
    	Delay_sec(.1);
    ///*	
    	SPI=persist.UserData[XSPI + axis];
    	offset=persist.UserData[XHomeOffset + axis] * SPI / 10000 ; //using axis to chose which offset to USER_INPUT_MODE
    	//printf("SPI %d\n",SPI);  // print the desired speed
    	//printf("Offset %d\n",offset);  // print the desired speed
    	if ((offset/SPI) < 2 && (offset/SPI) > -2)
    	{
    		Home_Abort_If_Needed();
    		chan[axis].Position = offset;
    		chan[axis].Dest = offset;
    		Delay_sec(.1);
    		if (nomove == 0)
    			Move(axis,0.0);
    	}
    //*/	
    	//EnableAxisDest(axis,0.0);
    	persist.UserData[HOMING_PERSIST]&=~(0x01<<axis);
    	
    	return 1;
    }
    Cheers and thanks
    TomH
    Attached Files Attached Files

  6. #6
    Join Date
    May 2006
    Posts
    4045

    Re: K2 CNC Water Jet Table With Issues from 2013

    Hi TomH,

    One bug I see is the statement:

    index_last = index_last;

    should be:

    index_this = index_last;


    that would result in index_last being uninitialized with indeterminate results.

    Do you know if your system has encoders with index pulses that it is attempting to use?

    I'd suggest fixing that bug, adding a number of diagnostic printf messages, then compile/download/execute that file to KFLOP to see what happens.

    Regards
    TK
    http://dynomotion.com

  7. #7
    Join Date
    Nov 2013
    Posts
    4

    Re: K2 CNC Water Jet Table With Issues from 2013

    Oct. 28, 2016
    Tom thank for the fast reply!
    And yes I was look hard at that line also.
    I dint see how it was set the index_this in that part of the code.
    I will give it a shot as soon as I can.

    Now if I compile and download this without flashing the Kflop to get back to the original code and setting it is just a matter of rebooting correct?
    Not sure what thread to put this on but the “Defines.c” has this line in it “#define HOMING_THREAD 6” so I would assume thread 6 would be the place for a test. What you think?
    Tom

  8. #8
    Join Date
    May 2006
    Posts
    4045

    Re: K2 CNC Water Jet Table With Issues from 2013

    Hi Tom,

    Correct. As long as you don't Flash anything then KFLOP will restore back to the way it was on the next power cycle.

    Thread #6 is probably a good guess.

    Regards
    TK
    http://dynomotion.com

Similar Threads

  1. Replies: 0
    Last Post: 05-14-2014, 04:32 PM
  2. Water Table Build for DynaCNC table.
    By Mini-MillX2 in forum Plasma, EDM / Other similar machine Project Log
    Replies: 3
    Last Post: 12-09-2012, 03:35 PM
  3. Water Table - Water Depth
    By ajclay in forum Plasma, EDM / Other similar machine Project Log
    Replies: 10
    Last Post: 05-19-2012, 01:05 AM
  4. What do you do with your water table waste water?
    By turboedgs in forum Plasma, EDM / Other similar machine Project Log
    Replies: 1
    Last Post: 07-28-2010, 10:33 PM
  5. Water transfer techniques for water table?
    By Knut in forum Waterjet General Topics
    Replies: 3
    Last Post: 02-02-2007, 04:52 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
  •