586,069 active members*
3,714 visitors online*
Register for free
Login
Page 1 of 2 12
Results 1 to 20 of 40
  1. #1
    Join Date
    Nov 2014
    Posts
    5

    dual spindles in Kmotion

    Does anyone have any advice on setting up dual spindle tool changes in Kmotion? My cnc has independent dual spindles, but I have no idea how to program kmotion.

  2. #2
    Join Date
    Sep 2012
    Posts
    1195

    Re: dual spindles in Kmotion

    I replied in your other thread about the CAM portion. You'll need to be more specific about how your machine is set up mechanically. There are too many different possibilities to give a good answer without details about the mechanics. If you are still installing the system, I can definitely give you a lot of info about the general setup, but I just don't know how to program Kmotion specifically (I went with Mach 3 which is really simple to set up for this).

  3. #3
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    Hi fisherman1,

    As mmoe states there are a number of techniques that you could use. Do you have a separate Z axis for each spindle? How are the Spindles turned on and off. How are the Speed controlled? Our Later Test Versions have an XY offset in the Tool Table that could be used to offset to the 2nd spindle.

    Regards
    TK
    http://dynomotion.com

  4. #4
    Join Date
    Nov 2014
    Posts
    5

    Re: dual spindles in Kmotion

    mmoe thanks for your in depth post on my other thread. My spindles have independent servos on there own axis, and they both have a VFD. They can be turned on via Kmotion, and the speed is controlled manually on the VFD.

    Another option is I can install MACH 3 into Kmotion as a plug in.

    Tom I experimented with the offset on Kmotion manually, which seemed to work pretty well, I just don't know how to get it to work in a cut file.

    Ideally, I would like my spindles to pause between each tool change and not go immediately into cutting, so if I had more than 2 tool changes, I could switch out the tools.

    Click image for larger version. 

Name:	IMG_1113.jpg 
Views:	2 
Size:	89.1 KB 
ID:	255718

  5. #5
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    Hi fisherman1,

    Which bits turn your spindles on and off?

    Again there are a lot of different approaches you could take. For example you could just treat your 2nd Spindle as an A axis. Or you could have an M6 Tool change program switch the active Z axis from one Spindle to the other by redefining the the XYZ coordinated motion system to different KFLOP Axis based on selected Tool. With:

    DefineCoordSystem(0,1,2,-1); // define X=0, Y=1, Z=2

    or

    DefineCoordSystem(0,1,3,-1); // define X=0, Y=1, Z=3


    You could put a GCode pause by inserting an M0 into the GCode. Or by adding a pop-up message box in the GCode:

    (MSG,Load Router Bit X)

    Or you could add the MessageBox into the M6 Tool change program.

    I don't understand why you would want a pause before every tool change or there would be not much point in having two spindles. Seems like somehow you would need to tll the system to pause or not.

    What do you mean by: "experimented with the offset on Kmotion manually, which seemed to work pretty well". What did you do?

    Regards
    TK
    TK
    http://dynomotion.com

  6. #6
    Join Date
    Sep 2012
    Posts
    1195

    Re: dual spindles in Kmotion

    I think he means that he wants the stop or optional stop before the toolchange so that when he is finished with the first two tools, he can insert two new tools for an operation that requires more than 2 tools. I agree that I would probably not want a stop at every toolchange since there will be many programs that don't need more than the first two tools.

    In his other thread, CAM software and post processor flexibility for dual spindles is the main topic. I use Bobcad primarily and you can add a check box to the toolpath wizard which will insert a stop or optional stop (depending on how you configure the "Program Block" in the post processor) based on whether that check box is active for that particular toolpath or not (this is called "Advanced Posting" in Bobcad). In that case, a person could program the first two tools without the stop checked, then program the following tools with the stop checked so that a manual toolchange can take place.

    If the OP doens't intend to use both heads down at the same time, I suspect that the M6 tool change configuration in Kmotion would be the better way to go. Can you assign the tool offset to each head within that macro? If so, it seems to me that you would basically have it set up where the CAM software doesn't really even need to know there are more than one head. That might work with the CAM he already has.

  7. #7
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    Hi mmoe,

    It is possible to change the Tool Y offset using PC_COMM_SET_TOOLTABLE_OFFSETY from a M6 activated C Program.

    I was thinking he might just enter the offset into the Tool Table manually. Tools that he intended to enter into Spindle #1 would have zero xy tool offset. Tools that he intended to load into Spindle #2 would have a non-zero xy tool offset. The M6 Program could test the XY tool offset for the tool and determine which Spindle was in use and set a Global Flag (Vitrtual bit) for which spindle was active as well as switch the active Z axis. M3/M5 spindle commands could test the Virtual bit to determine which Spindle to turn on/off.

    Any other ideas?

    Regards
    TK
    http://dynomotion.com

  8. #8
    Join Date
    Sep 2012
    Posts
    1195

    Re: dual spindles in Kmotion

    I wasn't sure where the tool offset in X and Y was located, but sounds like it's part of the tool table and would be easy to reference. Is it possible to just link the XY offset to the Z offset or is it already set up that way anyways? If so, can you just use an "H" value to apply both the length offset and the XY offset (0,0 for head 1, and Xx,Yy for head 2)? That would seem like the easiest way to do it from the post processor perspective. It would then just be a standard toolchange code like this, correct?:

    M6 T2 (selects head 2 as active)
    G43 H2 (selects tool 2 offset in XYZ)


    If I had the OP's machine, I'd probably want to configure it so that each head moves to it's side of the gantry and touches off of a tool sensor plate, which I assume could be configured to automatically enter the tool length offset into the tool table. Each head appears as if it can move past the work area at opposite ends of the gantry far enough to put a touch plate under each head, so there would need to be a macro to zero each head out, but it seems to me that would be do-able. I'd put the touch plate mounted to the gantry on each side so that it doesn't really matter where the gantry is located. The only trick would be getting the two touch plates to match up, but once you got them set up properly it would be worth it. I'd also put a button into the control panel for each head, so I could just push a button to zero a specific head. If I only needed to change the tool in head 1, I would only have to zero out head one, so having a separate button for each head would be slick. Not sure how easy those things are to do in Kmotion, but I'm guessing it's all possible. I'd then set up the machine to do as close to a standard toolchange as possible, like the code above. The OP could then use the RhinoCAM he already has, which I'm sure can output standard toolchange code with G43 length offsets.

  9. #9
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    M6 T2 (selects head 2 as active)
    G43 H2 (selects tool 2 offset in XYZ)
    That should work with KMotionCNC

    Regards
    TK
    http://dynomotion.com

  10. #10
    Join Date
    Nov 2014
    Posts
    5

    Re: dual spindles in Kmotion

    Thanks for the help, I'm going to give these suggestions a try.

    I think my plan is to have 2 post processors, one for operations with only 2 tools that don't stop between tool changes, and another post processor for stopping between tool changes for operations with more than 2 tools.

  11. #11
    Join Date
    Feb 2008
    Posts
    216

    Re: dual spindles in Kmotion

    We are wrapping up the build of our CNC machine.

    We have two spindles,
    The primary is a HSD ATC spindle. The secondary is a Sugino drill with manual chuck.

    Each spindle is driven by a separate Hitachi VFD. Over the weekend we were able to run each spindle separately as if they were wired using the Kanalog DAC and Konnect Outputs for the M3/M4/M5 and Sxxx commands as shown in the manual.

    My question is how do we set them up to be able to both run and be controlled by KmotionCNC simply?

    If you look at the build thread, there is a single Z axis that the primary spindle is mounted to and then a vertical slide off to the right side that the sugino drill is mounted to. When the sugino drill spindle is turned on, a series of timer relays energize the Air slide on the Z plate as well as the spindle quill which extends the drill chuck below the height of the primary spindle. This will be used for drilling repetitive holes.
    http://www.cnczone.com/forums/attach...6&d=1422730401


    My question is, how do we write the G-code or control KmotionCNC to be able to drive both spindles separately given this configuration. We are still learning the programming and tool changing side of things, We can figure out the X,Y,Z offsets in the tool tables, we just don’t’ know how to make the G-code switch on and control the rpm of the drill vs the spindle. Or to be able to manually control one or the other from the computer screen as there is only one spindle command shown.

    Thanks as always.
    -Dan

  12. #12
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    Hi Dan,

    One approach might be to use the Selected Tool Slot as a key to determine which Spindle to operate. So for example in GCode you might have:

    M6T1 (Select the main Spindle as Tool#1)
    M3S1000 (this will turn on the main Spindle at 1000RPM)
    .
    . (do some main Spindle work)
    .
    M5 (Turn off the Main Spindle)

    M6T2 (select the Drill as Tool#2)
    M3S300 (this will turn on the Drill at 300RPM)
    .
    . (do some Drill work)
    .
    M5 (Turn off the Drill)


    The M3, M5, S programs will all have to test something to determine which device they are supposed to operate. If your M6 Program is configured to use Var #9 then the C code to check operate the Spindle would be:

    Code:
    if (persist.UserData[9] == 1) // Tool #1 ??
    {
       //yes Main spindle
    }
    else
    {
       // no, Drill
    }
    HTH
    Regards
    TK
    http://dynomotion.com

  13. #13
    Join Date
    Feb 2008
    Posts
    216

    Re: dual spindles in Kmotion

    Quote Originally Posted by TomKerekes View Post
    Hi Dan,

    One approach might be to use the Selected Tool Slot as a key to determine which Spindle to operate. So for example in GCode you might have:

    M6T1 (Select the main Spindle as Tool#1)
    M3S1000 (this will turn on the main Spindle at 1000RPM)
    .
    . (do some main Spindle work)
    .
    M5 (Turn off the Main Spindle)

    M6T2 (select the Drill as Tool#2)
    M3S300 (this will turn on the Drill at 300RPM)
    .
    . (do some Drill work)
    .
    M5 (Turn off the Drill)


    The M3, M5, S programs will all have to test something to determine which device they are supposed to operate. If your M6 Program is configured to use Var #9 then the C code to check operate the Spindle would be:

    Code:
    if (persist.UserData[9] == 1) // Tool #1 ??
    {
       //yes Main spindle
    }
    else
    {
       // no, Drill
    }
    HTH
    Regards

    Then How does the G-code or M command know to check the VAR#9? Is it a c code is it automatic?

    This is all new to me.

  14. #14
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    Hi Dan,

    You will need to add the checks to the C Code.

    It isn't clear to me what you have done so far and what you have working.

    One approach would be to start simple and pretend you only have a main Spindle and write C programs M3_main.c, M4_main.c, M5_main.c, and S_main.c that successfully control the Main Spindle. Verify those programs all work successfully from GCode.

    Next pretend you only have a Drill. Write different C Programs for M3_drill.c, M4_drill.c, M5_drill.c, and S_drill.c that successfully control the Drill. Verify those programs all work successfully from GCode.

    Now attempt to merge the C Programs together. For example you will have an M3_main.c and a M3_drill.c. Examine them and identify the differences. Wherever there is a difference add an "if" condition to do the one or the other appropriate thing to create a single M3_both.c Program.

    HTH
    Regards
    TK
    http://dynomotion.com

  15. #15
    Join Date
    Feb 2008
    Posts
    216

    Re: dual spindles in Kmotion

    Ok thanks, that makes a little more sense.

    So far i haven't had to write any C program to get them to work, i just populated the M3/M4 commands with I/Os in the KmotionCNC setup windows.

  16. #16
    Join Date
    Feb 2008
    Posts
    216

    Re: dual spindles in Kmotion

    Hi Tom,

    I am following your instructions here to run the spindle using C Code. KMotionCNC Spindle Control

    I followed everything to get our first spindle operating using Ch4. But when I go into the Tool Setup Screen M3-M9 Tab and configure the C Files for M3,M4,M5 & S. Your c programs folder have a SpindleOnCWJog.c, SpindleOnCCW.c, SpindleOffjog.c but you don't have a matching Spindlejog.c for the S command file like it shows in the jpeg for the CSS set up folder in the instructions. I tried to use the CSS version of SpindleJog and the SpindleMillJog.c files but nothing worked. When i changed the M3,M4&M5 c-files to the CSS folder files and the spindle started to operate correctly.

    What C file do I need for S so that I can operate the spindle out of CSS mode?

    Thanks,
    Dan

  17. #17
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    Hi Dan,

    The Basic Spindle Configuration described in that link will not work with your system. It is for the case where simple speed control with a DAC (no C Program used) is sufficient and no CSS is needed.

    For your situation use this link:

    KMotionCNC Spindle Control

    Which uses this program for the S Action
    \C Programs\SpindleUsingJogs\CSS\SpindleJog.c

    I'm a bit confused on what you are saying. I read that the CSS files didn't work but then you switched to the CSS files and it worked?

    HTH
    Regards
    TK
    http://dynomotion.com

  18. #18
    Join Date
    Feb 2008
    Posts
    216

    Re: dual spindles in Kmotion

    For the time being lets forget about running two spindles with C-code. I’m just trying to get a single spindle operating with C-code for now.


    For our very first attempt (months ago) we used the “Basic Configuration” setup where you set M3,M4 and M5 as Two I/O Bits. And hooked up the Dac0 on the Kanalog to the VFD. We have this method working OK.

    Last night we tried testing the spindle using the C-code method instead of the above mentioned method. We configured Axis 4 to control the DAC as Open loop. The issue came when it came time to choose the C Code files.

    My understanding, correct me if I’m wrong, is that in terms of using C Code to operate the spindle you have two methods to do so, the standard method for a router (normal RPM independent of X axis) and the Constant Surface Speed method for Lathe operation?

    With this assumption we tried to operate the spindle using the non CSS version of the files found in the following directory C://KmotionX/C Programs/SpindleUsingsJogs Folder

    We couldn’t get it to work because we didn’t know where the corresponding C Code file was for S command. Whatever we tried wouldn’t work.
    We used Files:
    M3>>SpindleOnCWJog.c
    M4>>SpindleOnCWWJog.c
    M5>>SpindleOffJog.c
    S>>????

    When we couldn’t get this to work we followed the directions exactly as they were on the website and used the files located in C://KmotionX/C Programs/SpindleUsingsJogs/CSS Folder and it started right up.
    We used Files:
    M3>>OnCWJog.c
    M4>>OnCWWJog.c
    M5>>OffJog.c
    S>>SpindleJog.c

    By using the files located in the CSS folder, Are we not contending with the CSS mode as default? Or is the Normal RPM mode still the default with these files and a separate G-code/C-Code command will activate the CCS mode?

    I’m not sure if I helped clear things up or muddied the waters further?

  19. #19
    Join Date
    May 2006
    Posts
    4045

    Re: dual spindles in Kmotion

    Hi Dan,

    Your question is quite clear. Thanks. There are many methods to achieve Spindle control with and without Using C Programs and so forth. The examples in the SpindleUsingJogs\CSS folder support CSS and assume your spindle can be controlled using Axis Jog Commands. But CCS is not required as it is controlled by G96 to turn on CSS mode and G97 to turn it off. The default is normal RPM mode.

    HTH
    Regards
    TK
    http://dynomotion.com

  20. #20
    Join Date
    Feb 2008
    Posts
    216

    Re: dual spindles in Kmotion

    Hi Tom,

    We aren’t sure what we are doing wrong, when we use the C Code to operate the spindle, we can get the spindle to rotate CW and CCW and stop using the control buttons on the KMotionCNC screen but we can’t control the spindle speed, it stays at a single speed. In addition if we try to change the spindle speed using the command line prompt or Gcode it won’t won’t change either.

    We used the CSS C-code files as the instructions suggest. We modified the MySpindleDefs file to reflect the Spindle Axis of the DAC, the CW & CCW Bits and the Factor. We didn’t change the SpeedVAR or StateVAR. We set up all 4 files to use Thread 4 (which isn’t being used) and VAR 2, the Spindle C code is using VAR113. We configured the DAC channel and revised the initialization file.

    When this didn’t work we tried it again using V2.c files in the SpindleUsingJogs folder with the same result. I think there is something simple here that I am overlooking. Any suggestions?

    Thanks for your help.
    -Dan

Page 1 of 2 12

Similar Threads

  1. dual spindles operating.
    By saratbabu in forum Chinese Machines
    Replies: 1
    Last Post: 05-05-2012, 05:02 PM
  2. Dual 5 hp spindles
    By ceencee in forum Phase Converters
    Replies: 6
    Last Post: 06-03-2011, 12:47 AM
  3. Replies: 0
    Last Post: 04-19-2011, 12:11 AM
  4. Spindles de alta qualidade.High quality spindles.
    By Newtron in forum News Announcements
    Replies: 0
    Last Post: 09-21-2009, 08:33 PM
  5. Good article on dual contact spindles/toolholders
    By Belding in forum MetalWork Discussion
    Replies: 1
    Last Post: 11-11-2008, 10:27 AM

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
  •