SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Moderators: TomKerekes, dynomotion

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

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

Post by NOELNOG » Thu Jan 25, 2024 3:56 pm

one more question regarding to parameters, i am making some voice WAV. messages to better explain the operator when something is wrong.
I im trying to use a C program with parameters and use only one Mxx code to call them, just like i did to activate a multisipndle boring drills in other machine, so that way i can save the rest of the Mxx number available, but i don't know how to execute the powershell bat. file from C program, do you think is this possible?

regards

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

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

Post by TomKerekes » Fri Jan 26, 2024 3:19 am

Hi Noel,

Regarding boring head: if you don't mind using the A Axis why not just use that. The GCode would move A when you need to bore and move Z when you want to use the normal Spindle. No need to disable one or the other just only move the one you need.

Regarding WAV file. You could use a ScreenScript command to execute an Action to execute a PC Batch file. Such as:

Code: Select all

#include "KMotionDef.h"

#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

void main()
{
	if (ScreenScript("Action:7;0;0;0;0;0;C:\\Temp\\LimitSwitch.bat"))
		printf("Screen Script Failed\n");
	else
		printf("Screen Script Success\n");
}
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Tue Feb 06, 2024 6:43 pm

Hi Tom.
thank you for the previous answers you gave me, programs works perfect now.

I have an other issue with the cnc router that has been working almost two years with kflop and kannalog, most of the time it works perfect, but sometimes it skip C program functions, for example it uses 4 independent spindles, they are controlled by M codes, the operator said sometimes when the machine finish using one spindle and switch to use a different spindle, it does not turn on or it does not orient spindle down, although the g code and machine keeps running normal, so he has to stop the machine, do reset home and cycle start over again, that issue happen sometimes only, it may work for weeks or days all day long with no problem, and sometimes happen.
OrientLEFTspindle.c
(504 Bytes) Downloaded 39 times
OrientATCspindle.c
(479 Bytes) Downloaded 32 times
Orient Spindle 3.c
(491 Bytes) Downloaded 37 times
LUBE.c
(329 Bytes) Downloaded 41 times
LEFTspindle Selector.c
(561 Bytes) Downloaded 35 times
INITreset,FINAL.c
(18.52 KiB) Downloaded 32 times
ATCspindle Selector.c
(518 Bytes) Downloaded 38 times
Accesories B.c
(521 Bytes) Downloaded 35 times
Accesories A.c
(348 Bytes) Downloaded 38 times

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

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

Post by TomKerekes » Tue Feb 06, 2024 7:14 pm

Hi Noel,

I don't see anything obvious.

Please post your GCodeConfigCNC.txt so we can see how things are configured.

The next time it happens you might stop and investigate what went wrong. What was the GCode that last executed. What was the last MCode? What should the Outputs be? Check KMotion.exe Digital IO Screen to see what they actually are? If the Bits are on and off are the Relays actually on and off respectively? Anything printed on the Console? Is it always the same spindle?

Maybe add printf statements in the Spindle Change Programs to see if/what was actually called.

Although it shouldn't be necessary, you might add switches/inputs to verify the Spindle actually came down or on. That could help diagnosing the problem.

What Version are you running?

Sorry for no simple solution.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Tue Feb 06, 2024 7:34 pm

I have tested the external contactors and and valves, they work ok. also i teach the operator to open the digital IO screen and see if the respective bits are on, but he say they doesn't turn on when that happen. console doesn't show any errors, i recently updated the last version 5.3.1 but it did it again last week, the machine works 8 to 10 hours a day anyway, like i said it only happen two or three times not very often.
also the machine is running always the same operation same G code program.
GCodeConfigCNC.txt
(23.21 KiB) Downloaded 34 times

thank you

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

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

Post by TomKerekes » Wed Feb 07, 2024 1:26 am

Hi Noel,

You might record which MCode didn't work and which Bits were not set properly. It may help to find the issue. It doesn't look like you posted all the C Programs for every MCodes. It might be an issue with Virtual bits vs hardware bits.

You might add the printfs to determine if the C Program actually executed or not.

I see the MCodes are set to "Execute Prog". In this case the GCode doesn't wait for the C Program to finish before going on. The danger would be that another C Program to use the same Thread Kills the Thread and downloads the next program to the Thread before the first C Program finishes. Probably unlikely as these programs mostly only set bits so should only take microseconds. But it would be better to change to "Exec/wait/sync" so the GCode doesn't continue until the MCode has finished. Please try this to see if it has an effect.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Wed Feb 07, 2024 3:09 pm

Hi Tom
TomKerekes wrote:
Wed Feb 07, 2024 1:26 am
I see the MCodes are set to "Execute Prog". In this case the GCode doesn't wait for the C Program to finish before going on. The danger would be that another C Program to use the same Thread Kills the Thread and downloads the next program to the Thread before the first C Program finishes. Probably unlikely as these programs mostly only set bits so should only take microseconds. But it would be better to change to "Exec/wait/sync" so the GCode doesn't continue until the MCode has finished. Please try this to see if it has an effect.
I think that will be the solution changing to "Exec/wait/sync", because it seems that there is not enough time to execute the action, now i see why, thank you, i almost sure that would work.
TomKerekes wrote:
Wed Feb 07, 2024 1:26 am
You might add the printfs to determine if the C Program actually executed or not.
how can add this pritfs? will that appear in console?

regards

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

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

Post by TomKerekes » Wed Feb 07, 2024 7:20 pm

Hi Noel,

Add for example:

Code: Select all

printf("MCode 101 switching to Spindle #2\n");
When the printf executes the message will go to the KMotion Console.
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Wed Feb 07, 2024 9:46 pm

Thank you Tom.

is there some way to save all history in a folder or file, where i can see the functions record from days or weeks? console clears when turn kflop off right?

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

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

Post by TomKerekes » Wed Feb 07, 2024 9:53 pm

Hi Noel,

Console messages are accumulated into the file \KMotion\Data\LogFile.txt

But Console messages are only logged when KMotion.exe is running.
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply