Machsupport Forum

Mach Discussion => Mach SDK plugin questions and answers. => Finished Plugins for Download => Topic started by: poppabear on September 19, 2008, 11:37:04 PM

Title: Extra Spindles Plug in........
Post by: poppabear on September 19, 2008, 11:37:04 PM
Greettings,

   Here is a plug in that will let you add upto 3 spindles across the Modbus (serial or TCP). One of the three will be the standard Mach OEM spindle.
It is Targeted toward a "Drop Spindle Lathe" with "Live Tooling".  So bascially you can control upto 3 Analog driven Spindle motors.  The Second and Third cannot Thread, but you can control:
ON, OFF, Speed, Enable, CW, CCW, Plus Options on: Upto 4 General purpose inputs, 4 General purpose outputs, Per motor.
Each motor will put out ONE Analog output for speed control, and each can have upto 2 Analog inputs, one for External spindle speed override, and one for True Spindle speed feedback.
You have the usual "User assiganed DROs and LEDs for setting up".

I included a Lathe 3 Spindle screen set in the installer, that also installs the S2 and S3 motor control Macros.......  (Please Read the "Help" Flash that comes  up when you push the "Help button" on the config screen.

This Plug in has a "Tabbed Config Dialog", and to configure it, you find its config in under the "Plugin Control" menu.

Special Thanks to: Ed Bryson, after I stuggled for 3 weeks trying to get tabbing to work, and all those incomplete info on MSDN. He found and example on Code Project and within 30 minutes of his help, my Tabbing was working, he also helped me get the Plugin config into the menu. My many, many thanks Ed.

********************   EDIT  ***********************

      Here is a NEW 3 Spindle installer, it has the new screen set (that turns off the S2/3 Spindle CW/CCW Leds), fixes a label, Also the xml is fixed
where the VB scripter window appears over the screen (had to drag it back from my second screen.......... ).

Scott
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on January 22, 2009, 09:35:51 AM
Hello Scott, This will be my first "Dig" into ModIO ad I have some basic questions for you.

Can the extra spindles be controlled with MDI ?
If so, what would I enter for say.....Spindle3,CW,S1000 ?
Also, what is the proper GCoding to select the extra spindle motors and set the speeds in a program ?
This is an excellent piece of work btw, Thanks.
RC

   
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on January 22, 2009, 01:24:40 PM
OK...I think I got this part figured out.


Pretty nifty Scott. With a little help, I think I might be able to get this to work for me.


Awful COOL,
Thanks Scott,
RC :)

Scott, One thing I noticed...M802 P1 Q1 R700 starts the spindle,
then to stop it, I have to include the P word or the ticker runs "P Out of Limits" or such and the spindle won't stop.
Just seem like M802 Q0 should be all that is needed.
No biggie, just wondering if you were aware and how difficult it would be to change.
Thanks again,
RC
Title: Re: Extra Spindles Plug in........
Post by: poppabear on January 22, 2009, 05:49:29 PM
look at your pulley ranges, and look at the Macros that are included that control the 2 other spindles and you will see what is going on.

scott
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on March 12, 2009, 09:59:46 PM
Hey Scott,
   On this .lset/XML only....when I hit OP/EDIT BTN SCRIPT then select a script btn, it only shows up in the task bar. It will maximize but will not restore to the smaller window.
Never seen this before and it is only with this .lset/XML.
It' the same with the VB Editor....either full screen or in the task bar. Nothing in between.
Is there a setting to correct this ?
Thanks,
RC
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on March 12, 2009, 10:07:56 PM
Scott,
 I noticed something else. If S1 is running and I hit the EStop, it stops.
But S2 and S3 will not stop when hitting the EStop/Reset button.
This is in simulation of course but the S2 and S3 RUN LED's remain lit so I assume that the spindles would not shut down on an actual machine when the EStop is hit.
Please verify and advise.

Thanks Scott,
RC
Title: Re: Extra Spindles Plug in........
Post by: poppabear on March 13, 2009, 09:21:06 AM
Ohhh.............  1st problem:  I develop with 2 (TWO) screens.........  I dont know how, but it sounds like the VB window is going to your "2cd" monitor.....
Goto "Control Panel" then "Display" Look for the section in where you can see Monitors 1 and 2, even though monitor 2 may be "Grayed" out click on it and make sure the "Extend my desktop" to this moniotr is UNCHECKED, hit apply then OK.

It is working Fine here, BUT, when I did what you asked here, the VB window opened in my 2cd monitor..............  If you have a second monitor plug it in and set your preferences for the second one as "Indepenant" not a "clone".

On the "E Stop"  the Macros 802 (CW), and 803 (CCW),  802 uses OUTPUT5, and OUTPUT6, 803 uses OUTPUT7, and OUTPUT8 they are hard coded in.
So, when ever mach is in a E Stop (reset) condition Mach "Kills" all outputs (the outputs above control the CW/CCW on signal to the Drive your using). So once you go to an
E Stop condition ALL OUTPUTS die. When you hit the Estop (come out of Reset), they do NOT turn back on unless you purposly Code them to come back on and override Mach3. I did not do that, So if all 3 spindles are running and you hit the E Stop all the OUTPUTS (and All ENABLEs) die. When you come out of reset Only the Enables will come back up, but you have to Re-Push the S1, 2, 3 CW or CCW buttons again to restart them...........  The thing that is throwing you is that the User LEDs that represent
the S2, and S3 CW or CCW condition DON'T  "turn off" when you hit the Estop button, and that is my Opps...........

So the solution for the User LED problem is attached. I redid the Screen L-set and I put in the "Reset" button, to execute a VB script, what it does is, when you push the reset it will turn OFF the 4 UserLEDs on the Screen. 

the Set is attached, put it in the usual place and restart your 3 spindle Lathe Mach .

scott
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on March 13, 2009, 10:10:51 AM
Hey Scott,
   The new .lset is OK now. Thanks for the explanation.

The VB window is still out of whack.
I have no selections for a second monitor in the settings....anywhere...that I can find.
Have never had a second one.
Any other tricks ?
Thanks Scott,
RC
 
Title: Re: Extra Spindles Plug in........
Post by: poppabear on March 13, 2009, 10:39:03 AM
I have no clue then why your VB  Window will not come up, then, mine is working like normal here.......... on that profile no probs.
If you can Bring up the window buy hitting the Maximize window from the window "panes" right click the VB one in the lower tool bar right click and hit maximize.
then the prob is in your video display.......  Reinstall mach and see if it makes a difference, If you have a "Vidio Card" Soft ware thing like from NVidia or ATI, open thier application and make sure it is set for ONE screen.

if none of that works, setting the screens to only ONE, or reinstalling mach, then it is a Windows issue that is beyond my understanding. Pehaps another could chime in on it.

scott
Title: Re: Extra Spindles Plug in........
Post by: poppabear on March 13, 2009, 10:41:05 AM
Oh, also the screens stuff is under the "Advanced" button under the standard display window dialog.
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on March 13, 2009, 10:57:03 AM
OK Scott..I'll try a re-install.
I checked every tab i could find again, including all in ADVANCED and there is nothing about a 2nd monitor.

It's onboard graphics...no card.

8 other xml's work normally, I'll fiddle with it a bit.

Thanks,
RC
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on March 13, 2009, 12:03:43 PM
Scott,
   I put 802 and 3 macros in the std. turn profile and the VB window works as it should.
I'll ask someone else to try your xml and see what they get.

chop chop,
rc
Title: Re: Extra Spindles Plug in........
Post by: poppabear on March 13, 2009, 12:18:32 PM
or just ad the screen, plugin, and Macros to a Lathe profile you know is working

scott
Title: Re: Extra Spindles Plug in........
Post by: Overloaded on March 13, 2009, 01:11:09 PM
Hi Scott,
That is exactly what I did....good thought.
  Also, Brett checked it for me and could see the window far off to the right on a big monitor. He then drug it back to the center...all is well now.
It was totally off of my small screen.
Anyway...back to business.
Everything else is working well so far. (sim)

Cool,
RC
Title: Re: Extra Spindles Plug in........
Post by: poppabear on August 04, 2009, 09:16:26 AM
I added a NEW 3 Spindle installer, it has the new screen set (that turns off the S2/3 Spindle CW/CCW Leds), fixes a label, Also the xml is fixed where the VB scripter window appears over the screen (had to drag it back from my second screen.......... ). it is up in the "Edited" first post where the original download was, version 1.1.

Scott
Title: Re: Extra Spindles Plug in........
Post by: mhmslm on December 03, 2009, 12:48:14 AM
"So bascially you can control upto 3 Analog driven Spindle motors.  The Second and Third cannot Thread"

Can someone please define "Thread" for me in this context.  I hope it doesn't mean what I think it does.  Thanks.

Mike   ???
Title: Re: Extra Spindles Plug in........
Post by: poppabear on December 03, 2009, 06:30:27 PM
? what is to define, the 2cd and 3rd cannot Thread (like on a lathe) only spindle 1 in mach is hooked into the threading algorithm

The 2cd and 3rd, where for:
on lathes: if you want to run a "Live Tool" in your ATC, and if you want to run a Drop spindle to machine the other end of the piece (that does not need threading),  OR, if you want to run a Router or other machine that you would like independant analog spindle speed control on.

scott
Title: Re: Extra Spindles Plug in........
Post by: mhmslm on December 03, 2009, 09:58:37 PM
Sorry I bothered you.  I was wondering if it all meant that you couldn't operate the Z axis on Nos. 2 and 3.
Title: Re: Extra Spindles Plug in........
Post by: poppabear on December 04, 2009, 04:49:43 PM
your not bothering me, and sorry if I came across as a Rear-end, but, the analog ONLY controls the spindle motors, the Z axis is up to you.......

scott
Title: Re: Extra Spindles Plug in........
Post by: mhmslm on December 04, 2009, 06:10:18 PM
OK, I understand.  Thanks for your reply.  I think I read Mach3 allows control of several relays.  Do you think it's feasable to switch control of Z axis via these relays?  Or are there better ways of selecting them?  I guess what I really need for now is to know whether or not I have a convenient way to get use out of 3 spindles using Mach3, similar to the way the CaMaster Cobra does.  Or would that not be in the cards?  Thanks.
Title: Re: Extra Spindles Plug in........
Post by: TOTALLYRC on December 04, 2009, 11:30:37 PM
Hi Scott,
If I understand this correctly, this would also work on a mill/router where I have an auxiliary spindle attached to the same z as the first spindle. What this plugin would do is allow me to control the 0-10v for a second VFD while not running the first VFD for the primary spindle. All this could be done without having to swap wires every time I wanted to use the auxiliary spindle.

Is this just for the p-port or will it work on external motion controllers such as the smoothstepper?

Title: Re: Extra Spindles Plug in........
Post by: ger21 on December 05, 2009, 07:12:54 AM
OK, I understand.  Thanks for your reply.  I think I read Mach3 allows control of several relays.  Do you think it's feasable to switch control of Z axis via these relays?  Or are there better ways of selecting them?  I guess what I really need for now is to know whether or not I have a convenient way to get use out of 3 spindles using Mach3, similar to the way the CaMaster Cobra does.  Or would that not be in the cards?  Thanks.

You can use the SwapAxis function to switch between different Z axis'.
Title: Re: Extra Spindles Plug in........
Post by: mhmslm on December 05, 2009, 07:18:54 PM
Thanks Gerry.  With that in mind, and since my project is in early enough development stage, I think I will brainstorm some about including that feature.

Mike
Title: Re: Extra Spindles Plug in........
Post by: ger21 on December 05, 2009, 07:25:23 PM
From what I've heard, the next version of mach3 (ver 4) is supposed to have better support for multiple Z axis'. Not sure what that will be, though.
Title: Re: Extra Spindles Plug in........
Post by: poppabear on December 11, 2009, 12:59:23 PM
you can control a total of 3 spindles with the plugin, (all three over the modbus), spindle 1, is the official one with mach3, that you can do threading on, with a indexer coming in to a PP or external motion card.

the spindles 2 and if applicable 3, have to be 0-10v analog speed control, you have options on several General digital IO, and 2 analog feed backs as well, one for true speed, and one for SS OVR of that spindle.

the custom macros are there to have independant control over spindle two and three (and one).

the plugin  has NOTHING to do with the Z at all, only your spindles, like if you want to run a multi head router, or multispindle lathe (ie. drop spindle, live tooling).

BUT, it is for Serial or TCP over modbus control only!!!!!!!!

scott
Title: Re: Extra Spindles Plug in........
Post by: Manuel S on June 01, 2010, 05:55:25 PM
I have a cilyndrical grinder prototype, I am interested on a second spindle.
I want to know if it can work with Machmill and which are the best serial Modbus to use with it.
We set up under Machmill because our operators are used to work with mills so they identify X and Y better than Z and X.
Besides, MasterCam generates Gcode for complex profiles, and they work under Machmill.
Thanks
Title: Re: Extra Spindles Plug in........
Post by: poppabear on June 07, 2010, 02:59:59 AM
Yes, cheapest solution would be to buy:
1). M1/M12 from CNC4PC,
OR
2). Peter Holmans ModIO board, both put out Analog, Peters is higher resolution than the M1/M12 option.
OR
3). a Pokeys puts out 10 bit res anlog.

any three of the solutions would work for you.

the top two you could use the Extra Spindles plugin which was written before the pokeys came out.

Note the pokeys has up to two different extra ways to send out a signal, for a spindle (but it would be tied to your Mach spindle speed), it has a PWM pin and/or an analog pin for Spindle.

The Plugin how ever using the two listed above (Number 1 or 2.), you can set Independant spindle speeds for spindles 2 and 3.

scott

You will need to use serial Plugin Modbus for the M1/M12, or Old Serial Modbus for Petes boards
Title: Re: Extra Spindles Plug in........
Post by: cp_nova on June 19, 2010, 02:07:48 AM
Hello all, brand new here. I am retrofitting a lathe and would like to do polygon turning with a second spindle. It would have to be run at an exact rpm ratio to the main spindle dependent on the number of flats and number of cutters on the 2nd spindle. Typical 1:1, 2:1 etc. Is this possible with your add on?,
Title: Re: Extra Spindles Plug in........
Post by: poppabear on June 21, 2010, 03:31:18 AM
yes, set the speeds in the seconday spindle macros