SETTING UP KFLOP, KANALOG FOR NEW CNC ROUTER RETROFIT

Moderators: TomKerekes, dynomotion

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

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

Post by TomKerekes » Sun Feb 27, 2022 5:59 pm

It would be very time consuming to communicate all the information and to do all the testing. We charge $250/hr for custom programming.

Just break it down one step at a time. For example can you understand what this function call does?

Code: Select all

	// - Move to position of requested tool
	// - Rapid move to absolute position of new tool only in X and Y
	if (MoveXY(ToolPositionX(Tool),HOLDER_Y,SlowSpeed)) return 1;
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Sun Feb 27, 2022 7:51 pm

TomKerekes wrote:
Sun Feb 27, 2022 5:59 pm
It would be very time consuming to communicate all the information and to do all the testing. We charge $250/hr for custom programming.

Just break it down one step at a time. For example can you understand what this function call does?

Code: Select all

	// - Move to position of requested tool
	// - Rapid move to absolute position of new tool only in X and Y
	if (MoveXY(ToolPositionX(Tool),HOLDER_Y,SlowSpeed)) return 1;
Hi Tom

yes i understand, it commands the X axis to move where the new tool position is, then move on Y axis slow to put the holder in the fork, i don't know what is return 1; for, i understand that return 0; is to end the program.

actually i'm playing with the Linear4ToolHoldersRev.c and it's running ok,i can see the tool moving in the screen, i already know what values to change to adjust speeds, distances, but what i don't know is how to use this program for a rotary,or modify or use part of this program to perform rotary tool change, i have studing the ARotateToolChanger.c but i still don't make it do anything, it shows AXIS A i assume it's for use a stepper or servo for rotary
but my magazine is 24 dc motor.

thanks

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

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

Post by TomKerekes » Mon Feb 28, 2022 6:28 pm

it commands the X axis to move where the new tool position is, then move on Y axis slow to put the holder in the fork,
Well not quite. First the function ToolPositionX is called to compute the X Position of the tool. Did you study the ToolPositionX() function? On this machine only the X Position of the tool varies. The Y positions are all the same. It then Calls the MoveXY() function which moves both X and Y at the same time and waits for both to complete moving. Did you study the MoveXY function?
i don't know what is return 1; for, i understand that return 0; is to end the program.
A general approach for handling errors is that when a function is called to do something and it succeeds it returns 0 to the caller. On failure it returns a non zero value. Usually 1, but maybe different numbers if it is necessary to inform the code that called it what exactly went wrong. In the C language a 0 is false and non-zero is true. So the 'if" statement returns with an error code if the MoveXY function returned any error. Returning from the top level main function terminates the program regardless of the value. 1 is returned to be consistent as if this code might be called from something else.

The ARotateToolChanger.c used a KFLOP Axis to rotate to different tools. The first thing you will need to understand is how your system works. Before trying to write a program to do something you should know how to do it yourself first. It seems you have a 24V motor? Is it wired up? How is it interfaced? How will you know what it's positions is to know when to turn it on and off? Use the Digital IO Screen to test your hardware and observe sensors.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Tue Mar 01, 2022 5:20 pm

Hello Tom

TomKerekes wrote:
Mon Feb 28, 2022 6:28 pm
Did you study the ToolPositionX() function? On this machine only the X Position of the tool varies. The Y positions are all the same. It then Calls the MoveXY() function which moves both X and Y at the same time and waits for both to complete moving. Did you study the MoveXY function?
yes, in general i understand how this functions works, i have played with this program changing values and i understood their behavior, also i studied my magazine corousel, it's a genova type wheel, also know how it works, basically it read each tool position using binary code with 3 sensors, i applied 24 volt directlly to the dc motor and sensors send signals as this:

binary code:
sensors A B C
tool 1- 0 0 1
tool 2- 0 1 0
tool 3 - 0 1 1
tool 4 - 1 0 0
tool 5- 1 0 1
tool 6- 1 1 0
tool 7- 1 1 1
tool 8- 0 0 0

I assume that i need convert this binary code to 8 independent signals to be able to read each tool.
can i do this using a c program? or i need to build a logic gate circuit outside to convert it?

thanks

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

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

Post by TomKerekes » Tue Mar 01, 2022 5:48 pm

Yes you can decode the tool with a C Program. Read each sensor, multiply A by 4, B by 2, and add them up.

For example:

Code: Select all

int Tool = ReadBit(BITA) * 4 + ReadBit(BITB) * 2 + ReadBit(BITC);
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Fri Mar 04, 2022 1:16 am

Hi Tom.

I decided to modify my ATC carousel to use a stepper motor instead a 24v dc, i think would be faster to rotate
i, have my A axis activated to drive ATC.

playing with the c programs ArotateToolChanger.c and Linear4ToolHoldersRev2.c, i compiled one out of these two programs that it seems to work, it does almost everything i want, for example:
1-it moves on x and y to certain position,
2-move the tool into the holder,
3-raise the Z up,
4-at this point, the A axis start to rotate to positon the tool, i have 8 tools divided in degrees, so it start at tool1,45.000 tool 2, 90.000 etc.
5- after tool position, the Z axis go down and clamp,
6-it moves on Y to pull the tool out of the carousel, then it go to work.

the problem is that i added a function in the program to perform rotatingin the A axis when Z raise up, but i could not figure it out how to make that variable to change it's value as the program running, it only reads the actual number and perform rotating but if number does not change never rotate again.
there is a copy with some notes what i did.
ROTARYTOOLCHANGER,TEST.c
(13.03 KiB) Downloaded 44 times
Thanks

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

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

Post by TomKerekes » Fri Mar 04, 2022 1:33 am

Since the ToolPositionA() function compute the A position based on the tool I think you need to replace:

Code: Select all

	if (MoveA(PLATE_A_3,SlowSpeed)) return 1;
with

Code: Select all

	if (MoveA(ToolPositionA(Tool),SlowSpeed)) return 1;
Minor thing: some of your Error Messages say Z instead of A
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Fri Mar 04, 2022 1:55 am

Thank you Tom.

it's running just perfect now :D

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

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

Post by TomKerekes » Fri Mar 04, 2022 2:15 am

So you are a c Programmer :)
Regards,

Tom Kerekes
Dynomotion, Inc.

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

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

Post by NOELNOG » Sat Mar 12, 2022 12:43 am

Hi Tom

i am trying to set the genova wheel type carousel again, i made a program for stepper motor carousel earlier but, have to do lot of mechanical work to make conversion, to this point i have the c. program for stepper working fine using A axis, i would like to use almost the same program exept make some changes in reason that instead of read A axis i need to read input bits in order to sense each tool, i made some modifications to the program and the machine works ok exept that i am confusing to create a function or variable to read each input bit instaed of degree of the A axis, there is a copy with notes where i am lost.

thanks
ROTARY TOOL CHANGE GENOVA WHEEL.c
(14.03 KiB) Downloaded 48 times

Post Reply