View Full Version : Sub programing in turning

20-04-2016, 10:36 PM
I have been looking at this for a while where have I gone wrong folks
I am trying to use a G91 to inc step to cut a streight line then a chamfer so I end up with a turned down bit of bar with a 45deg angle to the outer bar size.

Please tell me where I'm going wrong
If not clear please let me know what I need to explain better

G90 G18 G40 G80 G21
M03 s500
G00 Z50 x23
G00 Z45
G01 X0 f75
G0 Z46 X22
G01 Z45 x21.8
M98 P0002 L32
G90 z46 x22

G91 X-.3
G01 Z30 f100
G01 Z25 X22
G0 Z46 X21.8
G91 X-.3

21-04-2016, 02:31 PM
Hi, what control are you using? Do you have G71/G72?

21-04-2016, 11:40 PM
You need to get rid of the G90 in the subroutine.
As it stands, you switch to incremental (G91) and move X, but then you switch back to absolute (G90) and ultimately move the X to an absolute position. So rather than every iteration of your sub moving incrementally in the X, you always end up moving to an absolute X position which means the next iteration will simply repeat the exact same movements.

22-04-2016, 12:50 AM
Yes I see what you mean now. I was trying to use a sub program to avoid a shed load of code to get the bar turned down and the chamfer at the same time