Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: rhtuttle on March 02, 2010, 11:59:07 AM

Title: 4th axis - GCode degrees vs distance
Post by: rhtuttle on March 02, 2010, 11:59:07 AM
I have never looked into a 4th rotating axis until lately and have some real basic questions.  I have read several of the posts here but seem to be getting more confused rather than less. 

1. Can anyone point me to some literature that explains coding concepts for an A-axis?

2. If I use a 10/1 reduced drive for the axis with 1.8 degree stepper and 10 microstepping I would use 20000/360 for steps per revolution, correct?

3. Do you express the A distance in degrees, circumference distance, or, can you do either?

4. Code example for: 1" diameter stock that you want to spiral at a 45 degrees ( move x 3.1416 inches and rotate A 360 degrees) like screw cutting.

5. Code example for: 1" diameter stock that you want to rotate A-axis 0.2 inches on the surface, do a sub routine to cut along the X-axis, then rotate A 0.3 inches.

If you can provide insight on any of the above it would be very much appreciated.

TIA

RT

Title: Re: 4th axis - GCode degrees vs distance
Post by: pointcloud on March 02, 2010, 12:16:30 PM
1. Ok in Mach under general config you will see a box on the left that says unchecked for linear. Whcich means unchecked you use a linear measurement, checked is angular for input.

2. stepper calculation??? looks ok 

3.  if you check the box in the gen config you will use angular if it is unchecked it would be a linear input.

4-5 I would use the box checked and write something like this   
G01X0Y0Z.480A0F12(ENTER THE WORK .020)
G01X10Y0Z.480A45F12 
G00Z.750(.250 above the part)

This would have the X travel 10 inches the Y would not move, The Z would be .020 deep, and the a would rotate 45 deg or a 1/4 turn.
REMEMBER Z0 IS THE CENTER OF THE A AXIS.... TOP OF THE PART IS .500 ON A 1" DIA.
Title: Re: 4th axis - GCode degrees vs distance
Post by: rhtuttle on March 02, 2010, 12:31:04 PM
Since the A-axis rotates I assumed that the box had to be checked.  (sound of hand slapping forehead) DOH!

Can you query and configure on the fly (VB,Button or Interface) whether the axis is rotational?

RT
Title: Re: 4th axis - GCode degrees vs distance
Post by: cjmerlin on March 02, 2010, 02:09:49 PM
I use separate Mach3 profiles to do this, use mach loader to setup profiles.
Title: Re: 4th axis - GCode degrees vs distance
Post by: rhtuttle on March 02, 2010, 02:44:09 PM
Thanks for the reply.  I do use separate profiles, but to my knowledge there is no way of changing them without having to shut mach down and reload.  Which means that you have to re-reference.

I have an app that generates the code, loads it into Mach and runs it using the Mach interfaces available.  If it is possible to switch from angular to linear programmatically then I would prefer to do that when possible.
Title: Re: 4th axis - GCode degrees vs distance
Post by: pointcloud on March 02, 2010, 06:40:21 PM
I have no idea why you'd do this changing???

Title: Re: 4th axis - GCode degrees vs distance
Post by: Greolt on March 02, 2010, 08:39:47 PM
1. Ok in Mach under general config you will see a box on the left that says unchecked for linear. Which means unchecked you use a linear measurement, checked is angular for input.

I don't believe this is correct.  I remember Art saying that that checkbox did only one thing (which I can't remember) but it was not to change units to linear.

For an rotational axis to be swapped between angular units and linear units, the controller would also need to know what is the diameter/circumference.

Angular units are the only ones that make any sense as a unit of measure for rotation.

Greg
Title: Re: 4th axis - GCode degrees vs distance
Post by: pointcloud on March 02, 2010, 08:58:47 PM
Just check it out...

Title: Re: 4th axis - GCode degrees vs distance
Post by: Overloaded on March 02, 2010, 09:16:40 PM
Here is an interesting topic that might be of interest.
And a clip from the new MILL manual.

http://www.machsupport.com/forum/index.php/topic,1117.0.html
Title: Re: 4th axis - GCode degrees vs distance
Post by: Greolt on March 02, 2010, 09:28:45 PM
That wording can be easily misunderstood.  A good example of that is in this thread.

Unchecking the box does not suddenly allow Mach to know how many steps make a linear unit.

Cutting on a 10 unit diameter job, the steps per linear unit is very different than when cutting on a one unit diameter job.

Mach does have the ability to adjust the rotational axis feedrate to compensate for differing diameters.  It does not have the ability to alter steps per unit as diameter differs.

I say again....Angular units are the only ones that make any sense as a unit of measure for rotation.

Greg
Title: Re: 4th axis - GCode degrees vs distance
Post by: RICH on March 02, 2010, 11:07:30 PM
Greg,
From my 53 page vault of info on a rotary axis:

Quote
The checkbox for linear/angular only tells an axis not to convert when switching from mm to inch, other than that it
has no purpose. A, B and C are always rotary axis.. So using an IJ with an A axis is an error in syntax, though still legal, the missing Y in this
case woudl simply be interpreted as the current Y location, and the A would just be a linearised motion on that axis during the movement of the XY
in the XY plane arc.
Art

I was experimenting a fair amount with the rotary ( in my case a stepper driving the spindle on the lathe ) for constant turning motion , as an indexer, as rotary in angular, and also as rotary using linear ie; the steps per inch relative to a diameter, then slaving them to say the Z axis.
You need seperate profiles for rotary and linear. Then there is swap axis via a macro but that had faults ( swaps pins but not the tuning units ?) ............
Then you consider the different combinations of feedrates, the feedrate modes, slaving ect and it all can become rather confusing..... ???

Angular does make sense and helps to keep ones sanity.  ;)

RICH
Title: Re: 4th axis - GCode degrees vs distance
Post by: Greolt on March 03, 2010, 02:44:23 AM
Ahh........ that is the info from Art that I remembered reading but had forgotten the detail.

"The checkbox for linear/angular only tells an axis not to convert when switching from mm to inch, other than that it
has no purpose. A, B and C are always rotary axis.."

Thanks Rich

Greg
Title: Re: 4th axis - GCode degrees vs distance
Post by: bowber on March 03, 2010, 04:20:32 PM
Set the rotary to angular, like someone has already said the only true way to set it is angular.
There is a setting in mach to tell it the diameter so it can sort out the feedrate via linear units though.

Steve
Title: Re: 4th axis - GCode degrees vs distance
Post by: pointcloud on March 08, 2010, 05:47:37 PM
Have a look at the Mach manual page 93 at the bottom.
No you can't say 1 degree is now 1 inch, unless that is calculated to equal that.
But A B C can be linear. That's what the book says?
Title: Re: 4th axis - GCode degrees vs distance
Post by: RICH on March 08, 2010, 09:25:01 PM
Quote
There is a setting in mach to tell it the diameter so it can sort out the feedrate via linear units though.

The Rotation RADIUS was changed from diameter, see the Setting ( Alt 6 ) screen in Mach Mill.
 
You can use the rotary as linear but requires changing the steps per  in motor tuning and also velocity based on a set diameter.
In my fooling around, it was slaved to the x & z axis on the lathe. Then I did coordinated moves, but, all hand coding.

RICH
Title: Re: 4th axis - GCode degrees vs distance
Post by: rhtuttle on March 09, 2010, 02:09:03 PM
Thanks to all that have responded.  Now I am more throughly confused than ever ;)

PointCloud,  'Why would you want do do that!!!'  Probably because I don't know what I am doing.

Query.  I have a tube that I wish to do the following.  Put a logo on with a diamond drag point that was drawn with a Vectric product and assumes a linear relationship.  I want the logo to remain proportional regardless of the tube size. Then continue with adding a geometric design (e.g. greek key) to the circumference which is defined in radial terms so that regardless of size there are always the same number of repititions on the circumference.

It seems as though I will have to change profiles to accomplish this kind of task and I have no problem with that.  I just was trying to find out what the limitations are in Mach.  Love the program.  Love the help you guys give.  Hopefully I will have my A-axis put togehter in the next few months and then I will have a whole slew of new questions for  everyone.

Thanks,

RT
Title: Re: 4th axis - GCode degrees vs distance
Post by: Greolt on March 09, 2010, 02:46:51 PM
Have a look at the Mach manual page 93 at the bottom.
No you can't say 1 degree is now 1 inch, unless that is calculated to equal that.
But A B C can be linear. That's what the book says?

Mach is used to control many varied machines.

Take for example, a hot wire foam cutter.  These typically have four axis, all of which are linear.

In the context of this thread, the 4th axis being discussed is a rotational axis, not linear.

Greg
Title: Re: 4th axis - GCode degrees vs distance
Post by: pointcloud on March 09, 2010, 03:35:55 PM
greolt. you said that a b c were always radial. LOL...
 the question was can he change it between linear and radial. The answer is YES, but you have to make sure of what you are doing. If it rotates then you put in angle values, if it is linear then you put in a linear distance..

Checking or Unchecking the box will require your axis to be setup accordingly...

Title: Re: 4th axis - GCode degrees vs distance
Post by: pointcloud on March 09, 2010, 03:49:26 PM
font=Verdana]Query.  I have a tube that I wish to do the following.  Put a logo on with a diamond drag point that was drawn with a Vectric product and assumes a linear relationship.  I want the logo to remain proportional regardless of the tube size. Then continue with adding a geometric design (e.g. greek key) to the circumference which is defined in radial terms so that regardless of size there are always the same number of repititions on the circumference."""""

It seems as though I will have to change profiles to accomplish this kind of task and I have no problem with that.  I just was trying to find out what the limitations are in Mach.  Love the program.  Love the help you guys give.  Hopefully I will have my A-axis put togehter in the next few months and then I will have a whole slew of new questions for  everyone.[/font]

I am thinking that you need to use a 4 axis cad/cam software to interpret this into a more functioning work? You can do this with many different name brands of software... I use rhinocam, in my case I would simple wrap your art around a tube and use a v-carve or a pencil tracing function to get my code? I also would not use a drag point on a radial surface but a streight tip. As to proportioning, and tube size... Proportions could remain the same, and you'd juse use a larger tube prior to code writing...

A drag point will continually try to drift down hill on a round surface...
Check out the CNC zone.com for some great insight to cad/cam machining software, there are lots of them. Some free and some $15k+..

Title: Re: 4th axis - GCode degrees vs distance
Post by: Greolt on March 09, 2010, 05:37:28 PM
greolt. you said that a b c were always radial. LOL...

No I did not actually say that. Art did. ;D

Sorry, I should have made it clearer that I was quoting Art. (the quote in blue above)

The part of that quote being relevant to the OP's question about units on a rotational axis and the point that I tried to make (not very well it seems) was,

 ".....other than that it has no purpose....."

Greg
Title: Re: 4th axis - GCode degrees vs distance
Post by: Vogavt on January 25, 2011, 10:38:38 AM
Resurrecting an old thread here. After reading through this I still need to get my mind around what it takes to work in the A-axis. I would ask that someone clarify my understanding.

Example One: If you are wanting to engrave a cylinder you could to set all the A-axis references in the gcode to Y-axis and simply tell Mach the diameter of the cylinder somewhere. My question is now I'm not sure how having the A-axis in angular or linear would then apply or even how to calibrate the steps per.

Example Two: If I'm wanting to drill four holes at 900 apart, I'd need to tell Mach that I'm wanting an angular setup and reference A-axis in degrees. Correct?

Example Three: To add even more confusion, how do I cut threads?

Still not clear on how to make the A-axis move at a reasonable rate when the other axes are moving.

I suppose I can see where I might need different profiles.


Could someone post a simplified explanation of how to set this up in Mach and where/what it applies to? I've read several posts now and like others have said "I'm more confused now than ever".

Thanks in advance,
Vogavt

Title: Re: 4th axis - GCode degrees vs distance
Post by: RICH on January 25, 2011, 12:04:54 PM
Vogavt,
Quote
Example One:
Spend $20 and buy a program called Wrapper as it will do all the converting for you and save you from mistakes.

Quote
Example Two:
Yes, the rotary is set up as Angular, then the code is sort of like:

G*********  ( DRILL HOLE  / CANNNED CYCLE)
G0 A90 ( ROTATES THE A AXIS 90 DEGREES )
Repeat above if in Incremental mode



Have a look in the Tool Box as there is a canned drill cycle for the lathe which can generate all the code.
There is a read me file in the file explaining how to install and use.

Quote
Example Three:
In another thread there was a suggestion, but, I would recommend going back to using the lathe with a conventional motor
using an index. See Threading on the Lathe in Members Docs.

You need a seperate profiles for rotary  when using it as Rotary  or linear or for that matter slaving it.

RICH

Title: Re: 4th axis - GCode degrees vs distance
Post by: Vogavt on January 25, 2011, 01:02:12 PM
I did purchase CNCWrapper a couple of months ago. Great program but it doesn't allow Arc commands due to Mach limitations. All arcs must be converted to lines.

When I asked him about it he gave a good explanation as to why it wouldn't. Can remember the details, but it was Mach related, not his software.
Title: Re: 4th axis - GCode degrees vs distance
Post by: RICH on January 25, 2011, 05:24:08 PM
From the code i have seem it generates it breaks the arc into line segments as you so state.
For some things that may be fine, but maybe not for some forms of engraving. When you manually engrave something around a cylinder and are chasing
your cutting small straight lines , just a matter of how small they are. Not true if your hand engraving and using an engraving ball.
Must admit that i have not used Wrapper to any great extent so can't really find fault with it nor tried enough parameters to judge results against non linear moves.

My hand engraving days are long gone and only have fond memories when Remington Arms was developing their machine to try to duplicate hand engraving.
I was more interested in learning and watching the pro's work away in the custom shop. ;)

RICH