Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Bob La Londe on September 29, 2012, 12:44:38 PM

Title: Dual Spindle Control - Companion Spindle
Post by: Bob La Londe on September 29, 2012, 12:44:38 PM
I'm working on a retrofit project converting an old early 1980s Hurco over to PC based control.  I've got the basic retrofit figured out with several things I need to nail down specific choices on yet, but "I want it all!"(I ran a servo on PC control a couple weeks ago, and I am nailing down the details on an air, spindle brake, and lubrication in my meager spare time.  Then I need to wire up permanenty all the stuff I tested before.)

The machine has a 5HP spindle motor with 3-120hz VFD control for speeds of 96 - 3600 RPM.  I woud like to be able to switch over to a "companion" spindle on the fly using offsets in my code to do detail work.  The reason companion is in quotes is I want full control of it as a fully swapped Z axis.  I'm not looking at clamping a router to the quill.   The companion spindle needs to be driven by a different VFD.  I have a 0-1000 hz VFD I'll program for 166 - 667 hz (10K-40K rpm) to drive that spindle motor.  

The companion spindle will be on its own linear rails with its own servo.  

I could use some direction here.  I need to be able to do two things.  

1.  Switch control between VFDs.
2.  Switch control between servos.

I'ld like to be able to do it in code, but I don't have an issue with adding hardware (relays maybe) to do it.  I have not written any macros for Mach, but if that will do what I want I'm willing to tackle that to.  

I was originally looking at just manually switching control or possibley writing two different machine profiles, but I noticed Syil Canda has a companion air spindle they claim they can switch back and forth to in code.  I know an air spindle is less complex to deal with than a VFD driven spindle, but still.  They are switching their Z axis, and they are changing from running their main variable speed spindle to opening and closing an air valve to run their air spindle.  

I've also been following Ger's design/build thread for his V2 dual spindle gantry router over on CNC Zone.  

The main power cabinet will be intersting to see if this works out the way I want.  It already has 2 VFDs in there, (the main spindle motor has a separate 3 phase cooling fan motor) and if the companion works out there will be three.  
Title: Re: Dual Spindle Control - Companion Spindle
Post by: ger21 on September 30, 2012, 07:48:30 AM
I can tell you what I plan on doing, but haven't drawn any schematic, or written any code yet. And things may change when I actually start doing it.


First, my plan is to switch spindles based on the tool numbers. Something like, tools #100 and lower will use one spindle, and tools #101 and higher will use the other spindle. This should make any g-code usable, with nothing special in the g-code to switch spindles.

For my two spindles, I plan on using a single VFD to drive both, using relays and contactors to switch the motor power wires. With 2 VFD's, you might need more relays.

For the macros, there are two ways to go about it. Either use a macro pump, or do everything in the M6 macros.

A couple things need to happen.
You need to do a SwapAxis(), or reset it if they're already swapped.
You need to electronically swap the axis (VFD's). My thought is to use an Output, and have it active for one spindle and inactive for the other.
You need to do an offset for the second spindle location. I plan on using G52.

If you search the Yahoo group for Bennyattwell's posts, he has some info on how he uses a machine with I think around 30 independent spindles.

Another option is to wait for Mach4, which is supposed to support multiple spindles.