Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: RichardV48 on January 07, 2010, 03:59:59 PM

Title: Rotary Axis Help
Post by: RichardV48 on January 07, 2010, 03:59:59 PM
I would like to get some help setting up the rotary axis on a lathe I just completed. I am using a 3 axis driver with the X running parallel to the lathe base, the Z for the router and the Y set up as the rotary axis. I have set the Y steps in the motor tuning for degrees and if I manually enter a degree value, G1 Y360, it moves the correct amount. I also created a 4 flute file and if I edit the code and insert the 0, 90, 180, and 270 degree values for the Y it works.  I get a small step/bump on the Y axis from the inch values generated by the G code, but not the correct movement.
I’m not sure if there is a way to configure Mach to convert the Y inch values generated in the G code to degrees or if you have to use the A axis to accomplish that. If that is the case how would I set it up? I have looked on the forum, but didn’t see anything dealing with this.
This is my first attempt at rotary so any help would be greatly appreciated.

Title: Re: Rotary Axis Help
Post by: RICH on January 07, 2010, 05:39:42 PM
What are you planning on doing with the rotary on the lathe?

I am currently on a new adventure to utilize the spindle as an indexer on the lathe. The intent is to drill holes, limited decorative cutting, some minor profiling, some wierd stuff...., after a piece has been turned. It will save setups.
I am using the A axis for rotary motion.

If i didn't have some specific things in mind i would probably just mount the rotary to the  mill  ( or maybe in your case a router ) and not bother.  

You may want to have a look at the following posts since there are a number of things to consider.,13639.msg89612.html#msg89612,13604.msg89361.html#msg89361,12484.msg89181.html#msg89181,12484.msg88232.html#msg88232,13548.msg88932.html#msg88932,13400.msg87932.html#msg87932,13040.msg89459.html#msg89459

I guess it can be as simple or complex as you want.
Just remember there are some 4 different feedrates, 3 feedrate modes, the gcode that needs to be appropriate, choice of screens to use.

No answers ...but some stuff  to think about,

BTW nice name sort of like mine,  ;D
Title: Re: Rotary Axis Help
Post by: RichardV48 on January 07, 2010, 06:42:38 PM
I have seen alot of the attachments you posted. Trust me, I am not doing anything as complex as you are. I have just converted a wood lathe to cnc to basically perform like the ones you see attached as a 4th axis option on cnc router tables.
Problem is I have never set a 4th axis setup and cant seem to get it to work. When I spoke of rotary axis, I was referring to the spindle of the lathe. Probably the wrong terminology.
If you could point me to something that will walk me through setting up the A axis that would be great.

Title: Re: Rotary Axis Help
Post by: RICH on January 07, 2010, 08:33:02 PM
In Configuration:
Motor Outputs> enable the A, assign step and direction pin, port, and define if active low or high
Motor Tuning> set the steps per unit to your calculated  steps per degree and then experiment some 

                    to find the velocity and accel values.
General Logic Config> check the box so A-axis is angular ( left side of screen)
                              > Check the approproate boxes that apply "ROTATIONAL" you will find the         

                         defintions of them in the Mill or lathe manual
Hotkeys> define what key you want to use for jogging the A axis
ToolPath> Rotations check "Use Radius for Feedrate"
                               check A rotations enabled
                               check the axis of roataion that applies                               
Backlash> put the degree value in for the A Axis if you are going to use backlash or need it

Settings Tab>Rotation Radius ( from what Greg replied in another post )

As of Version R3.042.033 this has been, not quite fixed, but greatly improved.  Previous versions it

was buggy.

The DROs on the settings page are now labelled "Rotation Radius" which is now correct.  Previously

they were labelled "Rotation Diameters" which was partly right and partly wrong.

When "Use Radius for Feedrate" is checked in toolpath setup and you have a number greater than

zero in the appropriate "Rotation Radius" DRO this turns on the rotary axis feedrate compensation.

The compensation system takes the value of the "Rotation Radius" DRO and the value of the Z axis

DRO and adds them together to ascertain what diameter the cutter is at.

Then it compensates the rotary axis feedrate to keep the tool cutting at the called for feedrate. (within

motor tuning parameters)

So if you are using the centre of rotation for Z zero (which I always try to do) then have a near zero

number (0.01) in the "Rotation Radius" DRO and the Z axis DRO value will be used for the


If on the other hand you have Z zero at the outer circumference of the job, enter that radius in the

"Rotation Radius" DRO, then this value plus whatever Z DRO is, will be used for the feedrate


I said "not quite fixed" because Brian was going to fix the issue of a "Rotation Radius" DRO value of

zero turning the compensation system off, but he must have forgotten.

That is why you must use a near zero value in the "Rotation Radius" DRO and not zero.

Hope this is clear and helps.


So, the radius entered is really the location of Z zero relative to the axis of rotation?
Yes that is correct Gerry

The should all work fine using the Mill Screen . The lathe screen set in the link is currently missing

the Rotation Radius DRO.

Hopefully Greg or Gerry will take a read of this and coment appropriately.

BTW, I am not doing anything too complicated and I am trying to unconfuse "myself" on the

displayed feedrates relative to all the different modes, etc.

Probably forgot something,

Title: Re: Rotary Axis Help
Post by: ostie01 on January 07, 2010, 08:33:48 PM
If your 4th axis is your lathe spindle, it will need some feedback from a servo motor with encoder or a stepper motor.

This is needed to know where it is positioning in relation with the bed or cutter.

Since you spoke about router, you probably need a stepper motor to run your lathe spindle.

I think the setup will be very similar to a standard 4th axis setup.

So if you can mount a stepper motor to the spindle, just follow the links posted in previous thread.

I am not sure if this what you need but take a look at these video


Title: Re: Rotary Axis Help
Post by: RichardV48 on January 08, 2010, 09:29:17 AM
I think this is what I was looking for. Let me give it a shot and I will let you know how it turns out, no pun intended.

Title: Re: Rotary Axis Help
Post by: RichardV48 on January 08, 2010, 12:28:34 PM
Making some progress. Using your instructions, I now have the A axis active and the motor tuning calibrated and can rotate the spindle using code that I manually input.
There were two areas I ran into a problem.
First was the Rotational settings in the Gen Config. I could not find anything in the manual for the Rot 360 Rollover, or the Ang Short Tot on G0 options. That’s not to say they are not in there, I just couldn’t find them, so I left both unchecked.
Second, when I go to the settings page and enter a value into the Rotational Radius DRO, to activate the feederate compensation, the value clears as soon as I leave the page or click on anything else on that page.?? Not sure why that is happening.   ???

Title: Re: Rotary Axis Help
Post by: RICH on January 09, 2010, 08:51:07 AM
Your not alone on not finding something as there are a couple of manuals and you need to look at all of them at times.
 Sometimes info only mentioned once, there are references to pages that were wrong, and as previuosly posted they  don't reflect changes.
 There is no "single" place to look for an easy grasp of all that is associated with a rotary axis.
 I am working on a Rotary Table How To write up which consolidates a whole bunch of info.
There are a lot of good postings about roatry  / 4th axis, but, you need to spend a lot of time searching for specifc info and application
 through all the replies to the postings.

ROT 360 ROLLOVER - when checked the A axis Dro wll display from 0-360 degrees and then start over at 0.
If not checked the A axis DRO will be additive such that 2 revolutions will display 720 degrees.

ANG SHORT  ROT ON G0-The axis will move in the shortest possible move to a new position, such that if
at 0 degrees and you jogged to 359 deg then it would just rotate   -1 degree.

ROTATIONAL SOFT LIMITS - if checked will apply "software"  limit switches to the rotary axis. 

When you input the value for A ROTATION RADIUS are you keeping the curser in the box and hitting the enter key?  ???
Works here. BTW, the standard lathe screen set dosn't have that DRO. Thus you need to use Mach Mill.

When playing around i suggest you don't do a rapid with an A axis rotation and axis move like:
G00 A360 X20     that corrupted one of my lathe xml's which then affected all the lathe profiles / xml's.  ;D

Title: Re: Rotary Axis Help
Post by: RichardV48 on January 09, 2010, 09:37:31 AM
Thanks for the info on the settings. I am going to write it in the manual for future reference. I think I need to check the second option, sounds like it will speed up the cuts.
I didnt enter the info in the rotational radius correctly, so I will go back and enter it. I finally got the lathe working correctly last night. I had issues with the post processor in the cam program. It said it was a Y-A conversion, but it actually was doing an X-A conversion. Once that was corrected I ran several programs doing air cuts and it seemed to be working correctly. I guess the true test will come today when I actually cut something.
I really appreciate the help. I spent the better part of a week looking for basic information on line and although I found alot of information, most was well beyond the basics. I would like to see your write up when it is finished, its something needed for us beginners.

Thanks Again,
Title: Re: Rotary Axis Help
Post by: Chaoticone on January 09, 2010, 09:56:00 AM
I hate to step in this thread but I have to ask.........

Rich, how can you possibly be a master of corruption and a bug slayer too?

How do you do it? LOL

Rich, you can delete this post if you want to.  ;)

Richard, all of the docs should be comeing up to speed soon. Version 4 will be much easier to create docs for and I'm going to get Rich a brand new Pen.  ;D

Thanks guys, this is a good thread with good people.

Title: Re: Rotary Axis Help
Post by: RICH on January 09, 2010, 10:19:49 AM
Whenever you try something new you become a beginner. Shortening a learning curve for someone is my pleasure when i can do it. Mach is so configurable and it's use can go from basic to complex very quickly depending on how much of that configurability you want to implement. And you don't learn it in a short time thus I consider myself a beginner also. Can't realy complain about the manuals since a book could be written on every subject.

The write-up curently has some 100 pages of stuff / notes in it. So a lot of sorting out to do to put similarities into perspective. What it will cover, when you will see it, how much effort will go into it,I can't say.

Till then, keep on posting, as i am sure there is someone that can be of help,
Title: Re: Rotary Axis Help
Post by: RICH on January 09, 2010, 12:20:11 PM
My modified work saying is "You don't know how stupid you are until you get into something you haven't done".

So I do a fair amount of research on things that apply to something i would be doing or of interest to me. The learning is fun. Then as a beginner you find all the poop, or question why something seems too difficult when it should be easy.

The rotary stuff just happens to provide a good machining option for the 44 MAG model i am working on.
Sometimes you need to expand the horizon to accomplish a task.So preparation is fun also, but successful
application is even more enjoyable. 

BTW, Richard already has a cnc sickness. One of the symptoms as you know, is the needed feeling of rotary movement.  Corruption through ease of setup is only one treatment and my license to practice is limited. So will refer him to a specialist if the condition doesn't improve.  ;D
Title: Re: Rotary Axis Help
Post by: Chaoticone on January 09, 2010, 01:07:12 PM

Title: Re: Rotary Axis Help
Post by: RICH on January 09, 2010, 01:37:04 PM
Now on the corruption of the lathe screen that occured.
That G00 A360 Z ( or what ever axis ) 12 is a dumb command, maybe should of recieved an error, but,
it realy screwed up Mach. I just replaced the xml associated with an earlier one from the backups.

When it happened, you could not move the A axis ( even if you went in and out of Mach or used another different
lathe screen ) in fact when i tried to jog / mdi say the x  axis joy. Went out of mach and tried using Mill and all was OK. Tried again a few times with three different xmls / profiles joy...and one time the x axis just took off unexpectantly ...real suprise on that one. It was not until the corrupted XML was replaced that things went back to normal. 


Title: Re: Rotary Axis Help
Post by: Chaoticone on January 09, 2010, 04:43:01 PM
Is normal even a word?  ;D

Title: Re: Rotary Axis Help
Post by: Hood on January 09, 2010, 04:57:44 PM
Is normal even a word?  ;D


Definitely not if referring to SC residents ;D

Title: Re: Rotary Axis Help
Post by: Chaoticone on January 09, 2010, 05:07:48 PM
Thanks Hood. As usual your there to help out. Eliminated a little confusion for me. I thought I had missed something.  ::)


Title: Re: Rotary Axis Help
Post by: RICH on January 09, 2010, 06:47:13 PM
Back to normal now.   :)
Like Jeff said, "I am assumning  If your 4th axis is your lathe spindle, it will need some feedback from a servo motor with encoder or a stepper motor. This is needed to know where it is positioning in relation with the bed or cutter." So additionial config is required
in addition to what was posted.

Do have any feedback? What kind of motor are you using?
If no feedback, and A is rotary,then the feedrates shown will be useless , some of the rotary settings won't work, and coding and setup may be better done via a linear setup. A single index won't work to well,this is especialy true if the spindle rpm is slow or your indexing. In my case, for what i am doing, turning at just a few rpm ( 10 rpm max and 1-5 will seem normal in the moves), and my setup is linear.

Just a heads up, ;)
Title: Re: Rotary Axis Help
Post by: RichardV48 on January 11, 2010, 09:36:54 AM
The 4th axis is the spindle and is driven by a stepper. I found the problem, it was with the post processor. Although the processor I had loaded indicated it was Y-A, it was actually doing an X-A conversion so the A wasnt being coded to move. Once corrected it is now working. I cut some pieces over the weekend and although it still needs some tweeking it cut the parts accurately and didnt break anything, success!  I will definately keep my eye open for your finished instruction on this process.

Title: Re: Rotary Axis Help
Post by: Eclipze on March 28, 2010, 10:00:16 AM

I'm setting up a 4th Axis and looking to optimise the G0 movements.  Gantry CNC with stepper controller 4th rotary.
I'm not sure if the "Ang Short Rot on G0" will help when G1 commands exceed the 0 to 360 movements.

GCODE example...

% MILL_TURN_PART_TRIAL -----------------------------------------
N5 G17
N10 G21 G40 G49
N15 G53 G50 G90 G94
N20 M48
N25 G54
N30 S6000 M3
N35 G0 Z22.
N40 G0 A0.
N45 (-------------------------)
N55 (-------------------------)
N60 G0 X18.064 Y55.325 Z22.
N65 G0 A270.
N70 G0 Z19.5
N75 G1 Z14.5 F100
N80 G1 A630. F3985
N85 G0 Z22.
N90 G0 A270.
N95 G0
N100 G0 Z16.5
N105 G1 Z11.5 F100
N110 G1 A630. F3985
N115 G0 Z22.
N120 G0 Z22
N125 M5
N130 M9
N135 G40 G49 G80
N140 M30

The issue with this example, is that with "Ang Short Rot on G0" ticked... the A630 commands are completely ignored.  It has to be with 0 to 360.
It does this with or without "Rot 360 rolloever" ticked.

The post-processor is kicking out this code, and it's getting difficult to figure out how to optimise it there.  But currently this type of code is causing excessive rotations.   If I did a 10 turn spiral slot with two passes, the rotary is going to unwind 10 turns at the end of the first pass before starting the second.

The only other way I can think of is to implement a function in the gcode using G92.  For example, for a G0 command it would first G92 mod(A current position / 360)*260, then G0 to new location.  This won't provide shortest path though, unless I get more complicated with maintaining a variable for the rotarys position (getting messy). 

What I believe would be needed...
G0 shortest path followed by a DRO update for 0 to 360 position.
G1 commands function without angle wrapping or any modification to DRO position. 
So feed commands function exactly as intended, however G0 rapids via shortest path and resets the DRO to the 0 to 360 range, ready for the next procedure.

Do I have my logic correct, or have I misunderstood how this could be implemented?

Otherwise, would it be possible to somehow setup a gcode command to turn on and off the "Ang Short Rot on G0".  This would enable me to turn it on, G0 to next position by shortest path, G92 to restore the DRO to where it would have been given unwinding, then turn the "Ang Short Rot on G0" function off.  I could easily add this on/off to the G0 rapids in the post-processor and all would be neatly solved :-)

Would appreciate any comments.
Title: Re: Rotary Axis Help
Post by: Darius on March 30, 2015, 10:47:15 AM
Hello, I have set up a rotary tabble on my Seig How do I get it to run continuously cordialment darius France
Title: Re: Rotary Axis Help
Post by: stirling on March 31, 2015, 05:37:30 AM
Darius - welcome to the forum. Unfortunately not only have you resurrected a 5 year old thread but you've done it twice. Please start your own thread - you'll get more/better replies if you do.