Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Azalin on October 06, 2019, 03:02:28 PM

Title: Turn | Is eccentric turning possible with Mach4?
Post by: Azalin on October 06, 2019, 03:02:28 PM
Hi,

I have a 2 axis lathe with encoder on the spindle. I use SolidWorks/SolidCAM to generate g-codes. No problems at all. Only thing that I wasn't been able to get SolidCAM to post a simple eccentric turning program. So I guess SC doesn't support eccentric turning at all.

Question is how can I write a program to cut a piece like in the attached image?

Thanks,
Suat
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: smurph on October 06, 2019, 04:34:51 PM
There is nothing in standard G code that specifically does this.  Hence why SolidCAM would not post a program to do it.  There may be machine that have custom G codes for this type of operation though.  And it would have a specific post processor for SolidCAM to use it. 

If your motion controller is capable of real time gearing of the X axis motor to the encoder on the spindle, you could do something like this.  For instance, I know a Galil could do this. 

Otherwise, to me, this would be more of a 4th axis milling type of operation. 

Steve
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: joeaverage on October 06, 2019, 06:41:07 PM
Hi,
one other alternative is to approximate the shape in Gcode.

I, some time ago, generated some Gcode that allowed a lathe to cut a hex by moving the X axis in and out in
synchronicity with the C axis (spindle). You could do the same thing but instead of a hex make it an eccentric.

Craig
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: Graham Waterworth on October 06, 2019, 08:21:47 PM
You also need a Y axis to keep the tool on the centre line, you are in effect producing a circle with the tool in the XY plane.

Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: joeaverage on October 06, 2019, 09:15:44 PM
Hi,
I seem to recall NOT having to have a variable Y axis when 'turning' a hex, and I likewise cant imagine that you would need a variable
Y axis to turn an eccentric.

I'll try to find the post that had the hex code.

Craig
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: joeaverage on October 07, 2019, 05:21:45 PM
Hi,
stick with me here...this may take a couple of posts to flesh out.

I have attached a pic of an eccentric circle of radius r with its centre displaced from the rotational centre of the lathe
by a distance d. As the job rotates (increasing theta) the centre of the eccentric describes a circle with components:
x'=d cos(theta)
y'=d sin(theta)

According to the diagram we require the distance r' from the lathe tip to the lathe centre as a function of theta.

r'=(r2-d2sin2(theta))1/2 -d cos(theta)

All that is neccessary is to generate gcode moves at sufficiently fine intervals of increasing theta.

Will come back with some details.

Craig
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: joeaverage on October 07, 2019, 05:30:36 PM
Hi,
whoops....my attached pic is upside down....this attachment may be easier to read.

Craig
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: Azalin on October 07, 2019, 05:51:44 PM
Thanks Craig
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: joeaverage on October 07, 2019, 06:38:56 PM
Hi Azalin,
as an example if the eccentric diameter is 50mm and its is displaced 10mm from the lathe centre:
r=50
d=10

With the spindle at 30 degrees theta =300
r'=(502-102sin230)1/2-10.cos(30)
   =(2500-100x0.25)1/2 -10x0.8660
   =49.749-8.660
   =41.089mm

Now if the lathe spindle rotates another degree so theta=31
r'=(2500-100x0.2652)1/2-10X0.8571
    =41.165mm

The Gcode that would link these two steps is:
g1 x41.089 c30
g1 x41.165 c31

This is clearly too painfully slow to calculate by hand so that's what Lua is for. Note I would calculate (using a Lua script) every 0.1 degree
or maybe even finer, thus I would use a macro as a sort of Wizard.

Craig
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: joeaverage on October 07, 2019, 06:44:52 PM
Hi,
this approach will, as Graham suggested, put the lathe tool either under or over the centre line throughout the toolpath.
Depending on the material that may be a problem which could only be cured by having the Y height
move  synchronously.

Craig
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: Ya-Nvr-No on October 08, 2019, 01:08:59 PM
Guess I'm not following your math; as plotting out a 30 degree stock rotation does not prove your calculation. Either by staying on the stock center line or the eccentrics tangent point, witch would be its center line.

So guess I need educated on your logic or I'm not following your descriptions.

I'm a big proponent of CAD drawings to visualize and verify.

For me I can see a Cool idea for a macro on my 6 axis lathe, but I will still need to calculate in tool nose radius for my use.

Thanks for the inspiration. I do some arcs, wedges and twists now but never looked at eccentrics.

Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: Ya-Nvr-No on October 08, 2019, 01:42:49 PM
What it seems to follow is the blue circle. Created from the offset dimension.
(CAD, Created from 3 tangent points) The offset tangents points.

Another good tool I use is the spread sheet and formulas I can follow.

It would be interesting to see the plotted results from your formulas.
Sorry I just don't follow them or know how I would use them in a macro. But they are interesting.

Or I am all wet and am not following this threads topic at all.
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: BR549 on October 08, 2019, 02:07:11 PM
Check with Les over at Sheetcam. Years back he helped me with applications to CAM out Crankshaft grinding and Camshaft grinding using Sheetcam to create teh Gcode. Both functions are about what you want to do with OD offset grinding. I have teh plugins here somewhere but Less might remember doing it as well.

(;-) TP
Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: Graham Waterworth on October 08, 2019, 07:45:21 PM
Here is my experience.

If you have an eccentric that you can approach from the Z axis you can use the XC way to produce the eccentric.

Tool stays on the centre line and the C axis rotates and the X axis moves in sync plus and minus to follow the shape while feeding to depth in Z.

If you are in a groove like a crank journal then the only way is with XY & C axis,  the X&Y do a G02/3 move that is the same radius as the offset of the eccentric while tied to the C rotation.  This is milling mode on most lathes. So

The main problem is the max RPM, I could only do 400rpm and that was on a Mazak Integrex i400S with a smooth control. There was nothing faster at the time.

Title: Re: Turn | Is eccentric turning possible with Mach4?
Post by: Ya-Nvr-No on October 10, 2019, 10:36:45 AM
Thanks Graham for the followup

thought id show using excel graphing the two formulas, first from joe's then mine.
more to illustrate how you can use VBA array and functions in excel to display data.