SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Moderators: TomKerekes, dynomotion

NOELNOG
Posts: 165
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Sat May 04, 2024 5:33 pm

TomKerekes wrote:
Thu May 02, 2024 7:04 pm
Hi Noel,

Do you have the M6 Action set to Execute/wait/Sync? If not try that.
Hi Tom

the ATC action is working now, i was missing "Execute/wait/Sync" Thank you very much.

https://www.youtube.com/watch?v=eOpyYvUKtrY

NOELNOG
Posts: 165
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Wed Jun 12, 2024 10:00 pm

Hi Tom

I am working with an ATC carousel and my C.program is working ok exept one thing, regarding to slot number match. let s say that the program execute tool change ok, it does select tool number ok and get back and put the tool in the fork, raise spindle, carousel rotates and select the next tool everything ok to this point. my issue is when i rotates the carousel manually when i need to replace tools or set newones, the program does not make the carousel comeback where the last tool was grabed for the spindle, so it keeps on the position randomly i rotated and of corse it will crash the tool in the spindle.
GENEVA ROTARY TOOL CHANGER BINARY,OK.c
(17.41 KiB) Downloaded 193 times
thanks in advance

User avatar
TomKerekes
Posts: 2684
Joined: Mon Dec 04, 2017 1:49 am

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Wed Jun 12, 2024 10:41 pm

Hi Noel,

UnloadTool is defined as

Code: Select all

int UnloadTool(int CurrentTool);
and

Code: Select all

int UnloadTool(int CurrentTool, int Tool)
Please make them consistent. Compiling with the TI Compiler will provide warnings of this.

This code

Code: Select all

	if (CarouselPosition(), (Tool))	// need to load different tool?
seems wrong. In C multiple expressions separated by commas return the last expression. See here.

Probably should be:

Code: Select all

	if (CarouselPosition() != Tool)	// need to load different tool?
Similarly with:

Code: Select all

		while (CarouselPosition(), (Tool))	//when carousel find the requested tool
HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 165
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Tue Jun 18, 2024 2:14 am

Hi Tom

Thank you for your help.
My ATC program is working, it returns to last tool position without crashing tools.
now I have an other problem, my ATC carousel uses binary code sensors to select each tool, there are three sensors aligned under the aluminum plate with steel pins to code each tool. and there is one more sensor on the shaft of the motor, i used that for tool number 8,everything works fine exept some tool numbers fails the rotation, depend where is it, I found that when the carousel try to rotate, in some point it clears the rightmost sensor first than the middle one, then the middleone clears first than the leftmost sensor this is ovious for the rotation angle, but the ATC C.program read that changes right away and make the carousel stop before it reach the next postion, so the tool would crash, this is only when the carousel try to start to rotate, it moves just few degrees and stop, and not fails in all positions mostly it works fine, for example from tool 5 to 4, 6 to 4, 7 to 4, 7 to 6 it fails, all depends if the rightmost sensor involves code.
is there some way to disable the sensors for some miliseconds when carousel start to rotate then enable them to catch the next position, or make some code to read first the three sensors clear then read the code, that way when the carousel start rotating ignors sensors until they clear and get new code, i dont know if i axplained well?.
this is my atc C. program

regards.
GENEVA ROTARY TOOL CHANGER BINARY,OK.c
(17.7 KiB) Downloaded 193 times

User avatar
TomKerekes
Posts: 2684
Joined: Mon Dec 04, 2017 1:49 am

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Tue Jun 18, 2024 3:03 pm

You might wrap the CarouselPosition function with a function like CarouselPositionStable that detects whenever the position changes and records the time. Then return position invalid (-1) until it has not changed for a certain amount of time. Then return the CarouselPosition.
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 165
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Tue Jun 18, 2024 5:02 pm

Sounds difficult for me, could you give me an example please, i have not idea how to record the time

Regards

User avatar
TomKerekes
Posts: 2684
Joined: Mon Dec 04, 2017 1:49 am

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Wed Jun 19, 2024 12:53 am

Try this:

Code: Select all

// return Carosel Position when stable otherwise return invalid (-1)
int CarouselPositionStable(void)
{
	static int LastReadPosition=-1;
	static double LastChangeTime=0;
	int NewReadPosition;
	
	NewReadPosition = CarouselPosition(); //read sensors 
	
	if (NewReadPosition != LastReadPosition)  // changed?
	{
		LastChangeTime= Time_sec();  // record when
		LastReadPosition = NewReadPosition;
	}
	else
	{
		if (Time_sec() > LastChangeTime + 0.2) // no changes for a period of time?
			return NewReadPosition;  // return stable reading
	}
	return -1; // not stable return invalid
}
Note the UnloadTool inconsistency has not been fixed which will now probably become important. Currently the parameter 'Tool" is being used but never set by the caller so is basically garbage, so most likely doesn't match the CurrentTool, so always decides it must rotate the Carousel, but then instantly sees the Carousel in position and stops rotating.
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 165
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Sun Jun 23, 2024 10:57 pm

Thankyou Tom.
NOELNOG wrote:
Tue Jun 18, 2024 5:02 pm
Note the UnloadTool inconsistency has not been fixed which will now probably become important. Currently the parameter 'Tool" is being used but never set by the caller so is basically garbage, so most likely doesn't match the CurrentTool, so always decides it must rotate the Carousel, but then instantly sees the Carousel in position and stops rotating.
i made changes for this and TI compiler does not show warnings any more, i know something is not correct, the carousel still detecting wrong reading in some tool numbers.
GENEVA ROTARY TOOL CHANGER BINARY,OK.c
(17.99 KiB) Downloaded 188 times

User avatar
TomKerekes
Posts: 2684
Joined: Mon Dec 04, 2017 1:49 am

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by TomKerekes » Mon Jun 24, 2024 12:33 am

The code is still calling CarouselPosition. CarouselPositionStable is never used.
Regards,

Tom Kerekes
Dynomotion, Inc.

NOELNOG
Posts: 165
Joined: Wed Nov 10, 2021 3:54 pm

Re: SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Post by NOELNOG » Sat Jun 29, 2024 1:44 am

Hi Tom

My carousel is woking great now, i finally make the code you sent me work exelent.

Now I am dealing with tool length offsets, i have not understood some points, because once i set some value in the table tool, everytime i reset home with different tools loaded looks like it chages the height from the reference point to machines bed wich is the the zero point.
this is the secuence.
when i turn the machine on, first thing i do is reset home, so the axis move slow to find the sensor then comeback few inches away then set X and Y to zero.
the Z axis go down few inches then sets automatically 3.875 inches , i write that in the home reset c. program.
each tool go down to cut from that point, i entered a lengh value for each one in the tool table, but i have noted that if i rest home with different tools loaded in the spindle, the heights change respect to the machines bed, so they will cut too deep or less deep, there is my g code attached.

( WEEKE TESTING )
( File created: jueves, junio 27, 2024 - 02:50 p. m.)
( Machine Size)
( X= 140.000, Y= 55.000, Z= 0.750)
()
(Toolpaths used in this file:)
(WEEKE 3)
(----ATC SPINDLE, AUTOMATIC TOOL CHANGE, BIT 1057---- )
(4 = End Mill {0.5 inches})
(6 = End Mill {0.375 inches})
(8 = End Mill {0.25 inches})
N14 M06 T8 (Tool: End Mill {0.5 inches})
N15 G00 G43 Z2.0000H8
N17 G04P1
N18 M03 S18000
N21 G04P1
N22(Toolpath:- WEEKE 1)
N23()
N24 G94
N25 G00 X11.7725Y-34.5994
N26 G00 Z1.0000
N27 G1 X11.7725Y-34.5994Z0.5000F60.0
N28 G1 X11.7725Y-15.0148Z0.5000F280.0
N29 G2 X12.0225Y-14.7648I0.2500J0.0000
N30 G1 X20.0868Y-14.7648Z0.5000
N31 G2 X20.3368Y-15.0148I0.0000J-0.2500
N32 G1 X20.3368Y-34.5994Z0.5000
N33 G2 X20.0868Y-34.8494I-0.2500J0.0000
N34 G1 X12.0225Y-34.8494Z0.5000
N35 G2 X11.7725Y-34.5994I0.0000J0.2500
N36 G00 X11.7725Y-34.5994
N37 G00 Z1.0000
(PERFORM TOOL CHANGE)
N39 M06 T6 (Tool: End Mill {0.375 inches})
N40 G43 Z2.0000H6
N41 M03 S20000
N42 G04P2
(BEGIN NEXT CUT)
N45 G00 X36.7913Y-14.8921
N46 G00 Z1.0000
N47 G1 X36.7913Y-14.8921Z0.5000F60.0
N48 G2 X46.8983Y-24.9991I0.0000J-10.1070F280.0
N49 G2 X36.7913Y-35.1061I-10.1070J0.0000
N50 G2 X26.6843Y-24.9991I0.0000J10.1070
N51 G2 X36.7913Y-14.8921I10.1070J0.0000
N52 G00 X36.7913Y-14.8921
N53 G00 Z1.0000
(PERFORM TOOL CHANGE)
N55 M06 T4 (Tool: End Mill {0.25 inches})
N56 G43 Z2.0000H4
N57 M03 S14000
N58 G04P2
(BEGIN NEXT CUT)
N61 G00 X60.9156Y-17.5304
N62 G00 Z1.0000
N63 G1 X60.9156Y-17.5304Z0.5000F60.0
N64 G1 X60.9027Y-17.6089Z0.5000F220.0
N65 G1 X60.8887Y-17.6873Z0.5000
N66 G1 X60.8735Y-17.7652Z0.5000
N67 G1 X60.8572Y-17.8427Z0.5000
N68 G1 X60.8398Y-17.9198Z0.5000
N69 G1 X60.8213Y-17.9964Z0.5000
N70 G1 X60.8018Y-18.0727Z0.5000
N71 G1 X60.7812Y-18.1485Z0.5000
N72 G1 X60.7597Y-18.2240Z0.5000
N73 G1 X60.7371Y-18.2991Z0.5000
N74 G1 X60.7135Y-18.3738Z0.5000
N75 G1 X60.6890Y-18.4481Z0.5000
N76 G1 X60.6635Y-18.5220Z0.5000
N77 G1 X60.6371Y-18.5955Z0.5000
N78 G1 X60.6097Y-18.6687Z0.5000
N863 G00 X60.9156Y-17.5304
N864 G00 Z1.0000
N865 G00 Z3.87500
N866 M05
N867 G04P1
N869 G00 X0.0000Y0.0000A0.0000
N870 M30
(END OF PROGRAM)

Post Reply