Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: mflanders on November 07, 2016, 03:18:29 PM

Title: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 07, 2016, 03:18:29 PM
I would like to be able to toggle my A-axis from a rotary to a spindle with Gcode. I am reading about a  swapaxis macro but I have no clue what it is and where to find it. could someone please help me out with this topic? I am wanting to cylindrical grind revolved parts and have the rotary spin around the X axis at a somewhat slow speed while milling in the X-direction. I would like to be able to switch it within the same program and have also be able to do some indexing for milling work.  I am using CAMWorks & Solidworks. I want to have a post developed that I can use the Syil X5 Combo like a lathe with live tooling for cutting round tools. They are asking for some sample code. any help would be great. Thanks!
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 07, 2016, 03:20:42 PM
https://youtu.be/HvKovZJn52Y

This video is on youtube. They show it on Syil america website. http://syil.myshopify.com/products/x5-combo This is what I am trying to achieve. I'm not concerned with the caming action however the cylindrical grinding could be huge for me if I can get this to work.

Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: hanermo on November 16, 2016, 12:09:27 PM
It used to be - M3 - that this requires support from the motion control driver.
I would expect that this thus depends on what motion control device you have.

And does anyone know if swapaxis() works on M4 in general ?
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 16, 2016, 12:14:52 PM
M3 & M4 are spindle controls. I'm trying to control the rotary as a spindle. This forum is suppose to help me figure out how to switch the rotary into a spindle and back to an indexable rotary within the same program. I would like it to run at a relatively low RPM and do peel grinding or cylindrical grinding like a lathe would do.
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 16, 2016, 07:27:14 PM
mflanders,

Quote
This forum is suppose to help me figure out how to

This link may help:
http://www.machsupport.com/forum/index.php/topic,11422.msg97374.html#msg97374

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 17, 2016, 07:35:16 AM
So I am reading that I need to define the A-axis with the ports and pins and tune it. Likewise for spindle. Then it is telling me I can control it with and M3/M4 S500 code. How would the main spindle stay running at a given rpm while designating a new S-command for the rotary? I am wanting to turn this rotary on about 100rpm and still have my cutting spindle with an Endmill turning 2000rpm. 
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 17, 2016, 03:34:29 PM
mflanders,

The SwapAxis function  is defined in the Mach3 Version Macro Programmers Reference Manual.

Also A rotary is to X
       B       "         Y
       c        "        Z

Do a search on swap axis and also have a read of Simpson's threads on the subject.

YOU may need to do some screen modifications and create scripting to do what you want to do.

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 18, 2016, 01:11:52 PM
If I was to add in the swap axis macro for switching the spindle into the A axis will the spindle remain running because it never saw an M05? Then after switched will it require an M03 S100 to start it up again?
I would like it to work as follows:  Let me know if you think this would work and allow these to work in conjunction with each other.
S2000 M03
SWAPAXIS (Saxis,Aaxis)
S120 M03
"run program"
M05
SWAPAXIS(Aaxis,Saxis)
M05


Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 18, 2016, 01:16:34 PM
of coarse it should be a :

ResetSwapAxis()
M05
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 19, 2016, 11:07:30 PM
SwapAxis (?,?) and ResetAxisSwap (?,?) are scripting functions used in a macro. The macro is called in the Gcode. The macro provides the proper scripting to do what you want to accomplish.The ?,? above are integers designating the different axes. Read the Macro Programmers Reference Manual.

A,B,C are rotary axes rotating about the x,Y,Z AXES. A,B,C can be rotary ( degrees ) or linear depending on how they are defined. You can't continously rotate the A,B,C axis in Mach.If the mill spindle is manualy controlled you can still define spindle in motor tuning. Note that XYZABC AND SPINDLE needs to be defined in Ports and Pins and tuned.

So you can swap, say A and Spindle, calling the correctly scripted macro at the proper place in the Gcode. Mach accomplishes this by swapping the pin outs of those axes.

There is more to this just swapping the axes and the proper scripting in a macro / macro's can take care of homing etc or whatever else needs to be done.Additionaly gcode can command the spindle speed.

I am not the sharpest tack / just a novice at programming and have never had a need to use swapping. So that said, unless someone chimes in on more specifics. There are some limitations ie; can only have one axis swap / same axis  active at a time, I think?
"YOU" will need to read the thread and associated threads you find by searching swap axis to see what is required.

The above is jest of it all as I remember.

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: Bob La Londe on November 20, 2016, 12:26:36 PM
Flanders, I have used a 4th axis in a sort of continuous mode by using commands like

G01 A1000000 X6 F(x)
(Then rather than rewind the axis I reset it to zero or any other useful degree)
G92 A0
(Then do one more rotation of A to complete the machining operation)
G01 A360 F(x)
(and then retract to clearance height or other housekeeping)
G00 Z1

Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 21, 2016, 07:43:20 AM
I really appreciate your help Rich! I dont know a whole lot about scripting and macros. I know G-Code. I haven't been a CNC programmer in many many years. I do all of our Solidworks Designing here but I am still involved in our technological advancements and R&D. I am hoping with the right people someone would be able to give me a copy of this macro and point me in the right direction. I can get this little 4Axis machine to cylindrical grind however The code would be much shorter and easier to use. As is now is seems the Aaxis isn't real smooth between lines of code. It gets more pauses that I think it should. I'm not sure it the backlash is set to tight or the tuning of the axis is off. Again, Thanks for any help. It
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: Bob La Londe on November 21, 2016, 04:54:16 PM
Flanders,  I am not Rich, but my example was a snippet of simple hand written code that you could use to achieve your goal of doing something like grinding a cylinder.  

I'm no Mach 4 guru, but ultimately its always about getting the job done.  If you don't know your basic G-code (sounds like you did once) then learn it.  

G00 Rapid machine move at max machine speed.  
G01 Controlled speed move set by last F word or F word in line.  
G92 Set offset of one or more axis.  

In Mach 3 there is a button you can click on that brings up the G-codes with a fair description of each one.  I use it all the time.  There is another for the M-codes.  

I didn't try to attack the problem the way your were.  I just tried to offer a quick and dirty way to get the job done.  



Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 07:43:40 AM
Thanks Bob, I am well aware of my basic G-Code. I have been programming 4 & 5 axis machines for over ten years. What I am trying to achieve is not just one simple cylindrical shape. I machine carbide preformed cutting tools from the green state and then sinter them into the carbide you may know of. It is all custom stuff. I am dealing with multiple Step diameters. I am trying to get this machine to act like a turning center were I take an endmill down to size and let the rotary act as the chuck in a lathe. I'll then have the table work in the X & Z directions. I don't know anything about scripting or macros. My camworks reseller will develop a post processor for me to do this but he is asking for some sample code. only thing I am getting from this forum is about some swap axis macro. Where is it? can I get a copy of it? once I get these details I'll go back to them and have a post developed.
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 22, 2016, 09:31:57 AM
mflanders,

I need to have some questions answered so I can better try to help you.

Do you currently use a Syil x5 combo machine?

Are steppers or servos used for the X,Y,Z  axes?

Is the mills spindle manually controlled or is a VFD used?

Do you have the 4th axis package and is it stepper or servo driven?

Assume you are using MAch3....What version?
Post your xml file that you are currently using.

Till then,
RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 10:10:37 AM
We have a Syil X5combo with the 4th axis add-on. We purchased one of these little guys as a test bed to see if couldn't handle our environment . It sat in one of our facilities in Farmington MI for almost a year and was never used. We had it delivered up to our facility in Northern MI and it sat here for another 6 months before I got sick of looking at it not running. I took it upon myself to utilize this machine. When I initially hooked it up the PC was bad. kept freezing up the machine. I replaced that and it seems to be working. Then the thing wasn't moving correctly in odd spots of programs. Come to find out the tuning was wrong on it. I since tuned it and it seems to be holding its coordinates. I'm not sure on the stepper or the servo motor. Cant seem to find it in the manual.
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 22, 2016, 10:12:11 AM
Quote
only thing I am getting from this forum is about some swap axis macro
Where is it?
can I get a copy of it?

Quote
once I get these details I'll go back to them and have a post developed
don't think so ....be patient :)

You need to understand what swap axis does and what the limitations in using it are. I gave you the basics in my reply #9 and I also referenced a link in reply #4.
I also told you to read the topic.

Info on some of Simpson's Macro's.
http://www.machsupport.com/forum/index.php/topic,11422.msg96092.html#msg96092

Here is a link to a board created by Simpson so the swap axis is done via hardware
and also macro's posted
http://www.machsupport.com/forum/index.php/topic,11422.msg99637.html#msg99637


Also undestand that in those threads he was developing the ability to use the mills spindle to hold the part to be turned and swap to be able to do milling using
the 4th axis controlling its spindle.
 
That sid note that I siad the following:

The macro provides the proper scripting to do what you want to accomplish.
SO
You can't just copy something and use it unless it is correct for how your
machine is configured and what you want to do.


RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 22, 2016, 10:18:27 AM
Quote
I'm not sure on the stepper or the servo motor.

That's important to know and would make a difference. A stepper on the 4th axis is fine for indexing but sucks for
driving a spindle.


Later,
RICH

Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 10:18:39 AM
Thanks Rich. I really do appreciate the help. Did you watch the youtube video I originally posted? It is on Syils website actually. https://www.youtube.com/watch?v=HvKovZJn52Y This is basically what I want to be able to do. As of right now I'm not concerned with the caming action but if I could get one of these little machines to cylindrical grind then mill flats and such in an indexable fashion it could be huge for us. As of now we use $100,000-$500,000 machines. Again, This is just a test bed to see if we couldn't buy them, leave them set up and potentially just throw away when wore out.

Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 10:20:00 AM
I only need the 4th axis to rotate roughly 120rpm. The spindle should be a servo because it can operate at over 4000 rpm.
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 22, 2016, 10:28:23 AM
When you grind will you be using live tooling mounted  the X axis of the lathe?

I need to look at your current configuration.

Do you info on the rotary in the manual?


RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 10:31:25 AM
I want to grind these diameters along the X axis having the rotary free winding at a certain rpm while the main spindle is running at 2000rpm. I will use a ½" crystallume endmill to cut on top center of the part and follow the tool profile in an X & Z motion. Same as the video shows.
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 10:35:24 AM
I cant find anything in the manual I have about the rotary Axis. I have had it do cylindrical grinding but it does it in 3° increments and the machine in my opinion isn't real smooth going between that many lines of code. I would like it to function more like a lathe and just turn on the rotary, then follow the x y & z linear moves.
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 22, 2016, 01:28:26 PM
Take a picture of the rotary please and post it.
I am thinking the rotary is stepper motor driven. Additionally the X,Y,Z axes are stepper driven.

Also has any modifications / changes ever been done to the machine?

This is important,

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 02:00:51 PM
No modifications have been made to the machine at the present time other than they had me tune the motors differently. Attached is a photo of it.
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 22, 2016, 04:19:42 PM
Some considerations before we continue:

Before doing anything you need to check how accurate your machine is as this is going to be a grinding operation. I will assume that the
grinding wheel is say, 1/2" max. diameter.

The positional accuracy for the X5 is stated as <= to 0.0004".
Your grinding max pass would be only 0.0005" deep or smaller and a finish pass would be even less. Calculated axes resolution is 1/step
per= 1/10160= 0.0001" and doubt if will be that and would guess it's 0.0004" on the Z movementif your lucky. The Z movement will be following
the profile on center of the prepared work.

There is no spindle runout specification for the machine. Now now matter what you do to true up the grinding wheel it will have some runout. Lets
say 0.0002".

So that tells me the machine right from the start is not quite accurate to do what you want it to do.
 
Consider the grinding wheel. I will assume it's max diameter to be say 1/2". You will need to true both the sides and bottom of it before
grinding. You will not have a sharp edge ie; no radius on the corner so don't expect to grind to a sharp corner as was portrayed in your
posted picture.

Why I note the above is that you understand that grinding to some part tolerance with what you have may not satisfy desired end result.

Now you have wheel wear to consider and haven't the foggiest on what you can expect per pass. So you will need some compensation per pass
or need to check part dimensions to see what needs to be adjusted. During the actual grinding you would need to stop the machine.

How do you plan on touching off to locate the part from a home position? That would set a G54 for the current wheel based on the direction you
would start grinding.

What's all this B.S. you may ask?
You want someone to do a post processor for you and they need to know what coding needs be in place depending on what you want to do and how!

So think about the complete sequence / steps of how the qrinding operation will be accomlished. Any Macro # callout required will need to be
conveyed to them when / if required in the grinding sequence.

Just a few thoughts.....we didn't even get into the machine setup yet!  ;)

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 05:37:43 PM
We manufacture carbide preforms. I
 Add +.030" to all diameters of my parts and the customer hard grinds them to finish size. I'm not at all worried about +-.003". We do this for furnace shrinkage and warpage. I will be using a ½" end mill to do the cutting. When we machine these tools they are in the "green" state. Similar to chalk consistency. If you watch the video on stilts
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: mflanders on November 22, 2016, 05:40:56 PM
Sorry, was typing syil and accidentally hit post on my phone. Anyways, if you watch the video on their website you will see what I'm trying to do. Is there a sample of this swapaxis ( ) macro I could forward to the company I have generate post for camworks?
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 22, 2016, 08:15:53 PM
Quote
Is there a sample of this swapaxis ( ) macro I could forward to the company

They don't need the macro scripting that would provide for swapping the axes. They would only need to know
what macro's  ( like ie; M200, M201  ) will and when  be  called out in the gcode.

You have not confirmed that the mill spindle is servo driven and may use a vfd. I know nothing about about your machine.

Your X,Y, Z axis and rotary is stepper driven. I don't know anything about the spindle motor. That being the case you may not be able to use the swapaxis function. It won't work.

I watched that video by the way.

What exactly did you purchase. Surely you must be able to get the purchase order for it.
I would also assume that you have  some manuals for the machine.
 
We need to know the info or we will be going in circles and wasting my time.

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 23, 2016, 10:21:42 AM
Xyil provides an external controller with their X5 combo  machine and is currently listed on their site
as  a "HiCon 4 axis control board". They also provide other "optional" controllers.

Is that what you have?
I need the board number / information about whatever  controller board you are using.

Take a picture of your spindle and post it.
Take some pictures of the drives and boards inside the control box. Mack sure one can read any  labels of the drives and boards.

Till then,
RICH
 

Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on November 24, 2016, 05:37:49 AM
mflanders,

One more question for you. ::)

You replaced the original PC with a different one.
On the original pc was there a board attached to the back of that PC and are you using it on the new PC?

If yes take a picture of it and post.

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on December 01, 2016, 07:56:47 AM
Mike,
So what's up?

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: Bob La Londe on December 11, 2016, 12:54:59 PM
Xyil provides an external controller with their X5 combo  machine and is currently listed on their site
as  a "HiCon 4 axis control board". They also provide other "optional" controllers.

Is that what you have?
I need the board number / information about whatever  controller board you are using.

Take a picture of your spindle and post it.
Take some pictures of the drives and boards inside the control box. Mack sure one can read any  labels of the drives and boards.

Till then,
RICH
 



Rich I highly doubt it has an external motion controller.  The standard seems to still be parallel with other stuff as options.  Jeff at Syil America adds an ESS now as a standard, and COA adds one on request.  If he swapped computers he would have needed to setup any external motion controller and should "know" what it is if there is one.  Yes, they do "offer" other controls.  They even offer a Seimens control, but I don't think any of us looking at Syil are doing so for anything other than the economy. 

I only need the 4th axis to rotate roughly 120rpm. The spindle should be a servo because it can operate at over 4000 rpm.

I highly doubt its a servo.  I have two X5 Combos.  Mine are Speedmasters, but they both use VFDs, and I am sure the standard X4 and X5 also use VFDs.  (I also have an X4).  Its pretty easy to check though.  Just open the cabinet on the back and look.  My X5s have Delta VFDs.

We have a Syil X5combo with the 4th axis add-on. We purchased one of these little guys as a test bed to see if couldn't handle our environment . It sat in one of our facilities in Farmington MI for almost a year and was never used. We had it delivered up to our facility in Northern MI and it sat here for another 6 months before I got sick of looking at it not running. I took it upon myself to utilize this machine. When I initially hooked it up the PC was bad. kept freezing up the machine. I replaced that and it seems to be working. Then the thing wasn't moving correctly in odd spots of programs. Come to find out the tuning was wrong on it. I since tuned it and it seems to be holding its coordinates. I'm not sure on the stepper or the servo motor. Cant seem to find it in the manual.

I strongly suggest you go thru the machine.  The ones I have are not as good as they claim.  I had a spacer missing on the Y axis ballscrew on one and the oil passage that feeds the Z axis ball screw was not drilled thru in the head.  I bypassed it with an oil line to make sure it got oil.  (The line was dry before.)  I suspect some used components were used on my other X5.  There was excessive backlash in the Z axis ball screw, and with less than 50 hours on the machine the gas spring that supports the Z failed.  My X4 had an out of square saddle and there was no oil line at all to the X axis ball nut.  Syil air freighted a replacement saddle from China to replace the bad saddle. 

Sorry, I do not have 4th axis setups on any of my X(x) machines, so I can't help there.  Mine all have Ethernet Smoothsteppers, but they were added by the reseller.

The standard on these machines is stepper drive on all axis, but they do offer some servo based versions.  They cost more and are a more expensive option.  I do not believe either Syil America or Charter Oak Automation stocks them that way.  There is a third Syil Importer now, but he is recent and he doesn't sell raw machines.  He juices them up and goes thru them selling them under his own name. 

Quote from: Rich
So that tells me the machine right from the start is not quite accurate to do what you want it to do.

No, it probably is not.  In fact I don't think any of mine is as accurate as they claim.  I use them for making molds, but none of my main stream of mold work is critical dimension work anyway.  I mean who cares if a rubber worm comes out 5 ten thousandths off.  My 1981 Hurco is as accurate (or better) than my Syils.  That being said, like with all but the crappiest mill drills I can use good machining techniques to creep up on critical dimensions. 


Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on December 11, 2016, 03:37:32 PM
Bob,
Thanks for your experience and reply.

BUT

Mike needs to provide the information requested to get the proper responses associated  to what he is seeking to do.
Not much more one can say.

RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: Bob La Londe on December 12, 2016, 10:15:35 AM
Rich,  I thought there was a way to make an axis spin continuously.  I seem to recall that in the past, or does it only work with the spindle?  
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: RICH on December 12, 2016, 12:09:33 PM
Bob,
For ABC you can index or have it rotate degrees for some time using gcode . Mach3 dose not provide for continuous ABC rotation as there can only be one spindle. Spindles are configurable. Swap axis can be used but what your swapping needs to be the same in configuration since the swap only changes configured pin outs and then  one or the other is not being used. I guess one could manually turn the 4th axis motor on / off and  have it run continuously, but, it's not automated or controlled.

InTurn 4th Axis can do it but suggest you go to the site and see what is required and how it's done.

Now as you mentioned, there are other external motion devices  available that can provide the feature and more, BUT, not cheap and may require purchased software to program the motion device.

Mach4 has additional features but requires an external motion control device, and frankly I have not been following the development of it.

That's the story in a nut shell if I got  it right.

FWIW,
Folks see some video and think they should be able to do what they are seeing not realizing what is required to do it.


RICH
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: TOTALLYRC on December 12, 2016, 04:24:24 PM
Mach 4 has the ability to control Out of Band axissss(plural) (sp?)
Not sure how exactly it is done but it is in there!


Mike
Title: Re: A axis acting as a spindle then toggle back to a rotary.
Post by: rcaffin on December 12, 2016, 06:35:58 PM
Seems to me ...
If you want to grind a highly accurate cam on a shaft, you must have tight coordination between A and Z. Probably tighter than that machine can offer in fact, but that's another matter.
But a spindle does NOT offer such coordination. You can get enough coordination with a single encoder pulse and a heavy chuck to do threading, but that's all. That is a deep assumption behind Mach (and many other CNC machines): that spindles SPIN.

All that said, I would confidentally expect that you could come moderately close to getting a cam if you treat the A axis as an A axis, and program accordingly. You would need Constant Velocity to be on, and you would need to do the trig yourself - in 1 degree steps or smaller. That would be how commercial cam-grinding machines work. They are not going to spin the chuck and hope to waggle the Z axis in and out at the required speed. They rotate the A axis chuck slowly and machine the cam.

My 2c.
Cheers
Roger