Hello Guest it is March 28, 2024, 09:57:14 AM

Author Topic: Turn | Is eccentric turning possible with Mach4?  (Read 3112 times)

0 Members and 1 Guest are viewing this topic.

Offline Azalin

*
  •  181 181
    • View Profile
Turn | Is eccentric turning possible with Mach4?
« 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

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #1 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
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #2 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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #3 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.

Without engineers the world stops
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #4 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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #5 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
« Last Edit: October 07, 2019, 05:23:30 PM by joeaverage »
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #6 on: October 07, 2019, 05:30:36 PM »
Hi,
whoops....my attached pic is upside down....this attachment may be easier to read.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'

Offline Azalin

*
  •  181 181
    • View Profile
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #7 on: October 07, 2019, 05:51:44 PM »
Thanks Craig
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #8 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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Turn | Is eccentric turning possible with Mach4?
« Reply #9 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
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'